summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2017-01-20 18:40:07 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2017-01-20 18:40:07 -0500
commit8f788421284bc9e8685bea8265ab14b436174376 (patch)
tree7a417775e48d75ab8043a47888cd2c43d9b8bcf4
parentde9f3bae65a3c488a11a998fa177921ed4cab339 (diff)
db-import-archlinux-src: Fixo
The first issue is a typo from last commit. But I went ahead and tidied the formatting around it. The second is that create_tarballs() errored out if a repo doesn't contain any arch=(any) packages. The third is that it assumed that ABSLIBRE_ROOT and ABS_ROOT already exist.
-rwxr-xr-xdb-import-archlinux-src14
1 files changed, 9 insertions, 5 deletions
diff --git a/db-import-archlinux-src b/db-import-archlinux-src
index 9d990a4..c355e7b 100755
--- a/db-import-archlinux-src
+++ b/db-import-archlinux-src
@@ -23,11 +23,10 @@ function sync_abs() {
function get_blacklist() {
libreblacklist update
- libreblacklist cat | libreblacklist get-pkg | sort -u | \ss
- sed "s/^/**\//" > ${BLFILE} || {
+ if ! libreblacklist cat | libreblacklist get-pkg | sort -u | sed "s/^/**\//" > ${BLFILE}; then
printf "[FAILED]\n"
return 1
- }
+ fi
# Prevent using an empty blacklist
[ $(wc -l ${BLFILE} | cut -d " " -f1) -eq 0 ] && return 1
@@ -72,10 +71,13 @@ create_tarballs() {
rm -fv $FTP_BASE/$baserepo/os/$arch/$baserepo.abs.tar.gz
# Create a new one joining arch and any
# Remove the first part of the path (it could be $repo but any isn't hit)
+ include=($repo/*)
+ if [[ -d ${ABSLIBRE_ROOT}/any/${baserepo}/ ]]; then
+ include+=(${ABSLIBRE_ROOT}/any/${baserepo}/*)
+ fi
bsdtar -czf $FTP_BASE/$baserepo/os/$arch/$baserepo.abs.tar.gz \
-s ":${ABSLIBRE_ROOT}/[a-z0-9_]\+/[a-z]\+::" \
- $repo/* ${ABSLIBRE_ROOT}/any/${baserepo}/*
-
+ "${include[@]}"
done
}
@@ -84,6 +86,8 @@ main() {
tmpdir=$(mktemp --tmpdir -d "${0##*/}.XXXXXXXXXX")
BLFILE=${tmpdir}/blacklist.txt
+ mkdir -p -- "$ABSLIBRE_ROOT" "$ABS_ROOT"
+
sync_abs
get_blacklist
sync_abs_libre