Changeset 295 for devel/pb/bin/pb


Ignore:
Timestamp:
Jan 12, 2008, 2:12:45 AM (12 years ago)
Author:
bruno
Message:

pb working for gentoo with mindi

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r294 r295  
    420420            my @ebuildfile;
    421421            # For gentoo we need to take pb as subsystem name
    422             pb_mkdir_p("$ENV{'PBBUILDDIR'}/portage/pb/$pbpkg") if (! -d "$ENV{'PBBUILDDIR'}/portage/pb/$pbpkg");
    423 
    424             # We need to first extract the ebuild file
    425             @ebuildfile = pb_extract_build_files($src,"$pbpkg-$pbver/pbconf/$ddir-$dver/","$ENV{'PBBUILDDIR'}/portage/pb/$pbpkg");
     422            # We put every apps here under sys-apps. hope it's correct
     423            # We use pb's home dir in order o have a single OVERLAY line
     424            my $tmpd = "$ENV{'HOME'}/portage/pb/sys-apps/$pbpkg";
     425            pb_mkdir_p($tmpd) if (! -d "$tmpd");
     426            pb_mkdir_p("$ENV{'HOME'}/portage/distfiles") if (! -d "$ENV{'HOME'}/portage/distfiles");
     427
     428            # We need to first extract the ebuild file
     429            @ebuildfile = pb_extract_build_files($src,"$pbpkg-$pbver/pbconf/$ddir-$dver/","$tmpd");
    426430
    427431            # Prepare the build env for gentoo
    428432            my $found = 0;
    429             my $pbbd = $ENV{'PBBUILDDIR'};
     433            my $pbbd = $ENV{'HOME'};
    430434            $pbbd =~ s|/|\\/|g;
    431             open(MAKE,"/etc/make.conf") || die "Unable to open /etc/make.conf";
    432             while (<MAKE>) {
    433                 $found = 1 if (/$pbbd\/portage/);
    434             }
    435             close(MAKE);
     435            if (-r "/etc/make.conf") {
     436                open(MAKE,"/etc/make.conf");
     437                while (<MAKE>) {
     438                    $found = 1 if (/$pbbd\/portage/);
     439                }
     440                close(MAKE);
     441            }
    436442            if ($found == 0) {
    437                 pb_system("sudo \'echo PORTDIR_OVERLAY=\"$ENV{'PBBUILDDIR'}/portage\" >> /etc/make.conf\'");
    438             }
    439             $found = 0;
    440             open(KEYW,"/etc/portage/package.keywords") || die "Unable to open /etc/portage/package.keywords";
    441             while (<KEYW>) {
    442                 $found = 1 if (/portage\/pb/);
    443             }
    444             close(KEYW);
    445             if ($found == 0) {
    446                 pb_system("sudo \'echo portage/pb >> /etc/portage/package.keywords\'");
    447             }
     443                pb_system("sudo sh -c 'echo PORTDIR_OVERLAY=\"$ENV{'HOME'}/portage\" >> /etc/make.conf'");
     444            }
     445            #$found = 0;
     446            #if (-r "/etc/portage/package.keywords") {
     447            #open(KEYW,"/etc/portage/package.keywords");
     448            #while (<KEYW>) {
     449            #$found = 1 if (/portage\/pb/);
     450            #}
     451            #close(KEYW);
     452            #}
     453            #if ($found == 0) {
     454            #pb_system("sudo sh -c \"echo portage/pb >> /etc/portage/package.keywords\"");
     455            #}
    448456
    449457            # Build
    450458            foreach my $f (@ebuildfile) {
    451459                if ($f =~ /\.ebuild$/) {
    452                     pb_system("ebuild $f digest ; ebuild $f package");
     460                    move($f,"$tmpd/$pbpkg-$pbver.ebuild");
     461                    pb_system("cd $tmpd ; ebuild $pbpkg-$pbver.ebuild clean ; ebuild $pbpkg-$pbver.ebuild digest ; ebuild $pbpkg-$pbver.ebuild package");
     462                    # Now move it where pb expects it
     463                    pb_mkdir_p("$ENV{'PBBUILDDIR'}/portage/pb/sys-apps/$pbpkg");
     464                    move("$tmpd/$pbpkg-$pbver.ebuild","$ENV{'PBBUILDDIR'}/portage/pb/sys-apps/$pbpkg");
    453465                }
    454466            }
    455             print $LOG "ebuild file: ".Dumper(\@ebuildfile)."\n" if ($debug >= 1);
    456 
    457             $made="$made portage/pb/$pbpkg/$pbpkg-$pbver.ebuild";
     467
     468            $made="$made portage/pb/sys-apps/$pbpkg/$pbpkg-$pbver.ebuild";
    458469        } elsif ($dtype eq "slackware") {
    459470            $made="$made build-$pbpkg/$pbpkg-$pbver-*-$pbtag.tgz";
Note: See TracChangeset for help on using the changeset viewer.