#!/bin/sh set -e if [ "$1" = purge ] ; then eval $(apt-config shell sourcesparts Dir::Etc::sourceparts/d) rm -f /etc/apt/apt-build.conf "$sourcesparts"apt-build.list rm -rf /var/cache/apt-build/ # prepare APT and apt-build information eval $(apt-config shell etcdir Dir::Etc) eval $(apt-config shell sourceslist Dir::Etc::sourcelist) eval $(apt-config shell sourcesparts Dir::Etc::sourceparts) sourceslist=/"$etcdir""$sourceslist" sourcesparts=/"$etcdir""$sourcesparts" aptbuildsource="$sourcesparts"/apt-build.list ## remove repository directory if it is empty #db_get apt-build/repository_dir #repository_dir="$RET" #if [ $(zcat "$repository_dir"/Packages.gz | wc -l) -eq 0 ] ; then # rm -rf "$repository_dir" #fi # ## remove build directory if it is empty #db_get apt-build/build_dir #build_dir="$RET" #if [ -d "$build_dir" ] && [ ! $(ls -A "$build_dir") ] ; then # rm -rf "$build_dir" #fi # remove apt-build.list resource file if [ -f "$aptbuildsource" ] ; then rm -f "$aptbuildsource" fi fi # remove obsolete config file from apt-build <= 0.12.37 if dpkg-maintscript-helper supports rm_conffile 2>/dev/null ; then dpkg-maintscript-helper rm_conffile /etc/apt/sources.list.d/apt-build -- "$@" fi # Automatically added by dh_installdebconf/13.3.3 if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule db_purge fi # End automatically added section