Changeset 620 for devel/pb/bin/pb


Ignore:
Timestamp:
Nov 29, 2008, 7:17:54 PM (11 years ago)
Author:
Bruno Cornec
Message:
  • change pb_distro_init interface and add a 6th parameter which is the update CLI to use for that distro.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r619 r620  
    587587                chomp($arch);
    588588                my ($ddir, $dver, $dfam);
    589                 ($ddir, $dver, $dfam, $pb{'dtype'}, $pb{'suf'}) = pb_distro_init($name,$ver);
     589                ($ddir, $dver, $dfam, $pb{'dtype'}, $pb{'suf'}, $pb{'upd'}) = pb_distro_init($name,$ver);
    590590                pb_log(2,"DEBUG: distro tuple: ".Dumper($ddir, $dver, $dfam, $pb{'dtype'}, $pb{'suf'})."\n");
    591591                pb_log(2,"DEBUG Filtering PBDATE => $pbdate, PBTAG => $pbtag, PBVER => $pbver\n");
     
    785785
    786786    # Get the running distro to build on
    787     my ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init();
    788     pb_log(2,"DEBUG: distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf))."\n");
     787    my ($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd) = pb_distro_init();
     788    pb_log(2,"DEBUG: distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd))."\n");
    789789
    790790    # Get list of packages to build
     
    10281028            ($odir,$over,$oarch) = split(/-/,$v);
    10291029        }
    1030         ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init($odir,$over);
     1030        ($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd) = pb_distro_init($odir,$over);
    10311031        pb_log(2,"DEBUG: distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf))."\n");
    10321032
     
    14491449        my ($name,$ver,$darch) = split(/-/,$v);
    14501450        chomp($darch);
    1451         my ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init($name,$ver);
     1451        my ($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd) = pb_distro_init($name,$ver);
    14521452
    14531453        if ($vetype eq "chroot") {
     
    19191919# We need to have that pb_distro_init function
    19201920# Get it from Project-Builder::Distribution
    1921 my ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init();
     1921my ($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd) = pb_distro_init();
    19221922print "distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf))."\n";
    19231923
     
    19391939if ( $ddir eq "fedora" ) {
    19401940    pb_system("yum clean all","Cleaning yum env");
    1941     #system "yum update -y";
    1942     my $arch=`uname -m`;
    1943     my $opt = "";
    1944     chomp($arch);
    1945     if ($arch eq "x86_64") {
    1946         $opt="--exclude=*.i?86";
    1947     }
    1948 
    19491941    if ($dver == 4) {
    1950         pb_system("yum -y $opt install rpm-build wget patch ntp sudo perl-DateManip perl-ExtUtils-MakeMaker",$cmtall);
     1942        pb_system("$pbupd rpm-build wget patch ntp sudo perl-DateManip perl-ExtUtils-MakeMaker",$cmtall);
    19511943        pb_system("$insmb","$cmtmb");
    19521944        pb_system("$insfm","$cmtfm");
     
    19551947        pb_system("$inslg","$cmtlg");
    19561948    } else {
    1957         pb_system("yum -y $opt install rpm-build wget patch ntp sudo perl-DateManip perl-ExtUtils-MakeMaker perl-File-MimeInfo perl-Mail-Sendmail",$cmtall);
     1949        pb_system("$pbupd rpm-build wget patch ntp sudo perl-DateManip perl-ExtUtils-MakeMaker perl-File-MimeInfo perl-Mail-Sendmail",$cmtall);
    19581950        if ($dver > 9) {
    1959             pb_system("yum -y $opt install perl-gettext",$cmtall);
     1951            pb_system("$pbupd perl-gettext",$cmtall);
    19601952        } else {
    19611953            pb_system("$inslg","$cmtlg");
     
    19771969    pb_system("$insfb","$cmtfb");
    19781970    pb_system("$insms","$cmtms");
    1979     pb_system("export TERM=linux ; liste=\"\" ; for i in make wget patch sudo perl-DateManip perl-File-HomeDir perl-Mail-Sendmail ntp; do rpm -q \$i 1> /dev/null 2> /dev/null ; if [ \$\? != 0 ]; then liste=\"\$liste \$i\"; fi; done; echo \"Liste: \$liste\" ; if [ \"\$liste\" != \"\" ]; then yast2 -i \$liste ; fi","$cmtall");
     1971    pb_system("export TERM=linux ; liste=\"\" ; for i in make wget patch sudo perl-DateManip perl-File-HomeDir perl-Mail-Sendmail ntp; do rpm -q \$i 1> /dev/null 2> /dev/null ; if [ \$\? != 0 ]; then liste=\"\$liste \$i\"; fi; done; echo \"Liste: \$liste\" ; if [ \"\$liste\" != \"\" ]; then $pbupd \$liste ; fi","$cmtall");
    19801972} elsif ( $dfam eq "md" ) {
    1981         pb_system("urpmi.update -a ; urpmi --auto rpm-build wget sudo patch ntp-client perl-File-MimeInfo perl-Mail-Sendmail perl-Locale-gettext","$cmtall");
     1973        pb_system("urpmi.update -a ; $pbupd rpm-build wget sudo patch ntp-client perl-File-MimeInfo perl-Mail-Sendmail perl-Locale-gettext","$cmtall");
    19821974        if (($ddir eq "mandrake") && ($dver eq "10.1")) {
    19831975            pb_system("$insdm","$cmtdm");
    19841976            pb_system("$inslg","$cmtlg");
    19851977        } else {
    1986             pb_system("urpmi --auto perl-DateManip","$cmtdm");
    1987             pb_system("urpmi --auto perl-Locale-gettext","$cmtdm");
     1978            pb_system("$pbupd perl-DateManip","$cmtdm");
     1979            pb_system("$pbupd perl-Locale-gettext","$cmtdm");
    19881980        }
    19891981} elsif ( $dfam eq "du" ) {
     
    19981990} elsif ( $dfam eq "gen" ) {
    19991991        #system "emerge -u system";
    2000         pb_system("emerge wget sudo ntp DateManip File-MimeInfo Mail-Sendmail Locale-gettext","$cmtall");
     1992        pb_system("$pbudp wget sudo ntp DateManip File-MimeInfo Mail-Sendmail Locale-gettext","$cmtall");
    20011993} else {
    20021994    pb_log(0,"No pkg to install\n");
Note: See TracChangeset for help on using the changeset viewer.