Changeset 166


Ignore:
Timestamp:
Oct 1, 2007, 10:26:09 AM (13 years ago)
Author:
Bruno Cornec
Message:

Attempt ro remove a pb on recent bash version (maybe)

Location:
devel/pb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r165 r166  
    459459        if (($cmt eq "Sources") || ($cmt eq "VMs")) {
    460460            $src = "$src $ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz";
    461             $cmd = "$cmd ; ln -sf $pbpkg-$pbver.tar.gz $pbpkg-latest.tar.gz";
     461            if ($cmd eq "") {
     462                $cmd = "ln -sf $pbpkg-$pbver.tar.gz $pbpkg-latest.tar.gz";
     463            } else {
     464                $cmd = "$cmd ; ln -sf $pbpkg-$pbver.tar.gz $pbpkg-latest.tar.gz";
     465            }
    462466        }
    463467    }
     
    642646    $p = $ARGV[0] if (defined $ARGV[0]);
    643647    print SCRIPT "echo Building packages on VM...\n";
    644     print SCRIPT "pb build2pkg $p\n";
     648    print SCRIPT "pb -p $ENV{'PBPROJ'} build2pkg $p\n";
    645649    close(SCRIPT);
    646650    chmod 0755,"$ENV{'PBDESTDIR'}/pbscript";
  • devel/pb/contrib/pbsetupqemu

    r164 r166  
    33# Script to be used as pbscript to create a potentialy
    44# missing pb account on the QEMU VM, and adds it to sudo
     5
     6# Needs to be extented with the pb Distribution.pm module at the end externally
    57#
    68# Needs to use root account to connect to the VM
     
    1113use strict;
    1214use File::Basename;
    13 use ProjectBuilder::Distribution qw (pb_distro_init);
    1415
    1516my $file = "/tmp/pbkey";
     
    3839$file="/etc/shadow";
    3940open(PBFILE,$file) || die "Unable to open $file";
     41open(PBOUT,"> $file.new") || die "Unable to open $file.new";
    4042while (<PBFILE>) {
    4143    s/^pb:\!\!:/pb:*:/;
     44    print PBOUT $_;
    4245}
    4346close(PBFILE);
     47close(PBOUT);
     48rename("$file.new",$file);
    4449
    4550# Adapt sudoers
     
    4752$found = 0;
    4853open(PBFILE,$file) || die "Unable to open $file";
     54open(PBOUT,"> $file.new") || die "Unable to open $file.new";
    4955while (<PBFILE>) {
    5056    $found = 1 if (/^pb   /);
     57    s/Defaults[ \t]+requiretty//;
     58    print PBOUT $_;
    5159}
    5260close(PBFILE);
    53 
    54 if ( $found == 0 ) {
    55     open(PBFILE,">> $file") || die "Unable to open $file";
    56     print PBFILE "pb   ALL=(ALL) NOPASSWD:ALL\n";
    57 }
     61print PBFILE "pb   ALL=(ALL) NOPASSWD:ALL\n" if ( $found == 0 );
     62close(PBOUT);
     63rename("$file.new",$file);
    5864
    5965system 'su - pb -c "mkdir -p .ssh ; chmod 700 .ssh ; cp /tmp/pbkey .ssh/authorized_keys ; chmod 600 .ssh/authorized_keys"';
     
    6773    if ( $dver <= 4 ) {
    6874        # FC4
    69         system "yum -y install neon newt-devel slang-devel autoconf automake libtool gcc rpm-build wget gcc-c++ docbook-utils-pdf ImageMagick man patch cdrecord mkisofs perl-DateManip ; rm -rf AppConfig-* ; wget http://search.cpan.org/CPAN/authors/id/A/AB/ABW/AppConfig-1.66.tar.gz ; tar xvfz AppConfig-1.66.tar.gz ; cd AppConfig* ; perl Makefile.PL ; make ; make install ; cd ..";
     75        system "yum -y install neon newt-devel slang-devel autoconf automake libtool gcc rpm-build wget gcc-c++ docbook-utils-pdf ImageMagick man patch cdrecord mkisofs perl-DateManip ntp ; rm -rf AppConfig-* ; wget http://search.cpan.org/CPAN/authors/id/A/AB/ABW/AppConfig-1.66.tar.gz ; tar xvfz AppConfig-1.66.tar.gz ; cd AppConfig* ; perl Makefile.PL ; make ; make install ; cd ..";
    7076    } else {
    7177        # FC5/6/7
    72         system "yum -y install neon newt-devel slang-devel autoconf automake libtool gcc rpm-build wget vim gcc-c++ docbook-utils-pdf ImageMagick man patch cdrecord mkisofs perl-AppConfig perl-DateManip";
     78        system "yum -y install neon newt-devel slang-devel autoconf automake libtool gcc rpm-build wget gcc-c++ docbook-utils-pdf ImageMagick man patch cdrecord mkisofs ntp perl-AppConfig perl-DateManip";
    7379    }
    7480} elsif ( $dfam eq "md" ) {
    75     system "urpmi --auto-select neon newt-devel slang-devel glibc-static-devel autoconf automake libtool gcc rpm-build wget gcc-c++ docbook-utils-pdf ImageMagick man patch mindi mondo mkisofs cdrecord perl-AppConfig perl-DateManip";
     81    system "urpmi --auto-select neon newt-devel slang-devel glibc-static-devel autoconf automake libtool gcc rpm-build wget gcc-c++ docbook-utils-pdf ImageMagick man patch mindi mondo mkisofs cdrecord ntp-client perl-AppConfig perl-DateManip";
    7682} elsif ( $dfam eq "du" ) {
    77     system "apt-get install autoconf automake libtool g++ wget patch mondo groff imagemagick docbook-utils docbook2x docbook-to-man openssh-server dpkg-dev debian-builder dh-make fakeroot libnewt-dev libncurses5-dev";
     83    system "apt-get install autoconf automake libtool g++ wget patch mondo groff imagemagick docbook-utils docbook2x docbook-to-man openssh-server dpkg-dev debian-builder dh-make fakeroot libnewt-dev ntp-client libncurses5-dev";
    7884} elsif ( $dfam eq "gen" ) {
    79     system "emerge neon newt slang autoconf automake subversion libtool gcc wget vim man groff lynx grub afio buffer mindi mondo-rescue cdrecord mkisofs";
     85    system "emerge neon newt slang autoconf automake subversion libtool gcc wget vim man groff lynx grub afio buffer mindi mondo-rescue cdrecord mkisofs ntp-client";
    8086} else {
    8187    print "No pkg to install\n";
    8288}
    83 
    84 $file = "/tmp/pbpatch";
    85 unlink $file;
    86 
    87 open(PBFILE,"> $file") || die "Unable to open $file";
    88 print PBFILE << 'EOF';
    89 --- File.pm     2007-09-29 14:55:28.000000000 +0100
    90 +++ File.pm.new 2007-09-29 14:55:44.000000000 +0100
    91 @@ -15,7 +15,7 @@
    92  package AppConfig::File;
    93  use strict;
    94  use warnings;
    95 -use AppConfig;
    96 +use AppConfig qw(:argcount);
    97  use AppConfig::State;
    98  our $VERSION = '1.65';
    99 
    100 @@ -208,6 +208,11 @@
    101 
    102                  my $nargs = $state->_argcount($variable);
    103 
    104 +                # Fix a bug if the variable is a hash - 1 has been created as a key
    105 +                if ($nargs eq AppConfig::ARGCOUNT_HASH) {
    106 +                    delete $state->{ VARIABLE }->{ $variable }{1};
    107 +                }
    108 +
    109                  # variables prefixed '-' are reset to their default values
    110                  if ($flag eq '-') {
    111                      $state->_default($variable);
    112 
    113 EOF
    114 close(PBFILE);
    11589
    11690# Patch AppConfig
     
    148122
    149123system "rm -rf project-builder-* ; wget ftp://ftp.mondorescue.org/src/project-builder-latest.tar.gz ; tar xvfz project-builder-latest.tar.gz ; cd project-builder-* ; perl Makefile.PL ; make ; make install ; cd ..";
     124
Note: See TracChangeset for help on using the changeset viewer.