summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-03-10 17:53:22 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2014-03-13 13:58:46 +0100
commitb9b0f6222c489db78331cc8be3c093538d22c70b (patch)
tree173f255d53371aad0846c3ccbeec44d321cfe838 /debian
parent52922e2a6795aadcbb8dd11bba14db0f05da34c6 (diff)
use a configurable list of versioned kernel packages
With APT::VersionedKernelPackages users have the option of adding packages like pre-build out-of-tree modules to the list of automatically protected from being autoremoved.
Diffstat (limited to 'debian')
-rw-r--r--debian/apt.auto-removal.sh21
-rw-r--r--debian/apt.conf.autoremove9
2 files changed, 20 insertions, 10 deletions
diff --git a/debian/apt.auto-removal.sh b/debian/apt.auto-removal.sh
index d105f440a..9c4a4157d 100644
--- a/debian/apt.auto-removal.sh
+++ b/debian/apt.auto-removal.sh
@@ -72,22 +72,23 @@ $previous_version
EOF
)
-cat > "$config_file".dpkg-new <<EOF
+generateconfig() {
+ cat <<EOF
// File autogenerated by $0, do not edit
APT
{
NeverAutoRemove
{
EOF
-for kernel in $kernels; do
- echo " \"^linux-image-${kernel}$\";" >> "$config_file".dpkg-new
- echo " \"^linux-image-extra-${kernel}$\";" >> "$config_file".dpkg-new
- echo " \"^linux-signed-image-${kernel}$\";" >> "$config_file".dpkg-new
- echo " \"^linux-backports-modules-.*-${kernel}$\";" >> "$config_file".dpkg-new
- echo " \"^linux-headers-${kernel}$\";" >> "$config_file".dpkg-new
-done
-cat >> "$config_file".dpkg-new <<EOF
+ apt-config dump --no-empty --format '%v%n' 'APT::VersionedKernelPackages' | while read package; do
+ for kernel in $kernels; do
+ echo " \"^${package}-${kernel}$\";"
+ done
+ done
+ cat <<EOF
};
};
EOF
-mv "$config_file".dpkg-new "$config_file"
+}
+generateconfig > "${config_file}.dpkg-new"
+mv "${config_file}.dpkg-new" "$config_file"
diff --git a/debian/apt.conf.autoremove b/debian/apt.conf.autoremove
index 9684c9c7d..ea68f88fc 100644
--- a/debian/apt.conf.autoremove
+++ b/debian/apt.conf.autoremove
@@ -9,6 +9,15 @@ APT
"^gnumach-image.*";
};
+ VersionedKernelPackages
+ {
+ "linux-image";
+ "linux-image-extra";
+ "linux-signed-image";
+ "linux-backports-modules-.*";
+ "linux-headers";
+ };
+
Never-MarkAuto-Sections
{
"metapackages";