File: postrm

package info (click to toggle)
debdelta 0.67
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye
  • size: 1,016 kB
  • sloc: python: 6,466; perl: 1,398; sh: 965; xml: 727; ansic: 215; makefile: 121; awk: 21
file content (30 lines) | stat: -rw-r--r-- 497 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
set -e

GPG_HOME=/etc/debdelta/gnupg

check1it () {
 (
  cd ${GPG_HOME}
  test -f sha1_hashes.txt && sha1sum -c --quiet sha1_hashes.txt
 )
}

if [ "$1" = purge ] ; then
  if  [ -r /var/lib/debdelta ] ; then
    rm -r /var/lib/debdelta
  fi

  if check1it ; then
    (
      cd ${GPG_HOME}
      rm -f pubring.gpg  secring.gpg  trustdb.gpg
      if test -f pubring.gpg~ ; then
          rm -f pubring.gpg~
      fi
      rm -f sha1_hashes.txt
    )
    rmdir ${GPG_HOME} || true
  fi

fi