From 52398fc78ba15ac10c68742bf5f47685a9fdb9f6 Mon Sep 17 00:00:00 2001 From: Frederic Lepied Date: Fri, 11 Jul 2003 06:55:51 +0000 Subject: put the default mount point like on the compilation cluster. use %_topdir to find the root of the rpm tree. use bzme to transform .gz in .bz2. --- rpmbuildupdate | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/rpmbuildupdate b/rpmbuildupdate index 14a595e..057cb61 100755 --- a/rpmbuildupdate +++ b/rpmbuildupdate @@ -15,7 +15,7 @@ use strict; use AppConfig; -my $mount_point = "/mnt/distrib/cooker/SRPMS/"; +my $mount_point = "/mnt/BIG/distrib/cooker/SRPMS/"; my $defaultrelease = "1mdk"; my %config; @@ -47,17 +47,22 @@ sub build closedir(MP); if($found == 0) { print "Package $pkg has no source, skipping.\n\n"; return; } - - system("/usr/sbin/urpmi --auto --force ".$mount_point.$pkgrpm); - #{ print "Error while urpmi $pkgrpm\n"; return; }; - wait; - - system("/usr/sbin/urpmi --install-src --force ".$mount_point.$pkgrpm); - #{ print "Error while urpmi --install-src $pkgrpm\n"; return; } - wait; - - - chdir "/usr/src/RPM/SOURCES" or die "Unable to chdir to /usr/src/RPM/SOURCES"; + + if (0) { + system("rpm -i $pkgrpm"); + } else { + system("/usr/sbin/urpmi --auto --force ".$mount_point.$pkgrpm); + #{ print "Error while urpmi $pkgrpm\n"; return; }; + wait; + + system("/usr/sbin/urpmi --install-src --force ".$mount_point.$pkgrpm); + #{ print "Error while urpmi --install-src $pkgrpm\n"; return; } + wait; + } + + my $top = `rpm --eval '%_topdir'`; + chop($top); + chdir("$top/SOURCES") or die "Unable to chdir to $top/SOURCES"; $found = 0; @@ -122,14 +127,10 @@ sub build # If gz was downloaded, recompressing it in bz2 if(-f $basename) { - print "Gunzipping $basename... "; - system("gunzip ".$basename); - print "done\n"; - $basename =~ s/\.gz$//; print "Bzipping $basename... "; - system("bzip2 ".$basename); + system("bzme ".$basename); print "done\n"; - $basename .= ".bz2"; + $basename =~ s/bz2/gz/; } } @@ -140,7 +141,7 @@ sub build if(!$found) { print "Unable to download file: URL is not valid ! :-/\n\n"; return; } - system("rpmbuild -ba ../SPECS/".$pkg.".spec"); + system("rpm -ba ../SPECS/".$pkg.".spec"); wait; } -- cgit v1.2.1