From 02ace28fe4f91f55d96938ba6074ef9e9239774e Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Jan 06 2020 09:49:25 +0000 Subject: pkgset: Hardlink downloaded packages When pungi-gather (or old pungi) download the packages from repos into work/$arch/, they are linked to work/global/. This was using link_type configuration option. However if that is set to symlink, we get a relative symlink in work/global/ which is later copied under the compose/ directory. Since it's a relative symlink, it gets broken by this. The fix is to hardlink the downloaded packages instead in the first step. Since both the source and destination are in work/ directory, we know it's the same volume and hardlinks should work. There is a fallback to copy just to be sure, but it shouldn't ever be used. Signed-off-by: Lubomír Sedlář --- diff --git a/pungi/phases/pkgset/sources/source_repos.py b/pungi/phases/pkgset/sources/source_repos.py index bca34f3..cbffe65 100644 --- a/pungi/phases/pkgset/sources/source_repos.py +++ b/pungi/phases/pkgset/sources/source_repos.py @@ -45,8 +45,7 @@ def get_pkgset_from_repos(compose): profiler = compose.conf["gather_profiler"] - link_type = compose.conf["link_type"] - pool = LinkerPool.with_workers(10, link_type, logger=compose._logger) + pool = LinkerPool.with_workers(10, "hardlink-or-copy", logger=compose._logger) path_prefix = os.path.join(compose.paths.work.topdir(arch="global"), "download") + "/" makedirs(path_prefix)