FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Development

 
 
LinkBack Thread Tools
 
Old 03-11-2010, 09:06 PM
Ghost1227
 
Default 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




--
 

Thread Tools




All times are GMT. The time now is 04:35 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org