File: remove-base

package info (click to toggle)
base-files 4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 228 kB
  • ctags: 8
  • sloc: sh: 172; makefile: 68
file content (21 lines) | stat: -rwxr-xr-x 641 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
set -e
rm -f /var/lib/dpkg/base.*
cd /var/lib/dpkg
if grep -q "^Package: base$" status; then
cp status status.bak
awk '
$0 == "Package: base" { state=1 }
state != 1 { print $0 }
state == 1 && $0 == "" { state=2 }
' status > status.new
mv status.new status
echo "Done."
echo
echo "The /var/lib/dpkg/status file has been modified to remove references to"
echo "the \`base' package, and all the /var/lib/dpkg/base.* files have been"
echo "removed. The file \`status.bak' contains a backup of the old \`status'"
echo "file, in case something went wrong."
else
echo "Not changing \`status' file since it does not seem to list base."
fi