pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/pkginstall Fix a longstanding bug in the pkginstall...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a5a21c85348d
branches:  trunk
changeset: 547673:a5a21c85348d
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Thu Sep 25 14:01:46 2008 +0000

description:
Fix a longstanding bug in the pkginstall infrastructure: incomplete
support for creating empty files as CONF_FILES.

The usual way is to add
CONF_FILES= /dev/null /some/file

However, some parts of the infrastructure check if the "source" is a
file -- this fails for /dev/null obviously (other parts accept
character devices already).

Fix this. Will follow up with PKGREVISION bumps for affected packages.

Ok during freeze: agc@

diffstat:

 mk/pkginstall/files |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 47d592f02d0c -r a5a21c85348d mk/pkginstall/files
--- a/mk/pkginstall/files       Thu Sep 25 12:04:16 2008 +0000
+++ b/mk/pkginstall/files       Thu Sep 25 14:01:46 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files,v 1.5 2008/01/04 21:50:27 heinz Exp $
+# $NetBSD: files,v 1.6 2008/09/25 14:01:46 wiz Exp $
 #
 # Generate a +FILES script that reference counts config files that are
 # required for the proper functioning of the package.
@@ -152,14 +152,14 @@
                "")     ;;
                *)      ${ECHO} "$f_mode $f_user $f_group" > $perms ;;
                esac
-               if ${TEST} ! -f "$file" -a ! -f "$f_eg"; then
+               if ${TEST} ! -f "$file" -a ! -f "$f_eg" -a ! -c "$f_eg"; then
                        :
                else
                        case "$f_flags:$_PKG_CONFIG:$_PKG_RCD_SCRIPTS" in
                        *f*:*:*|[!r]:yes:*|[!r][!r]:yes:*|[!r][!r][!r]:yes:*|*r*:yes:yes)
                                if ${TEST} -f "$file"; then
                                        ${ECHO} "${PKGNAME}: $file already exists"
-                               elif ${TEST} -f "$f_eg"; then
+                               elif ${TEST} -f "$f_eg" -o -c "$f_eg"; then
                                        ${ECHO} "${PKGNAME}: copying $f_eg to $file"
                                        ${CP} $f_eg $file
                                        case $f_user in
@@ -209,7 +209,7 @@
                        "")
                                if ${TEST} -f "$preexist"; then
                                        :
-                               elif ${TEST} -f "$file" -a -f "$f_eg" && \
+                               elif ${TEST} -f "$file" -a \( -f "$f_eg" -o -c "$f_eg" \) && \
                                     ${CMP} -s "$file" "$f_eg"; then
                                        case "$f_flags:$_PKG_CONFIG:$_PKG_RCD_SCRIPTS" in
                                        *f*:*:*|[!r]:yes:*|[!r][!r]:yes:*|[!r][!r][!r]:yes:*|*r*:yes:yes)



Home | Main Index | Thread Index | Old Index