Change repository directory layout
* Under the base URL there are supposed to be the repository files and a subdirectory "packages". * Fix the repository URL related confusion introduced earlier. The URL in the repository info (and thus in the repository file) is supposed to be the base URL for the repository. It is not a (potentially) different base URL for the package files. Package and repository files were supposed to live in the same directory. Now, by requiring the package files to live in a subdirectory -- which can also be a symlink -- we gain some flexibility. The URL in the repository config is usually the same as the in the repository info, unless it refers to a mirror site. This allows for mirrors to copy the original repository verbatim. * Remove the PackageURL rule and introduce a DownloadPackage rule instead. The URL for a package file cannot be computed in the jam parsing phase anymore, as it contains the hash value of the package list. * BRepositoryConfig: Add PackagesURL() for convenience.
This commit is contained in:
@@ -39,8 +39,8 @@ rule AddRepositoryPackages repository : architecture : packages : sourcePackages
|
||||
}
|
||||
|
||||
|
||||
rule PackageRepository repository : architecture : repositoryUrl : packagesUrl
|
||||
: anyPackages : packages : sourcePackages
|
||||
rule PackageRepository repository : architecture : repositoryUrl : anyPackages
|
||||
: packages : sourcePackages
|
||||
{
|
||||
repository = $(repository:G=repository) ;
|
||||
|
||||
@@ -50,7 +50,6 @@ rule PackageRepository repository : architecture : repositoryUrl : packagesUrl
|
||||
|
||||
HAIKU_REPOSITORIES += $(repository) ;
|
||||
HAIKU_REPOSITORY_URL on $(repository) = $(repositoryUrl) ;
|
||||
HAIKU_REPOSITORY_PACKAGES_URL on $(repository) = $(packagesUrl) ;
|
||||
HAIKU_REPOSITORY_DEFINITION_FILE on $(repository)
|
||||
= $(HAIKU_REPOSITORY_JAMFILE) ;
|
||||
|
||||
@@ -95,6 +94,8 @@ rule PackageRepository repository : architecture : repositoryUrl : packagesUrl
|
||||
|
||||
HAIKU_REPOSITORY_CACHE_FILE on $(repository) = $(repositoryFile) ;
|
||||
HAIKU_REPOSITORY_CONFIG_FILE on $(repository) = $(repositoryConfig) ;
|
||||
HAIKU_REPOSITORY_PACKAGES_CHECKSUM_FILE on $(repository)
|
||||
= $(packagesChecksumFile) ;
|
||||
}
|
||||
|
||||
|
||||
@@ -156,10 +157,10 @@ rule IsPackageAvailable package
|
||||
}
|
||||
|
||||
|
||||
rule PackageURL packageName
|
||||
rule DownloadPackage packageName
|
||||
{
|
||||
if ! [ IsPackageAvailable $(packageName) ] {
|
||||
Exit "PackageURL: package" $(packageName) "not available!" ;
|
||||
Exit "DownloadPackage: package" $(packageName) "not available!" ;
|
||||
return ;
|
||||
}
|
||||
|
||||
@@ -171,8 +172,16 @@ rule PackageURL packageName
|
||||
= [ on $(packageFamily) return $(HAIKU_PACKAGE_VERSIONS[1]) ] ;
|
||||
local fileName = [ on $(package) return $(HAIKU_PACKAGE_FILE_NAME) ] ;
|
||||
local repository = [ on $(package) return $(HAIKU_PACKAGE_REPOSITORY) ] ;
|
||||
local baseUrl
|
||||
= [ on $(repository) return $(HAIKU_REPOSITORY_PACKAGES_URL) ] ;
|
||||
local baseUrl = [ on $(repository) return $(HAIKU_REPOSITORY_URL) ] ;
|
||||
local packagesChecksumFile
|
||||
= [ on $(repository)
|
||||
return $(HAIKU_REPOSITORY_PACKAGES_CHECKSUM_FILE) ] ;
|
||||
|
||||
return $(baseUrl)/$(fileName) ;
|
||||
local downloadedFile = [ DownloadFile $(fileName)
|
||||
: "$(baseUrl)/`cat $source`/packages/$(fileName)"
|
||||
: $(packagesChecksumFile) ] ;
|
||||
NoUpdate $(downloadedFile) ;
|
||||
# Don't download the file again when something in the repository
|
||||
# changes. It is (supposed to be) still the same file.
|
||||
return $(downloadedFile) ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user