File: remove-base

package info (click to toggle)
base-files 5lenny11
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 312 kB
  • ctags: 6
  • sloc: sh: 173; makefile: 61
file content (21 lines) | stat: -rwxr-xr-x 646 bytes parent folder | download
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/info/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