[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

dpkg/dlocate wrapper



Hi all,

I have written a script that allows transparent access to dpkg or
dlocate. If you run an option supported by dlocate (a faster dpkg
implementation) it runs it; instead it will run normal dpkg.

So if you want to get the status of a package, it will call dlocate,
but if you want to install one, it will call dpkg.

It could be better for this script to be called simply 'dpkg' and then
rename the real dpkg to, for example, 'dpkg-real'. Then, dselect or
apt could call always this script, and if it's the case, work faster.

Look at the attached file.

Any suggestion is welcome :-)
Bye!

-- 
Do you really think win is easy to use?

---------------------------------------
Juli-Manel Merino Vidal <jmmv@mail.com>
    Running Debian GNU/Linux woody
---------------------------------------
#!/bin/sh
# Wrapper program to call dlocate (fast dpkg implementation) or dpkg
# depending on the options passed to it.
# Created by Julio Merino <jmmv@mail.com>

DPKG=/usr/bin/dpkg
DLOCATE=/usr/bin/dlocate

DLOCATE_OPTS="-S -L -l -s -ls -du -conf -lsconf -md5sum -md5check -man"

if [ -x $DLOCATE ]; then
    for opt in $DLOCATE_OPTS; do
        if [ "$opt" == "$1" ]; then
            $DLOCATE $@
            exit 1
        fi
    done
fi

$DPKG $@

Reply to: