haiku/build/scripts/upload_haiku_repository
Matt Madia 62ee6508dd Tweak scp command, to prevent uploading repositoryDir as a subdir of $version.
If for some reason (e.g., a forced rebuild), Buildbot rebuilds the same hrev,
it was possible for the scp command to place the repositoryDir as a subdir
in $arch/$version/, instead of as $arch/version. This should ensure that the
contents of repositoryDir are placed in $arch/$version/.
2013-11-30 20:26:39 -05:00

31 lines
800 B
Bash
Executable File

#!/bin/sh
#
# Usage: upload_haiku_repository <arch> <generatedDir> <sshUserName> <sshServer> <sshDestPath>
set -o errexit
if [ $# -lt 5 ]; then
echo "$0: Missing parameters!" >&2
exit 1
fi
arch="$1"
generatedDir="$2"
sshUserName="$3"
sshServer="$4"
sshDestPath="$5"
repositoryDir="$generatedDir/objects/haiku/$arch/packaging/repositories/haiku"
packageDir="$repositoryDir/packages"
# determine the version
fileName=`basename "$packageDir"/haiku-*.hpkg .hpkg`
version=${fileName#*-}
version=${version%%-*}
# upload the repo
scp -r "$repositoryDir/*" "$sshUserName@$sshServer:$sshDestPath/$arch/$version/"
ssh "$sshUserName@$sshServer" "chmod -R 755 $sshDestPath/$arch/$version"
sshSymlinkCommand="ln -sfT $version $sshDestPath/$arch/current"
ssh "$sshUserName@$sshServer" "$sshSymlinkCommand"