Changeset 226 for devel


Ignore:
Timestamp:
Oct 17, 2007, 6:38:20 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Improve pbsetupqemu for fc4, sudoers management
  • Adds updateqemu script
  • Adds support for "flat" type of CMS
  • gentoo is nover now
  • halt replaces poweroff
  • try to fix date issue on the VM
  • improve destdir management on spec file
Location:
devel
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r220 r226  
    567567        pb_system("ssh -q -p $port $mac \"rm -rf $tdir $bdir\"","VM cleanup on $mac");
    568568        if (! $vmexist) {
    569             pb_system("ssh -q -p $port $mac \"sudo /usr/bin/poweroff \"; sleep $tm ; echo \'if [ -d /proc/$vmpid ]; then kill -9 $vmpid; fi \' | bash ; sleep 10","VM $vm halt (pid $vmpid)");
     569            pb_system("ssh -q -p $port $mac \"sudo /sbin/halt -p \"; sleep $tm ; echo \'if [ -d /proc/$vmpid ]; then kill -9 $vmpid; fi \' | bash ; sleep 10","VM $vm halt (pid $vmpid)");
    570570        }
    571571        pb_send2ssh("Packages","$odir"."_"."$over");
     
    636636        $vmm = "$vmpath->{$ENV{'PBPROJ'}}/$vm.qemu";
    637637        if (! -f "$vmm") {
    638             print "Unable to find VM $vmm";
    639             return;
     638            die "Unable to find VM $vmm";
    640639        }
    641640        $cmd = "$vmcmd $ENV{'PBVMOPT'} -redir tcp:$vmport->{$ENV{'PBPROJ'}}:10.0.2.15:22 $vmm"
     
    674673    print SCRIPT "mv .pbrc \$HOME\n";
    675674    print SCRIPT "cd ..\n";
     675    # Force new date to be in the future compared to the date of the tar file by removing 1 minute
     676    my @date=(localtime->sec(), localtime->min(), localtime->hour(), localtime->mday(), localtime->mon(), localtime->year(), localtime->wday(), localtime->yday(), localtime->isdst());
     677    $date[1]--;
    676678    my $upddate = strftime("%m%d%H%M%Y", @date);
    677679    print SCRIPT "echo Setting up date on $vmntp...\n";
  • devel/pb/contrib/pbsetupqemu

    r220 r226  
    7979    }
    8080
    81     my $topbuilddir=`rpmquery --eval '%{_topdir}' 2> /dev/null`;
    82     chomp($topbuilddir);
     81    #my $topbuilddir=`rpmquery --eval '%{_topdir}' 2> /dev/null`;
     82    #chomp($topbuilddir);
    8383
    8484    if ( $dver <= 4 ) {
    8585        # FC4 - AppConfig unavailable
    86         system "yum -y $opt 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 sudo ; 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 ..";
     86        system "yum -y $opt 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 sudo ; rm -rf AppConfig-* ; 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 ..";
    8787    } else {
    8888        # FC5/6/7
     
    117117# Adapt sudoers
    118118$file="/etc/sudoers";
    119 $found = 0;
    120119open(PBFILE,$file) || die "Unable to open $file";
    121120open(PBOUT,"> $file.new") || die "Unable to open $file.new";
    122121while (<PBFILE>) {
    123     $found = 1 if (/^pb   /);
     122    next if (/^pb   /);
    124123    s/Defaults[ \t]+requiretty//;
    125124    print PBOUT $_;
    126125}
    127126close(PBFILE);
    128 print PBOUT "pb   ALL=(ALL) NOPASSWD:ALL\n" if ( $found == 0 );
     127print PBOUT "pb   ALL=(ALL) NOPASSWD:ALL\n";
    129128close(PBOUT);
    130129rename("$file.new",$file);
     
    172171}
    173172
    174 system "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 ..";
     173system "rm -rf project-builder-* ; wget --passive-ftp 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 ..";
    175174
  • devel/pb/lib/ProjectBuilder/Base.pm

    r212 r226  
    288288    $ENV{'PBCMSLOG'}="svn log";
    289289    $ENV{'PBCMSLOGFILE'}="svn.log";
     290} elsif ($cms->{$proj} eq "flat") {
     291    $ENV{'PBREVISION'}="flat";
     292    $ENV{'PBCMSLOG'}="/bin/true";
     293    $ENV{'PBCMSLOGFILE'}="/dev/null";
    290294} elsif ($cms->{$proj} eq "cvs") {
    291295    # Way too slow
     
    321325    }
    322326    pb_system("svn export $source $tmp","Exporting $source from SVN to $tmp");
     327} elsif ($cms->{$ENV{'PBPROJ'}} eq "flat") {
     328    if (-d $source) {
     329        $tmp = $destdir;
     330    } else {
     331        $tmp = $destdir."/".basename($source);
     332    }
     333    pb_system("cp -a $source $tmp","Exporting $source from DIR to $tmp");
    323334} elsif ($cms->{$ENV{'PBPROJ'}} eq "cvs") {
    324335    my $dir=dirname($destdir);
     
    346357if ($cms->{$ENV{'PBPROJ'}} eq "svn") {
    347358    pb_system("svn log -v $pkgdir > $destfile","Extracting log info from SVN");
     359} elsif ($cms->{$ENV{'PBPROJ'}} eq "flat") {
     360    # Nothing to do
    348361} elsif ($cms->{$ENV{'PBPROJ'}} eq "cvs") {
    349362    my $tmp=basename($pkgdir);
     
    367380    close(PIPE);
    368381    chomp($url);
     382} elsif ($cms->{$ENV{'PBPROJ'}} eq "flat") {
    369383} elsif ($cms->{$ENV{'PBPROJ'}} eq "cvs") {
    370384} else {
     
    381395if ($cms->{$ENV{'PBPROJ'}} eq "svn") {
    382396    pb_system("svn copy -m \"Creation of $newurl from $oldurl\" $oldurl $newurl","Copying $oldurl to $newurl ");
     397} elsif ($cms->{$ENV{'PBPROJ'}} eq "flat") {
    383398} elsif ($cms->{$ENV{'PBPROJ'}} eq "cvs") {
    384399} else {
     
    394409if ($cms->{$ENV{'PBPROJ'}} eq "svn") {
    395410    pb_system("svn co $url $destination","Checking $url to $destination ");
     411} elsif ($cms->{$ENV{'PBPROJ'}} eq "flat") {
    396412} elsif ($cms->{$ENV{'PBPROJ'}} eq "cvs") {
    397413} else {
     
    408424    pb_system("svn ci -m \"Updated to $ver\" $dir","Checking in $dir");
    409425    pb_system("svn up $dir","Updating $dir");
     426} elsif ($cms->{$ENV{'PBPROJ'}} eq "flat") {
    410427} elsif ($cms->{$ENV{'PBPROJ'}} eq "cvs") {
    411428} else {
     
    424441    }
    425442    return($l);
     443} elsif ($cms->{$ENV{'PBPROJ'}} eq "flat") {
    426444} elsif ($cms->{$ENV{'PBPROJ'}} eq "cvs") {
    427445} else {
  • devel/pb/lib/ProjectBuilder/Distribution.pm

    r203 r226  
    2929    $dfam="gen";
    3030    $dtype="ebuild";
    31     my $dver1 = $dver;
    32     $dver1 =~ s/\.//;
    33     $dsuf=".$ddir$dver1";
     31    $dver="nover";
     32    $dsuf=".$ddir";
    3433} elsif ($ddir =~ /slackware/) {
    3534    $dfam="slack";
  • devel/pbconf/project-builder/pbfilter/suse.pbf

    r32 r226  
    22# $Id$
    33#
    4 # Filter for redhat build
     4# Filter for suse build
    55#
    6 # PBSRC is replaced by the source package format
    7 filter PBSRC = ftp://ftp.mondorescue.org/src/%{name}-%{version}.tar.bz2
    8 
    96# PBGRP is replaced by the RPM group of apps
    107filter PBGRP = Applications/Archiving
  • devel/pbconf/project-builder/rpm/project-builder.spec

    r225 r226  
    22# $Id$
    33#
     4%define perlvendorlib: %(eval "`%{__perl} -V:installvendorlib | cut -d= -f2`")
    45
    56Summary:    Project Builder aka pb is a tool to produce packages for multiple distributions
     
    1112License:    GPL
    1213Group:      PBGRP
    13 Url:        http://www.mondorescue.org
     14Url:        http://trac.project-builder.org
    1415Source:     PBSRC
    1516BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
     
    3435
    3536%build
    36 %{__perl} Makefile.PL
     37%{__perl} Makefile.PL destdir=$RPM_BUILD_ROOT
    3738make
    3839
    3940%install
    40 make DESTDIR=${RPM_BUILD_ROOT} install
     41make DESTDIR=${RPM_BUILD_ROOT} pure_install
    4142
    4243%clean
    43 %{__rm} -rf %{buildroot}
     44%{__rm} -rf $RPM_BUILD_ROOT
    4445
    4546%files
     
    4849%doc INSTALL COPYING README AUTHORS contrib/pbsetupqemu
    4950
    50 %{perl_vendorlib}
     51%{_prefix}/lib/perl5/vendor_perl/*/*
     52%{_bindir}/*
    5153#%{_mandir}/*/*
    52 %{_bindir}/*
    5354
    5455%changelog
Note: See TracChangeset for help on using the changeset viewer.