Changeset 756


Ignore:
Timestamp:
Apr 4, 2009, 7:42:24 PM (11 years ago)
Author:
Bruno Cornec
Message:

pb_distro_init now returns a 7th paramater which is the arch, useful for pbdistrocheck

Location:
devel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/bin/pbdistrocheck

    r620 r756  
    2828pb_log_init($pbdebug, $pbLOG);
    2929
    30 my ($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd) = pb_distro_init();
    31 print "distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd))."\n";
     30my ($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd, $arch) = pb_distro_init();
     31print "distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd, $arch))."\n";
  • devel/pb-modules/lib/ProjectBuilder/Distribution.pm

    r751 r756  
    4242  # Return information on the running distro
    4343  #
    44   my ($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd) = pb_distro_init();
    45   print "distro tuple: ".Dumper($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd)."\n";
     44  my ($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd, $arch) = pb_distro_init();
     45  print "distro tuple: ".Dumper($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd, $arch)."\n";
    4646  #
    4747  # Return information on the requested distro
    4848  #
    49   my ($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd) = pb_distro_init("ubuntu","7.10");
    50   print "distro tuple: ".Dumper($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd)."\n";
     49  my ($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd, $arch) = pb_distro_init("ubuntu","7.10","x86_64");
     50  print "distro tuple: ".Dumper($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd, $arch)."\n";
    5151  #
    5252  # Return information on the running distro
    5353  #
    5454  my ($ddir,$dver) = pb_distro_get();
    55   my ($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd) = pb_distro_init($ddir,$dver);
    56   print "distro tuple: ".Dumper($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd)."\n";
     55  my ($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd, $arch) = pb_distro_init($ddir,$dver);
     56  print "distro tuple: ".Dumper($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd, $arch)."\n";
    5757
    5858=head1 USAGE
     
    6060=over 4
    6161
    62 
    63 =item B<pb_distro_get>
    64 
    65 This function returns a list of 2 parameters indicating the distribution name and version of the underlying Linux distribution. The value of those 2 fields may be "unknown" in case the function was unable to recognize on which distribution it is running.
    66 
    67 On my home machine it would currently report ("mandriva","2008.0").
    68 
    69 =cut
     62=item B<pb_distro_init>
     63
     64This function returns a list of 7 parameters indicating the distribution name, version, family, type of build system, suffix of packages, update command line and architecture of the underlying Linux distribution. The value of the 7 fields may be "unknown" in case the function was unable to recognize on which distribution it is running.
     65
     66As an example, Ubuntu and Debian are in the same "du" family. As well as RedHat, RHEL, CentOS, fedora are on the same "rh" family.
     67Mandriva, Open SuSE and Fedora have all the same "rpm" type of build system. Ubuntu ad Debian have the same "deb" type of build system.
     68And "fc" is the extension generated for all Fedora packages (Version will be added by pb).
     69
     70When passing the distribution name and version as parameters, the B<pb_distro_init> function returns the parameter of that distribution instead of the underlying one.
     71
     72Cf: http://linuxmafia.com/faq/Admin/release-files.html
     73Ideas taken from http://search.cpan.org/~kerberus/Linux-Distribution-0.14/lib/Linux/Distribution.pm
     74
     75=cut
     76
    7077
    7178sub pb_distro_init {
     
    171178}
    172179
    173 return($ddir, $dver, $dfam, $dtype, $dsuf, $dupd);
    174 }
    175 
    176 =item B<pb_distro_init>
    177 
    178 This function returns a list of 5 parameters indicating the distribution name, version, family, type of build system and suffix of packages of the underlying Linux distribution. The value of the 5 fields may be "unknown" in case the function was unable to recognize on which distribution it is running.
    179 
    180 As an example, Ubuntu and Debian are in the same "du" family. As well as RedHat, RHEL, CentOS, fedora are on the same "rh" family.
    181 Mandriva, Open SuSE and Fedora have all the same "rpm" type of build system. Ubuntu ad Debian have the same "deb" type of build system.
    182 And "fc" is the extension generated for all Fedora packages (Version will be added by pb).
    183 
    184 When passing the distribution name and version as parameters, the B<pb_distro_init> function returns the parameter of that distribution instead of the underlying one.
    185 
    186 Cf: http://linuxmafia.com/faq/Admin/release-files.html
    187 Ideas taken from http://search.cpan.org/~kerberus/Linux-Distribution-0.14/lib/Linux/Distribution.pm
     180return($ddir, $dver, $dfam, $dtype, $dsuf, $dupd, $arch);
     181}
     182
     183=item B<pb_distro_get>
     184
     185This function returns a list of 2 parameters indicating the distribution name and version of the underlying Linux distribution. The value of those 2 fields may be "unknown" in case the function was unable to recognize on which distribution it is running.
     186
     187On my home machine it would currently report ("mandriva","2009.0").
    188188
    189189=cut
     
    344344
    345345This function install the dependencies required to build the package on an RPM based distro
    346 dependencies can be passed as a prameter in which case they are not computed
     346dependencies can be passed as a parameter in which case they are not computed
    347347
    348348=cut
  • devel/pb/bin/pb

    r755 r756  
    620620                chomp($arch);
    621621                my ($ddir, $dver, $dfam);
    622                 ($ddir, $dver, $dfam, $pb{'dtype'}, $pb{'suf'}, $pb{'upd'}) = pb_distro_init($name,$ver,$arch);
     622                ($ddir, $dver, $dfam, $pb{'dtype'}, $pb{'suf'}, $pb{'upd'}, $pb{'arch'}) = pb_distro_init($name,$ver,$arch);
    623623                pb_log(2,"DEBUG: distro tuple: ".Dumper($ddir, $dver, $dfam, $pb{'dtype'}, $pb{'suf'})."\n");
    624624                pb_log(2,"DEBUG Filtering PBDATE => $pbdate, PBTAG => $pbtag, PBVER => $pbver\n");
     
    827827
    828828    # Get the running distro to build on
    829     my ($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd) = pb_distro_init();
    830     pb_log(2,"DEBUG: distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd))."\n");
     829    my ($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd, $arch) = pb_distro_init();
     830    pb_log(2,"DEBUG: distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd, $arch))."\n");
    831831
    832832    # Get list of packages to build
     
    834834    my $ptr = pb_get_pkg();
    835835    @pkgs = @$ptr;
    836 
    837     my $arch = pb_get_arch();
    838836
    839837    my ($pkg) = pb_conf_read("$ENV{'PBDESTDIR'}/$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.pb","pbpkg");
     
    879877
    880878            # If needed we may add repository to the build env
    881             my $darch = pb_get_arch();
    882             pb_distro_setuprepo($ddir,$dver,$darch,$dtype);
     879            pb_distro_setuprepo($ddir,$dver,$arch,$dtype);
    883880            foreach my $f (@specfile) {
    884881                if ($f =~ /\.spec$/) {
     
    908905            chmod 0755,"debian/rules";
    909906
    910             my $darch = pb_get_arch();
    911             pb_distro_setuprepo($ddir,$dver,$darch,$dtype);
     907            pb_distro_setuprepo($ddir,$dver,$arch,$dtype);
    912908            pb_distro_installdeps("debian/control",$dtype,$pbupd);
    913909            pb_system("dpkg-buildpackage -us -uc -rfakeroot","Building package","verbose");
     
    22922288# We need to have that pb_distro_init function
    22932289# Get it from Project-Builder::Distribution
    2294 my ($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd) = pb_distro_init();
    2295 print "distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf))."\n";
     2290my ($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd, $arch) = pb_distro_init();
     2291print "distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf, $arch))."\n";
    22962292
    22972293# We may need a proxy configuration. Get it from the local env
Note: See TracChangeset for help on using the changeset viewer.