From a155674269773981da82bf15678c9e2a5820d50e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 15 Dec 2016 14:02:06 +0100 Subject: [PATCH] Set persistdir to a temporary location MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't want to even touch any system directory. Signed-off-by: Lubomír Sedlář --- bin/pungi-gather | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/pungi-gather b/bin/pungi-gather index 02f9e2cd..d720696d 100755 --- a/bin/pungi-gather +++ b/bin/pungi-gather @@ -4,6 +4,8 @@ import os import argparse +import tempfile +import shutil import pungi.ks from pungi.dnf_wrapper import DnfWrapper, Conf @@ -71,6 +73,7 @@ def main(): ns = parser.parse_args() dnf_conf = Conf(ns.arch) + dnf_conf.persistdir = tempfile.mkdtemp() dnf_obj = DnfWrapper(dnf_conf) gather_opts = GatherOptions() @@ -126,6 +129,7 @@ def main(): packages.add("-%s" % i) g.gather(packages, conditional_packages) + shutil.rmtree(dnf_conf.persistdir) print_rpms(g) if ns.profiler: