From 02ace28fe4f91f55d96938ba6074ef9e9239774e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Mon, 6 Jan 2020 10:45:52 +0100 Subject: [PATCH] pkgset: Hardlink downloaded packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ář --- pungi/phases/pkgset/sources/source_repos.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pungi/phases/pkgset/sources/source_repos.py b/pungi/phases/pkgset/sources/source_repos.py index bca34f38..cbffe655 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)