[Koha-cvs] CVS: koha buildrelease,1.5,1.6
Steve Tonnesen
tonnesen at users.sourceforge.net
Tue Oct 29 00:01:03 CET 2002
Update of /cvsroot/koha/koha
In directory usw-pr-cvs1:/tmp/cvs-serv26298
Modified Files:
buildrelease
Log Message:
buildrelease now handles 1.2 and 1.3 branches automatically (for guessing next version)
Index: buildrelease
===================================================================
RCS file: /cvsroot/koha/koha/buildrelease,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** buildrelease 14 Oct 2002 11:20:40 -0000 1.5
--- buildrelease 28 Oct 2002 23:01:01 -0000 1.6
***************
*** 1,10 ****
#!/usr/bin/perl
my $kohadir=`pwd`;
chomp $kohadir;
! my $kohahtmldir="/koha/koha/koha-html/";
! if (-e "$kohadir/.kohaautobuild.conf") {
! open C, "$kohadir/.kohaautobuild.conf";
while (<C>) {
chomp;
--- 1,16 ----
#!/usr/bin/perl
+ sub guess_kohahtmldir ($;$);
+
my $kohadir=`pwd`;
chomp $kohadir;
! my $kohahtmldir=guess_kohahtmldir($kohadir, "/koha/koha/koha-html/");
! my $roothomedir=(getpwuid(0))[7]; # ~root is traditionally just /
! $roothomedir='/root' unless defined $roothomedir;
!
! my $has_kohaautobuild_conf = 0;
! if (-e "$roothomedir/.kohaautobuild.conf") {
! open C, "<$roothomedir/.kohaautobuild.conf";
while (<C>) {
chomp;
***************
*** 16,19 ****
--- 22,26 ----
}
}
+ $has_kohaautobuild_conf = 1;
}
***************
*** 36,39 ****
--- 43,47 ----
if ($input) {
$kohadir=$input;
+ $kohahtmldir=guess_kohahtmldir($kohadir, $kohahtmldir) unless $has_kohaautobuild_conf;
}
***************
*** 45,49 ****
}
! open (C, "> $kohadir/.kohaautobuild.conf") || die "unable to create kohaautobuild file";
print C qq|
kohadir=$kohadir
--- 53,57 ----
}
! open (C, ">$roothomedir/.kohaautobuild.conf");
print C qq|
kohadir=$kohadir
***************
*** 52,56 ****
print "\n\nGuessing at next release version. You may need to enter your SourceForge password...\n";
- chdir $kohadir;
open (CVSLOG, "cvs log buildrelease|");
my $symbolicnamessection=0;
--- 60,63 ----
***************
*** 59,62 ****
--- 66,71 ----
my $highestrc;
my $released;
+ my $majorversion;
+ my $majorversionrc;
while (<CVSLOG>) {
if (/^symbolic names:/) {
***************
*** 73,76 ****
--- 82,90 ----
$version=$1;
$rc=$2;
+ $version=~m#(\d+\.\d+)\.#;
+ if (versioncompare($version, $majorversion->{$1})) {
+ $majorversion->{$1}=$version;
+ $majorversionrc->{$1}=$rc;
+ }
if (versioncompare($version, $highestversion)) {
$highestversion=$version;
***************
*** 80,83 ****
--- 94,102 ----
} else {
$version=$id;
+ $version=~m#(\d+\.\d+)\.#;
+ if (versioncompare($version, $majorversion->{$1})) {
+ $majorversion->{$1}=$version;
+ $majorversionrc->{$1}=0;
+ }
if (versioncompare($version, $highestversion)) {
$highestversion=$version;
***************
*** 95,98 ****
--- 114,126 ----
my $currentversion='';
+ my $branchdata=`grep buildrelease CVS/Entries`;
+ chomp $branchdata;
+ my $branch=(split(m#/#, $branchdata))[5];
+
+ if ($branch eq 'Trel-1-2') {
+ $highestversion=$majorversion->{'1.2'};
+ $highestrc=$majorversionrc->{'1.2'};
+ ($highestrc) ? ($released=0) : ($released=1);
+ }
if ($released) {
***************
*** 100,127 ****
$components[$#components]++;
$nexthighestversion=join '.', @components;
! $releaseversion=$nexthighestversion."RC1";
$currentversion=$highestversion;
} else {
! $releaseversion="$highestversion\RC".($highestrc+1);
! $currentversion="$highestversion\RC$highestrc";
}
print "Current release tag is $currentversion.\n";
print "\nWould you like to bump that up to $releaseversion (or manually enter version)? [Y]/N: ";
chomp($input = <STDIN>);
if ($input =~ /^n/i) {
print "\nWould you like to rebuild the $currentversion tarball? Y/[N]: ";
chomp($input = <STDIN>);
if ($input =~ /^y/i) {
$releaseversion=$currentversion;
! print "\n\n";
! print "Do not do this if you have released the tarball to anybody, as it will\n";
! print "overwrite the tag marking the files that were in the tarball.\n\n";
! print "Confirm that you want to overwrite the tag for $releaseversion? Y/[N]: ";
! chomp($input = <STDIN>);
! if ($input =~ /^n/i || $input eq '') {
! print "\nStopping. Please re-run buildrelease now.\n";
! exit;
! }
} else {
print "What should the new version be? [$releaseversion]: ";
--- 128,155 ----
$components[$#components]++;
$nexthighestversion=join '.', @components;
! my $minornumber=(split(/\./, $highestversion))[1];
! if ($minornumber/2 == int($minornumber/2)) {
! $releaseversion=$nexthighestversion."RC1";
! } else {
! $releaseversion=$nexthighestversion;
! }
$currentversion=$highestversion;
} else {
! $releaseversion=$highestversion."RC".($highestrc+1);
! $currentversion=$highestversion."RC$highestrc";
}
+
print "Current release tag is $currentversion.\n";
print "\nWould you like to bump that up to $releaseversion (or manually enter version)? [Y]/N: ";
chomp($input = <STDIN>);
+ my $tagging_needs_confirmation = 0;
if ($input =~ /^n/i) {
print "\nWould you like to rebuild the $currentversion tarball? Y/[N]: ";
chomp($input = <STDIN>);
+ print STDERR "releaseversion=($releaseversion), currentversion=($currentversion)\n";#XXXZZZ
if ($input =~ /^y/i) {
$releaseversion=$currentversion;
! $tagging_needs_confirmation = 1;
} else {
print "What should the new version be? [$releaseversion]: ";
***************
*** 131,142 ****
}
}
}
! print "\nWould you like to tag the CVS repository?\n(answer yes if releasing tarball) [Y]/N: ";
chomp ($input=<STDIN>);
! my $cvstag=1;
! if ($input=~/^n/i) {
! $cvstag=0;
}
--- 159,190 ----
}
}
+ } else {
+ print "What should the new version be? [$releaseversion]: ";
+ chomp ($input=<STDIN>);
+ if ($input) {
+ $releaseversion=$input;
+ }
}
! print "\nWould you like to tag the CVS repository?\n(answer yes if releasing tarball) Y/[N]: ";
chomp ($input=<STDIN>);
! my $cvstag=0;
! # FIXME: This means anything other than n will tag; too dangerous?
! if ($input=~/^y/i) {
! $cvstag=1;
! }
!
!
! if ($cvstag && $tagging_needs_confirmation) {
! print "\n\n";
! print "Do not do this if you have released the tarball to anybody, as it will\n";
! print "overwrite the tag marking the files that were in the tarball:\n\n";
! print "Confirm that you want to overwrite the tag for $releaseversion? Y/[N]: ";
! chomp($input = <STDIN>);
! if ($input =~ /^n/i || $input !~ /\S/) {
! print "\nStopping. Please re-run buildrelease now.\n";
! exit;
! }
}
***************
*** 159,181 ****
print qq|
! Updating the 'koha' CVS files. You may need to enter your SourceForge password.
Using $kohadir.
|;
chdir($kohadir);
system("cvs update");
! print qq|
Tagging koha with tag R_$tagname
|;
! ($cvstag) && (system("cvs tag -F R_$tagname"));
print qq|
! Updating the 'koha-html' CVS files. You may need to enter your SourceForge password.
Using $kohahtmldir.
|;
! chdir($kohahtmldir);
system("cvs update");
! print qq|
Tagging koha-html with tag R_$tagname
|;
! ($cvstag) && (system("cvs tag -F R_$tagname"));
--- 207,236 ----
print qq|
! Updating your checked-out copy of the 'koha' CVS files.
! You may need to enter your SourceForge password.
Using $kohadir.
|;
chdir($kohadir);
system("cvs update");
! if ($cvstag) {
! print qq|
Tagging koha with tag R_$tagname
|;
! system("cvs tag -F R_$tagname");
! }
print qq|
! Updating your checked-out copy of the 'koha-html' CVS files.
! You may need to enter your SourceForge password.
Using $kohahtmldir.
|;
! chdir($kohahtmldir) || die "$kohahtmldir: $!\n";
system("cvs update");
!
! if ($cvstag) {
! print qq|
Tagging koha-html with tag R_$tagname
|;
! system("cvs tag -F R_$tagname");
! }
***************
*** 185,189 ****
system("rm -rf $rootdir");
mkdir ($rootdir, 0700);
! chdir($rootdir);
mkdir("intranet-cgi", 0755);
--- 240,244 ----
system("rm -rf $rootdir");
mkdir ($rootdir, 0700);
! chdir($rootdir) || die "$rootdir: $!\n";
mkdir("intranet-cgi", 0755);
***************
*** 216,221 ****
system("mv $rootdir/intranet-cgi/README $rootdir");
system("mv $rootdir/intranet-cgi/TODO $rootdir");
! system("mv $rootdir/intranet-cgi/installer.pl $rootdir");
! system("mv $rootdir/intranet-cgi/koha.upgrade $rootdir");
chmod 0770, "$rootdir/installer.pl";
chmod 0770, "$rootdir/koha.upgrade";
--- 271,278 ----
system("mv $rootdir/intranet-cgi/README $rootdir");
system("mv $rootdir/intranet-cgi/TODO $rootdir");
! system("mv $rootdir/intranet-cgi/installer.pl $rootdir");
! system("mv $rootdir/intranet-cgi/koha.upgrade $rootdir");
! system("mv $rootdir/intranet-cgi/Install.pm $rootdir");
! system("mv $rootdir/intranet-cgi/kohareporter $rootdir");
chmod 0770, "$rootdir/installer.pl";
chmod 0770, "$rootdir/koha.upgrade";
***************
*** 229,232 ****
--- 286,293 ----
system("cp $rootdir/intranet-cgi/moredetail.pl $rootdir/opac-cgi");
system("cp $rootdir/intranet-cgi/search.pl $rootdir/opac-cgi");
+ system("cp $rootdir/intranet-cgi/subjectsearch.pl $rootdir/opac-cgi");
+ system("cp $rootdir/intranet-cgi/logout.pl $rootdir/opac-cgi");
+ system("mv $rootdir/intranet-cgi/opac/* $rootdir/opac-cgi");
+ system("rmdir $rootdir/intranet-cgi/opac");
***************
*** 238,241 ****
--- 299,303 ----
system("mv $rootdir/intranet-cgi/misc $rootdir/scripts");
system("mv $rootdir/intranet-cgi/marc $rootdir/scripts");
+ system("mv $rootdir/intranet-cgi/acqui.simple/bulkmarcimport.pl $rootdir/scripts/z3950daemon/");
system("mv $rootdir/intranet-cgi/acqui.simple/processz3950queue $rootdir/scripts/z3950daemon/");
system("mv $rootdir/intranet-cgi/acqui.simple/z3950-daemon-launch.sh $rootdir/scripts/z3950daemon/");
***************
*** 245,263 ****
# Remove extraneous files from intranet-cgi
system("rm -f $rootdir/intranet-cgi/ChangeLog.bak");
- system("rm -f $rootdir/intranet-cgi/ChangeLog.bak");
system("rm -f $rootdir/intranet-cgi/SendMessages");
system("rm -f $rootdir/intranet-cgi/buildrelease");
system("rm -f $rootdir/intranet-cgi/database.mysql");
system("rm -f $rootdir/intranet-cgi/installer-lite.pl");
! system("rm -f $rootdir/intranet-cgi/koha-1.2.0.tar.gz");
! system("rm -f $rootdir/intranet-cgi/rel-1-2");
system("rm -f $rootdir/intranet-cgi/testKoha.pl");
system("rm -rf $rootdir/intranet-cgi/html-template");
system("rm -rf $rootdir/intranet-cgi/t");
# Copy all CVS files to intranet-html and opac-html
system("cp -a $kohahtmldir/intranet-html/* $rootdir/intranet-html");
system("cp -a $kohahtmldir/opac-html/* $rootdir/opac-html");
# Remove extraneous files from opac-html
system("rm -f $rootdir/opac-html/koha.mo");
--- 307,332 ----
# Remove extraneous files from intranet-cgi
system("rm -f $rootdir/intranet-cgi/ChangeLog.bak");
system("rm -f $rootdir/intranet-cgi/SendMessages");
system("rm -f $rootdir/intranet-cgi/buildrelease");
system("rm -f $rootdir/intranet-cgi/database.mysql");
system("rm -f $rootdir/intranet-cgi/installer-lite.pl");
! # FIXME: The following two lines look suspicious
! #system("rm -f $rootdir/intranet-cgi/koha-1.2.0.tar.gz");
! #system("rm -f $rootdir/intranet-cgi/rel-1-2");
system("rm -f $rootdir/intranet-cgi/testKoha.pl");
system("rm -rf $rootdir/intranet-cgi/html-template");
system("rm -rf $rootdir/intranet-cgi/t");
+ # Set all .pl scripts executable
+ system("find $rootdir/intranet-cgi -name '*.pl' -exec chmod a+x \\{\\} \\;");
# Copy all CVS files to intranet-html and opac-html
system("cp -a $kohahtmldir/intranet-html/* $rootdir/intranet-html");
system("cp -a $kohahtmldir/opac-html/* $rootdir/opac-html");
+ # Move koha-tmpl files
+ system("mv $rootdir/intranet-cgi/koha-tmpl/opac-tmpl/* $rootdir/opac-html");
+ system("mv $rootdir/intranet-cgi/koha-tmpl/intranet-tmpl/* $rootdir/intranet-html");
+ system("rm -rf $rootdir/intranet-cgi/koha-tmpl");
+
# Remove extraneous files from opac-html
system("rm -f $rootdir/opac-html/koha.mo");
***************
*** 275,283 ****
system("find $rootdir -name .#* -exec rm -rf \\{\\} \\; 2>/dev/null");
! if (-e "/root/docs") {
! print "Copying docs folder from /root/docs...";
! system("cp -r /root/docs/* $rootdir/docs/");
} else {
! print "I would have copied the docs from from /root/docs, but I couldn't find it.\n";
print "Press <ENTER> to continue...\n";
<STDIN>;
--- 344,353 ----
system("find $rootdir -name .#* -exec rm -rf \\{\\} \\; 2>/dev/null");
!
! if (-e "$roothomedir/docs") {
! print "Copying docs folder from $roothomedir/docs...";
! system("cp -r $roothomedir/docs/* $rootdir/docs/");
} else {
! print "I would have copied the docs from from $roothomedir/docs, but I couldn't find it.\n";
print "Press <ENTER> to continue...\n";
<STDIN>;
***************
*** 311,313 ****
--- 381,396 ----
}
return 0;
+ }
+
+ sub guess_kohahtmldir ($;$) {
+ my($kohadir, $default) = @_;
+ my $kohahtmldir;
+ # It probably makes sense to assume that the 'koha' and 'koha-html'
+ # modules are checked out within the same parent directory
+ if (-d $kohadir && $kohadir =~ /^(.*)\/[^\/]+$/) {
+ $kohahtmldir = "$1/koha-html"
+ } else {
+ $kohahtmldir = $default;
+ }
+ return $kohahtmldir;
}
More information about the Koha-cvs
mailing list