[Lunar-commits] r15529 - lunar/trunk/bin
Auke Kok
sofar at lunar-linux.org
Thu Jun 30 12:03:12 UTC 2005
Author: sofar
Date: 2005-06-30 12:03:06 +0000 (Thu, 30 Jun 2005)
New Revision: 15529
Modified:
lunar/trunk/bin/lvu
Log:
Feature addition: lvu diff [locally edited module] -> create a unidiff suited for submission.
Modified: lunar/trunk/bin/lvu
===================================================================
--- lunar/trunk/bin/lvu 2005-06-30 11:37:27 UTC (rev 15528)
+++ lunar/trunk/bin/lvu 2005-06-30 12:03:06 UTC (rev 15529)
@@ -80,8 +80,9 @@
version module display version of module in moonbase
edit module copy a module to zlocal for editing
-submit module try to submit a module to the lunar ML
-unedit module delete your zlocal copy of a module
+diff module view changes on edited module
+submit module attempt to submit a module to the lunar ML
+unedit module delete zlocal copy of a module
sum [module] display checksums
md5sum [module] display md5sums
@@ -727,6 +728,32 @@
}
+diff_module() {
+ if [ "$ZLOCAL_OVERRIDES" != "on" ]; then
+ message "can't diff modules without ZLOCAL_OVERRIDES=on"
+ exit 1
+ fi
+ if [ -z "$1" ]; then
+ message "diff requires a single module name"
+ exit 1
+ fi
+ if ! run_details "$1" ; then
+ message "diff requires an existing module"
+ exit 1
+ else
+ if echo $SECTION | grep -q '^zlocal' ; then
+ ZLOCAL_OVERRIDES=off SECTION=$(find_section $1)
+ if echo $SECTION | grep -q '^zlocal' ; then
+ unset SECTION
+ fi
+ else
+ message "no local copy of \"$MODULE\" exists"
+ exit 1
+ fi
+ diff -Nurb $MOONBASE/$SECTION/$MODULE $MOONBASE/zlocal/$MODULE --exclude ".svn" --exclude "CVS" | sed "s|^\([+-][+-][+-] \)$MOONBASE/[^/]*/|\1|g" | grep -v "^diff "
+ fi
+}
+
submit_module() {
# this code tries to send the module back to the mailinglist
# as good as it gets
@@ -1246,6 +1273,10 @@
fi
;;
+ diff)
+ diff_module $2
+ ;;
+
submit)
submit_module $2
;;
More information about the Lunar-commits
mailing list