[Mageia-sysadm] [224] use hostname function from perl core module Sys::Hostname ( and so avoid 1 useless fork )

root at mageia.org root at mageia.org
Thu Jan 6 04:25:27 CET 2011


Revision: 224
Author:   misc
Date:     2011-01-06 04:25:26 +0100 (Thu, 06 Jan 2011)
Log Message:
-----------
use hostname function from perl core module Sys::Hostname ( and so avoid 1 useless fork )

Modified Paths:
--------------
    build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mageia_upload.pm

Modified: build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mageia_upload.pm
===================================================================
--- build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mageia_upload.pm	2011-01-06 03:18:34 UTC (rev 223)
+++ build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mageia_upload.pm	2011-01-06 03:25:26 UTC (rev 224)
@@ -19,6 +19,7 @@
 use base qw/Youri::Repository/;
 use MDV::Distribconf::Build;
 use SVN::Client;
+use Sys::Hostname;
 
 use constant {
     PACKAGE_CLASS   => 'Youri::Package::URPM',
@@ -70,8 +71,7 @@
     my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
     $year+=1900;
     $mon++;
-    my $hostname = `hostname`;
-    my ($host) = $hostname =~ /([^.]*)/;
+    my ($host) = hostname =~ /([^.]*)/;
     sprintf "$year%02d%02d%02d%02d%02d.$user.$host.${$}_", $mon, $mday, $hour, $min, $sec;
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/mageia-sysadm/attachments/20110106/bc32c1f4/attachment.html>


More information about the Mageia-sysadm mailing list