pungi: fix --nosource option

https://bugzilla.redhat.com/show_bug.cgi?id=1014680
This commit is contained in:
Marek Marczykowski-Górecki 2014-04-08 01:06:43 +02:00
parent 7fe06dd703
commit 39f318923e
2 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,79 @@
From a403e72e5c76c8f885b7b2120b7f5753c8f5006d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
<marmarek@invisiblethingslab.com>
Date: Mon, 7 Apr 2014 00:49:29 +0200
Subject: [PATCH] Do not collect (or even check existence) src.rpms when
--nosource given
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
Cc: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
src/pypungi/__init__.py | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/src/pypungi/__init__.py b/src/pypungi/__init__.py
index e719f1a..67f4663 100644
--- a/src/pypungi/__init__.py
+++ b/src/pypungi/__init__.py
@@ -774,7 +774,8 @@ class Pungi(pypungi.PungiBase):
# get package objects according to the input list
self.getPackageObjects()
- self.createSourceHashes()
+ if self.is_sources:
+ self.createSourceHashes()
pass_num = 0
added = set()
@@ -799,16 +800,18 @@ class Pungi(pypungi.PungiBase):
for po in sorted(self.po_list):
added.update(self.get_package_deps(po))
- added_srpms = self.add_srpms()
- added.update(added_srpms)
- if self.is_selfhosting:
- for srpm_po in sorted(added_srpms):
- added.update(self.get_package_deps(srpm_po))
+ if self.is_sources:
+ added_srpms = self.add_srpms()
+ added.update(added_srpms)
+ if self.is_selfhosting:
+ for srpm_po in sorted(added_srpms):
+ added.update(self.get_package_deps(srpm_po))
if self.is_fulltree:
new = self.add_fulltree()
self.fulltree_packages.update(new)
- self.fulltree_packages.update([ self.sourcerpm_srpmpo_map[i.sourcerpm] for i in new ])
+ if self.is_sources:
+ self.fulltree_packages.update([ self.sourcerpm_srpmpo_map[i.sourcerpm] for i in new ])
added.update(new)
if added:
continue
@@ -816,7 +819,8 @@ class Pungi(pypungi.PungiBase):
# add langpacks
new = self.add_langpacks(self.po_list)
self.langpack_packages.update(new)
- self.langpack_packages.update([ self.sourcerpm_srpmpo_map[i.sourcerpm] for i in new ])
+ if self.is_sources:
+ self.langpack_packages.update([ self.sourcerpm_srpmpo_map[i.sourcerpm] for i in new ])
added.update(new)
if added:
continue
@@ -824,7 +828,8 @@ class Pungi(pypungi.PungiBase):
# add multilib packages
new = self.add_multilib(self.po_list)
self.multilib_packages.update(new)
- self.multilib_packages.update([ self.sourcerpm_srpmpo_map[i.sourcerpm] for i in new ])
+ if self.is_sources:
+ self.multilib_packages.update([ self.sourcerpm_srpmpo_map[i.sourcerpm] for i in new ])
added.update(new)
if added:
continue
--
1.8.3.1

View File

@ -15,6 +15,7 @@ URL: https://fedorahosted.org/pungi
Source0: https://fedorahosted.org/pungi/attachment/wiki/%{version}/%{name}-%{version}.tar.bz2
Patch0: support-verify-downloaded-packages.patch
Patch1: disable-efi.patch
Patch2: effective-nosource-option.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: yum => 3.4.3-28, repoview, createrepo >= 0.4.11
Requires: lorax
@ -31,6 +32,7 @@ A tool to create anaconda based installation trees/isos of a set of rpms.
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build
%{__python} setup.py build