[packages/lighttpd] updated branch.sh script to produce diffs from last svn tag

glen glen at pld-linux.org
Tue Aug 18 12:21:58 CEST 2015


commit c2f7af021d2eab313d76031a286fdb63251852c2
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Tue Aug 18 13:01:46 2015 +0300

    updated branch.sh script to produce diffs from last svn tag

 branch.sh | 49 +++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 41 insertions(+), 8 deletions(-)
---
diff --git a/branch.sh b/branch.sh
old mode 100644
new mode 100755
index 4a0e8f8..05e1c6c
--- a/branch.sh
+++ b/branch.sh
@@ -1,11 +1,44 @@
 #!/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 &
+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
+	# remove revno's for smaller diffs
+	sed -e 's,^\([-+]\{3\} .*\)\t(revision [0-9]\+)$,\1,'
+}
+
+old=$svn/tags/$tag
+new=$svn/branches/$branch
+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,}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/lighttpd.git/commitdiff/abcb55517e5aec450579ace8de0d4c540973e3da



More information about the pld-cvs-commit mailing list