X-Git-Url: https://git.tld-linux.org/?p=packages%2Flighttpd.git;a=blobdiff_plain;f=branch.sh;fp=branch.sh;h=72c2ffc8efbd45cd7797a6a03f1a9a7909ee9687;hp=4a0e8f8ddaa9e6f06993d4f1b1f75efa90384c3d;hb=2bc378a1b82f8e82ab66bd2a656282134a6d05e0;hpb=82b54184faf5e32cf65c54d52bcecea5c2f03d5c diff --git a/branch.sh b/branch.sh old mode 100644 new mode 100755 index 4a0e8f8..72c2ffc --- a/branch.sh +++ b/branch.sh @@ -1,11 +1,58 @@ #!/bin/sh set -e svn=svn://svn.lighttpd.net/lighttpd -p=lighttpd -v=1.5 - -svn co $svn/trunk $p-$v -r=$(svnversion $p-$v) -t=$p-r$r.tar.bz2 -tar -cjf $t --exclude-vcs $p-$v -../dropin $t & +url=https://git.lighttpd.net/lighttpd/lighttpd1.4.git +package=lighttpd +tag=lighttpd-1.4.42 +branch=master +out=$package-branch.diff +repo=$package.git + +# old version of this code used to create tarball. +# leave it around +if [ "$1" = "tarball" ]; then + v=1.5 + svn co $svn/trunk $package-$v + r=$(svnversion $package-$v) + t=$package-r$r.tar.bz2 + tar -cjf $t --exclude-vcs $package-$v + ../dropin $t & + exit 0 +fi + +d=$- +filter() { + set -$d + # Excluding files which change version or were not in dist tarball + filterdiff -p1 \ + -x 'CMakeLists.txt' \ + -x 'configure.ac' \ + -x 'SConstruct' \ + -x 'packdist.sh' \ + | cat +} + +if [ ! -d $repo ]; then + git clone --bare $url -b $branch $repo +fi + +cd $repo + git fetch origin +$branch:$branch +refs/tags/$tag:refs/tags/$tag + git log -p --reverse $tag..$branch | filter > ../$out.tmp +cd .. + +if ! test -s $out.tmp; then + echo >&2 "No diffs..." + rm -f $out.tmp + exit 0 +fi + +if cmp -s $out{,.tmp}; then + echo >&2 "No new diffs..." + rm -f $out.tmp + exit 0 +fi +mv -f $out{.tmp,} + +../md5 $package.spec +../dropin $out