Subject: Emergency maintenance on dpkg database

From: [email-masked]
Date: 2 Jul 1996 15:07:53 -0000

Here's a script to redefine dpkg's idea of what files are in a
package.  For example, to add all files in /tmp/lib to aout-librl,
use 
 (dpkg -L aout-librl; cat /tmp/lib) | dpkg-redefine aout-librl

#!/bin/sh
list=/var/lib/dpkg/info/$1.list
if [ ! -f $list ]; then
	echo "$1 is not in dpkg's database"
	exit 1
fi
cat >$list.tmp
cp $list $list.bak
mv $list.tmp $list

-- 
Raul

---

From: Craig Sanders <[email-masked]>
Date: Thu, 4 Jul 1996 09:18:20 +1000 (EST)

this one displays a list of all man pages associated with a package.

use like so:

$ dpkg-man dpkg
1 md5sum
1 dpkg-name
5 deb
5 deb-control
8 dpkg
8 dpkg-deb
8 update-rc.d
8 start-stop-daemon
8 update-alternatives
8 install-info

or

$ man `dpkg-man dpkg`

i wrote this when i first installed netatalk and needed to read all of
the documentation so I could configure it :-)

this script is public domain.  If Ian J likes it, he's quite welcome to
include it in dpkg.  I find it useful sometimes.

---cut here--- dpkg-man ---cut here---
#! /bin/sh

# displays a list of all the man pages contained within an installed
# debian package.
#
# $1 - debian package name

dpkg -L $1 | \
  grep "man.*/.*\.[0-9]" | \
	  xargs -n 1 basename | \
	    sed -e 's/\(.*\)\.\(.*\)/\2 \1/'
---cut here--- dpkg-man ---cut here---

Craig

---

From: Richard Kettlewell <[email-masked]>
Date: Thu, 4 Jul 96 13:08:08 +0100 (BST)

>---cut here--- dpkg-man ---cut here---

How about this:

dpkg -L $1 | \
  grep "man.*/.*\.[0-9]" | \
          sed -e 's/^.*\/\([^\/]*\)\.\(.*\)/\2 \1/'

You should be able to cut the number of processes even further by
using awk or perl instead of grep and sed...

- Richard

---

From: Craig Sanders <[email-masked]>
Date: Fri, 5 Jul 1996 01:01:21 +1000 (EST)

>           sed -e 's/^.*\/\([^\/]*\)\.\(.*\)/\2 \1/'

yep, that's better.

> using awk or perl instead of grep and sed...

in fact, it can be done entirely with sed.  perl's nice but much bigger
than sed.

dpkg -L dpkg | \
  sed -n -e '/man.*\/.*[0-9]/s/^.*\/\([^\/]*\)\.\(.*\)/\2 \1/p'

Craig

---

From: Lars Wirzenius <[email-masked]>
Date: Fri, 05 Jul 1996 04:47:36 +0300

[ NB: I read the list.  Don't CC replies to me.  I pay for my PPP.  Thanks ]

> using awk or perl instead of grep and sed...

Or sed.

dpkg -L "$1" | sed '/man.*\.[0-9]/s/^.*\/\([^\/]*\)\.\(.*\)/\2 \1/p;d'

Something similar will go into Debiandoc, once I start on the queries.
(But it will find Info files, /usr/doc/<package>, and so on, as well.
I hope.)

---

From: Ian Jackson <[email-masked]>
Date: Wed, 10 Jul 96 00:06 BST

>  (dpkg -L aout-librl; cat /tmp/lib) | dpkg-redefine aout-librl

Note that doing this while dpkg is running is likely to cause serious
grief, and of course I reserve the right to change the format of the
file lists and the way they're stored.

Ian.