Subversion Repositories DevTools

Rev

Rev 1281 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1281 Rev 3613
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
 
2
 
3
USAGE="Usage: make_writable archive pkgname pkgversion"
3
USAGE="Usage: make_writable archive pkgname pkgversion"
4
case "$1" in
4
case "$1" in
5
  -h*|--h*)	echo "$USAGE"; exit 0 ;;
5
  -h*|--h*)     echo "$USAGE"; exit 0 ;;
6
esac
6
esac
7
if [ $# != 3 ]; then
7
if [ $# != 3 ]; then
8
  echo "$USAGE" 1>&2
8
  echo "$USAGE" 1>&2
9
  exit 100
9
  exit 100
10
fi
10
fi
11
 
11
 
-
 
12
# Log operations
-
 
13
LOGDIR=/home/releasem/logs
-
 
14
LOGFILE=`date +release.%Y.%m.%d.log`
-
 
15
mkdir -p $LOGDIR
-
 
16
echo `date` " make_writable $1 $2 $3" >> $LOGDIR/$LOGFILE
-
 
17
 
12
case "$1" in
18
case "$1" in
13
  dpkg_archive)		ARCHIVE="/devl/dpkg_archive" ;;
19
  dpkg_archive)         ARCHIVE="/devl/dpkg_archive" ;;
14
  deploy_archive)	ARCHIVE="/export/deploy/deploy_archive" ;;
20
  deploy_archive)       ARCHIVE="/devl/deploy_archive" ;;
-
 
21
  releases)             ARCHIVE="/devl/releases" ;;
15
  *)			echo "$0: Invalid archive: $1" 1>&2
22
  *)                    echo "$0: Invalid archive: $1" 1>&2
16
			exit 101
23
                        exit 101
17
			;;
24
                        ;;
18
esac
25
esac
19
 
26
 
20
if [ "`echo $2 | sed 's/[A-Za-z][-_A-Za-z0-9]*/x/'`" != "x" ]; then
27
if [ "`echo $2 | sed 's/[A-Za-z][-_A-Za-z0-9]*/x/'`" != "x" ]; then
21
  echo "$0: Invalid package name: $2" 1>&2
28
  echo "$0: Invalid package name: $2" 1>&2
22
  exit 102
29
  exit 102
Line 36... Line 43...
36
if [ ! -d "$PKGDIR" ]; then
43
if [ ! -d "$PKGDIR" ]; then
37
  echo "$0: Not a directory: $PKGDIR" 1>&2
44
  echo "$0: Not a directory: $PKGDIR" 1>&2
38
  exit 105
45
  exit 105
39
fi
46
fi
40
 
47
 
41
chmod a+rwx "$PKGNAMEDIR"
48
chmod ug+rwx "$PKGNAMEDIR"
42
if [ "$?" != 0 ]; then
49
if [ "$?" != 0 ]; then
43
  echo "$0: Could not chmod: $PKGNAMEDIR" 1>&2
50
  echo "$0: Could not chmod: $PKGNAMEDIR" 1>&2
44
  exit 106
51
  exit 106
45
fi
52
fi
46
 
53
 
-
 
54
#
-
 
55
# Fix perms on files and directories
-
 
56
#   Directories are rwx
-
 
57
#   Files are rw
-
 
58
#   Do not do links
-
 
59
#
47
find "$PKGDIR" -type d -exec chmod a+rwx {} \; &&
60
#find "$PKGDIR"  ! -type l -a -type d -exec chmod a+rw {} \;
-
 
61
#find "$PKGDIR"  ! -type l -a -type f -exec chmod a+rw {} \;
-
 
62
setfacl -R -m user::rwX,group::rwX,other::rwX "$PKGDIR"
48
  chmod -R a+rw "$PKGDIR"
63
setfacl -R -m user:releasem:rwx "$PKGDIR"
-
 
64