Bug#325396: try apt.conf hook
Chapter 4 of the file hiearchy standard says that /usr should not be
written to. The unpacking of the source into /usr in a postinst would
create data that lives outside of the dpkg database, so unpacking source
there automatically would be a violation of the FHS, in my opinion.
Creation of data somewhere under /var, or in a user-configurable
location is an option, but not one I'm fond of. What happens if source
is already unpacked there? We wouldn't want to overwrite an existing
buildtree that potentially has modifications. What happens when we run
out of disk space? Apt can't easily detect this ahead of time, so this
will cause the upgrade to fail, or leave something partially extracted.
However, you probably know what you want to happen in these cases, so I
think you can accomplish it by writing an apt hook. See:
You can write a Pre-Install-Pkgs hook that detects if a new
kernel-source package is being installed. If so, it can trigger some
action that will wait for apt to complete and then trigger an extraction
to whatever location you want.
Another option would be a Post-Invoke hook that compares the timestamp
or md5sum of the kernel-source tarballs it finds in /usr, and if one has
changed (or one has been added), perform the extraction.
Does this sound reasonable?
dann frazier <email@example.com>