From 1ad7e33963d583ab7c56652c169e52980b4f89c0 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 06 Sep 2015 12:05:50 -0400 Subject: Manage pci.ids.gz with update-alternatives This way, the pciids-* packages can be coinstalled. --- diff --git a/build b/build index 8605614..5f55422 100755 --- a/build +++ b/build @@ -10,6 +10,6 @@ install: install -d -o 0 -g 0 -m 0755 pciids-full.data/usr/share/misc/ install -d -o 0 -g 0 -m 0755 pciids-reduced.data/usr/share/misc/ sed '/^#/d; /^[ \t]*$$/d;' src/pci.ids | gzip -9cn \ - >pciids-full.data/usr/share/misc/pci.ids.gz + >pciids-full.data/usr/share/misc/pci.ids.full.gz sed '/^#/d; /^[ \t]*$$/d; /^\t\t/d;' src/pci.ids | gzip -9cn \ - >pciids-reduced.data/usr/share/misc/pci.ids.gz + >pciids-reduced.data/usr/share/misc/pci.ids.reduced.gz diff --git a/pciids-full.pkg/postinst b/pciids-full.pkg/postinst new file mode 100644 index 0000000..c4d992f --- /dev/null +++ b/pciids-full.pkg/postinst @@ -0,0 +1,6 @@ +#!/bin/sh + +if [ "x${1}" = 'xconfigure' ]; then + update-alternatives --install /usr/share/misc/pci.ids.gz pci.ids \ + /usr/share/misc/pci.ids.full.gz 20 +fi diff --git a/pciids-full.pkg/prerm b/pciids-full.pkg/prerm new file mode 100644 index 0000000..fcbaf91 --- /dev/null +++ b/pciids-full.pkg/prerm @@ -0,0 +1,5 @@ +#!/bin/sh + +if [ "x${1}" = 'xremove' ]; then + update-alternatives --remove pci.ids /usr/share/misc/pci.ids.full.gz +fi diff --git a/pciids-reduced.pkg/postinst b/pciids-reduced.pkg/postinst new file mode 100644 index 0000000..14a6298 --- /dev/null +++ b/pciids-reduced.pkg/postinst @@ -0,0 +1,6 @@ +#!/bin/sh + +if [ "x${1}" = 'xconfigure' ]; then + update-alternatives --install /usr/share/misc/pci.ids.gz pci.ids \ + /usr/share/misc/pci.ids.reduced.gz 10 +fi diff --git a/pciids-reduced.pkg/prerm b/pciids-reduced.pkg/prerm new file mode 100644 index 0000000..9d8f883 --- /dev/null +++ b/pciids-reduced.pkg/prerm @@ -0,0 +1,5 @@ +#!/bin/sh + +if [ "x${1}" = 'xremove' ]; then + update-alternatives --remove pci.ids /usr/share/misc/pci.ids.reduced.gz +fi -- cgit v0.9.1