rework installation process to use git rev info
authorTony Cook <tony@develop-help.com>
Sat, 26 Feb 2011 01:43:24 +0000 (12:43 +1100)
committerTony Cook <tony@develop-help.com>
Sat, 26 Feb 2011 01:43:24 +0000 (12:43 +1100)
.gitignore
MANIFEST
MANIFEST.SKIP
Makefile
site/util/bse_mkgitversion.pl [new file with mode: 0644]
site/util/bse_mksvnversion.pl [deleted file]
site/util/check_versions.pl

index b1f2d51..259ff89 100644 (file)
@@ -1 +1,36 @@
 test.cfg
+INSTALL.html
+INSTALL.txt
+site/cgi-bin/modules/BSE/Version.pm
+site/docs/BSE::UI::Affiliate.html
+site/docs/Generate.html
+site/docs/Generate::Article.html
+site/docs/Generate::Catalog.html
+site/docs/Generate::Product.html
+site/docs/TODO.html
+site/docs/access.html
+site/docs/add.html
+site/docs/affiliate.html
+site/docs/bse.html
+site/docs/bugs.html
+site/docs/config.html
+site/docs/dynamic.html
+site/docs/formmail.html
+site/docs/future_plans.html
+site/docs/gen.html
+site/docs/makedocs.html
+site/docs/pod2htmd.tmp
+site/docs/pod2htmi.tmp
+site/docs/search.html
+site/docs/secure.html
+site/docs/shop.html
+site/docs/shopadmin.html
+site/docs/siteusers.html
+site/docs/standard.html
+site/docs/storages.html
+site/docs/templates.html
+site/docs/thumbnails.html
+site/docs/upgrade_mysql.html
+site/docs/userupdate.html
+.#*
+*~
index f8c667a..e7d1e76 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -7,8 +7,6 @@ localinst.perl                  # simple test installer
 Makefile
 MANIFEST
 MANIFEST.SKIP
-pod2htmd.tmp
-pod2htmi.tmp
 README
 schema/article.txt
 schema/bse.sql
@@ -712,7 +710,7 @@ site/templates/user/unsubone_base.tmpl
 site/templates/user/userpage_base.tmpl
 site/templates/xbase.tmpl
 site/util/bse_back.pl
-site/util/bse_mksvnversion.pl
+site/util/bse_mkgitversion.pl
 site/util/bse_msgcheck.pl      Scan for undefined message ids
 site/util/bse_nightly.pl
 site/util/bse_notify_files.pl
index eee4482..908de2b 100644 (file)
@@ -2,6 +2,7 @@
 .*~
 \bCVS\b
 \.cvsignore$
+\.gitignore$
 ^\.svn/
 /\.svn/
 ^test\.cfg$
index 4237bb3..27e0ec2 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ DISTTAR=../$(DISTNAME).tar
 DISTTGZ=$(DISTTAR).gz
 WEBBASE=/home/httpd/html/bse
 
-MODULES=$(shell grep cgi-bin/.*\.pm MANIFEST | sed -e '/^\#/d' -e 's/[ \t].*//' )
+MODULES=$(shell grep cgi-bin/.*\.pm MANIFEST | sed -e '/^\#/d' -e 's/[ \t].*// -e /^site\/cgi-bin\/modules\/BSE\/Modules\.pm$/d' )
 
 help:
        @echo make dist - build the tar.gz file and copy to distribution directory
