Improve error messages for dup packages
authorAndre Heinecke <aheinecke@intevation.de>
Wed, 24 Feb 2016 10:00:22 +0000 (11:00 +0100)
committerAndre Heinecke <aheinecke@intevation.de>
Wed, 24 Feb 2016 10:00:22 +0000 (11:00 +0100)
* configure.ac: Print removal hint for duplicate packages.
* m4/gpg4win.m4 (GPG4WIN_FIND): Store potentially dup file names.

configure.ac
m4/gpg4win.m4

index cb0b6c8..351d556 100644 (file)
@@ -386,7 +386,15 @@ if test -n "$gpg4win_dup_sources"; then
       tmp="$tmp
 $i"
     done
-    AC_MSG_ERROR([Packages with more that one source version:$tmp])
+    tmp2="
+You might remove them with:"
+    for i in $gpg4win_rm_candidates; do
+        if ! grep -q $(basename $i) packages/packages.current; then
+            tmp2="$tmp2
+rm $i"
+        fi
+    done
+    AC_MSG_ERROR([Packages with more that one source version:$tmp$tmp2])
 fi
 
 
index f3a65d7..930e58f 100644 (file)
@@ -159,7 +159,8 @@ AC_DEFUN([GPG4WIN_FIND],
   for _gpg4win_f in $_gpg4win_file; do
       AS_IF([test "$_gpg4win_found" = yes],
             [AC_MSG_WARN(found more than one sources for $1 in $_gpg4win_dir)
-             gpg4win_dup_sources="$gpg4win_dup_sources $1"])
+             gpg4win_dup_sources="$gpg4win_dup_sources $1";
+             gpg4win_rm_candidates="$gpg4win_rm_candidates $_gpg4win_file"])
       _gpg4win_found=yes
   done