]> git.madduck.net Git - code/myrepos.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

* hours_since was broken by design, and fixing it involved changing
authorJoey Hess <joey@kodama.kitenet.net>
Sun, 21 Oct 2007 18:08:36 +0000 (14:08 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Sun, 21 Oct 2007 18:08:36 +0000 (14:08 -0400)
  its calling convention. If you used the old version, you'll get errors
  from the new old.

debian/changelog
mr
mrconfig.complex

index 6440ffe9e8d2e879b42fe22ddae897bacd4e91dd..6cef26dfa1de35dd171f67ba96502a859e9e917c 100644 (file)
@@ -2,8 +2,11 @@ mr (0.6) UNRELEASED; urgency=low
 
   * Add to the example mrconfig a "tags" command that lists tags.
     (Currently only for svn and git.)
+  * hours_since was broken by design, and fixing it involved changing
+    its calling convention. If you used the old version, you'll get errors
+    from the new old.
 
- -- Joey Hess <joeyh@debian.org>  Sun, 21 Oct 2007 01:49:03 -0400
+ -- Joey Hess <joeyh@debian.org>  Sun, 21 Oct 2007 13:58:30 -0400
 
 mr (0.5) unstable; urgency=low
 
diff --git a/mr b/mr
index 433354bc4f742620da2aaf057811579f1667b00e..89f3281f1137cda05469f33afd05b7df82008a39 100755 (executable)
--- a/mr
+++ b/mr
@@ -229,7 +229,7 @@ mr is run by joey. The second uses the hours_since function
 been at least 12 hours since the last update.
 
   skip = test $(whoami) != joey
-  skip = [ "$1" = update ] && [ $(hours_since "$1") -lt 12 ]
+  skip = [ "$1" = update ] && ! hours_since "$1" 12
 
 =item chain
 
@@ -899,6 +899,9 @@ lib =
                exit 1
        }
        hours_since() {
+               if [ -z "$1" ] || [ -z "$2" ]; then
+                       error "mr: usage: hours_since action num"
+               fi
                for dir in .git .svn .bzr CVS .hg; do
                        if [ -e "$MR_REPO/$dir" ]; then
                                flagfile="$MR_REPO/$dir/.mr_last$1"
@@ -908,8 +911,13 @@ lib =
                if [ -z "$flagfile" ]; then
                        error "cannot determine flag filename"
                fi
-               perl -wle 'print -f shift() ? int((-M _) * 24) : 9999' "$flagfile"
-               touch "$flagfile"
+               delta=$(perl -wle 'print -f shift() ? int((-M _) * 24) : 9999' "$flagfile")
+               if [ "$delta" -lt "$2" ]; then
+                       exit 0
+               else
+                       touch "$flagfile"
+                       exit 1
+               fi
        }
 
 update =
index c59c8fe46b69aa88f0c0c8434f4a459a06510bd5..f8ec25c2d30c6dfd85f39ab0d9233f73e84a0d27 100644 (file)
@@ -69,7 +69,7 @@ skip = ! wantsrc
 [src/linux-2.6]
 checkout = git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
 skip = ! mylaptop || ! wantsrc ||
-       ([ "$1" = update ] && [ $(hours_since "$1") -lt 12 ])
+       ([ "$1" = update ] && ! hours_since "$1" 12)
 
 [src/dpkg]
 # A merge of the upstream dpkg git repo and my own personal branch.