@@ -21,7 +21,7 @@ dist: cleantree $(DISTTGZ)
        cp $(DISTTGZ) $(WEBBASE)/dists/
        cp site/docs/bse.html $(WEBBASE)/relnotes/bse-$(VERSION).html
        cp site/docs/*.html $(WEBBASE)/docs
-       svn cp . http://svn.develop-help.com/devsvn/bse/tags/bse-$(VERSION)
+       git tag -m "$(VERSION) release" r$(VERSION)
 
 # make sure everything is committed
 cleantree:
@@ -29,7 +29,7 @@ cleantree:
          then echo '***' The debugger is still enabled ; \
          exit 1; \
        fi
-       test -z "`svn status`" || ( echo "Uncommitted files in the tree"; exit 1 )
+       test -z "`git status -s`" || ( echo "Uncommitted files in the tree"; exit 1 )
 
 archive: $(DISTTGZ)
 
@@ -71,7 +71,7 @@ INSTALL.txt: INSTALL.pod
 
 INSTALL.html: INSTALL.pod
        pod2html --infile=INSTALL.pod --outfile=INSTALL.html
-       -rm pod2html-dircache pod2html-itemcache
+       -rm pod2html-dircache pod2html-itemcache pod2htmd.tmp pod2htmi.tmp
 
 otherdocs:
        cd site/docs ; make all
@@ -84,17 +84,7 @@ site/util/mysql.str: schema/bse.sql
 version: site/cgi-bin/modules/BSE/Version.pm
 
 site/cgi-bin/modules/BSE/Version.pm: Makefile
-       echo 'package BSE::Version;' >site/cgi-bin/modules/BSE/Version.pm
-       echo 'use strict;' >>site/cgi-bin/modules/BSE/Version.pm
-       echo  >>site/cgi-bin/modules/BSE/Version.pm
-       echo 'our $$VERSION = "$(VERSION)";' >>site/cgi-bin/modules/BSE/Version.pm
-       echo  >>site/cgi-bin/modules/BSE/Version.pm
-       echo 'sub version { $$VERSION }' >>site/cgi-bin/modules/BSE/Version.pm
-       echo  >>site/cgi-bin/modules/BSE/Version.pm
-       echo '1;' >>site/cgi-bin/modules/BSE/Version.pm
-
-svnversion:
-       perl site/util/bse_mksvnversion.pl $(VERSION) site/cgi-bin/modules/BSE/Version.pm
+       perl site/util/bse_mkgitversion.pl $(VERSION) site/cgi-bin/modules/BSE/Version.pm
 
 modversion: site/cgi-bin/modules/BSE/Modules.pm
 
@@ -113,7 +103,7 @@ testup: checkver distdir
        cd `perl -lne 'do { print $$1; exit; } if /^base_dir\s*=\s*(.*)/' test.cfg`/util ; perl upgrade_mysql.pl -b ; perl loaddata.pl ../data/db
 
 checkver:
-       if [ -d .svn ] ; then perl site/util/check_versions.pl ; fi
+       if [ -d .git ] ; then perl site/util/check_versions.pl ; fi
 
 TEST_FILES=t/*.t
 
diff --git a/site/util/bse_mkgitversion.pl b/site/util/bse_mkgitversion.pl
new file mode 100644 (file)
index 0000000..93b6afc
--- /dev/null
@@ -0,0 +1,37 @@
+#!perl -w
+use strict;
+
+my $release = shift;
+
+my $output = shift
+  or die "Usage: $0 <bserev> <outfile>\n";
+
+$release =~ /^\d+\.\d+(_\d+)?$/
+  or die "Invalid revision";
+
+if (-d ".git") {
+  my ($git_desc) = `git describe`;
+  chomp $git_desc;
+
+  my @status = `git status -s`;
+  if (@status) {
+    $git_desc .= " +" . scalar(@status) . " local modifications";
+  }
+
+  $release .= " GIT $git_desc";
+}
+
+open VERSION, "> $output"
+  or die "Cannot create $output: $!\n";
+print VERSION <<EOS;
+package BSE::Version;
+use strict;
+
+my \$RELEASE = "$release";
+
+sub version { \$RELEASE }
+
+1;
+EOS
+
+close VERSION;
diff --git a/site/util/bse_mksvnversion.pl b/site/util/bse_mksvnversion.pl
deleted file mode 100644 (file)
index d3fd512..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#!perl -w
-use strict;
-
-my $release = shift;
-
-my $output = shift
-  or die "Usage: $0 <bserev> <outfile>\n";
-
-$release =~ /^\d+\.\d+(_\d+)?$/
-  or die "Invalid revision";
-
-my ($svn_rev_line) = grep /^Revision/, `svn info`;
-$svn_rev_line =~ /(\d+)/
-  or die "Invalid svn revision";
-my $svn_rev = $1;
-
-open VERSION, "> $output"
-  or die "Cannot create $output: $!\n";
-print VERSION <<EOS;
-package BSE::Version;
-use strict;
-
-my \$VERSION = "$release SVN r$svn_rev";
-
-sub version { \$VERSION }
-
-1;
-EOS
-
-close VERSION;
index c221269..fd532f1 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 
 my %vers;
 
-my @check = `svn status`;
+my @check = `git status -s`;
 chomp @check;
 @check = sort grep /cgi-bin\/.*\.pm$/, @check;
 @check = grep !m(BSE/Modules\.pm), @check;
@@ -17,8 +17,8 @@ for my $check (@check) {
   my $ver = file_vers($check);
 
   unless ($type eq "A") {
-    my $svn = `svn cat $check`;
-    my $old_ver = content_vers($svn);
+    my $committed = `git show HEAD:$check`;
+    my $old_ver = content_vers($committed);
 
     if (defined $old_ver) {
       $old_ver eq $ver