auto-upgrade-tester: Add a post-upgrade test to check for obsolete config files
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
update-manager (Ubuntu) |
Fix Released
|
Medium
|
Jean-Baptiste Lallement |
Bug Description
auto-upgrade-
Test fails if the list is not empty.
Script from upgrade-system
#####
### REMOVING OBSOLETE CONFIGS ###
#####
echo "${BOLD}D) Checking for obsolete configurations:
ORPHANS=$( dpkg-query -W -f='${Conffiles}\n' | grep obsolete | awk {'print $1'} )
##DEPENDS: dpkg (main/required), grep (main/required), mawk (main/required).
case $ORPHANS in
"")
echo "I: No obsolete configuration to purge."
break
;;
*)
echo "I: Removing obsolete configurations..."
unique(){
dpkg -S $ORPHANS | cut -d ':' -f 1 | uniq
##DEPENDS: dpkg (main/required), dpkg (main/required), coreutils (main/required).
}
UNIQUE=$( unique )
NUMBER=$( unique | wc -l )
echo "I: Number of packages affected: $NUMBER."
dpkg -S $ORPHANS
##DEPENDS: dpkg (main/required).
echo "${YELLOW}W: BEWARE OF FALSE POSITIVES! DELETE WITH EXTREME CAUTION!${RESET}"
rm -i $ORPHANS
##DEPENDS: coreutils (main/required).
apt-get $NOTTY --reinstall install ${UNIQUE}
##DEPENDS: apt (main/important).
### Escape dangerous purges automatically.
if [ $? != 0 ]
then
break
fi
;;
esac
Changed in update-manager (Ubuntu): | |
assignee: | Jean-Baptiste Lallement (jibel) → Aaron Albright (albrigha) |
Changed in update-manager (Ubuntu): | |
assignee: | Aaron Albright (albrigha) → Jean-Baptiste Lallement (jibel) |
status: | Triaged → In Progress |
Packages spotted by the above recipe need to have a bug filed, requesting that the package calls dpkg-maintscrip t-helper via debian/ *.maintscript content to either move (if there was a rename between versions) or remove the obsolete config, so as to achieve an upgrade that is free of accumulated cruft.