summaryrefslogtreecommitdiffstats
path: root/Tools/portbuild/scripts/cpdistfiles
blob: bb2c1361c79d5fe449d631747a6894dd8f8ea374 (plain)
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
32
33
34
35
36
37
38
39
#!/bin/sh

if [ $# != 1 ]; then
  echo "usage: $0 branch"
  exit 1
fi

# configurable variables
pb=/var/portbuild

. ${pb}/portbuild.conf

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)"

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

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

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

echo "================================================"
echo "all done at $(date)"
OpenPOWER on IntegriCloud