diff options
author | Frederic Lepied <flepied@mandriva.com> | 2004-05-06 14:23:10 +0000 |
---|---|---|
committer | Frederic Lepied <flepied@mandriva.com> | 2004-05-06 14:23:10 +0000 |
commit | 1c8c79ab0b639735c0e9d58ab9c9edc77a649f72 (patch) | |
tree | f63973bf786cbb0074fd8d83d117e73b022ecdf4 | |
parent | bdb495a5a3d0f98c2c43e680c5e6fb828f8f4ee2 (diff) | |
download | bootsplash-1c8c79ab0b639735c0e9d58ab9c9edc77a649f72.tar bootsplash-1c8c79ab0b639735c0e9d58ab9c9edc77a649f72.tar.gz bootsplash-1c8c79ab0b639735c0e9d58ab9c9edc77a649f72.tar.bz2 bootsplash-1c8c79ab0b639735c0e9d58ab9c9edc77a649f72.tar.xz bootsplash-1c8c79ab0b639735c0e9d58ab9c9edc77a649f72.zip |
add --log optionV0_20_1mdk
-rwxr-xr-x | rpmbuildupdate | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/rpmbuildupdate b/rpmbuildupdate index 94210f7..c549d3d 100755 --- a/rpmbuildupdate +++ b/rpmbuildupdate @@ -121,7 +121,7 @@ sub build my $pkg = shift; my $newversion = shift; my $pkgrpm = shift; - my $rpm; + my ($rpm, $log); my $found = 0; my ($version, $release); @@ -162,21 +162,31 @@ sub build { $version = $2; $release = $3; $found = 1;} } + if($config{log}) + { + my $basename; + ( $basename = $pkgrpm ) =~ s!.*/!!; + system("mkdir -p $top/log"); + $log = " >> $top/log/${basename}.log 2>&1"; + } else { + $log = ""; + } + if($config{deps}) { - system_die("sudo /usr/sbin/urpmi --auto --force ".$config{srpms}."/".$pkgrpm); + system_die("sudo /usr/sbin/urpmi --auto --force $pkgrpm $log"); wait; } - if($config{src}) + if($config{src}) { - system_die("$rpm -ivh $pkgrpm"); + system_die("$rpm -ivh $pkgrpm $log"); wait; $config{src} = 0; } elsif(!$config{nosource}) { - system_die("/usr/sbin/urpmi --install-src --force ".$config{srpms}."/".$pkgrpm); + system_die("/usr/sbin/urpmi --install-src --force $config{srpms} $log"); wait; } @@ -320,11 +330,11 @@ sub build return; } - if(system("$rpm -ba ../SPECS/".$pkg.".spec")) + if(system("$rpm -ba ../SPECS/".$pkg.".spec $log")) { wait; print "Binary build fails: building source only\n"; - system("$rpm -bs --nodeps ../SPECS/".$pkg.".spec"); + system("$rpm -bs --nodeps ../SPECS/$pkg.spec $log"); } wait; } @@ -347,7 +357,6 @@ sub parse_argv $conf->define("release", { ARGS => "=s", - ALIAS => "l", DEFAULT => "1mdk", ARGCOUNT => AppConfig::ARGCOUNT_ONE } ); @@ -396,6 +405,11 @@ sub parse_argv ARGCOUNT => AppConfig::ARGCOUNT_NONE } ); + $conf->define("log", + { ALIAS => "l", + DEFAULT => 0, + ARGCOUNT => AppConfig::ARGCOUNT_NONE } + ); $conf->args(); $config{rpmmon} = $conf->get("rpmmon"); $config{deps} = $conf->get("deps"); @@ -406,6 +420,7 @@ sub parse_argv $config{fedora} = $conf->get("fedora"); $config{top} = $conf->get("top"); $config{nobuild} = $conf->get("nobuild"); + $config{log} = $conf->get("log"); } @@ -422,6 +437,7 @@ sub usage print " --src <src.rpm file> <new version>: build new version from this source RPM\n"; print " --release <mdk_release>: release version of package (default: 1mdk)\n"; print " --deps: install builds dependencies\n"; + print " --log: log builds\n"; print " --nosource: do not install source from (urpmi x.src.rpm)\n"; print " --top <dir>: specify rpm top dir (default: `rpm --eval %_topdir`)\n"; print " --nobuild|-c: do not build the package. Only download files.\n"; |