Subversion Repositories DevTools

Rev

Rev 1281 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
#!/bin/sh
3613 dpurdie 2
#set -x
119 ghuddy 3
 
4
USAGE="Usage: make_readonly archive pkgname pkgversion"
5
case "$1" in
6
  -h*|--h*)     echo "$USAGE"; exit 0 ;;
7
esac
8
if [ $# != 3 ]; then
9
  echo "$USAGE" 1>&2
10
  exit 100
11
fi
12
 
3613 dpurdie 13
# Log operations
14
LOGDIR=/home/releasem/logs
15
LOGFILE=`date +release.%Y.%m.%d.log`
16
mkdir -p $LOGDIR
17
echo `date` " make_readonly $1 $2 $3" >> $LOGDIR/$LOGFILE
18
 
19
 
119 ghuddy 20
case "$1" in
21
  dpkg_archive)         ARCHIVE="/devl/dpkg_archive" ;;
3613 dpurdie 22
  deploy_archive)       ARCHIVE="/devl/deploy_archive" ;;
119 ghuddy 23
  releases)             ARCHIVE="/devl/releases" ;;
24
  *)                    echo "$0: Invalid archive: $1" 1>&2
25
                        exit 101
26
                        ;;
27
esac
28
 
29
if [ "`echo $2 | sed 's/[A-Za-z][-_A-Za-z0-9]*/x/'`" != "x" ]; then
30
  echo "$0: Invalid package name: $2" 1>&2
31
  exit 102
32
fi
33
if [ "`echo $3 | sed 's/[A-Za-z0-9][-_.A-Za-z0-9]*/x/'`" != "x" ]; then
34
  echo "$0: Invalid package version: $3" 1>&2
35
  exit 103
36
fi
37
 
38
PKGDIR="$ARCHIVE/$2/$3"
39
if [ ! -d "$PKGDIR" ]; then
40
  echo "$0: Not a directory: $PKGDIR" 1>&2
41
  exit 105
42
fi
43
 
44
if [ -f "$PKGDIR/PostInstall.sh" -a "$2" = "core_devl" ]; then
45
  echo "PostInstall script found"
46
  ( cd "$PKGDIR"; chmod +x PostInstall.sh; ./PostInstall.sh )
47
  echo "PostInstall script execution complete"
48
fi
49
 
50
#
3613 dpurdie 51
# Fix owner and perms on files and directories
52
#   Do not do links
53
#   Remove write access
54
#   Set owner to root
55
#   Remove 'releasem' user placed to allow release note insertion
119 ghuddy 56
#
3613 dpurdie 57
#find "$PKGDIR"  ! -type l -exec chmod a-w {} \; -exec chown root:ccperdev {} \;
58
#setfacl -R -m group::r-x "$PKGDIR"
59
#setfacl -R -x user:releasem "$PKGDIR"
119 ghuddy 60
 
3613 dpurdie 61
setfacl -R -x user:releasem "$PKGDIR"
62
setfacl -R -m user::rX,group::rX,other::rX "$PKGDIR"
63