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

Re: My experiences with experimental Gnome 2.6



On Mon, 2004-03-29 at 07:05, Ondřej Surý wrote:
> ondrej@ondrej:~$ cat /etc/apt/gen-preferences.sh
[...]

This script as posted seems to rely on there being a newline at
the end of preferences.in. Attached is a script which should do
the same job without the newline requirement.

Note that you'll need to redirect input to and output from this
script, however.

-- 
Joe Drew <hoserhead@woot.net> <drew@debian.org>

Just admit to yourself that you're a thief: http://me.woot.net/stealing.html
#!/bin/sh
 
while read LINE; do
    if [ ! -z "${LINE}" ]; then
        KEY=`echo $LINE | cut -f 1 -d :`
        DATA=`echo $LINE | cut -f 2- -d \ `
        case "${KEY}" in
            Source)
                SOURCE=`echo ${DATA} | tr -s "," " "`;
                ;;
            *)
                LINES="${LINES}\\n${LINE}"
                ;;
        esac
    fi
done

for source in `echo ${SOURCE}`; do
	for package in `apt-cache showsrc ${source} | grep Binary: | cut -f 2 -d : | tr -s "," " "`; do
	    echo -e "Package: ${package}${LINES}"
	    echo
	done
done
LINES=""


Reply to: