preinst is in acpi-support 0.140.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | #!/bin/sh
# Remove a no-longer used conffile (from http://wiki.debian.org/DpkgConffileHandling)
rm_conffile() {
PKGNAME="$1"
CONFFILE="$2"
if [ -e "$CONFFILE" ]; then
md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\'^ $CONFFILE[[:space:]]'{s/ obsolete$//;s/.* //p}\"`"
if [ "$md5sum" != "$old_md5sum" ]; then
echo "Obsolete conffile $CONFFILE has been modified by you."
echo "Saving as $CONFFILE.dpkg-bak ..."
mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
else
echo "Removing obsolete conffile $CONFFILE ..."
rm -f "$CONFFILE"
fi
fi
}
rm_confdir() {
DIRNAME="$1"
if [ -d "$DIRNAME" ]; then
rmdir --ignore-fail-on-non-empty "$DIRNAME"
fi
}
case "$1" in
install|upgrade)
if dpkg --compare-versions "$2" le "0.107"; then
rm_conffile acpi-support "/etc/modprobe.d/thinkpad_acpi.modprobe"
fi
if dpkg --compare-versions "$2" le "0.108"; then
rm_conffile acpi-support "/etc/acpi/events/lenovo-eject"
fi
if dpkg --compare-versions "$2" le "0.116"; then
for conffile in events/ibm-sleepbtn events/ibm-lockbtn \
thinkpad-lockorbattery.sh events/ibm-hibernatebtn \
events/lenovo-lockbtn events/ibm-videobtn \
events/thinkpad-mute always-mute.sh \
events/thinkpad-volume-down events/thinkpad-volume-up \
events/thinkpad-zoom thinkpad-zoom.sh \
events/thinkpad-thinklight thinkpad-thinklight.sh \
events/tosh-brightness-up events/tosh-brightness-down \
events/tosh-mute events/tosh-sleep events/sony-hibernate \
events/sony-brightness-up events/sony-brightness-down \
sonybright.sh events/thinkpad-brightness-down \
events/thinkpad-brightness-up thinkpad-brightness-up.sh \
thinkpad-brightness-down.sh
do
rm_conffile acpi-support "/etc/acpi/${conffile}"
done
fi
if dpkg --compare-versions "$2" le-nl "0.117"; then
rm_conffile acpi-support "/etc/acpi/events/asus-mail"
fi
if dpkg --compare-versions "$2" le-nl "0.119"; then
rm_conffile acpi-support /etc/init.d/vbesave
rm_conffile acpi-support /etc/acpi/resume.d/17-video-restore.sh
rm_conffile acpi-support /etc/acpi/suspend.d/80-video-vesa-state.sh
rm_conffile acpi-support /etc/acpi/suspend.d/80-video-pci-state.sh
update-rc.d vbesave remove
fi
if dpkg --compare-versions "$2" le-nl "0.120"; then
rm_conffile acpi-support /etc/acpi/suspend.d/88-time.sh
rm_conffile acpi-support /etc/acpi/resume.d/50-time.sh
rm_conffile acpi-support /etc/modprobe.d/toshiba_acpi.modprobe
fi
if dpkg --compare-versions "$2" lt-nl "0.121"; then
rm_conffile acpi-support /etc/modprobe.d/ibm_acpi.modprobe
fi
if dpkg --compare-versions "$2" lt-nl "0.122"; then
# Mass removal of suspend.d and resume.d hooks
rm_conffile acpi-support /etc/acpi/resume.d/10-thinkpad-standby-led.sh
rm_conffile acpi-support /etc/acpi/resume.d/13-855-resolution-set.sh
rm_conffile acpi-support /etc/acpi/resume.d/15-video-post.sh
rm_conffile acpi-support /etc/acpi/resume.d/35-modules-load.sh
rm_conffile acpi-support /etc/acpi/resume.d/40-infra-red.sh
rm_conffile acpi-support /etc/acpi/resume.d/49-855-resolution-set.sh
rm_conffile acpi-support /etc/acpi/resume.d/50-framebuffer-enable.sh
rm_conffile acpi-support /etc/acpi/resume.d/50-tosh-restore-brightness.sh
rm_conffile acpi-support /etc/acpi/resume.d/55-screen.sh
rm_conffile acpi-support /etc/acpi/resume.d/58-proc-sysfs-restore-state.sh
rm_conffile acpi-support /etc/acpi/resume.d/60-asus-wireless-led.sh
rm_conffile acpi-support /etc/acpi/resume.d/62-ifup.sh
rm_conffile acpi-support /etc/acpi/resume.d/65-console.sh
rm_conffile acpi-support /etc/acpi/resume.d/67-sound.sh
rm_conffile acpi-support /etc/acpi/resume.d/69-services.sh
rm_conffile acpi-support /etc/acpi/resume.d/72-acpi-pain.sh
rm_conffile acpi-support /etc/acpi/resume.d/90-hdparm.sh
rm_conffile acpi-support /etc/acpi/resume.d/90-thinkpad-unstandby-led.sh
rm_conffile acpi-support /etc/acpi/resume.d/90-xscreensaver.sh
rm_conffile acpi-support /etc/acpi/resume.d/98-acpi-unlock.sh
rm_conffile acpi-support /etc/acpi/suspend.d/05-acpi-lock.sh
rm_conffile acpi-support /etc/acpi/suspend.d/10-thinkpad-standby-led.sh
rm_conffile acpi-support /etc/acpi/suspend.d/30-proc-sysfs-save-state.sh
rm_conffile acpi-support /etc/acpi/suspend.d/50-irda-stop.sh
rm_conffile acpi-support /etc/acpi/suspend.d/50-tosh-save-brightness.sh
rm_conffile acpi-support /etc/acpi/suspend.d/55-down-interfaces.sh
rm_conffile acpi-support /etc/acpi/suspend.d/60-generate-modules-list.sh
rm_conffile acpi-support /etc/acpi/suspend.d/65-services-stop.sh
rm_conffile acpi-support /etc/acpi/suspend.d/70-modules-unload.sh
rm_conffile acpi-support /etc/acpi/suspend.d/75-console-switch.sh
rm_conffile acpi-support /etc/acpi/suspend.d/85-alsa-state.sh
rm_conffile acpi-support /etc/acpi/suspend.d/90-framebuffer-stop.sh
rm_confdir /etc/acpi/resume.d
rm_confdir /etc/acpi/suspend.d
rm_conffile acpi-support /etc/acpi/prepare.sh
rm_conffile acpi-support /etc/acpi/resume.sh
fi
if dpkg --compare-versions "$2" lt-nl "0.123"; then
rm_conffile acpi-support /etc/acpi/events/asus-volume-down
rm_conffile acpi-support /etc/acpi/events/asus-volume-up
rm_conffile acpi-support /etc/acpi/events/asus-volume-mute
fi
if dpkg --compare-versions "$2" lt-nl "0.124"; then
rm_conffile acpi-support /etc/acpi/events/sony-eject
rm_conffile acpi-support /etc/acpi/events/panasonic-hibernatebtn
rm_conffile acpi-support /etc/acpi/events/panasonic-sleepbtn
rm_conffile acpi-support /etc/acpi/ac.d/90-hdparm.sh
rm_conffile acpi-support /etc/acpi/battery.d/90-hdparm.sh
fi
if dpkg --compare-versions "$2" lt-nl "0.126"; then
for conffile in start.d/10-save-dmidecode.sh \
panapower.sh events/panasonic-brightness-down \
events/panasonic-brightness-up panabright.sh \
events/panasonic-mute events/panasonic-volume-down \
events/panasonic-volume-up events/asus-a6u-touchpad \
events/asus-internet events/asus-lock \
events/asus-media-next events/asus-media-play-pause \
events/asus-media-prev events/asus-media-stop \
events/asus-wireless events/thinkpad-thinkpad \
thinkpad-thinkpad.sh toshbright.sh hibernatebtn.sh \
wireless.sh events/video_brightnessup \
events/video_brightnessdown video_brightnessup.sh \
video_brightnessdown.sh
do
rm_conffile acpi-support "/etc/acpi/${conffile}"
done
rm_confdir /etc/acpi/ac.d
rm_confdir /etc/acpi/battery.d
fi
if dpkg --compare-versions "$2" lt-nl "0.127"; then
rm_conffile acpi-support /etc/acpi/start.d/90-hdparm.sh
fi
if dpkg --compare-versions "$2" lt-nl "0.132"; then
rm_conffile acpi-support /etc/acpi/start.d/60-asus-wireless-led.sh
rm_confdir /etc/acpi/start.d
rm_conffile acpi-support /etc/acpi/asus-wireless-2.sh
rm_conffile acpi-support /etc/acpi/events/asus-wireless-2
fi
if dpkg --compare-versions "$2" lt-nl "0.134";then
rm_conffile acpi-support /etc/acpi/events/asus-eee-volume-up
rm_conffile acpi-support /etc/acpi/events/asus-eee-volume-down
rm_conffile acpi-support /etc/acpi/events/asus-eee-volume-mute
fi
if dpkg --compare-versions "$2" lt-nl "0.138"; then
rm_conffile acpi-support /etc/acpi/events/sony-volume-up
rm_conffile acpi-support /etc/acpi/events/sony-volume-down
rm_conffile acpi-support /etc/acpi/events/sony-mute
rm_conffile acpi-support /etc/acpi/events/sony-sleep
rm_conffile acpi-support /etc/acpi/volupbtn.sh
rm_conffile acpi-support /etc/acpi/voldownbtn.sh
rm_conffile acpi-support /etc/acpi/mutebtn.sh
fi
esac
|