]> wolfpit.net Git - tool/wolfaur/.git/blob - register_package.sh
ignores faulty version checks (for now)
[tool/wolfaur/.git] / register_package.sh
1 #!/bin/bash
2 set -e
3
4 db_dir=${DESTDIR:-packages}
5 pkg_dir=${SRCDIR:-build}/$(basename "$1")
6 pkg_path=$(cd "$pkg_dir" && makepkg --packagelist)
7 pkg_version=$(basename "$pkg_path")
8
9 if [[ $(< "$pkg_dir/$VERSION_FILE") != "$SKIP_TAG" ]]
10 then
11 echo Found "$SKIP_TAG in $pkg_dir/$VERSION_FILE"
12 echo Skipping "$pkg_dir"
13 exit 0
14 #elif [[ $(< "$pkg_dir/$VERSION_FILE") != $(basename "$pkg_version") ]]
15 #then
16 # echo "Target $pkg_dir may not build correctly! Skipping..."
17 # rm "$pkg_dir/$VERSION_FILE"
18 # exit 0
19 #
20 elif [ -e "$pkg_path" ]
21 then
22 echo "Adding " "$(basename "$pkg_version")" " to $DB_PATH"
23 install "$pkg_path" --target-directory "$db_dir"
24 cd "$db_dir"
25 repo-add --remove "$DB_NAME" "$(basename "$pkg_version")"
26 repose --files --gzip "$DB_NAME" "$pkg_dir"
27 else
28 echo "Could not add $pkg_version to $DB_PATH"
29 exit 1
30 fi