From d27595922c92f0ee09455f1d63aeacdd68342076 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 2 Dec 2009 03:20:26 +0100 Subject: [PATCH] Added a new "preserve" var for build templates. When a package has this defined, its files won't be removed after a removal or upgrade process. This should be used in a few cases, mostly for the kernel pkg to always preserve a working kernel+modules. --HG-- extra : convert_revision : 03b19d1df2b029b6671865072b4d9529b0b86aa4 --- xbps-src/shutils/metadata.sh | 6 ++++++ xbps-src/shutils/tmpl_funcs.sh | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/xbps-src/shutils/metadata.sh b/xbps-src/shutils/metadata.sh index ef0bb0baca..abbfa9ed9a 100644 --- a/xbps-src/shutils/metadata.sh +++ b/xbps-src/shutils/metadata.sh @@ -289,6 +289,12 @@ _EOF echo "" >> $TMPFPROPS fi + # pkg needs to preserve its files after removal/upgrade? + if [ -n "$preserve" ]; then + echo "preserve" >> $TMPFPROPS + echo "" >> $TMPFPROPS + fi + # Dependencies if [ -n "$run_depends" ]; then echo "run_depends" >> $TMPFPROPS diff --git a/xbps-src/shutils/tmpl_funcs.sh b/xbps-src/shutils/tmpl_funcs.sh index dec0aefff1..b21c2a0ad3 100644 --- a/xbps-src/shutils/tmpl_funcs.sh +++ b/xbps-src/shutils/tmpl_funcs.sh @@ -71,7 +71,7 @@ reset_tmpl_vars() post_configure post_build post_install nostrip \ make_install_target version revision essential \ sgml_catalogs xml_catalogs xml_entries sgml_entries \ - disable_parallel_build run_depends font_dirs \ + disable_parallel_build run_depends font_dirs preserve \ only_for_archs conf_files keep_libtool_archives \ noarch subpackages sourcepkg gtk_iconcache_dirs \ abi_depends api_depends triggers openrc_services \