summaryrefslogtreecommitdiff
path: root/db-check-nonfree
diff options
context:
space:
mode:
Diffstat (limited to 'db-check-nonfree')
-rwxr-xr-xdb-check-nonfree40
1 files changed, 40 insertions, 0 deletions
diff --git a/db-check-nonfree b/db-check-nonfree
new file mode 100755
index 0000000..d8f34f0
--- /dev/null
+++ b/db-check-nonfree
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+. "$(dirname $0)/db-functions"
+. "$(dirname $0)/config"
+
+if [ $# -ge 1 ]; then
+ warning "Calling $(basename $0) with a specific repository is not supported"
+ exit 1
+fi
+
+# TODO: this might lock too much (architectures)
+for repo in ${repos[@]}; do
+ for pkgarch in ${ARCHES[@]}; do
+ repo_lock ${repo} ${pkgarch} || exit 1
+ done
+done
+
+msg "Check nonfree in repo:"
+nonfree=($(cut -d: -f1 ${BLACKLIST_FILE} | sort -u))
+for repo in ${ARCHREPOS[@]}; do
+ for pkgarch in ${ARCHES[@]}; do
+ msg2 "$repo $pkgarch"
+ if [ ! -f "${FTP_BASE}/${repo}/os/${pkgarch}/${repo}${DBEXT}" ]; then
+ continue
+ fi
+ unset cleanpkgs
+ cmd_="$(dirname $0)/list_nonfree_in_db.py -k ${BLACKLIST_FILE} \
+ -b ${FTP_BASE}/${repo}/os/${pkgarch}/${repo}${DBEXT}"
+ cleanpkgs=($(${cmd_}))
+ if [ ${#cleanpkgs[@]} -ge 1 ]; then
+ arch_repo_remove "${repo}" "${pkgarch}" ${cleanpkgs[@]}
+ fi
+ done
+done
+
+for repo in ${repos[@]}; do
+ for pkgarch in ${ARCHES[@]}; do
+ repo_unlock ${repo} ${pkgarch}
+ done
+done