summaryrefslogtreecommitdiffstats
path: root/pkgdb1
blob: a421007c128b450d90d5c40c70b7c884a12d1195 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash

# Get the package name from the filename
# hackish, but should work for now
getpkgname() {
    local tmp

    tmp=${1##*/}
    tmp=${tmp%.pkg.tar.gz}
    tmp=${tmp%-i686}
    tmp=${tmp%-x86_64}
    echo ${tmp%-*-*}
}

STAGEDIR=$(pwd)

#This is our "unknown" category. We will have to do something about this later.
# It is a stop-gap
CATEGORY=25

SVNCO=$1
REPOTAG=$2
if [ "$SVNCO" = "" ]; then
    me=$(basename $0)
    echo "usage: $me <abs_dir> <repo_tag>" >&2
    exit 1
fi

if [ ! "$(ls $STAGEDIR/*.pkg.tar.gz 2>/dev/null)" ]; then
    exit
fi

cd $STAGEDIR
for pkgfile in $STAGEDIR/*.pkg.tar.gz; do
    pkgname=$(getpkgname $pkgfile);
    fullname=$(basename $pkgfile)
    pkgpath="$SVNCO/$pkgname/repos/$REPOTAG"

    # find the matching PKGBUILD
    if [ ! -d "$pkgpath" ]; then
        msg "WARNING: could not find PKGBUILD for $pkgname, cannot update this entry"
        return
    fi
    pkgbuild="${pkgpath}/PKGBUILD"
    if [ ! -f $pkgbuild ]; then
        msg "WARNING: could not find PKGBUILD for $fullname, cannot update this entry"
        return
    fi

    # pick out the category from the pathname
    unset pkgname pkgver pkgrel pkgdesc license groups provides md5sums force
    unset replaces depends conflicts backup source install build makedepends
    unset options
    source $pkgbuild || continue

    deplist=${depends[@]}
    sources=${source[@]}
    echo $fullname
    echo $pkgname
    echo $pkgver
    echo $pkgrel
    echo $pkgdesc
    echo $CATEGORY
    echo $url
    echo $sources
    echo $deplist
done

exit 0