Sat Apr 21 10:22:33 2012 UTC ()
Revert previous: Patch submitter reports it's not necessary after all
since -f usually follows symlinks.


(wiz)
diff -r1.7 -r1.8 pkgsrc/mk/pkginstall/files

cvs diff -r1.7 -r1.8 pkgsrc/mk/pkginstall/files (expand / switch to unified diff)

--- pkgsrc/mk/pkginstall/files 2012/04/17 11:55:33 1.7
+++ pkgsrc/mk/pkginstall/files 2012/04/21 10:22:32 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: files,v 1.7 2012/04/17 11:55:33 wiz Exp $ 1# $NetBSD: files,v 1.8 2012/04/21 10:22:32 wiz Exp $
2# 2#
3# Generate a +FILES script that reference counts config files that are 3# Generate a +FILES script that reference counts config files that are
4# required for the proper functioning of the package. 4# required for the proper functioning of the package.
5# 5#
6case "${STAGE},$1" in 6case "${STAGE},$1" in
7UNPACK,|UNPACK,+FILES) 7UNPACK,|UNPACK,+FILES)
8 ${CAT} > ./+FILES << 'EOF' 8 ${CAT} > ./+FILES << 'EOF'
9#!@SH@ 9#!@SH@
10# 10#
11# +FILES - reference-counted configuration file management script 11# +FILES - reference-counted configuration file management script
12# 12#
13# Usage: ./+FILES ADD|REMOVE|PERMS [metadatadir] 13# Usage: ./+FILES ADD|REMOVE|PERMS [metadatadir]
14# ./+FILES VIEW-REMOVE depotdir viewdir 14# ./+FILES VIEW-REMOVE depotdir viewdir
@@ -149,28 +149,26 @@ ADD) @@ -149,28 +149,26 @@ ADD)
149 fi 149 fi
150 150
151 case $f_mode$f_user$f_group in 151 case $f_mode$f_user$f_group in
152 "") ;; 152 "") ;;
153 *) ${ECHO} "$f_mode $f_user $f_group" > $perms ;; 153 *) ${ECHO} "$f_mode $f_user $f_group" > $perms ;;
154 esac 154 esac
155 if ${TEST} ! -f "$file" -a ! -f "$f_eg" -a ! -c "$f_eg"; then 155 if ${TEST} ! -f "$file" -a ! -f "$f_eg" -a ! -c "$f_eg"; then
156 : 156 :
157 else 157 else
158 case "$f_flags:$_PKG_CONFIG:$_PKG_RCD_SCRIPTS" in 158 case "$f_flags:$_PKG_CONFIG:$_PKG_RCD_SCRIPTS" in
159 *f*:*:*|[!r]:yes:*|[!r][!r]:yes:*|[!r][!r][!r]:yes:*|*r*:yes:yes) 159 *f*:*:*|[!r]:yes:*|[!r][!r]:yes:*|[!r][!r][!r]:yes:*|*r*:yes:yes)
160 if ${TEST} -f "$file"; then 160 if ${TEST} -f "$file"; then
161 ${ECHO} "${PKGNAME}: $file already exists" 161 ${ECHO} "${PKGNAME}: $file already exists"
162 elif ${TEST} -h "$file"; then 
163 ${ECHO} "${PKGNAME}: $file is a symlink" 
164 elif ${TEST} -f "$f_eg" -o -c "$f_eg"; then 162 elif ${TEST} -f "$f_eg" -o -c "$f_eg"; then
165 ${ECHO} "${PKGNAME}: copying $f_eg to $file" 163 ${ECHO} "${PKGNAME}: copying $f_eg to $file"
166 ${CP} $f_eg $file 164 ${CP} $f_eg $file
167 case $f_user in 165 case $f_user in
168 "") ;; 166 "") ;;
169 *) ${CHOWN} $f_user $file ;; 167 *) ${CHOWN} $f_user $file ;;
170 esac 168 esac
171 case $f_group in 169 case $f_group in
172 "") ;; 170 "") ;;
173 *) ${CHGRP} $f_group $file ;; 171 *) ${CHGRP} $f_group $file ;;
174 esac 172 esac
175 case $f_mode in 173 case $f_mode in
176 "") ;; 174 "") ;;