From 8f788421284bc9e8685bea8265ab14b436174376 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 20 Jan 2017 18:40:07 -0500 Subject: 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. --- db-import-archlinux-src | 14 +++++++++----- 1 file 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 -- cgit v1.2.3