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

Re: holding packages



Today, Bob Hilliard <hilliard@debian.org> wrote:
[snip script]
>      It is trivial to modify this to make dpkg-unhold.

Not quite, as there are (AFAIK) three selection statuses:
hold, install, uninstall.

So, I recommend this script (rudimentarily tested, should work):

----cut---
#! /bin/bash

# dpkg-hold  --  command line tool to flag package(s) as held.
#
# by Craig Sanders, 1998-10-26.  This script is hereby placed into the
# public domain.
# Modified by Andreas Fuchs, 2001-03-04 to allow setting to 3 different
# statuses
#
# BUGS: this script has absolutely no error checking.  this is not good.

if [ -z "$*" ] || echo $1 | egrep -v "(hold|install|deinstall)" >/dev/null
then
        echo "Usage:"
        echo "      dpkg-status status <package...>"
	echo " status is one of: hold, install, deinstall"
        exit 1
fi

TOHOLD=$1; shift

for i in $@ ; do
        echo "$i	$TOHOLD"
done | dpkg --set-selections
----cut---

HTH.
-- 
Andreas Fuchs, <asf@acm.org>, <d96001@htlwrn.ac.at>, antifuchs
Hail RMS! Hail Cthulhu! Hail Eris! All hail Discordia!



Reply to: