On a Mac, check that we don't ship any files that have xattr set (bug #0001021)
3 # mkdist.sh - make a Geeklog distribution from a local Mercurial repository
5 # Usage: mkdist.sh new-version old-version
6 # e.g. ./mkdist.sh 1.3.9rc1 1.3.8-1sr4 [repository-dir]
9 echo "Usage: $0 new-version-number old-version-number [repository-dir]"
14 echo "Need another version number ..."
24 NEWVERSION="geeklog-$1"
25 OLDVERSION="geeklog-$2"
27 echo "Creating $NEWVERSION from $repository"
31 if [ -d $NEWVERSION ]; then
35 # use tar to create a copy without the .hg directory
37 tar cf gl-temp.tar '--exclude=\.hg' $repository
38 mv gl-temp.tar ../dist/
42 mv $repository $NEWVERSION
44 cp -r -p ../pear-1.3/pear/* $NEWVERSION/system/pear/
45 # remove PHP_Compat package
46 rm -rf $NEWVERSION/system/pear/PHP
50 # Blaine's test file ...
51 rm -f public_html/blaine.php
53 # accidental early GSoC commits ...
54 rm -f sql/pgsql_tableanddata.php
55 rm -f system/databases/pgsql.class.php
57 # don't ship MT-Blacklist modules any more
58 rm -f plugins/spamx/MTBlackList.Examine.class.php
59 rm -f plugins/spamx/Import.Admin.class.php
60 # only used by the Import class
61 rm -rf plugins/spamx/magpierss
62 rm -f plugins/spamx/rss.inc.php
63 # you'd need to set up a honeypot to use it
64 rm -f plugins/spamx/ProjectHoneyPot.Examine.class.php
66 # old upgrade files (from pre-1.3 versions)
67 rm -f sql/updates/*.sql
68 rm -f sql/updates/1.2.5-1_to_1.3.NOTES
70 # PEAR buildpackage files
71 rm -f plugins/calendar/buildpackage.php
72 rm -f plugins/links/buildpackage.php
73 rm -f plugins/polls/buildpackage.php
74 rm -f plugins/spamx/buildpackage.php
75 rm -f plugins/staticpages/buildpackage.php
79 rm -f public_html/pdfgenerator.php
80 rm -rf public_html/layout/professional/pdfgenerator
82 # about time we clean up the install directory ...
83 rm -f public_html/admin/install/addindex.php
85 mv db-config.php.dist db-config.php
86 mv public_html/siteconfig.php.dist public_html/siteconfig.php
88 # lib-custom.php.dist is the actual lib-custom.php file now ...
89 mv system/lib-custom.php.dist system/lib-custom.php
91 find . -type f -name '.*' -exec rm \{\} \;
92 #find . -name CVS -exec rm -r \{\} \; 2>/dev/null
94 # if on a Mac, check that we don't have any of those pesky xattributes set
96 if [ -n "$xattr" ]; then
105 find . -type f -exec chmod a-x \{\} \;
106 chmod a+x emailgeeklogstories
108 # set the default permissions
114 chmod 775 public_html/backend
115 chmod 644 public_html/backend/*.rss
116 chmod 775 public_html/images/articles
117 chmod 664 public_html/images/articles/*
118 chmod 775 public_html/images/topics
119 chmod 664 public_html/images/topics/*
120 chmod 775 public_html/images/userphotos
121 chmod 664 public_html/images/userphotos/*
125 diff -b -B --brief --recursive -N $OLDVERSION $NEWVERSION | grep -v 'system.pear' | cut -f 4 -d' ' >changed-files
126 # diff -b -B --brief --recursive -N $OLDVERSION $NEWVERSION | grep -v layout | grep -v docs | cut -f 4 -d' ' >changed-files
127 mv changed-files $NEWVERSION/public_html/docs/
129 if [ -f $NEWVERSION.tar ]; then
133 tar cf $NEWVERSION.tar $NEWVERSION
135 if [ -f $NEWVERSION.tar.gz ]; then
136 rm $NEWVERSION.tar.gz
141 md5 $NEWVERSION.tar.gz