diff contrib/buildrpm @ 9810:326a0a6453a3

buildrpm: warn if there is outstanding uncommitted changes
author Gilles Moris <gilles.moris@free.fr>
date Fri, 06 Nov 2009 09:30:18 +0100
parents ce145bf2ca5e
children c92ac5a56f69
line wrap: on
line diff
--- a/contrib/buildrpm	Fri Nov 06 09:26:29 2009 +0100
+++ b/contrib/buildrpm	Fri Nov 06 09:30:18 2009 +0100
@@ -21,6 +21,14 @@
     exit 1
 fi
 
+if $HG id -i | grep '+$' > /dev/null 2>&1; then
+    echo -n "Your local changes will NOT be in the RPM. Continue [y/n] ? "
+    read answer
+    if echo $answer | grep -iv '^y'; then
+        exit
+    fi
+fi
+
 rpmdir=/tmp/"`basename $root | sed 's/ /_/'`"-rpm # FIXME: Insecure /tmp handling
 
 cd "$root"