auto-upgrade-tester: Add a post-upgrade test to check for obsolete config files

Bug #939528 reported by Jean-Baptiste Lallement
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)
Fix Released
Medium
Jean-Baptiste Lallement

Bug Description

auto-upgrade-tester: Add a post-upgrade test to check for obsolete config files.
Test fails if the list is not empty.

Script from upgrade-system
  #################################
  ### REMOVING OBSOLETE CONFIGS ###
  #################################
  echo "${BOLD}D) Checking for obsolete configurations:${RESET}"
  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

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :
Changed in update-manager (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
assignee: nobody → Jean-Baptiste Lallement (jibel)
milestone: none → ubuntu-12.04-beta-2
description: updated
description: updated
summary: - auto-upgrade-tester: Add a post-upgrade test to check for obsolete files
+ auto-upgrade-tester: Add a post-upgrade test to check for obsolete
+ config files
description: updated
Revision history for this message
Martin-Éric Racine (q-funk) wrote :

Packages spotted by the above recipe need to have a bug filed, requesting that the package calls dpkg-maintscript-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.

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
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

I pushed a script update-manager/AutoUpgradeTester/post_upgrade_tests/test_obsolete_conffiles.py to the auto-upgrade-tester that will be active with next run.

Changed in update-manager (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.