diff options
author | Omar Vega Ramos <ovruni@gnu.org.pe> | 2015-09-28 11:53:06 -0500 |
---|---|---|
committer | Omar Vega Ramos <ovruni@gnu.org.pe> | 2015-09-28 11:53:06 -0500 |
commit | 0ebafbe6539b45b706e8509918f72bcf6b3bed0e (patch) | |
tree | 4e9a1f27bc9f09df8d17a075e62101f5de59dd41 /db-sync-arm | |
parent | b38f808a7cd46902ff4254a1a4c795abbfdf3dfb (diff) |
Fixing symlinks to db-sync-arm
Diffstat (limited to 'db-sync-arm')
-rwxr-xr-x | db-sync-arm | 30 |
1 files 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 |