Changeset 96


Ignore:
Timestamp:
Sep 3, 2007, 8:11:41 PM (11 years ago)
Author:
bruno
Message:

Force topdir in rpmbuild to generate packages where we want.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r95 r96  
    303303
    304304        if ($dtype eq "rpm") {
    305             # rpm has its own standard build directory
    306             my $tmp=`rpmquery --eval '%{_topdir}' 2> /dev/null`;
    307             chomp($tmp);
    308             $ENV{'PBBUILDDIR'}=$tmp;
    309305            print $LOG "Working under $ENV{'PBBUILDDIR'}\n" if ($debug >= 0);
    310306            foreach my $d ('RPMS','SRPMS','SPECS','SOURCES','BUILD') {
    311307                if (! -d "$ENV{'PBBUILDDIR'}/$d") {
    312                 pb_mkdir_p("$ENV{'PBBUILDDIR'}/$d") || die "Please ensure that you can write into $ENV{'PBBUILDDIR'} to create $d\nSolution: setup _topdir in your ~/.rpmmacros or\nchown the $ENV{'PBBUILDDIR'} directory to your uid";
     308                pb_mkdir_p("$ENV{'PBBUILDDIR'}/$d") || die "Please ensure that you can write into $ENV{'PBBUILDDIR'} to create $d\nchown the $ENV{'PBBUILDDIR'} directory to your uid";
    313309                }
    314310            }
     
    325321            foreach my $f (@specfile) {
    326322                if ($f =~ /\.spec$/) {
    327                     pb_system("rpmbuild -ba $f","Building package with $f");
     323                    pb_system("rpmbuild --define "_topdir $ENV{'PBBUILDDIR'}" -ba $f","Building package with $f under $ENV{'PBBUILDDIR'}");
    328324                    last;
    329325                }
     
    375371        } elsif ($cmt eq "Packages") {
    376372            if ($dtype eq "rpm") {
    377                 $src="$ENV{'PBBUILDDIR'}/RPMS/*/$pbpkg$pbver-$pbtag$dsuf.*.rpm $ENV{'PBBUILDDIR'}/SRPMS/$pbpkg$pbver-$pbtag$dsuf.src.rpm"
     373                # rpm has its own standard build directory
     374                my $tmp=`rpmquery --eval '%{_topdir}' 2> /dev/null`;
     375                chomp($tmp);
     376                $ENV{'PBBUILDDIR'}=$tmp;
     377                $src="$ENV{'PBBUILDDIR'}/RPMS/*/$pbpkg-$pbver-$pbtag$dsuf.*.rpm $ENV{'PBBUILDDIR'}/SRPMS/$pbpkg-$pbver-$pbtag$dsuf.src.rpm"
    378378            } elsif ($dtype eq "deb") {
    379379                my $tmp = "$ENV{'PBBUILDDIR'}/$pbpkg";
    380380                $src="$tmp"."_*.deb $tmp"."_*.dsc $tmp"."_*.tar.gz"
    381381            } elsif ($dtype eq "ebuild") {
    382                 $src="$ENV{'PBBUILDDIR'}/portage/*/$pbpkg/$pbpkg$pbver.ebuild"
     382                $src="$ENV{'PBBUILDDIR'}/portage/*/$pbpkg/$pbpkg-$pbver.ebuild"
    383383            } elsif ($dtype eq "slackware") {
    384                 $src="$ENV{'PBBUILDDIR'}/build-$pbpkg/$pbpkg$pbver-*-$pbtag.tgz"
     384                $src="$ENV{'PBBUILDDIR'}/build-$pbpkg/$pbpkg-$pbver-*-$pbtag.tgz"
    385385            } else {
    386386                die "Unknown dtype format $dtype";
     
    390390        push @src, $src;
    391391    }
    392     my ($pt) = pb_conf_get("sshhost", "sshlogin", "sshdir");
    393     my ($sshhost,$sshlogin,$sshdir) = @$pt;
     392    my ($sshhost,$sshlogin,$sshdir) = pb_conf_get("sshhost", "sshlogin", "sshdir");
    394393    my $mac = "$sshlogin->{$ENV{'PBPROJ'}}\@$sshhost->{$ENV{'PBPROJ'}}";
    395394    my $dir;
     
    402401    }
    403402    $src = join(' ',@src);
    404     pb_system("ssh -q $mac \"mkdir -p $dir ; cd $dir ; rm -f $src\"","Preparing $dir on $mac");
     403    pb_system("ssh -q $mac \"mkdir -p $dir ; cd $dir ; rm -f $src 2> /dev/null\"","Preparing $dir on $mac");
    405404    pb_system("scp -p $src $mac:$dir","$cmt delivery in $dir on $mac");
    406405}
Note: See TracChangeset for help on using the changeset viewer.