]> granicus.if.org Git - mutt/commitdiff
Include mq-based patches in the mutt patch list.
authorDavid Champion <dgc@bikeshed.us>
Mon, 3 Jan 2011 19:19:51 +0000 (13:19 -0600)
committerDavid Champion <dgc@bikeshed.us>
Mon, 3 Jan 2011 19:19:51 +0000 (13:19 -0600)
This augments the contents of the PATCHES file, so that mq-based builds
do not need to maintain that file.

patchlist.sh

index 1f1f185c431efb7be13f299915e1372a7784dccc..fedba9b0a0f635f8954418d627ec0025ba38a9ba 100755 (executable)
@@ -1,5 +1,21 @@
 #!/bin/sh --
 
+list_patches_PATCHES () {
+       cat PATCHES
+}
+
+list_patches_mq () {
+       hg qapplied | sed -e 's/^/mq-/'
+}
+
+list_patches () {
+       if [ -f .hg/patches/series ]; then
+               list_patches_mq
+       else
+               list_patches_PATCHES
+       fi
+}
+
 cat <<EOF
 /* this is an autogenerated file.  edit patchlist.sh instead. */
 #include "config.h"
@@ -13,7 +29,7 @@ void mutt_print_patchlist (void)
 {
 EOF
 
-while read patch ; do
+list_patches | while read patch ; do
        echo "  puts (\"${patch}\");"
 done