diff options
author | Francois Charette <francois@archlinux.org> | 2009-09-15 09:20:14 +0200 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2009-09-18 10:32:04 -0700 |
commit | 954b699c84cd0b6211bf4ffb83bcd8affd7d8875 (patch) | |
tree | 1a829714283351f13e5a7fbc85e7083ed9be0200 | |
parent | 7667c1bbbb8e4bacda38995294694acbe162789b (diff) |
Remove pkg from $stagedir if already in FTP repo
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rwxr-xr-x | db-update | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -74,6 +74,29 @@ die() { trap ctrl_c 2 trap cleanup 0 +# Remove any package from $stagedir that is already in the FTP repository +for f in $stagedir/*-any$PKGEXT; do + bf=$(basename $f) + ftppath_any="$FTP_BASE/$reponame/os/any" + if [[ -f $ftppath_any/$bf ]]; then + echo " WARNING: Package file $bf already exists in FTP repo" + echo " Removing from $stagedir" + /bin/rm $f + fi +done + +for current_arch in ${ARCHES[@]}; do + ftppath="$FTP_BASE/$reponame/os/$current_arch" + for f in $stagedir/*-$current_arch$PKGEXT; do + bf=$(basename $f) + if [[ -f $ftppath/$bf ]]; then + echo " WARNING: Package file $bf already exists in FTP repo" + echo " Removing from $stagedir" + /bin/rm $f + fi + done +done + # Process architecture-independent packages first. if [ -d "$stagedir" ]; then ANYPKGS="$(/bin/ls $stagedir/*-any$PKGEXT 2>/dev/null)" |