From 0ebafbe6539b45b706e8509918f72bcf6b3bed0e Mon Sep 17 00:00:00 2001 From: Omar Vega Ramos Date: Mon, 28 Sep 2015 11:53:06 -0500 Subject: Fixing symlinks to db-sync-arm --- db-sync-arm | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/db-sync-arm b/db-sync-arm index 9653d00..0f82ea9 100755 --- a/db-sync-arm +++ b/db-sync-arm @@ -139,7 +139,8 @@ init() { for _arch in "${OURARCHES[@]}"; do for _repo in "${ARMREPOS[@]}"; do # Modify whitelist to search packages and create symlinks - sed -i "s/*/-${_arch}.pkg.tar.xz/g" "/tmp/${_repo}-${_arch}.whitelist" + sed -i "s/*/-${_arch}.pkg.tar.xz/g" > "/tmp/${_repo}-${_arch}.whitelist" + cp "/tmp/${_repo}-${_arch}.whitelist" "/tmp/${_repo}-any.whitelist" msg "Putting symlinks in ${_repo}/os/${_arch}" @@ -148,31 +149,40 @@ init() { if [ -f "${FTP_BASE}/${PKGPOOLARM}/${_pkgfile}" ]; then ln -sf "../../../${PKGPOOLARM}/${_pkgfile}" \ "${FTP_BASE}/${_repo}/os/${_arch}/${_pkgfile}" + + # Delete entry to "any" whitelist + sed -i "s/${_pkgfile}//g" "/tmp/${_repo}-any.whitelist" fi # Symlink to signature if [ -f "${FTP_BASE}/${PKGPOOLARM}/${_pkgfile}.sig" ]; then ln -sf "../../../${PKGPOOLARM}/${_pkgfile}.sig" \ "${FTP_BASE}/${_repo}/os/${_arch}/${_pkgfile}.sig" + + # Delete entry to "any" whitelist + sed -i "s/${_pkgfile}//g" "/tmp/${_repo}-any.whitelist" fi done < "/tmp/${_repo}-${_arch}.whitelist" - # Modify whitelist to search "any" packages and create symlinks - sed -i "s/^/\^/g" "/tmp/${_repo}-${_arch}.whitelist" - sed -i "s/-${_arch}./-any./g" "/tmp/${_repo}-${_arch}.whitelist" + msg "Putting symlinks to packages with arch 'any' in ${_repo}/os/${_arch}" - # Putting symlinks to "any" packages - ls "${FTP_BASE}/${PKGPOOLARM}/" | grep '\-any\.' \ - | grep -w -f "/tmp/${_repo}-${_arch}.whitelist" \ - > "/tmp/${_repo}-any.pkgwhitelist" + # Modify whitelist to search "any" packages and create symlinks + sed -i "s/-${_arch}./-any./g" "/tmp/${_repo}-any.whitelist" + sed -i '/^$/d' "/tmp/${_repo}-any.whitelist" while read _pkgfile; do - # Symlink to package and signature + # Symlink to package if [ -f "${FTP_BASE}/${PKGPOOLARM}/${_pkgfile}" ]; then ln -sf "../../../${PKGPOOLARM}/${_pkgfile}" \ "${FTP_BASE}/${_repo}/os/${_arch}/${_pkgfile}" fi - done < "/tmp/${_repo}-any.pkgwhitelist" + + # Symlink to signature + if [ -f "${FTP_BASE}/${PKGPOOLARM}/${_pkgfile}.sig" ]; then + ln -sf "../../../${PKGPOOLARM}/${_pkgfile}.sig" \ + "${FTP_BASE}/${_repo}/os/${_arch}/${_pkgfile}.sig" + fi + done < "/tmp/${_repo}-any.whitelist" done done -- cgit v1.2.3