X-Git-Url: http://git.pld-linux.org/?p=packages%2Flighttpd.git;a=blobdiff_plain;f=branch.sh;h=ce27a4517142655aa11cc1e84a23f9d4378913d2;hp=d511c6fa114ba060cc751058a813e2dd6cd8e673;hb=61eb8efee6acea6635915b86beaf8521d1aac1c8;hpb=709c1a0bdff1f2e4d1c82c0c864f529d996c8523 diff --git a/branch.sh b/branch.sh old mode 100644 new mode 100755 index d511c6f..ce27a45 --- a/branch.sh +++ b/branch.sh @@ -1,14 +1,53 @@ #!/bin/sh set -e svn=svn://svn.lighttpd.net/lighttpd -tag=lighttpd-1.4.20 +package=lighttpd +tag=lighttpd-1.4.36 branch=lighttpd-1.4.x +out=lighttpd-branch.diff + +# 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 \ + -x 'CMakeLists.txt' \ + -x 'configure.ac' \ + -x 'SConstruct' \ + | \ + # remove revno's for smaller diffs + sed -e 's,^\([-+]\{3\} .*\)\t(revision [0-9]\+)$,\1,' +} old=$svn/tags/$tag new=$svn/branches/$branch -echo "Running diff: $old -> $new" -LC_ALL=C svn diff --old=$old --new=$new > lighttpd-branch.diff +echo >&2 "Running diff: $old -> $new" +LC_ALL=C svn diff --old=$old --new=$new > $out.tmp +revno=$(sed -ne 's,^[-+]\{3\} .*\t(revision \([0-9]\+\))$,\1,p' $out.tmp | sort -urn | head -n1) +echo >&2 "Revision $revno" +[ "$revno" -gt 0 ] || exit 1 + +sed -i -e "1i# Revision $revno" $out.tmp +filter < $out.tmp > $out.tmp2 && mv -f $out.{tmp2,tmp} + +if cmp -s $out{,.tmp}; then + echo >&2 "No new diffs..." + rm -f $out.tmp + exit 0 +fi +mv -f $out{.tmp,} -echo "Excluding files which change version or were not in dist tarball" -filterdiff -x 'configure.in' lighttpd-branch.diff > lighttpd-branch.diff.tmp -mv -f lighttpd-branch.diff.tmp lighttpd-branch.diff +../md5 $package.spec +../dropin $out