summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2010-02-07 02:47:48 +0100
committerAaron Griffin <aaronmgriffin@gmail.com>2010-04-28 18:05:09 +0200
commitcbf6a9877dcbc8478f41d60a55f3fa2bfca63831 (patch)
treea15e252155e29dafdf6f0c9d785c173b486f3b79
parent52b668dc79b2ca05f9eebedab0dfc7eefb263765 (diff)
downloaddbscripts-cbf6a9877dcbc8478f41d60a55f3fa2bfca63831.tar.gz
dbscripts-cbf6a9877dcbc8478f41d60a55f3fa2bfca63831.tar.xz
db-update: Use a master package pool and symlinks
This should save lots of transfer time with the mirrors :) Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rwxr-xr-xdb-update26
1 files changed, 19 insertions, 7 deletions
diff --git a/db-update b/db-update
index 418c680..a178996 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"
@@ -220,8 +225,12 @@ for current_arch in ${ARCHES[@]}; do
echo "Copying new files to '$ftppath'"
for f in "$WORKDIR/build/"*-$current_arch$PKGEXT; do
/bin/chmod 664 "$f" &>/dev/null
- 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
@@ -229,12 +238,15 @@ for current_arch in ${ARCHES[@]}; do
echo "Copying new files to '$ftppath_any' and symlinking"
for f in "$WORKDIR/build/"*-any$PKGEXT; do
/bin/chmod 664 "$f" &>/dev/null
- 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: failure symlinking $fname to $ftppath"
fi
done
fi