From fa300fb4c260bf150ff3d9eb56e589c6610d4289 Mon Sep 17 00:00:00 2001 From: tonnesen Date: Thu, 16 Jan 2003 20:57:29 +0000 Subject: [PATCH] Trunk 'buildrelease' script now gets the template files out of the koha-tmpl repository. --- misc/buildrelease | 49 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/misc/buildrelease b/misc/buildrelease index aef63334cc..0881f4d3c5 100644 --- a/misc/buildrelease +++ b/misc/buildrelease @@ -7,6 +7,7 @@ sub guess_kohahtmldir ($;$); my $kohadir=`pwd`; chomp $kohadir; my $kohahtmldir=guess_kohahtmldir($kohadir, "/koha/koha/koha-html/"); +my $kohatmpldir=guess_kohatmpldir($kohadir, "/koha/koha/koha-tmpl/"); my $roothomedir=(getpwuid(0))[7]; # ~root is traditionally just / $roothomedir='/root' unless defined $roothomedir; @@ -22,6 +23,9 @@ if (-e "$roothomedir/.kohaautobuild.conf") { if (/kohahtmldir=(.*)/) { $kohahtmldir=$1; } + if (/kohatmpldir=(.*)/) { + $kohatmpldir=$1; + } } $has_kohaautobuild_conf = 1; } @@ -54,10 +58,17 @@ if ($input) { $kohahtmldir=$input; } +print "\nWhere is the 'koha-tmpl' cvs module located [$kohatmpldir]: "; +chomp($input = ); +if ($input) { + $kohatmpldir=$input; +} + open (C, ">$roothomedir/.kohaautobuild.conf"); print C qq| kohadir=$kohadir kohahtmldir=$kohahtmldir +kohatmpldir=$kohatmpldir |; #---------------------------------------------------------- @@ -241,6 +252,25 @@ Tagging koha-html with tag R_$tagname #---------------------------------------------------------- # MOVE files to /tmp and build tar.gz #---------------------------------------------------------- + +print qq| +Updating your checked-out copy of the 'koha-tmpl' CVS files. +You may need to enter your SourceForge password. +Using $kohatmpldir. +|; +chdir($kohatmpldir) || die "$kohatmpldir: $!\n"; +system("cvs update"); + +if ($cvstag) { + print qq| +Tagging koha-tmpl with tag R_$tagname +|; + system("cvs tag -F R_$tagname"); +} + + + + my $rootdir="/tmp/koha-".$releaseversion; system("rm -rf $rootdir"); mkdir ($rootdir, 0700); @@ -319,9 +349,9 @@ system("find $rootdir/intranet-cgi -name '*.pl' -exec chmod a+x \\{\\} \\;"); 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"); +# Copy koha-tmpl files +system("cp -a $kohatmpldir/opac-tmpl/* $rootdir/opac-html"); +system("cp -a $kohatmpldir/intranet-tmpl/* $rootdir/intranet-html"); system("rm -rf $rootdir/intranet-cgi/koha-tmpl"); # Remove extraneous files from opac-html @@ -390,3 +420,16 @@ sub guess_kohahtmldir ($;$) { } return $kohahtmldir; } + +sub guess_kohatmpldir ($;$) { + my($kohadir, $default) = @_; + my $kohatmpldir; + # It probably makes sense to assume that the 'koha' and 'koha-tmpl' + # modules are checked out within the same parent directory + if (-d $kohadir && $kohadir =~ /^(.*)\/[^\/]+$/) { + $kohatmpldir = "$1/koha-tmpl" + } else { + $kohatmpldir = $default; + } + return $kohatmpldir; +} -- 2.39.5