summaryrefslogtreecommitdiffstats
path: root/urpmf
blob: 9263537f1f8e2a9ae42ebc8d1857ce1083698351 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

if [ "$#" -gt 1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
    echo "usage: rpmf [<file>]"
    exit 1
fi

hdlist="/var/lib/urpmi/hdlist.*.gz"

if ! ls $hdlist >/dev/null 2>/dev/null; then
    echo "urpmi is not installed"
    exit 1
fi

if [ -z "$1" ]; then
	gzip -dc $hdlist | hdlist2files -
else
	gzip -dc $hdlist | hdlist2files - | grep $1
fi