From af8587ce40c2a181ab9e00ab83aee70bf9e54883 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sat, 14 Sep 2013 19:51:09 +0200 Subject: [PATCH] Added new jam command 'build-remote-repository'. * build-remote-repository uploads the given set of packages to the server and builds the remote repository --- build/jam/CommandLineArguments | 10 ++++++++++ build/jam/RepositoryRules | 35 ++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/build/jam/CommandLineArguments b/build/jam/CommandLineArguments index 01dd5e008a..bb0aab796b 100644 --- a/build/jam/CommandLineArguments +++ b/build/jam/CommandLineArguments @@ -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]) ] ; diff --git a/build/jam/RepositoryRules b/build/jam/RepositoryRules index e96f30966f..066ace4a25 100644 --- a/build/jam/RepositoryRules +++ b/build/jam/RepositoryRules @@ -619,3 +619,38 @@ TREE_PATH="$(HAIKU_REPOSITORY_TREE_PATH)" TARGET_ARCHITECTURE="$(HAIKU_PACKAGING_ARCH)" EOF } + + +rule BuildRemoteHaikuPortsRepository target : packages +{ + local packageListFile = 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" +}