pkgsrc-Bugs archive

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

pkg/45513: pkgsrc DEINSTALL file doesn't have ${VARBASE} and other variables defined

>Number:         45513
>Category:       pkg
>Synopsis:       pkgsrc DEINSTALL file doesn't have ${VARBASE} and other 
>variables defined
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 23 10:15:00 +0000 2011
>Originator:     John Marino
If a package has a DEINSTALL script that deletes a file from ${VARBASE} 
(normally /var), you must use "/var" instead of ${VARBASE} because the latter 
is not expanded.

I assume this is not the intended behavior, otherwise the DEINSTALL script 
would fail when the $VARBASE is defined as something other than the standard 

The same effect is seen if ${PKG_DBDIR} is used as well, so the issue is not 
limited to $VARBASE.
create a dummy file at /var/db/pkg/test.db (assumes $VARBASE = /var).  Add the 
following DEINSTALL file for any package (I used biology/sewer) for testing 

# $NetBSD$

case ${STAGE} in
                ${RM} ${VARBASE}/db/pkg/test.db

> bmake install clean
> pkg_delete name-of-testpackage-\*

confirm that pkg_delete emits an error when file "/db/pkg/test.db" isn't found.

repeat the process using this DEINSTALL file:

# $NetBSD$

case ${STAGE} in
                ${RM} /var/db/pkg/test.db

confirm that pkg_delete successfully removes all files, including 


Home | Main Index | Thread Index | Old Index