1#!/bin/sh 2# 3# Usage: upload_haiku_repository <arch> <generatedDir> <sshUserName> <sshServer> <sshDestPath> 4 5set -o errexit 6 7if [ $# -lt 5 ]; then 8 echo "$0: Missing parameters!" >&2 9 exit 1 10fi 11 12arch="$1" 13generatedDir="$2" 14sshUserName="$3" 15sshServer="$4" 16sshDestPath="$5" 17repositoryDir="$generatedDir/objects/haiku/$arch/packaging/repositories/haiku" 18packageDir="$repositoryDir/packages" 19 20# determine the version 21fileName=`basename "$packageDir"/haiku-*.hpkg .hpkg` 22version=${fileName#*-} 23version=${version%%-*} 24 25# upload the repo 26rsync -rutlv -e ssh "$repositoryDir/" "$sshUserName@$sshServer:$sshDestPath/$arch/$version/" 27ssh "$sshUserName@$sshServer" "chmod -R 755 $sshDestPath/$arch/$version" 28sshSymlinkCommand="ln -sfT $version $sshDestPath/$arch/current" 29ssh "$sshUserName@$sshServer" "$sshSymlinkCommand" 30 31