#! /bin/bash # This script # 1) Ensures existence of a source-distribution in the download area; # 2) Modifies the package's website; and # 3) Copies all binary-repositories to the publicly-visible repository # computer. # # The package is built in the current working directory and installed under a # temporary directory in order to extract the documentation. # # Usage: # $0 reposRoot # # where: # reposRoot Path to the root-directory of all binary repositories. # May be absolute or relative to the current working # directory. For example, "/opt/tomcat/repos". set -e # exit on failure reposRoot=${1:?Root-directory of all binary repositories not specified} # Get the static release variables. # . ./release-vars.sh # Ensure that the path to the root-directory of all binary repositories is # absolute. # echo $reposRoot | grep -qv '^/' && reposRoot=`pwd`/$reposRoot # Ensure that the source repository has the source distribution, # if ! ssh $SOURCE_REPO_HOST test -e $ABSPATH_SOURCE_DISTRO; then trap "ssh $SOURCE_REPO_HOST rm -f $ABSPATH_SOURCE_DISTRO; `trap -p ERR`" ERR scp $SOURCE_DISTRO_NAME $SOURCE_REPO_HOST:$ABSPATH_SOURCE_DISTRO fi # Purge the source-repository of bug-fix versions that are older than the latest # corresponding minor release. # ssh -T $SOURCE_REPO_HOST bash --login <versions for vers in \`ls -d $PKG_ID_GLOB | sed "s/$PKG_NAME-//"\`; do fgrep -s \$vers versions || rm -rf $PKG_NAME-\$vers done EOF # Install the package in order to obtain the documentation. # prefix=/tmp/$PKG_ID ./configure --prefix=$prefix >configure.log 2>&1 trap "rm -rf $prefix; `trap -p EXIT`" EXIT make install install-info install-html >install.log 2>&1 # Copy the documentation to the package's website. # versionWebDirTmp=$ABSPATH_VERSION_WEB_DIR.tmp ssh -T $WEB_HOST rm -rf $versionWebDirTmp trap "ssh -T $WEB_HOST rm -rf $versionWebDirTmp; `trap -p ERR`" ERR scp -Br $prefix/share $WEB_HOST:$versionWebDirTmp ssh -T $WEB_HOST rm -rf $ABSPATH_VERSION_WEB_DIR ssh -T $WEB_HOST mv $versionWebDirTmp $ABSPATH_VERSION_WEB_DIR # On the web host, # ssh -T $WEB_HOST bash --login <versions sed -n '1,/$BEGIN_VERSION_LINKS/p' index.html >index.html.new for vers in \`cat versions\`; do href=\`find $PKG_NAME-\$vers -name udunits2.html\` test "\$href" || href=\`find $PKG_NAME-\$vers -name udunits2.html\` echo "
  • \$vers" \ >>index.html.new done sed -n '/$END_VERSION_LINKS/,\$p' index.html >>index.html.new cp index.html index.html.old mv index.html.new index.html # Delete all versions not referenced in the top-level HTML file. # for vers in \`ls -d $PKG_NAME-*.*.* | sed "s/$PKG_NAME-//"\`; do fgrep -s \$vers versions || rm -rf $PKG_NAME-\$vers done # Adjust the symbolic link to the current version. # rm -f $PKG_NAME-current ln -s $PKG_ID $PKG_NAME-current EOF # Copy the binary-repositories to the publicly-accessible repository # computer. # cd $reposRoot flock . rsync --archive --relative --delete * $WEB_HOST:$ABSPATH_WEB_ROOT/repos