[Bug 939528] [NEW] auto-upgrade-tester: Add a post-upgrade test to check for obsolete config files

Jean-Baptiste Lallement jean-baptiste at ubuntu.com
Thu Feb 23 14:07:19 UTC 2012


Public bug reported:

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

** Affects: update-manager (Ubuntu)
     Importance: Medium
     Assignee: Jean-Baptiste Lallement (jibel)
         Status: Triaged


** Tags: amd64 apport-bug precise

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to update-manager in Ubuntu.
https://bugs.launchpad.net/bugs/939528

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

Status in “update-manager” package in Ubuntu:
  Triaged

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/939528/+subscriptions




More information about the foundations-bugs mailing list