Changeset 749


Ignore:
Timestamp:
Mar 30, 2009, 2:31:42 AM (11 years ago)
Author:
Bruno Cornec
Message:
  • pb_get_arch placed lower in the modules tree and used everywhere uname was used
  • Adds the possibility to replace the post-install script for rinse to allow for a perl script replacement which is common between distributions
Location:
devel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/lib/ProjectBuilder/Base.pm

    r681 r749  
    3737
    3838our @ISA = qw(Exporter);
    39 our @EXPORT = qw(pb_mkdir_p pb_system pb_rm_rf pb_get_date pb_log pb_log_init pb_get_uri pb_get_content pb_set_content pb_display_file pb_syntax_init pb_syntax pb_temp_init $pbdebug $pbLOG $pbdisplaytype $pblocale);
     39our @EXPORT = qw(pb_mkdir_p pb_system pb_rm_rf pb_get_date pb_log pb_log_init pb_get_uri pb_get_content pb_set_content pb_display_file pb_syntax_init pb_syntax pb_temp_init pb_get_arch $pbdebug $pbLOG $pbdisplaytype $pblocale);
    4040
    4141=pod
     
    371371}
    372372
     373=item B<pb_get_arch>
     374
     375This function returns the architecture of our local environment and
     376standardize on i386 for those platforms. It also solves issues where a i386 VE on x86_64 returns x86_64 wrongly
     377
     378=cut
     379
     380sub pb_get_arch {
     381
     382my $arch = `uname -m`;
     383chomp($arch);
     384$arch =~ s/i.86/i386/;
     385
     386return($arch);
     387}
     388
    373389=back
    374390
  • devel/pb-modules/lib/ProjectBuilder/Distribution.pm

    r735 r749  
    119119
    120120    # By defaut propose yum
    121     my $arch=`uname -m`;
     121    my $arch=pb_get_arch();
    122122    my $opt = "";
    123     chomp($arch);
    124123    if ($arch eq "x86_64") {
    125124        $opt="--exclude=*.i?86";
     
    570569
    571570}
     571
     572
    572573=back
    573574
  • devel/pb/bin/pb

    r748 r749  
    15791579        # Get VE context
    15801580        my ($ptr,$vetmout,$vepath,$verebuild,$veconf,$vepostinstall) = pb_conf_get("vetype","vetmout","vepath","verebuild","veconf");
    1581         my ($veb4pi,$vepkglist) = pb_conf_get_if("veb4pi","vepkglist");
     1581        my ($veb4pi,$vepi,$vepkglist) = pb_conf_get_if("veb4pi","vepi","vepkglist");
    15821582        my $vetype = $ptr->{$ENV{'PBPROJ'}};
    15831583
     
    16001600                    my $verpmstyle = pb_distro_get_param($ddir,$dver,$darch,$verpmtype);
    16011601                    if ($verpmstyle eq "rinse") {
    1602                         # Need to reshape the mirrors generated
    1603                         my $post = "--before-post-install ";
     1602                        # Need to reshape the mirrors generated with local before-post-install script
     1603                        my $b4post = "--before-post-install ";
    16041604                        my $postparam = pb_distro_get_param($ddir,$dver,$darch,$veb4pi);
     1605                        if ($postparam eq "") {
     1606                            $b4post = "";
     1607                        } else {
     1608                            $b4post .= $postparam;
     1609                        }
     1610                        # Do we have a local post-install script
     1611                        my $post = "--post-install ";
     1612                        $postparam = pb_distro_get_param($ddir,$dver,$darch,$vepi);
    16051613                        if ($postparam eq "") {
    16061614                            $post = "";
     
    16261634                        $rinseverb = "--verbose" if ($pbdebug gt 0);
    16271635
    1628                         pb_system("sudo /usr/sbin/rinse --directory \"$vepath->{$ENV{'PBPROJ'}}/$ddir/$dver/$darch\" --arch \"$darch\" --distribution \"$ddir-$dver\" --config \"$veconf->{$ENV{'PBPROJ'}}\" $post $addpkgs $rinseverb","Creating the rinse VE for $ddir-$dver ($darch)", "verbose");
     1636                        pb_system("sudo /usr/sbin/rinse --directory \"$vepath->{$ENV{'PBPROJ'}}/$ddir/$dver/$darch\" --arch \"$darch\" --distribution \"$ddir-$dver\" --config \"$veconf->{$ENV{'PBPROJ'}}\" $b4post $post $addpkgs $rinseverb","Creating the rinse VE for $ddir-$dver ($darch)", "verbose");
    16291637                    } elsif ($verpmstyle eq "mock") {
    16301638                        pb_system("sudo /usr/sbin/mock --init --resultdir=\"/tmp\" --configdir=\"$veconf->{$ENV{'PBPROJ'}}\" -r $v","Creating the mock VE for $ddir-$dver ($darch)");
     
    27282736}
    27292737
    2730 # Which is our local arch ? (standardize on i386 for those platforms)
    2731 sub pb_get_arch {
    2732 
    2733 my $arch = `uname -m`;
    2734 chomp($arch);
    2735 $arch =~ s/i.86/i386/;
    2736 return($arch);
    2737 }
    2738 
    273927381;
Note: See TracChangeset for help on using the changeset viewer.