summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Vega Ramos <ovruni@gnu.org.pe>2015-09-26 17:16:36 -0500
committerOmar Vega Ramos <ovruni@gnu.org.pe>2015-09-26 17:16:36 -0500
commit67cb9c3f9eb7a5c68dfd775366573a0eccfc0da0 (patch)
tree2b1c55fb5a576f1bf6f0929098c2186bd34fe4b5
parent67061580ebd4dde6e94d281a60e1322dc6e9b587 (diff)
Fixing "any" packages to db-syn-arm
-rwxr-xr-xdb-sync-arm15
1 files changed, 11 insertions, 4 deletions
diff --git a/db-sync-arm b/db-sync-arm
index 08a0905..180869f 100755
--- a/db-sync-arm
+++ b/db-sync-arm
@@ -101,13 +101,13 @@ init() {
msg2 "Process clean db for syncing..."
- # Create a whitelist, add * wildcard to end
+ # Create a whitelist, add arch and * wildcard to end
# TODO due to lack of -arch suffix, the pool sync retrieves every arch even if
# we aren't syncing them
# IMPORTANT: the . in the sed command is needed because an empty
# whitelist would consist of a single * allowing any package to
# pass through
- printf '%s\n' "${db[@]}" | sed "s|.$|&*|g" > "/tmp/${_repo}-${_arch}.whitelist"
+ printf '%s\n' "${db[@]}" | sed "s|.$|&-${_arch}*|g" > "/tmp/${_repo}-${_arch}.whitelist"
msg2 "%d packages in whitelist" "$(wc -l /tmp/${_repo}-${_arch}.whitelist | cut -d' ' -f1)"
@@ -156,15 +156,22 @@ init() {
# Search packages in whitelist to create symlinks
sed -i 's/^/\^/' "/tmp/${_repo}-${_arch}.whitelist"
- ls "${FTP_BASE}/${pkgpool}/" | grep "${_arch}" \
+ ls "${FTP_BASE}/${pkgpool}/" \
grep -w -f "/tmp/${_repo}-${_arch}.whitelist" \
> "/tmp/${_repo}-${_arch}.pkgwhitelist"
- msg "Putting symlinks"
+ msg "Putting symlinks in ${_repo}/os/${_arch}"
while read _pkgfile; do
ln -sf "../../../${pkgpool}/${_pkgfile}" "${FTP_BASE}/${_repo}/os/${_arch}"
done < "/tmp/${_repo}-${_arch}.pkgwhitelist"
+ # Putting symlinks to "any" packages
+ ls "${FTP_BASE}/${_repo}/os/${_arch}/" | grep '\-any\.' \
+ > "/tmp/${_repo}-${_arch}-any.pkgwhitelist"
+
+ while read _pkgfile; do
+ ln -sf "../../../${pkgpool}/${_pkgfile}" "${FTP_BASE}/${_repo}/os/${_arch}"
+ done < "/tmp/${_repo}-${_arch}-any.pkgwhitelist"
done
done