From df7236cad32c6f4a0f4086a42ccb347ba3847dd8 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 27 Apr 2016 01:34:48 -0400 Subject: [PATCH 1/2] fix bug978 update xCATreg.pl to resolve the miniiso replacement issue --- xCAT-server/share/xcat/tools/xCATreg | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) mode change 100644 => 100755 xCAT-server/share/xcat/tools/xCATreg diff --git a/xCAT-server/share/xcat/tools/xCATreg b/xCAT-server/share/xcat/tools/xCATreg old mode 100644 new mode 100755 index ed71bd173..c98d3fdcb --- a/xCAT-server/share/xcat/tools/xCATreg +++ b/xCAT-server/share/xcat/tools/xCATreg @@ -55,11 +55,7 @@ my $regresultdir = "$regrootdir/regresult"; my $todayregresultdir=""; my $maildir="$regrootdir/mail"; my $mailfile=""; -my $rootdir = "$::XCATROOT/share/xcat/tools/autotest"; -my %confkeys; -my $mail_list = 0; -my $needhelp = 0; -my $branch = "master"; +my $rootdir = "$::XCATROOT/share/xcat/tools/autotest"; my %confkeys; my $mail_list = 0; my $needhelp = 0; my $branch = "master"; my $management_node = undef; #my $verbose_mode = 0; my $updates_regression = 0; @@ -524,7 +520,7 @@ sub copy_code { return 1; } send_msg(2, "[$mn->$confkeys{$mn}][copy_code] copy ISO $iso to $mn successfully"); - system ("sed -i 's|ISO=/\\S*|ISO=/$iso|g' $configfiledir/$regconf"); + system ("sed -i 's|^ISO=/\\S*|ISO=/$iso|g' $configfiledir/$regconf"); } if($mn =~ /sles/){ @@ -548,7 +544,7 @@ sub copy_code { return 1; } send_msg(2, "[$mn->$confkeys{$mn}][copy_code] copy ISO $iso to $mn successfully"); - system ("sed -i 's|ISO=/\\S*|ISO=/$iso|g' $configfiledir/$regconf"); + system ("sed -i 's|^ISO=/\\S*|ISO=/$iso|g' $configfiledir/$regconf"); if($os =~ /sles11/){ $res = system("xdsh $confkeys{$mn} \"mv /usr/lib/rpm/find-requires /usr/lib/rpm/find-requires.org\" && scp $osisodir/find-requires $confkeys{$mn}:/usr/lib/rpm/ > /dev/null"); @@ -581,7 +577,7 @@ sub copy_code { return 1; } send_msg(2, "[$mn->$confkeys{$mn}][copy_code] copy ISO $iso to $mn successfully"); - system ("sed -i 's|ISO=/\\S*|ISO=/$iso|g' $configfiledir/$regconf"); + system ("sed -i 's|^ISO=/\\S*|ISO=/$iso|g' $configfiledir/$regconf"); } return 0; } From d38d859ca1c65328a7e8a69b23a78e5872eaac6c Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 27 Apr 2016 01:38:00 -0400 Subject: [PATCH 2/2] modify indent --- xCAT-server/share/xcat/tools/xCATreg | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/tools/xCATreg b/xCAT-server/share/xcat/tools/xCATreg index c98d3fdcb..60e6947ab 100755 --- a/xCAT-server/share/xcat/tools/xCATreg +++ b/xCAT-server/share/xcat/tools/xCATreg @@ -55,7 +55,11 @@ my $regresultdir = "$regrootdir/regresult"; my $todayregresultdir=""; my $maildir="$regrootdir/mail"; my $mailfile=""; -my $rootdir = "$::XCATROOT/share/xcat/tools/autotest"; my %confkeys; my $mail_list = 0; my $needhelp = 0; my $branch = "master"; +my $rootdir = "$::XCATROOT/share/xcat/tools/autotest"; +my %confkeys; +my $mail_list = 0; +my $needhelp = 0; +my $branch = "master"; my $management_node = undef; #my $verbose_mode = 0; my $updates_regression = 0;