[ Index ] |
|
Code source de Serendipity 1.2 |
1 #!/bin/sh 2 # File: create_release.sh 3 # Author: Garvin Hicing 4 # $Id: create_release.sh,v 1.6 2005/03/04 10:16:38 garvinhicking Exp $ 5 # 6 # Description: 7 # This file is only used for developers to create a Serendipity release file 8 # with all the proper file permissions. CVS doesn't track the rightly, so we 9 # need to fix it before releasing. 10 # 11 # Usage: 12 # As security precaution for any other users just executing this script, there 13 # are two required input parameters. The first being the basename path of the 14 # serendipity installation. The second parameter is the target owner of the files. 15 16 echo "" 17 echo "-[serendipity create_release.sh START]---------------------------------" 18 19 if [ "x$1" = "x" ] || [ "x$2" = "x" ] || [ "x$3" = "x" ] || [ "x$4" = "x" ]; 20 then 21 echo "usage: ./create_release.sh 22 [tar.gz dump filename] 23 [serendipity installation dirname, without paths] 24 [username, i.e. nobody] 25 [group, i.e. nogroup]" 26 echo "" 27 echo "example:" 28 echo " $> cd serendipity/bundled-libs/" 29 echo " $> ./create_release.sh serendipity-0.7.tar.gz serendipity nobody nogroup" 30 echo "" 31 echo "WARNING: Running this script in a productive blog environment will do" 32 echo " serious harm!" 33 echo "-[serendipity create_release.sh END]----------------------------------" 34 echo "" 35 exit 1 36 else 37 if test "../../$2" 38 then 39 echo "WARNING: Running this script in a productive blog environment will do" 40 echo " serious harm! Only use it, if you are a developer and about" 41 echo " to bundle a new release version!" 42 echo "" 43 echo "Hit [ENTER] to continue, or abort this script" 44 read -n 1 45 46 echo "1. Operating on basedirectory ../../$2" 47 cd ../../ 48 echo " [DONE]" 49 echo "" 50 51 echo "2. Adjusting all subdirectory permissions to 755" 52 find "$2" -type d -exec chmod 755 {} \; 53 echo " [DONE]" 54 echo "" 55 56 echo "3. Adjusting core directory permissions to 777" 57 chmod 777 "$2" 58 chmod 777 "$2/templates_c" 59 chmod 777 "$2/plugins" 60 chmod 777 "$2/uploads" 61 echo " [DONE]" 62 echo "" 63 64 echo "4. Adjusting all file permissions to 644" 65 find "$2" -type f -exec chmod 644 {} \; 66 echo " [DONE]" 67 echo "" 68 69 echo "5. Adjusting special files..." 70 echo " - $2/.htaccess [666]" 71 chmod 666 "$2/.htaccess" 72 73 echo " - $2/upgrade.sh [744]" 74 chmod 744 "$2/upgrade.sh" 75 76 echo " - $2/bundled-libs/create_release.sh [766]" 77 chmod 766 "$2/bundled-libs/create_release.sh" 78 79 echo " - $2/tests [remove]" 80 rm -rf "$2/tests" 81 echo " [DONE]" 82 echo "" 83 84 echo "6. Altering CVS to be useful for anonymous users..." 85 echo " - Removing CVS branch tag, so that a user can upgrade to latest CVS" 86 find "$2" -type f -name Tag -exec rm {} \; 87 echo " [DONE]" 88 89 echo " - Inserting ANONYMOUS user instead of Developer account" 90 for i in `find $2 -type f -name Root` ; do 91 echo ':pserver:anonymous@cvs.sf.net:/cvsroot/php-blog' > $i; 92 done 93 echo " [DONE]" 94 echo "" 95 96 echo "7. Creating .tgz file $1" 97 tar --owner=$3 --group=$4 -czf "$1" "$2" 98 echo " [DONE]" 99 echo "" 100 101 echo "8. All Done. Bybe-Bye." 102 else 103 echo "Basedirectory ../../$2 not found. Check parameters" 104 fi 105 echo "-[serendipity create_release.sh END]----------------------------------" 106 echo "" 107 fi 108
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Nov 24 09:00:37 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |