file corruption
I've had a problem with emacs, for a while: the DOC strings are not
right for my binary. I suspect that this is related to the symlink in
./etc/ which points to DOC.
More recently, I had a problem linking a program -- the error messages
indicated that my linking libraries were corrupt. So, I pulled down a
bunch of packages (for devel and emacs) from sunsite to re-install
them. Only thing is: dpkg is completely oriented towards the first
time user doing a first time install.
So, I ripped some code out of dpkg and build myself a pair of
utilities that assume I know what I'm doing, and allow myself to
reinstall a package.
Reinstalling fixed the linking problem, but not the emacs DOC problem.
They are inst_all [which installs all debian packages located in the
current directory], and inst [which takes argument of a floppy disk
device, will mount it and do inst_all]. So, instead of mucking around
with cpio and all, I just do `inst fd0` and everything on the floppy
gets installed.
There are no options on these programs, I'm providing them as
examples.
I don't guarantee that I understood all the implications of dpkg's
organization, so there may be some administrative aspects that these
programs don't deal with.
I put these in /sbin
-------------------- inst ------------------------
#!/bin/sh
mkdir -p /tmp/install
mount -t msdos /dev/$1 /tmp/install || exit 1
cd /tmp/install
inst_all /tmp/install
cd /
umount /tmp/install
rmdir /tmp/install
-------------------- inst_all --------------------
#!/bin/sh
DIR=`pwd`
cd /
for FILE in $DIR/*.deb
do
if [ -f $FILE ]
then :
else
echo $FILE does not exist.
exit 1
fi
if [ -f /var/adm/dpkg/desc/$PKG.desc ]
then
cat /var/adm/dpkg/desc/$PKG.desc
fi
PKG=`basename $FILE .deb`
echo -n Installing $PKG
zcat $FILE 2>>/var/adm/dpkg/dpkg.log | cpio -Vimud
echo done.
if [ -f /var/adm/dpkg/list/$PKG.list ]
then
if [ -f /var/adm/dpkg/perm/$PKG.perm ]
then
echo -n Fixing the permissions of $PKG ...
fixperms -q $PKG
echo done.
else
echo inst_all: Could not find fixperms for the package $PKG
exit 1
fi
else
echo inst_all: $PKG is not an installed package.
fi
echo
df
echo
echo "Installation of $PKG complete."
done
for INST in /var/adm/dpkg/inst/*.inst
do
if [ -f $INST ]
then
sh $INST && rm -f $INST
fi
done
Reply to: