tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Overwriting config files that are symlinked

> Committed, thanks.
Oops, my patch is nonsense.

In fact, test -f yields true for a symlink, so the problem is not a symlink 
getting overwritten.

The problem is the symlink getting deleted upon removal of the old version of 
the package.

What happens is that +FILES VIEW-REMOVE is called in the VIEW-DEINSTALL stage, 
but with PKG_PREFIX and PREFIX both pointing to the same directory (/usr/pkg, 
in my case).

My impression is that the fix would be to skip the first part of 
mk/pkginstall/deinstall in case VIEW is empty.

But I've already been wrong last time and I'm not sure how pkgviews are 
supposed to work technically.

So, could someone familiar with the details please review the attached patch (I 
didn't indent the if'ed part to make the patch smaller) before I break anything?
Index: pkginstall/deinstall
RCS file: /cvsroot/pkgsrc/mk/pkginstall/deinstall,v
retrieving revision 1.2
diff -u -r1.2 deinstall
--- pkginstall/deinstall        18 Jul 2007 18:01:03 -0000      1.2
+++ pkginstall/deinstall        20 Apr 2012 12:40:02 -0000
@@ -2,6 +2,7 @@
 case ${STAGE} in
+       if [ -n "$VIEW" ]; then
        case ${_PKG_CONFIG} in
                case ${PKG_SYSCONFDEPOTBASE} in
@@ -17,6 +18,7 @@
+       fi
        # Unregister info files.

Home | Main Index | Thread Index | Old Index