Rev 1281 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/bin/shUSAGE="Usage: make_writable archive pkgname pkgversion"case "$1" in-h*|--h*) echo "$USAGE"; exit 0 ;;esacif [ $# != 3 ]; thenecho "$USAGE" 1>&2exit 100ficase "$1" indpkg_archive) ARCHIVE="/devl/dpkg_archive" ;;deploy_archive) ARCHIVE="/export/deploy/deploy_archive" ;;*) echo "$0: Invalid archive: $1" 1>&2exit 101;;esacif [ "`echo $2 | sed 's/[A-Za-z][-_A-Za-z0-9]*/x/'`" != "x" ]; thenecho "$0: Invalid package name: $2" 1>&2exit 102fiif [ "`echo $3 | sed 's/[A-Za-z0-9][-_.A-Za-z0-9]*/x/'`" != "x" ]; thenecho "$0: Invalid package version: $3" 1>&2exit 103fiPKGNAMEDIR="$ARCHIVE/$2"if [ ! -d "$PKGNAMEDIR" ]; thenecho "$0: Not a directory: $PKGNAMEDIR" 1>&2exit 104fiPKGDIR="$ARCHIVE/$2/$3"if [ ! -d "$PKGDIR" ]; thenecho "$0: Not a directory: $PKGDIR" 1>&2exit 105fichmod a+rwx "$PKGNAMEDIR"if [ "$?" != 0 ]; thenecho "$0: Could not chmod: $PKGNAMEDIR" 1>&2exit 106fifind "$PKGDIR" -type d -exec chmod a+rwx {} \; &&chmod -R a+rw "$PKGDIR"