[SCM] Samba Shared Repository - branch v3-2-test updated - release-3-2-0pre2-2980-gbabe47a

Karolin Seeger kseeger at samba.org
Fri Sep 5 09:25:18 GMT 2008


The branch, v3-2-test has been updated
       via  babe47a0ca130888eb478e2f5ff8d5ec04810938 (commit)
       via  4a5830fb03152cf59f27c762046554eb6df5cb65 (commit)
       via  16fe020367f3d63c4ff1391f265bdaa48764900f (commit)
      from  2d84b9a1024f68657f75aa7e0c4091b8c7afd194 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit babe47a0ca130888eb478e2f5ff8d5ec04810938
Author: Gerald (Jerry) Carter <jerry at samba.org>
Date:   Mon Aug 25 16:08:28 2008 -0500

    Add workaround for docs build and dependency on parameters.all.xml
    (cherry picked from commit d4f5b5255f9b95050ddd9d67bd3958402be77918)
    (cherry picked from commit c8154142d97ccf973feb36d77f932c893fda0af5)
    (cherry picked from commit c91e7e9f7f392d5ba850619395eddac34617f1e4)
    (cherry picked from commit bdb0a5d5fdbc331e11391f7b6e0aae963cebd3fc)

commit 4a5830fb03152cf59f27c762046554eb6df5cb65
Author: Gerald W. Carter <jerry at samba.org>
Date:   Tue May 27 16:27:21 2008 -0500

    Release scripts: Update create-tarball to include docs and other packaging details.
    
    I've updated the create-tarball script to support command line options,
    docs build (or copy and existing build), and to run the packaging update
    scripts.
    
      $ release-scripts/create-tarball --help
      Usage release-scripts/create-tarball [options]
          --help             Print command usage
          --branch <name>    Specify the branch to to create the archive file from
          --copy-docs <dir>  Copy documentation from <dir> rather than building
          --tag <name>       Tag name for release
          --keyid <email>    The GnuPG key ID used to sign the release tag
    (cherry picked from commit 7c96795e5954b6a716beb6f5a30d6c7bb1647717)

commit 16fe020367f3d63c4ff1391f265bdaa48764900f
Author: Gerald (Jerry) Carter <jerry at samba.org>
Date:   Tue May 27 12:00:00 2008 -0500

    Add simple script to build docs
    (cherry picked from commit 0865f4615d3ee91673dd6d02c6537765f34b3129)

-----------------------------------------------------------------------

Summary of changes:
 release-scripts/build-docs     |   28 ++++
 release-scripts/create-tarball |  314 ++++++++++++++++++++++++++++------------
 2 files changed, 247 insertions(+), 95 deletions(-)
 create mode 100755 release-scripts/build-docs


Changeset truncated at 500 lines:

diff --git a/release-scripts/build-docs b/release-scripts/build-docs
new file mode 100755
index 0000000..fa38d8d
--- /dev/null
+++ b/release-scripts/build-docs
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+DOCSRCDIR=`dirname $0`/../docs-xml
+
+cd $DOCSRCDIR || exit 1
+
+git-clean -d -x -f
+autoconf && \
+	./configure --with-papersize=letter && \
+	make smbdotconf/parameters.all.xml && \
+	make release
+
+if [ $? != 0 ]; then
+        echo "Docs build failed!"
+        exit 1
+fi
+
+mkdir ../docs
+rsync -Ca --delete --exclude=.git output/ ../docs/
+rsync -Ca --exclude=.svn registry ../docs/
+rsync -Ca --exclude=.svn archives/ ../docs/
+
+cd ../docs || exit 1
+/bin/rm -rf test.pdf Samba4*pdf htmldocs/Samba4* htmldocs/test
+mv manpages-3 manpages
+mv htmldocs/manpages-3 htmldocs/manpages
+
+exit
diff --git a/release-scripts/create-tarball b/release-scripts/create-tarball
index a689e69..3463f01 100755
--- a/release-scripts/create-tarball
+++ b/release-scripts/create-tarball
@@ -1,98 +1,222 @@
 #!/bin/bash
 
-TOPDIR="`dirname $0`/.."
+## option defaults
+OPT_BRANCH=""
+OPT_DOCSDIR=""
+OPT_TAG=""
+OPT_KEYID=""
 
