Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Preserve files under $PKG_DBDIR that don't belong to pkg_tools (see pkg_add(1)). This includes +IGNOREME and distfiles as used by portmaster(8). Fixes #364
Matthew Seaman committed 13 years ago
commit fbd4efd4a3222078bdd0d31369e52ff3ad047baf
parent 7e3f8df
1 file changed +11 -1
modified ports/pkg2ng
@@ -101,7 +101,17 @@ else
	for PKG in $( pkg_info -Ea ); do
		DB="${PKGDB}/${PKG}"
		if [ -e ${DB} ]; then
-
			mv ${DB} ${PKGBAK}/${PKG}
+
			cp -pr ${DB} ${PKGBAK}/${PKG}
+
			# Remove only the files documented in
+
			# pkg_add(1), then remove ${DB} only if empty
+
			for f in +COMMENT +CONTENTS +DEINSTALL +DESC \
+
                                 +DISPLAY +INSTALL +MTREE_DIRS \
+
			         +POST-DEINSTALL +POST-INSTALL  +REQUIRE \
+
                                 +REQUIRED_BY ;
+
			do
+
			    rm ${DB}/$f
+
			done
+
			rmdir ${DB} 2>/dev/null || true
			MOVED=1
		fi
	done