summaryrefslogtreecommitdiff
path: root/fullpkg
blob: 227f329a7a83f757c5cfb719580d6a665255bea3 (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
#!/bin/bash
# set -x # uncomment for debug
# Builds packages from ABS recursively. It tries to find dependencies that
# aren't built or need update and then makepkg them in order.

usage() {

    echo "cd to a dir containing a PKGBUILD and run:"
    echo "$0 [build_dir]"
    echo ""
    echo "This script will check dependencies, build them if possible "
    echo "and stage the packages on it's repo."
    echo ""
    echo "OPTIONS:"
    echo " -h           : this message."
    echo ""
    echo "Wrapper for \`fullpkg-find' and \`fullpkg-build'"
    exit 1

}

# Finds a PKGBUILD on toru's path cache
# Look in all caches but pick the first one
# TODO move to a toru flag (-p?)
where_is() {
  grep -m1 "^${1}:" "${TORUPATH}/paths" 2>/dev/null| \
    cut -d: -f2 2>/dev/null
}

while getopts 'haA:l:nm:' arg; do
    case "$arg" in
        h) usage ;;
    esac
done

shift $(( OPTIND - 1 ))

fullpkg-find "$1" && fullpkg-build -N "$1"

exit 0