]> git.donarmstrong.com Git - debhelper.git/blobdiff - autoscripts/preinst-sgmlcatalog
dh_installcatalogs: Adjust catalog conffile conversion to avoid dpkg conffile prompt...
[debhelper.git] / autoscripts / preinst-sgmlcatalog
index 41f55d6ddfdc5f066c2e86217dfdeb9909ee6610..96f06738bd0c0ce36daee300aedd37a270512b3a 100644 (file)
@@ -1,7 +1,8 @@
-if [ "$1" = "upgrade" ] && ! dpkg-query -S #CENTRALCAT# >/dev/null 2>&1; then
+if test -f #CENTRALCAT# -a "(" "$1" = "upgrade" -o "$1" = "install" -a -n "$2" ")" && 
+               ! dpkg-query -S #CENTRALCAT# >/dev/null 2>&1; then
        # If the dpkg-query command returns non-zero, the central catalog is
        # not owned by any package. This is due to an old behaviour of
        # debhelper. Now that file becomes a conffile. In order to avoid a
        # question during installation, we remove the old non-conffile.
-       rm -f #CENTRALCAT#
+       mv #CENTRALCAT# #CENTRALCAT#.old
 fi