aboutsummaryrefslogtreecommitdiffstats
path: root/BSF/tools/pwg_rel_create.sh
blob: a2a584a617efcc4433010a52c543e3febd08dc33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash

# +--------------------------------------------------------------------------+
# |                            pwg_rel_create.sh                             |
# +--------------------------------------------------------------------------+
# | author        : Pierrick LE GALL <http://le-gall.net/pierrick>           |
# | project       : Piwigo                                                   |
# +--------------------------------------------------------------------------+

if [ $# -lt 2 ]
then
  echo
  echo 'usage : '$(basename $0)' <tag> <version number>'
  echo
  exit 1
fi

tag=$1
version=$2

name=phpwebgallery-$version

cd /tmp
if [ -e $name ]
then
  rm -rf $name
fi

if [ -e $version ]
then
  rm -rf $version
fi
mkdir $version

# cvs export -r $tag -d $version phpwebgallery
svn export http://svn.gna.org/svn/phpwebgallery/tags/$tag $name
# creating mysql.inc.php empty and writeable
touch $name/include/mysql.inc.php
chmod a+w $name/include/mysql.inc.php

# find $name -name "*.php" \
#   | xargs grep -l 'branch 1.7' \
#   | xargs perl -pi -e "s/branch 1.7/${version}/g"

cd /tmp
for ext in zip tar.gz tar.bz2
do
  file=$version/$name.$ext
  if [ -f $file ]
  then
    rm $name
  fi
done


zip -r   $version/$name.zip     $name
tar -czf $version/$name.tar.gz  $name
tar -cjf $version/$name.tar.bz2 $name

cd /tmp/$version
md5sum p* >MD5SUMS