From 67061580ebd4dde6e94d281a60e1322dc6e9b587 Mon Sep 17 00:00:00 2001 From: Omar Vega Ramos Date: Sat, 26 Sep 2015 15:24:27 -0500 Subject: Fixing symlinks to db-syn-arm --- db-sync-arm | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/db-sync-arm b/db-sync-arm index 2e58802..08a0905 100755 --- a/db-sync-arm +++ b/db-sync-arm @@ -118,6 +118,8 @@ init() { pkgpool="pool/packages" fi + msg2 "Retrieving %d packages to pool" "$(wc -l /tmp/${_repo}-${_arch}.whitelist | cut -d' ' -f1)" + # Sync excluding everything but whitelist rsync "${extra[@]}" --no-motd -rtlH \ --delay-updates \ @@ -134,10 +136,28 @@ init() { "${WORKDIR}/${_arch}/${_repo}/" \ "${FTP_BASE}/${_repo}/os/${_arch}/" + # Cleanup + unset db + done + done + + + msg "Generating symbolic links to pool" + + for _arch in "${OURARCHES[@]}"; do + for _repo in "${ARMREPOS[@]}"; do + # Set pkgpool to symlink + if [ "${_repo}" = "community" ]; then + pkgpool="pool/community" + else + pkgpool="pool/packages" + fi + # Search packages in whitelist to create symlinks sed -i 's/^/\^/' "/tmp/${_repo}-${_arch}.whitelist" - ls ${FTP_BASE}/${pkgpool}/ | grep -w -f "/tmp/${_repo}-${_arch}.whitelist" \ + ls "${FTP_BASE}/${pkgpool}/" | grep "${_arch}" \ + grep -w -f "/tmp/${_repo}-${_arch}.whitelist" \ > "/tmp/${_repo}-${_arch}.pkgwhitelist" msg "Putting symlinks" @@ -145,8 +165,6 @@ init() { ln -sf "../../../${pkgpool}/${_pkgfile}" "${FTP_BASE}/${_repo}/os/${_arch}" done < "/tmp/${_repo}-${_arch}.pkgwhitelist" - # Cleanup - unset db done done -- cgit v1.2.3