generate.sh
changeset 5 7d3b7009399d
parent 3 859eeb3579b2
--- a/generate.sh	Mon Jul 05 23:29:07 2010 -0400
+++ b/generate.sh	Mon Jul 05 23:57:56 2010 -0400
@@ -3,6 +3,7 @@
 VERSION="hg-$DATE"
 REPO="./enano-hg"
 REVISION="tip"
+MINIMAL=
 
 usage()
 {
@@ -14,6 +15,8 @@
   -v version        Specify version of package (default: hg-$DATE)
   -r revision       Mercurial revision to pull (default: tip)
   -R repopath       Path to Mercurial repository (default: ./enano-hg)
+  -m                If set, installer doesn't pack a copy of Enano. Instead,
+                    it downloads and runs mkenanodev.sh.
 
 EOF
   exit 1
@@ -39,6 +42,9 @@
       REPO="$2"
       shift
       ;;
+    -m)
+      MINIMAL=true
+      ;;
     *)
       usage
       ;;
@@ -50,7 +56,7 @@
   usage
 fi
 
-if [ ! -d "$REPO/.hg" ]; then
+if [ ! -d "$REPO/.hg" -a -z "$MINIMAL" ]; then
   echo "ERROR: Could not find the Enano Mercurial repository at $REPO."
   echo "Perhaps you need to obtain a copy?"
   echo "  $ hg clone http://hg.enanocms.org/repos/enano-1.1 ./enano-hg"
@@ -62,15 +68,19 @@
 printf "Compacting self-extraction script..."
 sed -f compact-shellscript.sed self-extract-src.sh > self-extract.sh || fail "Failed to generate compacted self-extract script"
 
-printf "\nPulling latest code..."
-hg -R $REPO archive -r $REVISION -t tgz enano-$VERSION.tar.gz || fail "Could not pull revision $REVISION from Mercurial repo"
-printf "\nExtracting..."
-tar xzCf `dirname $0`/stage enano-$VERSION.tar.gz || fail "Could not extract tarball"
-rm -f enano-$VERSION.tar.gz
+if [ -z "$MINIMAL" ]; then
+	printf "\nPulling latest code..."
+	hg -R $REPO archive -r $REVISION -t tgz enano-$VERSION.tar.gz || fail "Could not pull revision $REVISION from Mercurial repo"
+	printf "\nExtracting..."
+	tar xzCf `dirname $0`/stage enano-$VERSION.tar.gz || fail "Could not extract tarball"
+	rm -f enano-$VERSION.tar.gz
+fi
 printf "\nCreating payload..."
 cd stage
 tar cjf ../enano-$VERSION-selfextract.tar.bz2 * || fail "Could not create staging tarball"
-rm -rf enano-$VERSION
+if [ -z "$MINIMAL" ]; then
+	rm -rf enano-$VERSION
+fi
 cd ..
 printf "\nWriting output..."
 cat self-extract.sh enano-$VERSION-selfextract.tar.bz2 > enano-$VERSION-bitnami-module.sh || fail "Could not write output"