You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devicemap.apache.org by bd...@apache.org on 2015/06/22 09:30:30 UTC
svn commit: r1686783 - in /devicemap/trunk: check_release_matches_tag.sh
check_staged_release.sh
Author: bdelacretaz
Date: Mon Jun 22 07:30:30 2015
New Revision: 1686783
URL: http://svn.apache.org/r1686783
Log:
Release checking scripts, adapted from the Sling project
Added:
devicemap/trunk/check_release_matches_tag.sh
devicemap/trunk/check_staged_release.sh (with props)
Added: devicemap/trunk/check_release_matches_tag.sh
URL: http://svn.apache.org/viewvc/devicemap/trunk/check_release_matches_tag.sh?rev=1686783&view=auto
==============================================================================
--- devicemap/trunk/check_release_matches_tag.sh (added)
+++ devicemap/trunk/check_release_matches_tag.sh Mon Jun 22 07:30:30 2015
@@ -0,0 +1,44 @@
+#!/bin/bash
+# check that a staged release matches the corresponding svn tags
+#
+# usage:
+# sh check_release_matches_tag.sh 004 /tmp/devicemap-staging
+#
+BASE=$2/$1/org/apache/devicemap
+TAGBASE=http://svn.apache.org/repos/asf/devicemap/tags/releases
+
+function fail() {
+ echo $* >&2
+ exit 1
+}
+
+function check() {
+ TAG=$TAGBASE/$1
+ ZIP=$PWD/$2
+ WORKDIR=workdir/$1/$(date +%s)
+ CUR=$PWD
+ echo
+ echo "Checking $ZIP against $TAG"
+ mkdir -p $WORKDIR
+ cd $WORKDIR > /dev/null
+ unzip $ZIP > /dev/null
+ ZIPDIR=$PWD/$(ls)
+ svn export $TAG svnexport > /dev/null
+ cd svnexport > /dev/null
+ diff -r . $ZIPDIR
+ cd $CUR
+
+}
+
+CURDIR=`pwd`
+cd $BASE || fail "Cannot cd to $BASE"
+
+find . -name *.zip | cut -c 3- | sed 's/\// /g' | while read line
+do
+ set $line
+ TAG=${1}-${2}
+ ZIP=${1}/${2}/${3}
+ check $TAG $ZIP
+done
+openssl sha1 $(find . -name *.zip)
+cd $CURDIR
Added: devicemap/trunk/check_staged_release.sh
URL: http://svn.apache.org/viewvc/devicemap/trunk/check_staged_release.sh?rev=1686783&view=auto
==============================================================================
--- devicemap/trunk/check_staged_release.sh (added)
+++ devicemap/trunk/check_staged_release.sh Mon Jun 22 07:30:30 2015
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+STAGING=${1}
+DOWNLOAD=${2:-/tmp/devicemap-staging}
+mkdir ${DOWNLOAD} 2>/dev/null
+
+if [ -z "${STAGING}" -o ! -d "${DOWNLOAD}" ]
+then
+ echo "Usage: check_staged_release.sh <staging-number> [temp-directory]"
+ exit
+fi
+
+if [ ! -e "${DOWNLOAD}/${STAGING}" ]
+then
+ echo "################################################################################"
+ echo " DOWNLOAD STAGED REPOSITORY "
+ echo "################################################################################"
+
+ wget -e "robots=off" --wait 1 -nv -r -np "--reject=html,txt" "--follow-tags=" \
+ -P "${DOWNLOAD}/${STAGING}" -nH "--cut-dirs=3" \
+ "https://repository.apache.org/content/repositories/orgapachedevicemap-${STAGING}/org/apache/devicemap/"
+
+else
+ echo "################################################################################"
+ echo " USING EXISTING STAGED REPOSITORY "
+ echo "################################################################################"
+ echo "${DOWNLOAD}/${STAGING}"
+fi
+
+echo "################################################################################"
+echo " CHECK SIGNATURES AND DIGESTS "
+echo "################################################################################"
+
+for i in `find "${DOWNLOAD}/${STAGING}" -type f | grep -v '\.\(asc\|sha1\|md5\)$'`
+do
+ f=`echo $i | sed 's/\.asc$//'`
+ echo "$f"
+ gpg --verify $f.asc 2>/dev/null
+ if [ "$?" = "0" ]; then CHKSUM="GOOD"; else CHKSUM="BAD!!!!!!!!"; fi
+ if [ ! -f "$f.asc" ]; then CHKSUM="----"; fi
+ echo "gpg: ${CHKSUM}"
+
+ for tp in md5 sha1
+ do
+ if [ ! -f "$f.$tp" ]
+ then
+ CHKSUM="----"
+ else
+ A="`cat $f.$tp 2>/dev/null`"
+ B="`openssl $tp < $f 2>/dev/null | sed 's/.*= *//' `"
+ if [ "$A" = "$B" ]; then CHKSUM="GOOD (`cat $f.$tp`)"; else CHKSUM="BAD!! : $A not equal to $B"; fi
+ fi
+ echo "$tp : ${CHKSUM}"
+ done
+
+done
+
+if [ -z "${CHKSUM}" ]; then echo "WARNING: no files found!"; fi
+
+echo "################################################################################"
+
+
Propchange: devicemap/trunk/check_staged_release.sh
------------------------------------------------------------------------------
svn:executable = *