Changeset 5 in ProjectBuilder
- Timestamp:
- Jul 29, 2007, 12:50:34 AM (17 years ago)
- Location:
- devel/pb
- Files:
-
- 2 added
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/cms2build.pl
r4 r5 8 8 use strict; 9 9 use common.pm; 10 use p roj.pm;10 use pb.pm; 11 11 use cms.pm; 12 12 13 set_env();14 15 VER=`cat ${TOOLHOME}/VERSION`16 TAG=`cat ${TOOLHOME}/TAG`17 my $DEST=$ENV{'TOPDIR'}."/".$VER."-".$TAG18 13 TEST="false" 19 14 OPT="" … … 37 32 38 33 # Make it safe for CMS commands 39 cd ${ TOOLHOME}/..34 cd ${PBROOT}/.. 40 35 41 36 for pkg in $c; do 42 37 p=$PKGDIR[ 43 v=`cat ${ TOOLHOME}/../$p/VERSION`44 tag=`cat ${ TOOLHOME}/../$p/TAG`38 v=`cat ${PBROOT}/../$p/VERSION` 39 tag=`cat ${PBROOT}/../$p/TAG` 45 40 echo "Management of $p $v-$tag (rev $REVISION)" 46 41 dest="$DEST/$p-$v" 47 42 rm -fr $dest 48 $CMSEXP $OPT ${ TOOLHOME}/../$p $dest43 $CMSEXP $OPT ${PBROOT}/../$p $dest 49 44 echo "$REVISION" > $dest/REVISION 50 45 echo "Generating SVN log file ..." 51 $SVNLOG $OPT -v ${ TOOLHOME}/../$p > $dest/history.log46 $SVNLOG $OPT -v ${PBROOT}/../$p > $dest/history.log 52 47 53 for d in `cat ${ TOOLHOME}/DISTROS`; do48 for d in `cat ${PBROOT}/DISTROS`; do 54 49 export ddir=`echo $d | cut -d_ -f1` 55 50 export dver=`echo $d | cut -d_ -f2` 56 51 echo "Generating build files for $ddir ($dver)" 57 . $ TOOLHOME/distro-env52 . $PBROOT/distro-env 58 53 59 54 ddd=`LANG=C ; date '+%Y-%m-%d'` 60 cat > $P ROJTMP/mondorescue.mc << EOF55 cat > $PBTMP/mondorescue.mc << EOF 61 56 define(\`TTT', ${tag})dnl 62 57 define(\`RRR', ${tag}${suf})dnl … … 77 72 78 73 if [ $ddir = "fedora" ]; then 79 $ TOOLHOME/mkchangelog.pl fc $p $PROJTMP/$p-fc.spec80 m4 $P ROJTMP/mondorescue.mc $inc $dest/distributions/rpm/$p.spec $MONDOTMP/$p-fc.spec > $dest/distributions/${ddir}-$dver/$p-fc.spec74 $PBROOT/mkchangelog.pl fc $p $PBTMP/$p-fc.spec 75 m4 $PBTMP/mondorescue.mc $inc $dest/distributions/rpm/$p.spec $MONDOTMP/$p-fc.spec > $dest/distributions/${ddir}-$dver/$p-fc.spec 81 76 fi 82 $ TOOLHOME/mkchangelog.pl $dtype $p $PROJTMP/$p.spec77 $PBROOT/mkchangelog.pl $dtype $p $PBTMP/$p.spec 83 78 if [ $? -ne 0 ]; then 84 79 echo "Unable to create changelog for ${ddir}-$dver/$p.spec" 85 80 exit -1 86 81 fi 87 m4 $P ROJTMP/mondorescue.mc $inc $dest/distributions/rpm/$p.spec $MONDOTMP/$p.spec > $dest/distributions/${ddir}-$dver/$p.spec82 m4 $PBTMP/mondorescue.mc $inc $dest/distributions/rpm/$p.spec $MONDOTMP/$p.spec > $dest/distributions/${ddir}-$dver/$p.spec 88 83 if [ _"`/bin/arch`" = _"x86_64" ] && [ $ddir = "rhel" ]; then 89 84 # Bug on x86_64 on _sysconfdir on rhel4 at least … … 91 86 fi 92 87 93 rm -f $P ROJTMP/$p.spec88 rm -f $PBTMP/$p.spec 94 89 elif [ "$dtype" = "ebuild" ]; then 95 m4 $P ROJTMP/mondorescue.mc $dest/distributions/$dfam/$p.ebuild > $dest/distributions/${ddir}-$dver/$p-$v.ebuild90 m4 $PBTMP/mondorescue.mc $dest/distributions/$dfam/$p.ebuild > $dest/distributions/${ddir}-$dver/$p-$v.ebuild 96 91 elif [ "$dtype" = "tgz" ]; then 97 m4 $P ROJTMP/mondorescue.mc $dest/distributions/$dfam/slack-desc > $dest/distributions/${ddir}-$dver/slack-desc92 m4 $PBTMP/mondorescue.mc $dest/distributions/$dfam/slack-desc > $dest/distributions/${ddir}-$dver/slack-desc 98 93 elif [ "$dtype" = "port" ]; then 99 m4 $P ROJTMP/mondorescue.mc $dest/distributions/$dfam/Makefile > $dest/distributions/${ddir}-$dver/Makefile94 m4 $PBTMP/mondorescue.mc $dest/distributions/$dfam/Makefile > $dest/distributions/${ddir}-$dver/Makefile 100 95 elif [ "$dtype" = "deb" ]; then 101 96 if [ -f $dest/distributions/$ddir/rules ]; then … … 109 104 exit -1 110 105 fi 111 m4 $P ROJTMP/mondorescue.mc $inc > $dest/distributions/${ddir}-$dver/rules112 $ TOOLHOME/mkchangelog.pl $dtype $p $dest/distributions/${ddir}-$dver/changelog106 m4 $PBTMP/mondorescue.mc $inc > $dest/distributions/${ddir}-$dver/rules 107 $PBROOT/mkchangelog.pl $dtype $p $dest/distributions/${ddir}-$dver/changelog 113 108 if [ $? -ne 0 ]; then 114 109 echo "Unable to create changelog for ${ddir}-$dver/changelog" … … 125 120 cd $dest 126 121 for f in mondorescue-howto.sgml *8; do 127 m4 $P ROJTMP/mondorescue.mc $f > ${f}.new122 m4 $PBTMP/mondorescue.mc $f > ${f}.new 128 123 mv ${f}.new $f 129 124 done … … 146 141 147 142 if [ _"`echo $p | grep -vE 'kernel|busybox' | grep mindi`" != _"" ]; then 148 v1=`cat ${ TOOLHOME}/../mondo-doc/VERSION`143 v1=`cat ${PBROOT}/../mondo-doc/VERSION` 149 144 if [ ! -d mondo-doc-$v1 ]; then 150 145 echo "mondo-doc should be created before $p" … … 155 150 fi 156 151 if [ "`echo $p | grep -v doc | grep mondo`" != "" ]; then 157 v1=`cat ${ TOOLHOME}/../mondo-doc/VERSION`152 v1=`cat ${PBROOT}/../mondo-doc/VERSION` 158 153 if [ ! -d mondo-doc-$v1 ]; then 159 154 echo "mondo-doc should be created before $p" … … 177 172 done 178 173 179 rm -rf $P ROJTMP174 rm -rf $PBTMP 180 175 181 176 echo "Version delivered :" -
devel/pb/bin/mdv-changelog.pl
r2 r5 8 8 9 9 open(FILE, $ARGV[0]) || die "Unable to open $ARGV[0]"; 10 open(OUT, "> $ENV{'P ROJTMP'}/out.spec") || die "Unable to create $ENV{'MONDOTMP'}/out.spec";11 open(CMT, "> $ENV{'P ROJTMP'}/cmt.spec") || die "Unable to create $ENV{'MONDOTMP'}/out.spec";10 open(OUT, "> $ENV{'PBTMP'}/out.spec") || die "Unable to create $ENV{'MONDOTMP'}/out.spec"; 11 open(CMT, "> $ENV{'PBTMP'}/cmt.spec") || die "Unable to create $ENV{'MONDOTMP'}/out.spec"; 12 12 while (<FILE>) { 13 13 if ($_ !~ /^\%changelog/) { … … 29 29 close (FILE); 30 30 31 move("$ENV{'P ROJTMP'}/out.spec", $ARGV[0]);31 move("$ENV{'PBTMP'}/out.spec", $ARGV[0]); 32 32 exit(0); 33 33 } -
devel/pb/bin/mkannounce.pl
r2 r5 18 18 $ENV{LANG}="C"; 19 19 20 my $ TOOLHOME;20 my $PBROOT; 21 21 my $tmp = dirname($PROGRAM_NAME); 22 22 print "$tmp\n"; 23 23 if ($tmp =~ /^\//) { 24 $ TOOLHOME= $tmp;24 $PBROOT = $tmp; 25 25 } 26 26 else { 27 $ TOOLHOME= "$ENV{PWD}/$tmp";27 $PBROOT = "$ENV{PWD}/$tmp"; 28 28 } 29 29 30 my $db="$ TOOLHOME/../website/announces3.sql";30 my $db="$PBROOT/../website/announces3.sql"; 31 31 32 32 my $dbh = DBI->connect("dbi:SQLite:dbname=$db","","", -
devel/pb/bin/mkchangelog.pl
r2 r5 35 35 (not (defined $outfile)) || ($outfile eq "")); 36 36 37 my $ TOOLHOME;37 my $PBROOT; 38 38 $tmp = dirname($PROGRAM_NAME); 39 39 if ($tmp =~ /^\//) { 40 $ TOOLHOME= $tmp;40 $PBROOT = $tmp; 41 41 } 42 42 else { 43 $ TOOLHOME= "$ENV{PWD}/$tmp";43 $PBROOT = "$ENV{PWD}/$tmp"; 44 44 } 45 45 46 die " TOOLHOME doesn't exist" if (not (defined $TOOLHOME));46 die "PBROOT doesn't exist" if (not (defined $PBROOT)); 47 47 48 if (-f "$ TOOLHOME/../$pkg/ChangeLog") {49 $chglog = "$ TOOLHOME/../$pkg/ChangeLog";48 if (-f "$PBROOT/../$pkg/ChangeLog") { 49 $chglog = "$PBROOT/../$pkg/ChangeLog"; 50 50 } 51 51 else { 52 52 $pkg2 = $pkg; 53 53 $pkg2 =~ s/-..*//; 54 if (-f "$ TOOLHOME/../$pkg2/ChangeLog") {55 $chglog = "$ TOOLHOME/../$pkg2/ChangeLog";54 if (-f "$PBROOT/../$pkg2/ChangeLog") { 55 $chglog = "$PBROOT/../$pkg2/ChangeLog"; 56 56 } 57 57 else { … … 59 59 } 60 60 } 61 $tmp="$ TOOLHOME/../$pkg/TAG";61 $tmp="$PBROOT/../$pkg/TAG"; 62 62 if (-f "$tmp") { 63 63 open(TAG,"$tmp") || die "Unable to open $tmp"; -
devel/pb/bin/mknewshtml.pl
r2 r5 18 18 $ENV{LANG}="C"; 19 19 20 my $ TOOLHOME;20 my $PBROOT; 21 21 my $tmp = dirname($PROGRAM_NAME); 22 22 if ($tmp =~ /^\//) { 23 $ TOOLHOME= $tmp;23 $PBROOT = $tmp; 24 24 } 25 25 else { 26 $ TOOLHOME= "$ENV{PWD}/$tmp";26 $PBROOT = "$ENV{PWD}/$tmp"; 27 27 } 28 28 29 29 my $lastnews="$ARGV[0]/latest-news.html"; 30 30 my $news="$ARGV[0]/news.shtml"; 31 my $db="$ TOOLHOME/../website/announces3.sql";31 my $db="$PBROOT/../website/announces3.sql"; 32 32 33 33 print "Using Database $db\n"; -
devel/pb/lib/cms.pm
r2 r5 24 24 $ret = $? >> 8; 25 25 if ($ret == 0) { 26 $ENV{'REVISION'}=`(cd $ TOOLHOME/.. ; svnversion .)`;26 $ENV{'REVISION'}=`(cd $PBROOT/.. ; svnversion .)`; 27 27 $ENV{'CMSLOG'}="svn log"; 28 28 $ENV{'CMSEXP'}="svn export"; 29 29 } else { 30 30 # By default if not SVN take CVS 31 $ENV{'REVISION'}=`(cd $ TOOLHOME/.. ; cvs rannotate -f . 2>&1 | awk '{print $1}' | grep -E '^[0-9]' | cut -d. -f2 |sort -nu | tail -1)`;31 $ENV{'REVISION'}=`(cd $PBROOT/.. ; cvs rannotate -f . 2>&1 | awk '{print $1}' | grep -E '^[0-9]' | cut -d. -f2 |sort -nu | tail -1)`; 32 32 $ENV{'CMSLOG'}="cvs log"; 33 33 $ENV{'CMSEXP'}="cvs export" -
devel/pb/lib/common.pm
r2 r5 9 9 @EXPORT = qw(set_env); 10 10 11 use lib qw (lib); 11 12 use strict; 12 13 use File::Basename; 13 14 use ExtUtils::Command; 14 15 use File::Temp qw /tempdir/; 16 use vars qw (%defpkgdir %extpkgdir %version &pb_init); 17 18 $ENV{'PBCONF'} = "/etc/pb"; 15 19 16 20 sub set_env { 17 21 18 my $tmp = dirname($PROGRAM_NAME); 19 #print "$tmp\n"; 20 if ($tmp =~ /^\//) { 21 $ENV{'TOOLHOME'} = $tmp; 22 } 23 else { 24 $ENV{'TOOLHOME'} = "$ENV{PWD}/$tmp"; 25 } 22 my $proj=shift; 23 my $ver; 24 my $tag; 26 25 27 die "TOOLHOME doesn't exist" if (not (defined $ENV{'TOOLHOME'})); 26 # Check project name 27 if ((defined $ENV{'PBPROJ'}) && 28 (not (defined $proj))) { 29 $proj = $ENV{'PBPROJ'}; 30 } 31 die "No project defined - use env var PBPROJ or -p proj" if (not (defined $proj)); 28 32 29 # Adapt to your needs30 $ENV{'TOPDIR'}=$ENV{'TOOLHOME'}."/../delivery";31 mkpath $ENV{'TOPDIR'};33 # Use project configuration file 34 require "$ENV{'PBCONF'}/$proj.pb"; 35 pb_init(); 32 36 37 # Check content 38 die "PBROOT doesn't exist in $ENV{'PBCONF'}/$proj.pb" if (not (defined $ENV{'PBROOT'})); 39 die "defpkgdir doesn't exist in $ENV{'PBCONF'}/$proj.pb" if (not (defined %defpkgdir)); 40 41 # Set temp directory 33 42 if (undef $ENV{'TMPDIR'}) { 34 43 $ENV{'TMPDIR'}="/tmp"; 35 44 } 36 $ENV{'PROJTMP'} = tempdir( "projbuild.XXXXXXXXXX", DIR => $ENV{'TMPDIR'}, CLEANUP => 1 ); 45 $ENV{'PBTMP'} = tempdir( "pb.XXXXXXXXXX", DIR => $ENV{'TMPDIR'}, CLEANUP => 1 ); 46 47 # Get global VERSION 48 open(VER, "$ENV{'PBROOT'}/VERSION") || die "Unable to open $ENV{'PBROOT'}/VERSION: $?"; 49 $ver = <VER>; 50 chomp($ver); 51 die "Invalid version name $ver in $ENV{'PBROOT'}/VERSION" if ($ver !~ /[0-9.]+/) || (defined $version{$ver}); 52 $ENV{'PBVER'}=$ver; 53 close(VER); 54 55 #Get global TAG 56 open(TAG, "$ENV{'PBROOT'}/TAG") || die "Unable to open $ENV{'PBROOT'}/TAG: $?"; 57 $tag = <TAG>; 58 chomp($tag); 59 die "Invalid version tag $tag in $ENV{'PBROOT'}/TAG" if ($tag !~ /[0-9]+/); 60 $ENV{'PBTAG'}=$tag; 61 close(TAG); 62 63 # Adapt to your needs 64 # Set delivery directory 65 $ENV{'PBTOPDIR'}="$ENV{'PBROOT'}/../delivery"; 66 $ENV{'PBDESTDIR'}=$ENV{'TOPDIR'}."/".$ENV{'PBVER'}."-".$ENV{'PBTAG'}; 67 mkpath $ENV{'PBDESTDIR'}; 37 68 38 69 umask 0022 -
devel/pb/lib/toolhome.pm
r2 r5 1 1 #!/usr/bin/perl -w 2 2 # 3 # Module to compute TOOLHOMEand put in the environment3 # Module to compute PBROOT and put in the environment 4 4 # 5 5 # $Id$ … … 17 17 #print "$tmp\n"; 18 18 if ($tmp =~ /^\//) { 19 $ENV{' TOOLHOME'} = $tmp;19 $ENV{'PBROOT'} = $tmp; 20 20 } 21 21 else { 22 $ENV{' TOOLHOME'} = "$ENV{PWD}/$tmp";22 $ENV{'PBROOT'} = "$ENV{PWD}/$tmp"; 23 23 } 24 24 25 die " TOOLHOME doesn't exist" if (not (defined $ENV{'TOOLHOME'}));25 die "PBROOT doesn't exist" if (not (defined $ENV{'PBROOT'})); 26 26 } 27 27 1;
Note:
See TracChangeset
for help on using the changeset viewer.