summaryrefslogtreecommitdiffstats
path: root/urpmf
blob: 8246179cc67e7f5bab31c3adf3604622ceb9ab92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

unalias ls 2>/dev/null

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

dir="/var/lib/urpmi"


if ls $dir/hdlist.*.gz >/dev/null 2>/dev/null; then
    found=1
    gzip -dc $dir/hdlist.*.gz | hdlist2files - | grep -E "$1"
fi
if ls $dir/hdlist.*.cz2 >/dev/null 2>/dev/null; then
    found=1
    bzip2 -dcq $dir/hdlist.*.cz2 | hdlist2files - | grep -E "$1"
fi
if [ "$found" != "1" ]; then
    echo "urpmi is not installed"
    exit 1
fi