summaryrefslogtreecommitdiff
path: root/Tools/portbuild/scripts/cpdistfiles
blob: 04c8a9283d7fbd9faa922a1107c6cca7acf5ac29 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh

# configurable variables
pb=/var/portbuild

. ${pb}/portbuild.conf

unset DISPLAY

# copy one distfile to remote host
cpdistfile () {
  tar -C distfiles -cf - $1 | ssh $ftpsite -l $user tar -C $distfiledir -xvf -
}

echo "================================================"
echo "md5 generation started at $(date)"

cd $pb/bak/distfiles
find . -type f | sort | xargs md5 > ../../md5-2

echo "================================================"
echo "copying started at $(date)"

cd $pb/bak
for i in $(diff ../md5 ../md5-2 | grep '^>' | sed -e 's^.*(\./^^' -e 's/).*//'); do
  cpdistfile $i
done
mv ../md5-2 ../md5

echo "================================================"
echo "all done at $(date)"