aboutsummaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2008-06-11 21:24:17 +0800
committerkris <kris@FreeBSD.org>2008-06-11 21:24:17 +0800
commit9db61cd34c11701f3b2d90be5ee7250bafe863c4 (patch)
treef00940f60dff52dc0118727d158daa2b0839901a /Tools
parent19300687322dc270ecbf341aa415dff9308e389c (diff)
downloadfreebsd-ports-gnome-9db61cd34c11701f3b2d90be5ee7250bafe863c4.tar.gz
freebsd-ports-gnome-9db61cd34c11701f3b2d90be5ee7250bafe863c4.tar.zst
freebsd-ports-gnome-9db61cd34c11701f3b2d90be5ee7250bafe863c4.zip
Revive this script and make it useful. Transfer the distfiles using rsync
and make sure they have been post-processed first.
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/portbuild/scripts/cpdistfiles49
1 files changed, 23 insertions, 26 deletions
diff --git a/Tools/portbuild/scripts/cpdistfiles b/Tools/portbuild/scripts/cpdistfiles
index bb2c1361c79d..6dbfa2773f29 100755
--- a/Tools/portbuild/scripts/cpdistfiles
+++ b/Tools/portbuild/scripts/cpdistfiles
@@ -1,39 +1,36 @@
#!/bin/sh
-if [ $# != 1 ]; then
- echo "usage: $0 branch"
+if [ $# -lt 2 ]; then
+ echo "usage: $0 arch branch"
exit 1
fi
# configurable variables
pb=/var/portbuild
-. ${pb}/portbuild.conf
+arch=$1
+branch=$2
-unset DISPLAY
-
-branch=$1
-shift
-
-# copy one distfile to remote host
-cpdistfile () {
- tar -C distfiles -cf - $1 | ssh $ftpsite -l $user tar -C $distfiledir --unlink -xvf -
-}
-
-echo "================================================"
-echo "md5 generation started at $(date)"
+yesreally=0
+dryrun=-n
+if [ "$3" = "-yesreally" ]; then
+ yesreally=1
+ dryrun=
+fi
-cd $pb/${branch}/bak/distfiles
-find . -type f | sort | xargs md5 > ../../md5-2
+distdir=${pb}/${arch}/${branch}/distfiles/
+log=${pb}/${arch}/${branch}/logs/.distfiles
-echo "================================================"
-echo "copying started at $(date)"
+if [ -e ${distdir}/.pbtmp ]; then
+ echo "${distdir} has not been processed!"
+ exit 1
+fi
-cd $pb/${branch}/bak
-for i in $(diff ../md5 ../md5-2 | grep '^>' | sed -e 's^.*(\./^^' -e 's/).*//'); do
- cpdistfile $i
-done
-mv ../md5-2 ../md5
+rsync ${dryrun} -r -v -l -t --exclude RESTRICTED/ ${pb}/${arch}/${branch}/distfiles/ portmgr@ftp-master:w/ports/distfiles/ | tee ${log}
-echo "================================================"
-echo "all done at $(date)"
+num=$(wc -l ${log} | awk '{print $1}')
+if [ "$yesreally" = "0" ]; then
+ echo "--> Will transfer ${num} files - make sure this is what you want and rerun '$0 $* -yesreally'"
+else
+ echo "--> Transferred ${num} files - results in ${log}"
+fi