-cd $TOPDIR
-
-echo -n "Please enter branch to cut tarball from: "
-read branch
-
-if [ "x$branch" = "x" ]; then
-   echo "You must enter a name!  Exiting...."
-   exit 1
-fi
-
-git-checkout $branch
-if [ $? -ne 0 ]; then
-   echo "Invalid branch name!  Exiting...."
-   exit 2
-fi
-
-VER_H=source/include/version.h
-(cd source && ./script/mkversion.sh)
-
-if [ ! -f $VER_H ]; then
-   echo "Failed to find $VER_H!  Exiting...."
-   exit 1
-fi
-
-version=`grep SAMBA_VERSION_OFFICIAL_STRING $VER_H | awk '{print $3}'`
-vendor_version=`grep SAMBA_VERSION_VENDOR_SUFFIX $VER_H | awk '{print $3}'`
-if [ -n "$vendor_version" ]; then
-    version="$version-$vendor_version"
-fi
-version=`echo $version | sed 's/\"//g'`
-
-echo "Creating release tarball for Samba $version"
-
-/bin/rm -rf ../samba-${version}
-git-archive --format=tar --prefix=samba-${version}/ HEAD | (cd .. && tar xf -)
-
-pushd ../samba-${version}
-
-echo "Enter the absolute path to the generated Samba docs directory."
-echo -n "Just hit return to exclude the docs from the generate tarball: "
-read docsdir
-
-if [ "x$docsdir" != "x" ]; then
-   if [ ! -d "$docsdir" ]; then
-      echo "$docsdir does not exist!  Exiting...."
-      exit 1
-   fi
-
-   /bin/rm -rf docs
-   mkdir docs
-   rsync -a --exclude=.svn $docsdir/ docs/
-
-   cd docs
-   /bin/rm -rf test.pdf Samba4*pdf htmldocs/Samba4* htmldocs/test
-   /bin/mv manpages-3 manpages
-   /bin/mv htmldocs/manpages-3 htmldocs/manpages
-   cd ..
-fi
-
-cd source
-./autogen.sh
-cd ..
-
-cd ..
-tar cf samba-${version}.tar --exclude=.git* --exclude=CVS --exclude=.svn samba-${version}
-gpg --detach-sign --armor samba-${version}.tar
-gzip -9 samba-${version}.tar
-
-popd
-echo -n "Enter tag name (or hit <enter> to skip): "
-read tagname
-
-if [ "x$tagname" != "x" ]; then
-   if [ "x`git-tag -l $tagname`" != "x" ]; then
-      echo -n "Tag exists.  Do you wish to overwrite? (y/N): "
-      read answer
-
-      if [ "x$answer" != "xy" ]; then
-      	 echo "Tag creation aborted."
-	 exit 1
-      fi
-   fi
-
-   echo -n "Enter the keyid:"
-   read keyid
-   if [ x"$keyid" = x"" ];then
-      echo "no keyid"
-      exit 1
-   fi
-   git-tag -u $keyid ${tagname}
-fi
-
-echo "Done!"
-exit 0
+TOPDIR="`dirname $0`/.."
+VER_H="${TOPDIR}/source/include/version.h"
+
+function exitOnError
+{
+    local _error="$1"
+    local _msg="$2"
+
+    if [ ${_error} -eq 0 ]; then
+	return 0
+    fi
+
+    echo "FAILURE: ${_msg}"
+    exit ${_error}
+}
+
+##
+## Print help usage
+##
+
+function printUsage
+{
+    echo "Usage $0 [options]"
+    echo "    --help             Print command usage"
+    echo "    --branch <name>    Specify the branch to to create the archive file from"
+    echo "    --copy-docs <dir>  Copy documentation from <dir> rather than building"
+    echo "    --tag <name>       Tag name for release"
+    echo "    --keyid <email>    The GnuPG key ID used to sign the release tag"
+    echo ""
+}
+
+##
+## Parse the command line options 
+##
+
+function parseOptions
+{
+    while [ -n "$1" ]; do
+	case "$1" in
+	    --help)
+		printUsage
+		exit 0
+		;;
+	    --branch)
+		shift
+		if [ -z "$1" ]; then
+		    printUsage
+		    return 1
+		fi
+		OPT_BRANCH="$1"
+		shift
+		;;
+	    --copy-docs)
+		shift
+		if [ -z "$1" ]; then
+		    printUsage
+		    return 1
+		fi
+		OPT_DOCSDIR="$1"
+		shift
+		;;
+	    --tag)
+		shift
+		if [ -z "$1" ]; then
+		    printUsage
+		    return 1
+		fi
+		OPT_TAG="$1"
+		shift
+		;;
+	    --keyid)
+		shift
+		if [ -z "$1" ]; then
+		    printUsage
+		    return 1
+		fi
+		OPT_KEYID="$1"
+		shift
+		;;
+	    *)
+		printUsage
+		return 1
+		;;
+	esac
+    done
+
+    if [ -z "${OPT_BRANCH}" ]; then
+	echo "You must specify a branch name!"
+	printUsage
+	return 1
+    fi
+}
+
+##
+## Build the dopcumentation (may be a no-op)
+##
+
+function buildDocs
+{
+    if [ -n "${OPT_DOCSDIR}" ]; then
+	if [ ! -d "${OPT_DOCSDIR}" ]; then
+	    exitOnError 1 "${OPT_DOCSDIR} does not exist.  Please specify the absolute path."
+	fi
+
+	mkdir docs
+	exitOnError $? "Failed to create docs directory"
+
+	rsync -av "${OPT_DOCSDIR}"/ docs/
+	exitOnError $? "Failed top copy docs from ${OPT_DOCSDIR}"
+	
+	return 0
+    fi
+
+    echo "Building documentation.  This may take a while.  Log file in /tmp/docs-build.log.$$"
+
+    ${TOPDIR}/release-scripts/build-docs 2> /tmp/docs-build.log.$$
+    return $?
+
+}
+
+
+##
+## Create a release tag
+##
+function createReleaseTag
+{
+    if [ -z "${OPT_TAG}" ]; then
+	echo "Tagging disabled"
+	return 0
+    fi
+
+    if [ "x`git-tag -l ${OPT_TAG}`" != "x" ]; then
+	echo -n "Tag exists.  Do you wish to overwrite? (y/N): "
+	read answer
+
+	if [ "x$answer" != "xy" ]; then
+      	    echo "Tag creation aborted."
+	    exit 1
+	fi
+    fi
+
+    if [ -z "${OPT_KEYID}" ]; then
+	echo -n "Enter the keyid:"
+	read OPT_KEYID
+	if [ -z "${OPT_KEYID}" ]; then
+	    exitOnError 1 "No keyid specified"
+	fi
+    fi
+
+    git-tag -u ${OPT_KEYID} ${OPT_TAG}
+    exitOnError $? "Failed to create tag"
+
+    return 0
+}
+##
+## Main driver
+##
+function main 
+{
+    parseOptions "$@"
+    exitOnError $? "Failed to parse options"
+    
+    cd $TOPDIR
+
+    git-checkout ${OPT_BRANCH}
+    exitOnError $? "Invalid branch name \"${OPT_BRANCH}\""
+
+    (cd source && ./script/mkversion.sh)
+    if [ ! -f $VER_H ]; then
+	exitOnError 1 "Failed to find ${VER_H}!"
+    fi
+
+    version=`grep SAMBA_VERSION_OFFICIAL_STRING $VER_H | awk '{print $3}'`
+    vendor_version=`grep SAMBA_VERSION_VENDOR_SUFFIX $VER_H | awk '{print $3}'`
+    if [ -n "$vendor_version" ]; then
+	version="$version-$vendor_version"
+    fi
+    version=`echo $version | sed 's/\"//g'`
+
+    echo "Creating release tarball for Samba $version"
+
+    /bin/rm -rf ../samba-${version}
+    git-archive --format=tar --prefix=samba-${version}/ HEAD | (cd .. && tar xf -)
+    exitOnError $? "Failed to create release directory tree"
+
+    pushd ../samba-${version}
+
+    packaging/bin/update-pkginfo ${version} 1 ""
+
+    buildDocs
+    exitOnError $? "Failed to build documentation"
+
+    ( cd source && ./autogen.sh )
+
+    cd ..
+    tar cf samba-${version}.tar --exclude=.git* --exclude=CVS --exclude=.svn samba-${version}
+    exitOnError $? "Failed to create tarball from git tree"
+
+    gpg --detach-sign --armor samba-${version}.tar
+    ## exitOnError $? "Failed to sign tarball"
+
+    gzip -9 samba-${version}.tar
+    exitOnError $? "Failed to compress archive"
+
+    popd
+
+    createReleaseTag
+    exitOnError $? "Failed to create release tag"
+
+    return 0
+}
+
+main "$@"
+exit $?


-- 
Samba Shared Repository


More information about the samba-cvs mailing list