[arch-dev-public] [PATCH 5/7] db-update: Use a master package pool and symlinks
--- db-update | 26 +++++++++++++++++++------- 1 files changed, 19 insertions(+), 7 deletions(-) diff --git a/db-update b/db-update index be16499..572e44a 100755 --- a/db-update +++ b/db-update @@ -131,6 +131,11 @@ for current_arch in ${ARCHES[@]}; do ftppath="$FTP_BASE/$reponame/os/$current_arch" ftppath_any="$FTP_BASE/$reponame/os/any" + poolpath="$FTP_BASE/packages/os/$current_arch" + poolpath_any="$FTP_BASE/packages/os/any" + # The following is used to create relative symlinks + poolrel="../../../packages/os/$current_arch" + poolrel_any='../../../packages/os/any' if [ ! -d "$ftppath" ]; then echo "FTP path for this repo ($reponame) is missing" @@ -219,20 +224,27 @@ for current_arch in ${ARCHES[@]}; do if [ $(getpkgfiles "$WORKDIR/build/"*-$current_arch$PKGEXT 2>/dev/null | wc -l) != 0 ]; then echo "Copying new files to '$ftppath'" for f in "$WORKDIR/build/"*-$current_arch$PKGEXT; do - if ! /bin/cp "$f" "$ftppath/"; then - die "error: failure while copying files to $ftppath" + if ! /bin/cp "$f" "$poolpath/"; then + die "error: failure while copying files to $poolpath" + fi + fname="$(basename $f)" + if ! ln -s "$poolrel/$fname" "$ftppath/$fname"; then + die "error: failure symlinking $fname to $ftppath" fi done fi if [ $(getpkgfiles "$WORKDIR/build/"*-any$PKGEXT 2>/dev/null | wc -l) != 0 ]; then echo "Copying new files to '$ftppath_any' and symlinking" for f in "$WORKDIR/build/"*-any$PKGEXT; do - if ! /bin/cp "$f" "$ftppath_any"; then - die "error: failure while copying files to $ftppath_any" + if ! /bin/cp "$f" "$poolpath_any"; then + die "error: failure while copying files to $poolpath_any" + fi + fname="$(basename $f)" + if ! ln -s "$poolrel_any/$fname" "$ftppath_any/$fname"; then + die "error: failure symlinking $fname to $ftppath_any" fi - bf=$(basename $f) - if ! ln -s "../any/$bf" "$ftppath/$bf"; then - die "error: failed to make link for $bf." + if ! ln -s "$poolrel_any/$fname" "$ftppath/$fname"; then + die "error: failed symlinking $fname to $ftppath" fi done fi -- 1.7.0.2 --
On Thu, Mar 11, 2010 at 4:06 PM, Ghost1227 <ghost1227@archlinux.us> wrote:
--- db-update | 26 +++++++++++++++++++------- 1 files changed, 19 insertions(+), 7 deletions(-)
Did you test this? I didn't. db-move and db-remove should, in theory, work fine. But This patch alone is going to do more harm than good. It's the cleanup that I worry about. Cleanup is going to need to be revamped to handle the pool. We're going to have to check each package in the pool dir to see if it has remaining symlinks in any repo. If it does not, it's a candidate for removal.
participants (2)
-
Aaron Griffin
-
Ghost1227