summaryrefslogtreecommitdiff
path: root/src/pkgbuild-check-nonfree
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-05-22 18:49:59 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-05-22 18:49:59 -0400
commit62c6567f5a01ee700d1fae99855898d8f85d76f4 (patch)
treed614eb272d8ca374b7aa3f1922b00c862bd6800c /src/pkgbuild-check-nonfree
parent4ff2981b13f10192f9725592c0364a5377932c6d (diff)
add a lib/blacklist.sh, use it for pkgbuild-check-nonfree
Diffstat (limited to 'src/pkgbuild-check-nonfree')
-rwxr-xr-xsrc/pkgbuild-check-nonfree43
1 files changed, 4 insertions, 39 deletions
diff --git a/src/pkgbuild-check-nonfree b/src/pkgbuild-check-nonfree
index ada95b5..e20e1a3 100755
--- a/src/pkgbuild-check-nonfree
+++ b/src/pkgbuild-check-nonfree
@@ -20,7 +20,7 @@
# along with Parabola. If not, see <http://www.gnu.org/licenses/>.
. libremessages
-. /usr/share/libretools/conf.sh
+. /usr/share/libretools/blacklist.sh
# Unset any PKGBUILD variables inherited from the environment
# I took these from makepkg 4.1.1-1
@@ -28,40 +28,6 @@ unset pkgname pkgbase pkgver pkgrel epoch pkgdesc url license groups provides
unset md5sums replaces depends conflicts backup source install changelog build
unset makedepends optdepends options noextract
-# Usage: blacklist_lookup $pkg
-# Look up the blacklist entry for $pkg
-blacklist_lookup() {
- local pkg=$1
- sed 's/^/^/;s/$/:/' "$XDG_CONFIG_HOME/libretools/blacklist.txt" |
- grep -F "^$pkg:" |
- sed 's/^^//;s/:*$//'
-}
-
-# Usage: update_blacklist $url
-# Update the cached blacklist file
-update_blacklist() {
- local remote_blacklist="$1"
- local local_blacklist="$XDG_CONFIG_HOME/libretools/blacklist.txt"
-
- stat_busy "Downloading blacklist of proprietary software packages"
-
- mkdir -p "${local_blacklist%/*}"
- if wget -N -q -O "${local_blacklist}.part" "$remote_blacklist" 2>/dev/null; then
- stat_done
- mv "${local_blacklist}.part" "$local_blacklist"
- else
- stat_done
- rm "${local_blacklist}.part"
- if [[ -e "$XDG_CONFIG_HOME/libretools/blacklist.txt" ]]; then
- warning "Using local copy of blacklist"
- else
- error "Download failed, exiting"
- return 1
- fi
-
- fi
-}
-
# Usage: check_deps $pkgbuild
# Check whether a PKGBUILD package depends on non-free packages
check_deps() (
@@ -85,8 +51,8 @@ check_deps() (
)
local ret=0
for pkg in "${pkgs[@]}"; do
- local line="$(blacklist_lookup $pkg)"
- local rep="$(cut -d: -f2 <<<"$line:")"
+ local line="$(blacklist-lookup "$pkg")"
+ local rep="$(blacklist-get-rep <<<"$line")"
if [[ -z $line ]]; then
# not mentioned in blacklist; free
plain "$pkg: free"
@@ -144,8 +110,7 @@ main() {
return 1
fi
- load_conf_libretools || return 1 # load ${BLACKLIST}
- update_blacklist "$BLACKLIST" || return 1
+ blacklist-update || return 1
local ret=0
for pkgbuild in "${pkgbuilds[@]}"; do