From d1b21b4ad3a5df40d5837c1a62775dcac699fe9c Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Thu, 1 May 2014 19:41:31 +0200 Subject: [PATCH] Improve build feature handling with HAIKU_NO_DOWNLOADS=1 * Adjust the respective rules such that with disabled downloads, only packages already available in the downloads folder will be considered as available build features. This way, the build system will not for instance try to build qrencode after a bootstrap, as that package is not yet available. --- build/jam/RepositoryRules | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/build/jam/RepositoryRules b/build/jam/RepositoryRules index 238690debe..82ee382bd7 100644 --- a/build/jam/RepositoryRules +++ b/build/jam/RepositoryRules @@ -36,12 +36,21 @@ rule AddRepositoryPackage repository : architecture : baseName : version package = $(package:E=$(baseName):G=package-in-$(repository:G=)) ; HAIKU_PACKAGE_REPOSITORY on $(package) = $(repository) ; HAIKU_PACKAGE_ARCHITECTURE on $(package) = $(architecture) ; - HAIKU_PACKAGE_FILE_NAME on $(package) = $(package:G=)-$(architecture).hpkg ; + local packageFileName = $(package:G=)-$(architecture).hpkg ; + HAIKU_PACKAGE_FILE_NAME on $(package) = $(packageFileName) ; local packageFamily = [ InvokeRepositoryMethod $(repository) : PackageFamily : $(baseName) ] ; baseName = $(packageFamily:G=) ; + if $(HAIKU_NO_DOWNLOADS) = 1 { + # Only add packages to repository that already exist in download + # directory. + if ! [ Glob $(HAIKU_DOWNLOAD_DIR) : $(packageFileName) ] { + return ; + } + } + if ! $(baseName) in $(HAIKU_AVAILABLE_PACKAGES) { HAIKU_AVAILABLE_PACKAGES += $(baseName) ; } @@ -170,18 +179,14 @@ rule RemotePackageRepository repository : architecture : repositoryUrl PreprocessPackageOrRepositoryInfo $(repositoryInfo) : $(repositoryInfoTemplate) : $(architecture) ; - # build repository file, using only packages available in the download - # directory - local allPackageFiles = [ + # build repository file + local packageFileNames = [ on $(packageListFile) return $(HAIKU_REPOSITORY_PACKAGE_FILE_NAMES) ] ; local packageFiles ; - for packageFile in $(allPackageFiles) { - if [ Glob $(HAIKU_DOWNLOAD_DIR) : $(packageFile) ] { - packageFile = $(packageFile:G=package-file) ; - MakeLocate $(packageFile) : $(HAIKU_DOWNLOAD_DIR) ; - packageFiles += $(packageFile) ; - } + for packageFile in $(packageFileNames) { + MakeLocate $(packageFile) : $(HAIKU_DOWNLOAD_DIR) ; + packageFiles += $(packageFile) ; } RepositoryCache $(repositoryFile) : $(repositoryInfo) : $(packageFiles) ;