]> git.pld-linux.org Git - packages/lighttpd.git/blob - branch.sh
also upload to dropin
[packages/lighttpd.git] / branch.sh
1 #!/bin/sh
2 set -e
3 svn=svn://svn.lighttpd.net/lighttpd
4 package=lighttpd
5 tag=lighttpd-1.4.36
6 branch=lighttpd-1.4.x
7 out=lighttpd-branch.diff
8
9 # old version of this code used to create tarball.
10 # leave it around
11 if [ "$1" = "tarball" ]; then
12         v=1.5
13         svn co $svn/trunk $package-$v
14         r=$(svnversion $package-$v)
15         t=$package-r$r.tar.bz2
16         tar -cjf $t --exclude-vcs $package-$v
17         ../dropin $t &
18         exit 0
19 fi
20
21 d=$-
22 filter() {
23         set -$d
24         # Excluding files which change version or were not in dist tarball
25         filterdiff \
26                 -x 'CMakeLists.txt' \
27                 -x 'configure.ac' \
28                 -x 'SConstruct' \
29                 | \
30         # remove revno's for smaller diffs
31         sed -e 's,^\([-+]\{3\} .*\)\t(revision [0-9]\+)$,\1,'
32 }
33
34 old=$svn/tags/$tag
35 new=$svn/branches/$branch
36 echo >&2 "Running diff: $old -> $new"
37 LC_ALL=C svn diff --old=$old --new=$new > $out.tmp
38 revno=$(sed -ne 's,^[-+]\{3\} .*\t(revision \([0-9]\+\))$,\1,p' $out.tmp | sort -urn | head -n1)
39 echo >&2 "Revision $revno"
40 [ "$revno" -gt 0 ] || exit 1
41
42 sed -i -e "1i# Revision $revno" $out.tmp
43 filter < $out.tmp > $out.tmp2 && mv -f $out.{tmp2,tmp}
44
45 if cmp -s $out{,.tmp}; then
46         echo >&2 "No new diffs..."
47         rm -f $out.tmp
48         exit 0
49 fi
50 mv -f $out{.tmp,}
51
52 ../md5 $package.spec
53 ../dropin $out
This page took 0.07545 seconds and 3 git commands to generate.