mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 03:33:25 +02:00
make.sh: Rewrite uploadsrc with rsync
Instead of having a very dodgy diff of filelists, this rsync call does everything automatically and only requires authentication once. Signed-off-by: Michael Tremer <michael.tremer@ipfire.org> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
committed by
Arne Fitzenreiter
parent
65710b528a
commit
dbd455ef93
22
make.sh
22
make.sh
@@ -1904,24 +1904,24 @@ gettoolchain)
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
uploadsrc)
|
uploadsrc)
|
||||||
PWD=`pwd`
|
|
||||||
if [ -z $IPFIRE_USER ]; then
|
if [ -z $IPFIRE_USER ]; then
|
||||||
echo -n "You have to setup IPFIRE_USER first. See .config for details."
|
echo -n "You have to setup IPFIRE_USER first. See .config for details."
|
||||||
print_status FAIL
|
print_status FAIL
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
URL_SOURCE=$(grep URL_SOURCE lfs/Config | awk '{ print $3 }')
|
URL_SOURCE="$(awk '/^URL_SOURCE/ { print $3 }' lfs/Config)"
|
||||||
REMOTE_FILES=$(echo "ls -1" | sftp -C ${IPFIRE_USER}@${URL_SOURCE})
|
|
||||||
|
rsync \
|
||||||
|
--recursive \
|
||||||
|
--update \
|
||||||
|
--ignore-existing \
|
||||||
|
--progress \
|
||||||
|
--human-readable \
|
||||||
|
--exclude="toolchains/" \
|
||||||
|
"${BASEDIR}/cache/" \
|
||||||
|
"${IPFIRE_USER}@${URL_SOURCE}"
|
||||||
|
|
||||||
for file in ${BASEDIR}/cache/*; do
|
|
||||||
[ -d "${file}" ] && continue
|
|
||||||
grep -q "$(basename ${file})" <<<$REMOTE_FILES && continue
|
|
||||||
NEW_FILES="$NEW_FILES $file"
|
|
||||||
done
|
|
||||||
[ -n "$NEW_FILES" ] && scp -2 $NEW_FILES ${IPFIRE_USER}@${URL_SOURCE}
|
|
||||||
cd $BASEDIR
|
|
||||||
cd $PWD
|
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
lang)
|
lang)
|
||||||
|
|||||||
Reference in New Issue
Block a user