Blame | Last modification | View Log | RSS feed
#!/bin/shUSAGE="Usage: make_readonly 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" ;;releases) ARCHIVE="/devl/releases" ;;*) 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 103fiPKGDIR="$ARCHIVE/$2/$3"if [ ! -d "$PKGDIR" ]; thenecho "$0: Not a directory: $PKGDIR" 1>&2exit 105fiif [ -f "$PKGDIR/PostInstall.sh" -a "$2" = "core_devl" ]; thenecho "PostInstall script found"( cd "$PKGDIR"; chmod +x PostInstall.sh; ./PostInstall.sh )echo "PostInstall script execution complete"fi## Fix owner and prems on files and directories# Do not do links#find "$PKGDIR" ! -type l -exec chmod a-w {} \; -exec chown root:other {} \;