Added new jam command 'build-remote-repository'.

* build-remote-repository <packages> uploads the given set of packages
  to the server and builds the remote repository
This commit is contained in:
Oliver Tappe 2013-09-14 19:51:09 +02:00
parent 8f3f0ee615
commit af8587ce40
2 changed files with 45 additions and 0 deletions

View File

@ -66,6 +66,16 @@ rule ProcessCommandLineArguments
}
}
# Copy the given set of local package files to the remote repository
# and create a new version of that remote repository.
case build-remote-repository : {
BuildRemoteHaikuPortsRepository $(JAM_TARGETS[1])
: $(JAM_TARGETS[2-]) ;
JAM_TARGETS = $(JAM_TARGETS[1]) ;
NotFile $(JAM_TARGETS) ;
Always $(JAM_TARGETS) ;
}
# A target starting with "@" is a build profile.
case @* : {
HAIKU_BUILD_PROFILE = [ Match "@(.*)" : $(JAM_TARGETS[1]) ] ;

View File

@ -619,3 +619,38 @@ TREE_PATH="$(HAIKU_REPOSITORY_TREE_PATH)"
TARGET_ARCHITECTURE="$(HAIKU_PACKAGING_ARCH)"
EOF
}
rule BuildRemoteHaikuPortsRepository target : packages
{
local packageListFile = <repository-package-list>HaikuPorts-packages ;
Depends $(target) : $(packageListFile) ;
HAIKU_REMOTE_REPOSITORY_PACKAGES on $(target) = $(packages) ;
BuildRemoteHaikuPortsRepository1 $(target) : $(packageListFile) ;
}
actions BuildRemoteHaikuPortsRepository1
{
remote=haiku_files@haiku-files.org
if [ -n "$(HAIKU_REMOTE_REPOSITORY_PACKAGES:E=:J)" ]; then
for package in $(HAIKU_REMOTE_REPOSITORY_PACKAGES) ; do
file=`basename $package`
if ! grep -q $file $(2); then
echo "Error: $file is not being referenced in $(2)"
exit 1
fi
done
scp $(HAIKU_REMOTE_REPOSITORY_PACKAGES) \
$remote:haiku-files.org/files/hpkg/
fi
packageList=package-list.$(TARGET_PACKAGING_ARCH)
scp $(2) $remote:build_repository/$packageList
ssh $remote \
"cd build_repository \
&& ./build_repo.sh $(TARGET_PACKAGING_ARCH) $packageList"
}