Changeset 1111 for devel/rpmbootstrap


Ignore:
Timestamp:
Nov 18, 2010, 2:06:01 AM (7 years ago)
Author:
bruno
Message:
  • Rename previous option osupd into the more correct osins, and add a real osupd param to support distribution update commands
  • Adds 2 new commands to update distributions in VM|VE with updatevm|ve (Fix #70)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/rpmbootstrap/bin/rpmbootstrap

    r1082 r1111  
    216216my ($name,$ver,$darch) = split(/-/,$ENV{'PBV'});
    217217chomp($darch);
    218 my ($ddir, $dver, $dfam, $dtype, $dos, $pbsuf, $pbupd) = pb_distro_init($name,$ver,$darch);
     218my ($ddir, $dver, $dfam, $dtype, $dos, $pbsuf, $pbupd, $pbins) = pb_distro_init($name,$ver,$darch);
    219219
    220220#
     
    282282my $repo = $mirror;
    283283my $found = 0;
    284 if ($pbupd =~ /yum/) {
     284if ($pbins =~ /yum/) {
    285285    my $response1;
    286286    while ($found == 0) {
     
    334334my $osupdname = "";
    335335
    336 if ($pbupd =~ /yum/) {
     336if ($pbins =~ /yum/) {
    337337    $oscachedir = "$vepath/var/cache/yum/core/packages/";
    338338    $osupdcachedir = "$vepath/var/cache/yum/updates-released/packages/";
     
    344344        $osupdcachedir = "$vepath/var/cache/yum/updates-released/packages/";
    345345    }
    346 } elsif ($pbupd =~ /zypper/) {
     346} elsif ($pbins =~ /zypper/) {
    347347    $oscachedir = "$vepath/var/cache/zypp/packages/opensuse/suse/$darch";
    348348    $osupdname = "Zypper";
    349 } elsif ($pbupd =~ /urpmi/) {
     349} elsif ($pbins =~ /urpmi/) {
    350350    $oscachedir = "$vepath/var/cache/urpmi/rpms";
    351351    $osupdname = "URPMI";
     
    418418
    419419# yum needs that distro-release package be installed, so force it
    420 if ($pbupd =~ /yum/) {
     420if ($pbins =~ /yum/) {
    421421    foreach my $p1 (<$cachedir/($ddir|redhat)-release-*.rpm>) {
    422422        copy("$cachedir/$p1","$vepath/tmp");
     
    461461
    462462pb_log(1,"Adapting $osupdname repository entries\n");
    463 if ($pbupd =~ /yum/) {
     463if ($pbins =~ /yum/) {
    464464    #
    465465    # Force the architecture for yum
     
    478478    }
    479479    $minipkglist = "ldconfig yum passwd vim-minimal dhclient authconfig";
    480 } elsif ($pbupd =~ /zypper/) {
     480} elsif ($pbins =~ /zypper/) {
    481481    pb_mkdir_p("$vepath/etc/zypp/repos.d");
    482482    open(REPO,"> $vepath/etc/zypp/repos.d/$ddir-$dver") || die "Unable to create repo file";
     
    497497        pb_system("chroot $vepath /bin/bash -c \"yes | /usr/bin/zypper sa $baseurl $ddir-$dver\"","Bootstrapping Zypper");
    498498    }
    499 } elsif ($pbupd =~ /urpmi/) {
     499} elsif ($pbins =~ /urpmi/) {
    500500    # Setup the repo
    501501    my $baseurl = dirname(dirname(dirname($mirror)));
     
    508508# No need for sudo here
    509509#
    510 $pbupd =~ s/sudo//g;
    511 pb_system("chroot $vepath /bin/bash -c \"$pbupd $minipkglist \"","Bootstrapping OS by running $pbupd $minipkglist");
     510$pbins =~ s/sudo//g;
     511pb_system("chroot $vepath /bin/bash -c \"$pbins $minipkglist \"","Bootstrapping OS by running $pbins $minipkglist");
    512512
    513513#
     
    520520if (defined $opts{'a'}) {
    521521    $opts{'a'} =~ s/,/ /g;
    522     pb_system("chroot $vepath /bin/bash -c \"$pbupd $opts{'a'} \"","Adding packages to OS by running $pbupd $opts{'a'}");
     522    pb_system("chroot $vepath /bin/bash -c \"$pbins $opts{'a'} \"","Adding packages to OS by running $pbins $opts{'a'}");
    523523}
    524524
     
    527527#
    528528pb_log(1,"Cleaning up\n");
    529 if ($pbupd =~ /yum/) {
     529if ($pbins =~ /yum/) {
    530530    pb_system("chroot $vepath /usr/bin/yum clean all","Cleaning yum");
    531531}
Note: See TracChangeset for help on using the changeset viewer.