From 89e1cf9782236a7d933504694a73fb00b7dd4b40 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Mon, 30 Aug 2004 15:17:35 +0000 Subject: - use rpm --eval , pterjan idea --- rpmbuildupdate | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'rpmbuildupdate') diff --git a/rpmbuildupdate b/rpmbuildupdate index 3d0fdc8..2fa5c15 100755 --- a/rpmbuildupdate +++ b/rpmbuildupdate @@ -14,6 +14,8 @@ # TODO # do not hardcode sudo urpmi command ( to use --deps on cluster ) +# rework configuration option +# remove TODO and &sub call use strict; use AppConfig; @@ -224,7 +226,9 @@ sub build { my $email; my @l = getpwuid($<); - $email = $ENV{EMAIL} ? $l[6]." <$ENV{EMAIL}>" : $l[6]." <$l[0]\@mandrakesoft.com>"; + my $packager = `rpm --eval '\%packager'`; + chomp($packager); + $email = $packager ? $packager : ( $ENV{EMAIL} ? $l[6]." <$ENV{EMAIL}>" : $l[6]." <$l[0]\@mandrakesoft.com>"); $spec .= "* ".`LC_TIME=C date '+%a %b %e %Y'|tr -d '\n'`." ".$email. " ".$newversion."-".$config{release}."\n"; $spec .= "- New release $newversion\n\n"; @@ -319,7 +323,8 @@ sub build $found++ if(-e $basename); chmod(0644,"${top}/SOURCES/$basename"); } - + + # TODO use output ? open(SPECFILE, ">../SPECS/".$pkg.".spec") or die "Unable to open $pkg.spec"; print SPECFILE $spec; close(SPECFILE); -- cgit v1.2.1