Subversion Repositories DevTools

Rev

Rev 6559 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
#!/bin/sh
3616 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
 
3616 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" ;;
3616 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
 
4535 dpurdie 44
#
45
#   Package Post Install Process for known packages
6559 dpurdie 46
#   These packages are generally build system related
4535 dpurdie 47
#
6564 dpurdie 48
if [ "$2" = "core_devl" -o "$2" = "buildtool"  -o "$2" = "jats-installer" -o "$2" = "generate_release_notes" ] ; then
4535 dpurdie 49
    if [ -f "$PKGDIR/PostInstall.sh" ]; then
50
      echo "PostInstall script found"
51
      ( cd "$PKGDIR"; chmod +x PostInstall.sh; ./PostInstall.sh "$archive" "$2" "$3" )
52
      echo "PostInstall script execution complete"
53
    fi
119 ghuddy 54
fi
55
 
56
#
3616 dpurdie 57
# Fix owner and perms on files and directories
58
#   Do not do links
59
#   Remove write access
60
#   Set owner to root
61
#   Remove 'releasem' user placed to allow release note insertion
119 ghuddy 62
#
3616 dpurdie 63
#find "$PKGDIR"  ! -type l -exec chmod a-w {} \; -exec chown root:ccperdev {} \;
64
#setfacl -R -m group::r-x "$PKGDIR"
65
#setfacl -R -x user:releasem "$PKGDIR"
119 ghuddy 66
 
3616 dpurdie 67
setfacl -R -x user:releasem "$PKGDIR"
68
setfacl -R -m user::rX,group::rX,other::rX "$PKGDIR"
69