Opened 8 years ago

Last modified 6 years ago

#12905 closed bug

package_repo requires a url in repo-info file which needs eval — at Version 4

Reported by: kallisti5 Owned by: nobody
Priority: normal Milestone: R1/beta1
Component: Kits/Package Kit Version: R1/Development
Keywords: package_repo Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by kallisti5)

package_repo requires a url in the repo.info file. (the repo.info file is read in by package_repo tool to build the binary on-disk repo which is then served by http to our package manager)

This really doesn't make sense. You're always going to know the repo's base url... so why would you need to specify it while building the repo?

This makes repo creation a lot more complex than it needs to be... I also haven't been able to find anywhere the repo.info url is actually used. (don't get a packages's URL mixed up the internal repo url)

Example:

URL: http://packages.haiku-os.org/haikuports/master/repo/x86_64/c623cf2b4d85bc452d5a21a2586e552fe1b04f6d66eca0663f257461c106db9f/repo.info

name HaikuPorts
vendor "Haiku Project"
summary "The HaikuPorts repository (for Haiku hrev50482)"
priority 1
url http://packages.haiku-os.org/haikuports/master/repo/x86_64/c623cf2b4d85bc452d5a21a2586e552fe1b04f6d66eca0663f257461c106db9f
architecture x86_64

Change History (4)

comment:1 by kallisti5, 8 years ago

kallisti5@ares package :) $ grep -R url * | grep -v Package
RepositoryConfig.cpp:		<< "url=" << fBaseURL << "\n"
RepositoryConfig.cpp:	const char* url = driverSettings.GetParameterValue("url");
RepositoryConfig.cpp:	if (url == NULL || *url == '\0')
RepositoryConfig.cpp:	fBaseURL = url;
RepositoryInfo.cpp:const char* const BRepositoryInfo::kURLField			= "url";
RepositoryInfo.cpp:BRepositoryInfo::SetOriginalBaseURL(const BString& url)
RepositoryInfo.cpp:	fOriginalBaseURL = url;
RepositoryInfo.cpp:	const char* url = get_driver_parameter(settingsHandle, "url", NULL, NULL);
RepositoryInfo.cpp:	if (name == NULL || *name == '\0' || url == NULL || *url == '\0'
RepositoryInfo.cpp:	fOriginalBaseURL = url;

So BRepositoryConfig's fBaseURL, PackagesURL(), and BaseURL() use it...

kallisti5@ares package :( $ egrep -R "PackagesURL\(|BaseURL\(" *
ActivateRepositoryConfigJob.cpp:	fRepositoryBaseURL(repositoryBaseURL),
ActivateRepositoryConfigJob.cpp:	repoConfig.SetBaseURL(fRepositoryBaseURL);
AddRepositoryRequest.cpp:	fRepositoryBaseURL(repositoryBaseURL),
manager/PackageManager.cpp:			BString url = remoteRepository->Config().PackagesURL();
RefreshRepositoryRequest.cpp:		= BString(fRepoConfig.BaseURL()) << "/" << "repo.sha256";
RefreshRepositoryRequest.cpp:		BString("Fetching repository checksum from ") << fRepoConfig.BaseURL(),
RefreshRepositoryRequest.cpp:	BString repoCacheURL = BString(fRepoConfig.BaseURL()) << "/" << "repo";
RefreshRepositoryRequest.cpp:		BString("Fetching repository-cache from ") << fRepoConfig.BaseURL(),
RepositoryConfig.cpp:	fBaseURL(baseURL),
RepositoryConfig.cpp:BRepositoryConfig::BaseURL() const
RepositoryConfig.cpp:BRepositoryConfig::PackagesURL() const
RepositoryConfig.cpp:BRepositoryConfig::SetBaseURL(const BString& baseURL)
RepositoryInfo.cpp:BRepositoryInfo::OriginalBaseURL() const
RepositoryInfo.cpp:BRepositoryInfo::SetOriginalBaseURL(const BString& url)

Since the user provides the repo URL to gain access to the repo, it all seems extremely illogical to then re-read the repo config file and potentially re-adjust where the repo is?

comment:2 by kallisti5, 8 years ago

It seems like BRepositoryConfig should be constructed with the repo URL from the URL the user or system already has vs needing a second copy from the repo itself.

comment:3 by kallisti5, 8 years ago

Description: modified (diff)

comment:4 by kallisti5, 8 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.