]> TLD Linux GIT Repositories - packages/lighttpd.git/blob - branch.sh
- init cleanup (merged too much from PLD)
[packages/lighttpd.git] / branch.sh
1 #!/bin/sh
2 set -e
3 svn=svn://svn.lighttpd.net/lighttpd
4 url=https://git.lighttpd.net/lighttpd/lighttpd1.4.git
5 package=lighttpd
6 tag=lighttpd-1.4.45
7 branch=master
8 out=$package-branch.diff
9 repo=$package.git
10
11 # old version of this code used to create tarball.
12 # leave it around
13 if [ "$1" = "tarball" ]; then
14         v=1.5
15         svn co $svn/trunk $package-$v
16         r=$(svnversion $package-$v)
17         t=$package-r$r.tar.bz2
18         tar -cjf $t --exclude-vcs $package-$v
19         ../dropin $t &
20         exit 0
21 fi
22
23 d=$-
24 filter() {
25         set -$d
26         # Excluding files which change version or were not in dist tarball
27         filterdiff -p1 \
28                 -x '.gitignore' \
29                 -x 'CMakeLists.txt' \
30                 -x 'SConstruct' \
31                 -x 'configure.ac' \
32                 -x 'packdist.sh' \
33         | cat
34 }
35
36 if [ ! -d $repo ]; then
37         git clone --bare $url -b $branch $repo
38 fi
39
40 cd $repo
41         git fetch origin +$branch:$branch +refs/tags/$tag:refs/tags/$tag
42         git log -p --reverse $tag..$branch | filter > ../$out.tmp
43 cd ..
44
45 if ! test -s $out.tmp; then
46         echo >&2 "No diffs..."
47         rm -f $out.tmp
48         exit 0
49 fi
50
51 if cmp -s $out{,.tmp}; then
52         echo >&2 "No new diffs..."
53         rm -f $out.tmp
54         exit 0
55 fi
56 mv -f $out{.tmp,}
57
58 ../md5 $package.spec
59 ../dropin $out