Changeset 1132


Ignore:
Timestamp:
Dec 23, 2010, 2:01:37 AM (9 years ago)
Author:
bruno
Message:
  • Adds params to pb_distro_setuprepo to support generic family/os templates
  • Fix pbinstalltype issue (setupve was broken) by useing a dsitro based hash
  • Use new pb.conf variable (ospkg and osrepo for pkg install)
  • Adds function pb_distro_setuposrepo to setup pb install repo
  • Adds a private pb_distro_setuprepo_gen function for code share between pb_distro_setuposrepo and pb_distro_setuprepo
  • Move the relative conf parameters from pb.pb to pb.conf
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/etc/pb.conf

    r1131 r1132  
    445445oscmd rpmbootstrap = rpm,rpm2cpio,wget
    446446#oscmdopt rpmbootstrap =
     447#
     448
     449# How do you want to install pb in your VM/VE (pkg or file)
     450pbinstalltype default = pkg
     451# No gentoo repo provided yet
     452pbinstalltype gen = file
     453# Default main package for pkg install of pb
     454ospkg default = project-builder
     455# Where is the associated repo
     456osrepo rpm = ftp://ftp.project-builder.org/$ddir/$dver/pb.repo
    447457
    448458# Number of process in // for pb
    449459#pbparallel pb = 2
    450460#
    451 
    452 # Default insgtallation type is with packages for pb
    453 pbinstalltype default = pkg
    454461
    455462#
  • devel/pb-modules/lib/ProjectBuilder/Distribution.pm

    r1111 r1132  
    2323 
    2424our @ISA = qw(Exporter);
    25 our @EXPORT = qw(pb_distro_conffile pb_distro_init pb_distro_get pb_distro_getlsb pb_distro_installdeps pb_distro_getdeps pb_distro_only_deps_needed pb_distro_setuprepo pb_distro_get_param);
     25our @EXPORT = qw(pb_distro_conffile pb_distro_init pb_distro_get pb_distro_getlsb pb_distro_installdeps pb_distro_getdeps pb_distro_only_deps_needed pb_distro_setuprepo pb_distro_setuposrepo pb_distro_get_param);
    2626
    2727=pod
     
    406406}
    407407
    408 =item B<pb_distro_setuprepo>
    409 
    410 This function sets up potential additional repository to the build environment
    411 
    412 =cut
    413 
    414 sub pb_distro_setuprepo {
     408=item B<pb_distro_setuposrepo>
     409
     410This function sets up potential additional repository for the setup phase
     411
     412=cut
     413
     414sub pb_distro_setuposrepo {
    415415
    416416my $ddir = shift || undef;
     
    418418my $darch = shift;
    419419my $dtype = shift || undef;
    420 
    421 my ($addrepo) = pb_conf_read("$ENV{'PBDESTDIR'}/pbrc","addrepo");
     420my $dfam = shift || undef;
     421my $dos = shift || undef;
     422
     423pb_distro_setuprepo_gen($ddir,$dver,$darch,$dtype,$dfam,$dos,pb_distro_conffile(),"osrepo");
     424}
     425
     426=item B<pb_distro_setuprepo>
     427
     428This function sets up potential additional repository to the build environment
     429
     430=cut
     431
     432sub pb_distro_setuprepo {
     433
     434my $ddir = shift || undef;
     435my $dver = shift;
     436my $darch = shift;
     437my $dtype = shift || undef;
     438my $dfam = shift || undef;
     439my $dos = shift || undef;
     440
     441pb_distro_setuprepo_gen($ddir,$dver,$darch,$dtype,$dfam,$dos,"$ENV{'PBDESTDIR'}/pbrc","addrepo");
     442}
     443
     444=item B<pb_distro_setuprepo_gen>
     445
     446This function sets up in a generic way potential additional repository
     447
     448=cut
     449
     450sub pb_distro_setuprepo_gen {
     451
     452my $ddir = shift || undef;
     453my $dver = shift;
     454my $darch = shift;
     455my $dtype = shift || undef;
     456my $dfam = shift || undef;
     457my $dos = shift || undef;
     458my $pbconf = shift || undef;
     459my $pbkey = shift || undef;
     460
     461return if (not defined $pbconf);
     462return if (not defined $pbkey);
     463my ($addrepo) = pb_conf_read($pbconf,$pbkey);
    422464return if (not defined $addrepo);
    423465
    424 my $param = pb_distro_get_param($ddir,$dver,$darch,$addrepo);
     466my $param = pb_distro_get_param($ddir,$dver,$darch,$addrepo,$dfam,$dtype,$dos);
    425467return if ($param eq "");
    426468
     
    487529my $dos = shift || "unknown";
    488530
     531pb_log(2,"DEBUG: pb_distro_get_param on $ddir-$dver-$darch for ".Dumper($opt)."\n");
    489532if (defined $opt->{"$ddir-$dver-$darch"}) {
    490533    $param = $opt->{"$ddir-$dver-$darch"};
  • devel/pb/bin/pb

    r1130 r1132  
    10261026
    10271027    # Additional potential repo
    1028     pb_distro_setuprepo($ddir,$dver,$arch,$dtype);
     1028    pb_distro_setuprepo($ddir,$dver,$arch,$dtype,$dfam,$dos);
    10291029    foreach my $pbpkg (@pkgs) {
    10301030        # We need to install the package to test, and deps brought with it
     
    10871087
    10881088            # If needed we may add repository to the build env
    1089             pb_distro_setuprepo($ddir,$dver,$arch,$dtype);
     1089            pb_distro_setuprepo($ddir,$dver,$arch,$dtype,$dfam,$dos);
    10901090            foreach my $f (@specfile) {
    10911091                if ($f =~ /\.spec$/) {
     
    11151115            chmod 0755,"debian/rules";
    11161116
    1117             pb_distro_setuprepo($ddir,$dver,$arch,$dtype);
     1117            pb_distro_setuprepo($ddir,$dver,$arch,$dtype,$dfam,$dos);
    11181118            pb_distro_installdeps("debian/control",$dtype,$pbins);
    11191119            pb_system("dpkg-buildpackage -us -uc -rfakeroot","Building package","verbose");
     
    27042704
    27052705EOF
    2706     my $itype = pb_conf_get("pbinstalltype");
    2707     if ($itype->{$ENV{'PBPROJ'}} =~ /^file/) {
     2706    my ($instype) = pb_conf_get("pbinstalltype");
     2707    my $itype = pb_distro_get_param($ddir,$dver,$darch,$instype,$dfam,$dtype,$dos);
     2708    if ($itype =~ /^file/) {
    27082709        print SCRIPT << 'EOF';
    27092710# Then install manually the missing perl modules
     
    27212722pb_system("rm -rf ProjectBuilder-* ; wget --passive-ftp ftp://ftp.mondorescue.org/src/ProjectBuilder-latest.tar.gz ; gzip -cd ProjectBuilder-latest.tar.gz | tar xf - ; cd ProjectBuilder-* ; perl Makefile.PL ; make ; make install ; cd .. ; rm -rf ProjectBuilder-* ; rm -rf project-builder-* ; wget --passive-ftp ftp://ftp.mondorescue.org/src/project-builder-latest.tar.gz ; gzip -cd project-builder-latest.tar.gz | tar xf - ; cd project-builder-* ; perl Makefile.PL ; make ; make install ; cd .. ; rm -rf project-builder-* ;","Building Project-Builder");
    27222723EOF
    2723     } elsif ($itype->{$ENV{'PBPROJ'}} =~ /^pkg/) {
     2724    } elsif ($itype =~ /^pkg/) {
    27242725        # pkg based install. We need to point to the project-builder.org repository
    27252726        print SCRIPT << 'EOF';
    2726 my ($pbpkg) = pb_conf_get_if("pbpkg");
    2727 
    2728 my $pkgforpb = pb_distro_get_param($ddir,$dver,$darch,$pbpkg,$dfam,$dtype,$depdos);
    2729 pb_distro_setuprepo($ddir,$dver,$darch,$dtype);
     2727my ($ospkg) = pb_conf_get_if("ospkg");
     2728
     2729my $pkgforpb = pb_distro_get_param($ddir,$dver,$darch,$ospkg,$dfam,$dtype,$dos);
     2730pb_distro_setuposrepo($ddir,$dver,$darch,$dtype,$dfam,$dos);
    27302731pb_distro_installdeps(undef,$dtype,$pbins,pb_distro_only_deps_needed($dtype,join(' ',split(/,/,$pkgforpb))));
    27312732EOF
  • pbconf/devel/pb.pb

    r1110 r1132  
    7777filteredfiles rpmbootstrap = Makefile.PL
    7878filteredfiles ProjectBuilder = Makefile.PL,lib/ProjectBuilder/Base.pm,lib/ProjectBuilder/Distribution.pm
    79 
    80 # How do you want to install pb in your VM/VE (pkg or file)
    81 # Can not be outside pb.pb as for other projects it may conflict, so this file will be needed for
    82 # pkg install with pb, which means that pkg install of pb in VM|VM is only possible when building for pb
    83 # project. Constraint on users.
    84 pbinstalltype default = pkg
    85 # No gentoo repo provided yet
    86 pbinstalltype gen = file
    87 pbpkg default = project-builder
    88 addrepo centos-5-x86_64 = ftp://ftp.project-builder.org/centos/5/noarch/pb.repo
  • pbconf/devel/rpmbootstrap/pbfilter/all.pbf

    r1082 r1132  
    11filter PBDESC = It helps building a chrooted environment for RPM based distributions$/in a similar way as debootstrap for deb based distributions.
    22# Summary of package
    3 filter PBSUMMARY = tool similar to debootstrap for RPM based distributions
     3filter PBSUMMARY = Tool similar to debootstrap for RPM based distributions
Note: See TracChangeset for help on using the changeset viewer.