~ubuntu-branches/ubuntu/hardy/sbuild/hardy

« back to all changes in this revision

Viewing changes to debian/sbuild.postrm

  • Committer: Bazaar Package Importer
  • Author(s): Roger Leigh, Jan-Marek Glogowski
  • Date: 2008-01-01 11:36:55 UTC
  • mfrom: (8.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080101113655-rxlefdonr61fnikq
Tags: 0.57.0-1
* Sbuild/*.pm: Reindent to increase readability.
* Sbuild/Chroot.pm: set APT::Install-Recommends to false inside the
  chroot (Closes: #449253).
* Sbuild/Conf.pm: Add and export $check_depends_algorithm.
  [Jan-Marek Glogowski]
* sbuild:
  - Reindent to increase readability.
  - Add additional syntax checks.  Thanks to Jan-Marek Glogowski.
  - build: Use unicode line drawing characters instead of ASCII.
  - filter_dependencies: Remove redundant conditional.
    [Jan-Marek Glogowski]
  - Add check for check-depends-algorithm option. [Jan-Marek Glogowski]
  - filter_dependencies: Change dependency behaviour depending upon
    check_depends_algorithm.  [Jan-Marek Glogowski]
  - Move to bin/.
* avg-pkg-build-time:
  - Move to bin/.
* bin/*: Reindent to increase readability.
* chroot/*: Reindent to increase readability.
* bin/sbuild-createchroot:
  - Moved from chroot/buildd.chroot.
  - Also install fakeroot and build-essential.
* sbuild-createchroot.1.in: Add manual page.
* chroot/buildd.chroot:
  - Add GPL boilerplate.
  - Remove /etc/passwd creation (already done by debootstrap).
  - Remove sbuild directory creation (already done by schroot).
  - Use here doc to set up /etc/apt/sources.list.
  - List sources.list.
* chroot/README: Rename from README.buildd-chroot.  Remove
  buildd.chroot section.
* example.sbuildrc: Add missing variable types.  [Jan-Marek Glogowski]
* example.sbuildrc: Add missing variable types and add
  $check_depends_algorithm.  [Jan-Marek Glogowski]
* sbuild.1: Document --check-depends-algorithm [Jan-Marek Glogowski]
* Move manual pages to man/.
* debian/manpages: Move manual pages to man/.
* sbuild.conf: Move to etc/.
* example.sbuildrc: Move to etc/.
* debian/compat: Move to debhelper v6 compatibility level.
* debian/control: Update to Standards-Version 3.7.3.
* debian/copyright:
  - Update git repository location.
  - Update GPL boilerplate.
* debian/sbuild.dirs:
  - Rename from debian/dirs.
  - Remove all but -var/lib/sbuild/srcdep-lock.
* debian/manpages: Remove.
* debian/sbuild.postinst: Rename from debian/postinst.
* debian/sbuild.preinst: Rename from debian/preinst.
* debian/sbuild.postrm: Rename from debian/postrm.
* debian/sbuild.install:
  - New file.
  - Install files from usr/sbin and usr/share/man/man8.
* debian/rules:
  - Install sbuild-createchroot, and add buildd.chroot compatibility
    symlink.
  - Move -stamp files to debian/.
  - Remove GENFILES.
  - Run configure, make, and make install in appropriate rules.
  - Use dh_install.
  - Remove all special-cased installation rules (now handled by automake).
* Note: All upstream changes are now in an upstream ChangeLog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
# postrm script for sbuild
 
3
#
 
4
# see: dh_installdeb(1)
 
5
 
 
6
set -e
 
7
 
 
8
# summary of how this script can be called:
 
9
#        * <postrm> `remove'
 
10
#        * <postrm> `purge'
 
11
#        * <old-postrm> `upgrade' <new-version>
 
12
#        * <new-postrm> `failed-upgrade' <old-version>
 
13
#        * <new-postrm> `abort-install'
 
14
#        * <new-postrm> `abort-install' <old-version>
 
15
#        * <new-postrm> `abort-upgrade' <old-version>
 
16
#        * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
 
17
# for details, see /usr/share/doc/packaging-manual/
 
18
 
 
19
PACKAGE="sbuild"
 
20
 
 
21
# Remove a conffile which has been forgotten by dpkg
 
22
# If the file does not exist, or is owned by any package, do not remove it.
 
23
rm_conffile() {
 
24
    CONFFILE="$1"
 
25
 
 
26
    local delete="false"
 
27
 
 
28
    if [ -f "$CONFFILE" ]; then
 
29
        local fpkg=""
 
30
        local pkg=""
 
31
        if fpkg=$(dpkg -S "$CONFFILE" 2>/dev/null); then
 
32
            # Don't delete, but check which package it came from.
 
33
            pkg=$(echo $fpkg | sed -e  's/\(^[[:print:]][[:print:]]*\): .*$/\1/')
 
34
            if [ "$pkg" = "$PACKAGE" ]; then
 
35
                delete="true"
 
36
            fi
 
37
        else
 
38
            rm -f "$CONFFILE"
 
39
            delete="true"
 
40
        fi
 
41
    else
 
42
        delete="true"
 
43
    fi
 
44
 
 
45
    # Remove dpkg cruft
 
46
    if [ "$delete" = "true" ]; then
 
47
        rm -f "${CONFFILE}.dpkg-old"
 
48
        rm -f "${CONFFILE}.dpkg-new"
 
49
        rm -f "${CONFFILE}.dpkg-dist"
 
50
    fi
 
51
}
 
52
 
 
53
case "$1" in
 
54
 
 
55
    remove|upgrade|failed-upgrade|abort-install|abort-upgrade)
 
56
 
 
57
        ;;
 
58
 
 
59
    purge|disappear)
 
60
 
 
61
        if [ -z "`getent group sbuild`" ]; then
 
62
            deluser --group sbuild
 
63
        fi
 
64
 
 
65
        rm_conffile "/etc/sbuild.conf"
 
66
        rm_conffile "/etc/sbuild.conf.local"
 
67
 
 
68
        rm -f /var/lib/sbuild/apt.conf
 
69
        rm -f /var/lib/sbuild/avg-build-space
 
70
        rm -f /var/lib/sbuild/avg-build-times
 
71
        rm -f /var/lib/sbuild/source-dependencies-*
 
72
 
 
73
        ;;
 
74
 
 
75
    *)
 
76
 
 
77
        echo "postrm called with unknown argument \`$1'" >&2
 
78
        exit 0
 
79
 
 
80
        ;;
 
81
esac
 
82
 
 
83
# dh_installdeb will replace this with shell code automatically
 
84
# generated by other debhelper scripts.
 
85
 
 
86
#DEBHELPER#
 
87
 
 
88
exit 0