Changeset 1127 for devel/pb/bin/pb


Ignore:
Timestamp:
12/21/10 02:37:35 (2 years ago)
Author:
bruno
Message:
  • Modify pb_check_req interface to return the found value and allow direct call
  • Use pb_check_req to avoid some hardcoded path
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r1126 r1127  
    19511951                die("Found an existing Virtual machine $vmm. Won't overwrite") if (-r $vmm); 
    19521952                if (($vmtype eq "qemu") || ($vmtype eq "xen") || ($vmtype eq "kvm")) { 
    1953                     pb_system("/usr/bin/qemu-img create -f qcow2 $vmm $vmsize->{$ENV{'PBPROJ'}}","Creating the QEMU VM"); 
     1953                    my $command = pb_check_req("qemu-img",0); 
     1954                    pb_system("$command create -f qcow2 $vmm $vmsize->{$ENV{'PBPROJ'}}","Creating the QEMU VM"); 
    19541955                } elsif ($vmtype eq "vmware") { 
    19551956                } else { 
     
    20592060                            $addpkgs = "-a $postparam"; 
    20602061                        } 
    2061                         pb_system("sudo /usr/bin/rpmbootstrap $rbsopt $postinstall $addpkgs $ddir-$dver-$darch $rbsverb","Creating the rpmbootstrap VE for $ddir-$dver ($darch)", "verbose"); 
     2062                        my $command = pb_check_req("rpmbootstrap",0); 
     2063                        pb_system("sudo $command $rbsopt $postinstall $addpkgs $ddir-$dver-$darch $rbsverb","Creating the rpmbootstrap VE for $ddir-$dver ($darch)", "verbose"); 
    20622064                    } elsif ($verpmstyle eq "mock") { 
    20632065                        my ($rbsconf) = pb_conf_get("rbsconf"); 
    2064                         pb_system("sudo /usr/sbin/mock --init --resultdir=\"/tmp\" --configdir=\"$rbsconf->{$ENV{'PBPROJ'}}\" -r $v $rbsopt","Creating the mock VE for $ddir-$dver ($darch)"); 
     2066                        my $command = pb_check_req("mock",0); 
     2067                        pb_system("sudo $command --init --resultdir=\"/tmp\" --configdir=\"$rbsconf->{$ENV{'PBPROJ'}}\" -r $v $rbsopt","Creating the mock VE for $ddir-$dver ($darch)"); 
    20652068                        # Once setup we need to install some packages, the pb account, ... 
    2066                         pb_system("sudo /usr/sbin/mock --install --configdir=\"$rbsconf->{$ENV{'PBPROJ'}}\" -r $v su","Configuring the mock VE"); 
     2069                        pb_system("sudo $command --install --configdir=\"$rbsconf->{$ENV{'PBPROJ'}}\" -r $v su","Configuring the mock VE"); 
    20672070                    } else { 
    20682071                        die "Unknown verpmtype type $verpmstyle. Report to dev team"; 
Note: See TracChangeset for help on using the changeset viewer.