From b11a8e5a909159301227b5cbe1da554bc1f3ca88 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 10 Mar 2015 16:14:44 -0500 Subject: [PATCH 01/78] switch to BSD style hashes for the iso checksums (dennis) - refactor to get better data into .treeinfo (dennis) - Add --nomacboot option (csieh) --- .gitignore | 1 + pungi.spec | 7 ++++++- sources | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ea0d4566..958b9a3e 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ pungi-2.1.2.tar.bz2 /pungi-3.11.tar.bz2 /pungi-3.12.tar.bz2 /pungi-3.13.tar.bz2 +/pungi-3.14.tar.bz2 diff --git a/pungi.spec b/pungi.spec index d9f4be28..11a10e06 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,7 +1,7 @@ %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Name: pungi -Version: 3.13 +Version: 3.14 Release: 1%{?dist} Summary: Distribution compose tool @@ -56,6 +56,11 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Mar 10 2015 Dennis Gilmore - 3.14-1 +- switch to BSD style hashes for the iso checksums (dennis) +- refactor to get better data into .treeinfo (dennis) +- Add --nomacboot option (csieh) + * Fri Dec 12 2014 Dennis Gilmore - 3.13-1 - Add support for --installpkgs (bcl) - Add a cmdline option to set the lorax config file (bcl) diff --git a/sources b/sources index f8de28ab..fff137f9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4609de9057defe74f33c803a2da166a1 pungi-3.13.tar.bz2 +b1fa4c6e85073b12440c5f113e9e7622 pungi-3.14.tar.bz2 From 9db07c22664c9d5c6bf863a4d332277395e5a2f1 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 12 Mar 2015 11:06:06 -0500 Subject: [PATCH 02/78] update to the pungi 4.0 dev branch --- .gitignore | 1 + pungi.spec | 30 +++++++++++++++--------------- sources | 2 +- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 958b9a3e..6301f429 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ pungi-2.1.2.tar.bz2 /pungi-3.12.tar.bz2 /pungi-3.13.tar.bz2 /pungi-3.14.tar.bz2 +/pungi-4.0.tar.bz2 diff --git a/pungi.spec b/pungi.spec index 11a10e06..dd1ba403 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,8 +1,6 @@ -%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} - Name: pungi -Version: 3.14 -Release: 1%{?dist} +Version: 4.0 +Release: 0.11%{?dist}.gitdfd0cc9 Summary: Distribution compose tool Group: Development/Tools @@ -15,7 +13,7 @@ Requires: lorax >= 22.1 Requires: repoview Requires: python-lockfile -BuildRequires: python-devel +BuildRequires: python-devel, python-setuptools BuildArch: noarch @@ -36,7 +34,6 @@ rm -rf $RPM_BUILD_ROOT %{__install} -d $RPM_BUILD_ROOT/var/cache/pungi %{__install} -d $RPM_BUILD_ROOT/%{_mandir}/man8 %{__install} doc/pungi.8 $RPM_BUILD_ROOT/%{_mandir}/man8/ -%{__mv} $RPM_BUILD_ROOT/%{_bindir}/pungi.py $RPM_BUILD_ROOT/%{_bindir}/pungi %clean @@ -45,17 +42,20 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) -%doc Authors Changelog COPYING GPL ToDo doc/README -# For noarch packages: sitelib -%{python_sitelib}/pypungi +%license COPYING GPL +%doc AUTHORS doc/README +%{python_sitelib}/%{name} %{python_sitelib}/%{name}-%{version}-py?.?.egg-info -%{_bindir}/pungi +%{_bindir}/* %{_datadir}/pungi %{_mandir}/man8/pungi.8.gz /var/cache/pungi %changelog +* Thu Mar 12 2015 Dennis Gilmore - 4.0-0.1.git64b6c80 +- update to the pungi 4.0 dev branch + * Tue Mar 10 2015 Dennis Gilmore - 3.14-1 - switch to BSD style hashes for the iso checksums (dennis) - refactor to get better data into .treeinfo (dennis) @@ -121,9 +121,9 @@ rm -rf $RPM_BUILD_ROOT * Sun Oct 27 2013 Daniel Mach - 3.01-1 - Add 'make log' command to print changelog for spec. (Daniel Mach) -- Implement %prepopulate config section as an additional package input. (Daniel Mach) +- Implement %%prepopulate config section as an additional package input. (Daniel Mach) - Don't automatically apply fulltree on input multilib packages. (Daniel Mach) -- Implement %multilib-blacklist and %multilib-whitelist config sections. (Daniel Mach) +- Implement %%multilib-blacklist and %%multilib-whitelist config sections. (Daniel Mach) - Turn off fulltree for multilib packages. (Daniel Mach) - Return package flags: input, fulltree-exclude, langpack, multilib, fulltree (Daniel Mach) - Exclude srpms from conditional deps. (Daniel Mach) @@ -280,7 +280,7 @@ rm -rf $RPM_BUILD_ROOT - Use https url for bugzilla by default. * Thu Oct 09 2008 Jesse Keating - 2.0.6-1 -- Handle %packages --default to pick up the default groups. +- Handle %%packages --default to pick up the default groups. - Set iso name to be the same as --name - Make sure we don't include the 'sha1:' in the iso SHA1SUM file. - Fix .treeinfo to have proper case in file names @@ -439,7 +439,7 @@ McLoughlin) * Thu Aug 30 2007 Jesse Keating - 1.0.2-1 - Fix some bugs with source iso creation - Add source repo to kickstart file -- Add %end to %packages in kickstart file +- Add %%end to %%packages in kickstart file * Tue Aug 28 2007 Jesse Keating - 1.0.1-1 - Default flavor to blank. @@ -558,7 +558,7 @@ McLoughlin) * Fri Mar 09 2007 Jesse Keating - 0.2.8-1 - Call createrepo ourselves for the tree, not buildinstall's job - Convert from commands to subprocess for things we call out -- Add kickstart %packages syntax support to package manifest +- Add kickstart %%packages syntax support to package manifest - Make the list we hand off to yum to search for as unique as we can * Wed Feb 28 2007 Jesse Keating - 0.2.7-1 diff --git a/sources b/sources index fff137f9..e3bc81d2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b1fa4c6e85073b12440c5f113e9e7622 pungi-3.14.tar.bz2 +eb68ff41fc39f79c106e071529dccf01 pungi-4.0.tar.bz2 From 31772f1b6e8a4909094c0fa2264db8bf031ca8dc Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 12 Mar 2015 11:42:52 -0500 Subject: [PATCH 03/78] update git snapshot to switch to executing lorax since it is using dnf --- pungi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pungi.spec b/pungi.spec index dd1ba403..42089062 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.0 -Release: 0.11%{?dist}.gitdfd0cc9 +Release: 0.2%{?dist}.git320724e Summary: Distribution compose tool Group: Development/Tools @@ -53,6 +53,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Mar 12 2015 Dennis Gilmore - 4.0-0.2.git320724e +- update git snapshot to switch to executing lorax since it is using dnf + * Thu Mar 12 2015 Dennis Gilmore - 4.0-0.1.git64b6c80 - update to the pungi 4.0 dev branch From b2b45637747e64fe2b8cb23ee0d64ce4e0392457 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 12 Mar 2015 13:25:48 -0500 Subject: [PATCH 04/78] rename binaries (dennis) - Add the option to pass a custom path for the multilib config files (bcl) - Call lorax as a process not a library (bcl) - Close child fds when using subprocess (bcl) - fixup setup.py and MANIFEST.in to make a useable tarball (dennis) - switch to BSD style hashes for the iso checksums (dennis) - refactor to get better data into .treeinfo (dennis) - Initial code merge for Pungi 4.0. (dmach) - Initial changes for Pungi 4.0. (dmach) - Add --nomacboot option (csieh) --- pungi.spec | 14 +++++++++++++- sources | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pungi.spec b/pungi.spec index 42089062..2f6062c4 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.0 -Release: 0.2%{?dist}.git320724e +Release: 0.3%{?dist}.git320724e Summary: Distribution compose tool Group: Development/Tools @@ -53,6 +53,18 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Mar 12 2015 Dennis Gilmore - 4.0-0.3.gita3158ec +- rename binaries (dennis) +- Add the option to pass a custom path for the multilib config files (bcl) +- Call lorax as a process not a library (bcl) +- Close child fds when using subprocess (bcl) +- fixup setup.py and MANIFEST.in to make a useable tarball (dennis) +- switch to BSD style hashes for the iso checksums (dennis) +- refactor to get better data into .treeinfo (dennis) +- Initial code merge for Pungi 4.0. (dmach) +- Initial changes for Pungi 4.0. (dmach) +- Add --nomacboot option (csieh) + * Thu Mar 12 2015 Dennis Gilmore - 4.0-0.2.git320724e - update git snapshot to switch to executing lorax since it is using dnf diff --git a/sources b/sources index e3bc81d2..9b27fa6b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -eb68ff41fc39f79c106e071529dccf01 pungi-4.0.tar.bz2 +508b9f1f1845d03d99b76f82b57628f7 pungi-4.0.tar.bz2 From 8e457455d6e5510fe60b6644d9ba84f1cbf1af34 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 12 Mar 2015 18:10:33 -0500 Subject: [PATCH 05/78] fix up the pungi logging by putting the arch in the log file name (dennis) - change pypungi imports to pungi (dennis) - spec file cleanups (dennis) --- pungi.spec | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pungi.spec b/pungi.spec index 2f6062c4..c4198eb4 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.0 -Release: 0.3%{?dist}.git320724e +Release: 0.4%{?dist}.git18d4d2e Summary: Distribution compose tool Group: Development/Tools @@ -12,6 +12,8 @@ Requires: yum => 3.4.3-28 Requires: lorax >= 22.1 Requires: repoview Requires: python-lockfile +Requires: kobo +Requires: productmd BuildRequires: python-devel, python-setuptools @@ -20,14 +22,12 @@ BuildArch: noarch %description A tool to create anaconda based installation trees/isos of a set of rpms. - %prep %setup -q %build %{__python} setup.py build - %install rm -rf $RPM_BUILD_ROOT %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT @@ -35,11 +35,6 @@ rm -rf $RPM_BUILD_ROOT %{__install} -d $RPM_BUILD_ROOT/%{_mandir}/man8 %{__install} doc/pungi.8 $RPM_BUILD_ROOT/%{_mandir}/man8/ - -%clean -rm -rf $RPM_BUILD_ROOT - - %files %defattr(-,root,root,-) %license COPYING GPL @@ -51,8 +46,12 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man8/pungi.8.gz /var/cache/pungi - %changelog +* Thu Mar 12 2015 Dennis Gilmore - 4.0-0.4.git18d4d2e +- fix up the pungi logging by putting the arch in the log file name (dennis) +- change pypungi imports to pungi (dennis) +- spec file cleanups (dennis) + * Thu Mar 12 2015 Dennis Gilmore - 4.0-0.3.gita3158ec - rename binaries (dennis) - Add the option to pass a custom path for the multilib config files (bcl) From fb8ac264abfc289ce41a09c55753120ce562ec65 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 12 Mar 2015 18:10:59 -0500 Subject: [PATCH 06/78] updated tarball --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 9b27fa6b..ea220fa7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -508b9f1f1845d03d99b76f82b57628f7 pungi-4.0.tar.bz2 +48a4b179f4824e3f0c9e241fbd3f07b1 pungi-4.0.tar.bz2 From 61e704d7138ea630123650219edb30dfb967743e Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 13 Mar 2015 14:27:36 -0500 Subject: [PATCH 07/78] update Requires for rename of python-productmd --- pungi.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pungi.spec b/pungi.spec index c4198eb4..26252796 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.0 -Release: 0.4%{?dist}.git18d4d2e +Release: 0.5%{?dist}.git18d4d2e Summary: Distribution compose tool Group: Development/Tools @@ -13,7 +13,7 @@ Requires: lorax >= 22.1 Requires: repoview Requires: python-lockfile Requires: kobo -Requires: productmd +Requires: python-productmd BuildRequires: python-devel, python-setuptools @@ -47,6 +47,9 @@ rm -rf $RPM_BUILD_ROOT /var/cache/pungi %changelog +* Fri Mar 13 2015 Dennis Gilmore - 4.0-0.5.git18d4d2e +- update Requires for rename of python-productmd + * Thu Mar 12 2015 Dennis Gilmore - 4.0-0.4.git18d4d2e - fix up the pungi logging by putting the arch in the log file name (dennis) - change pypungi imports to pungi (dennis) From 289d376c2188f0087b45feabd205839eec5ca449 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 14 Mar 2015 12:27:19 -0500 Subject: [PATCH 08/78] update the git snapshot to pick up some fixes --- pungi.spec | 7 ++++--- sources | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pungi.spec b/pungi.spec index 26252796..6ae0864f 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.0 -Release: 0.5%{?dist}.git18d4d2e +Release: 0.6%{?dist}.20150314.gitd337c34 Summary: Distribution compose tool Group: Development/Tools @@ -29,14 +29,12 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %{__python} setup.py build %install -rm -rf $RPM_BUILD_ROOT %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT %{__install} -d $RPM_BUILD_ROOT/var/cache/pungi %{__install} -d $RPM_BUILD_ROOT/%{_mandir}/man8 %{__install} doc/pungi.8 $RPM_BUILD_ROOT/%{_mandir}/man8/ %files -%defattr(-,root,root,-) %license COPYING GPL %doc AUTHORS doc/README %{python_sitelib}/%{name} @@ -47,6 +45,9 @@ rm -rf $RPM_BUILD_ROOT /var/cache/pungi %changelog +* Sat Mar 14 2015 Dennis Gilmore - 4.0-0.6.20150314.gitd337c34 +- update the git snapshot to pick up some fixes + * Fri Mar 13 2015 Dennis Gilmore - 4.0-0.5.git18d4d2e - update Requires for rename of python-productmd diff --git a/sources b/sources index ea220fa7..426152bd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -48a4b179f4824e3f0c9e241fbd3f07b1 pungi-4.0.tar.bz2 +1bbc1458424ab756551addfd52f924d5 pungi-4.0.tar.bz2 From 296ada27f42e638b8e0813b259393b1602ad405f Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 20 May 2015 15:28:52 -0500 Subject: [PATCH 09/78] make sure we treat the isfinal option as a boolean when fetching it (dennis) - if there is a variant use it in the volume id and shorten it. this will make each producst install tree have different volume ids for their isos (dennis) - fix up productmd import in the executable (dennis) - fixup productmd imports for changes with open sourcing (dennis) - tell the scm wrapper to do an absolute import otherwise we hit a circular dep issue and things go wonky (dennis) - include the dtd files in /usr/share/pungi (dennis) - add missing ) causing a syntax error (dennis) - fix up the productmd imports to import the function from the common module (dennis) - fix up typo in getting arch for the lorax log file (dennis) --- pungi.spec | 604 ++--------------------------------------------------- sources | 2 +- 2 files changed, 18 insertions(+), 588 deletions(-) diff --git a/pungi.spec b/pungi.spec index 6ae0864f..1617b57d 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,11 +1,11 @@ Name: pungi Version: 4.0 -Release: 0.6%{?dist}.20150314.gitd337c34 +Release: 0.7%{?dist}.20150520.gitdc1be3e Summary: Distribution compose tool Group: Development/Tools License: GPLv2 -URL: https://fedorahosted.org/pungi +URL: https://pagure.io/pungi Source0: https://fedorahosted.org/pungi/attachment/wiki/%{version}/%{name}-%{version}.tar.bz2 Requires: createrepo >= 0.4.11 Requires: yum => 3.4.3-28 @@ -14,6 +14,7 @@ Requires: repoview Requires: python-lockfile Requires: kobo Requires: python-productmd +Requires: python-kickstart BuildRequires: python-devel, python-setuptools @@ -45,6 +46,20 @@ A tool to create anaconda based installation trees/isos of a set of rpms. /var/cache/pungi %changelog +* Wed May 20 2015 Dennis Gilmore - 4.0-0.7.20150520.gitdc1be3e +- make sure we treat the isfinal option as a boolean when fetching it (dennis) +- if there is a variant use it in the volume id and shorten it. this will make + each producst install tree have different volume ids for their isos (dennis) +- fix up productmd import in the executable (dennis) +- fixup productmd imports for changes with open sourcing (dennis) +- tell the scm wrapper to do an absolute import otherwise we hit a circular dep + issue and things go wonky (dennis) +- include the dtd files in /usr/share/pungi (dennis) +- add missing ) causing a syntax error (dennis) +- fix up the productmd imports to import the function from the common module + (dennis) +- fix up typo in getting arch for the lorax log file (dennis) + * Sat Mar 14 2015 Dennis Gilmore - 4.0-0.6.20150314.gitd337c34 - update the git snapshot to pick up some fixes @@ -73,588 +88,3 @@ A tool to create anaconda based installation trees/isos of a set of rpms. * Thu Mar 12 2015 Dennis Gilmore - 4.0-0.1.git64b6c80 - update to the pungi 4.0 dev branch - -* Tue Mar 10 2015 Dennis Gilmore - 3.14-1 -- switch to BSD style hashes for the iso checksums (dennis) -- refactor to get better data into .treeinfo (dennis) -- Add --nomacboot option (csieh) - -* Fri Dec 12 2014 Dennis Gilmore - 3.13-1 -- Add support for --installpkgs (bcl) -- Add a cmdline option to set the lorax config file (bcl) -- Add python-lockfile requires and drop python-devel (bcl) -- Make our OS iso bootable on aarch64. (pjones) -- fix up typo (dennis) -- replace tabs with spaces (dennis) - -* Tue Sep 30 2014 Dennis Gilmore - 3.12-2 -- add patch to fix whitespace errors - -* Thu Sep 11 2014 Dennis Gilmore - 3.12-1 -- Remove magic parameter to mkisofs (hamzy) -- Added option for setting release note files (riehecky) - -* Thu Jul 31 2014 Dennis Gilmore - 3.11-1 -- make sure that the dvd/cd is using the shortened volumeid (dennis) - -* Thu Jul 31 2014 Dennis Gilmore - 3.10-1 -- fix up volume shortening substituions to actually work (dennis) - -* Wed Jul 30 2014 Dennis Gilmore - 3.09-1 -- implement nameing scheme from - https://fedoraproject.org/wiki/User:Adamwill/Draft_fedora_image_naming_policy - (dennis) -- implement shortening of the volumeid which has a 32 character limit (dennis) - -* Wed Jul 23 2014 Dennis Gilmore - 3.08-1 -- fix up some issues with --no-dvd and --workbasedir (dennis) - -* Sun Jul 20 2014 Dennis Gilmore - 3.07-1 -- add option to not make a dvd - -* Mon Jul 14 2014 Dennis Gilmore - 3.06-1 -- allow the base work directory to be configurable - -* Tue Jul 08 2014 Dennis Gilmore - 3.05-1 -- Don't emit media labels with spaces in them. (pjones) - -* Sat Jun 07 2014 Fedora Release Engineering - 3.04-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Thu May 01 2014 Dennis Gilmore - 3.04-2 -- add missing requires on python-lockfile - -* Tue Apr 29 2014 Dennis Gilmore - 3.04-1 -- Use a lockfile around things that modify the cachedir. (rbean) -- Improve logging for missing srpms. (rbean) -- honour the --nosource option (dennis) -- support ppc64le in pungi (hamzy) -- Add configurable compression type to pungi (default to xz) (rbean) - -* Thu Oct 31 2013 Dennis Gilmore - 3.03-1 -- revert to the old way of doing versioning as the change in 3.01 did not work - -* Thu Oct 31 2013 Dennis Gilmore - 3.02-1 -- fix typo in call to __version__ (Dennis Gilmore) - -* Sun Oct 27 2013 Daniel Mach - 3.01-1 -- Add 'make log' command to print changelog for spec. (Daniel Mach) -- Implement %%prepopulate config section as an additional package input. (Daniel Mach) -- Don't automatically apply fulltree on input multilib packages. (Daniel Mach) -- Implement %%multilib-blacklist and %%multilib-whitelist config sections. (Daniel Mach) -- Turn off fulltree for multilib packages. (Daniel Mach) -- Return package flags: input, fulltree-exclude, langpack, multilib, fulltree (Daniel Mach) -- Exclude srpms from conditional deps. (Daniel Mach) -- Improve greedy methods: none, all, build. (Daniel Mach) -- Add .gitignore. (Daniel Mach) -- Add 'yaboot' multilib method. (Daniel Mach) -- Drop pulseaudio-utils from runtime whitelist (Daniel Mach) -- Remove packages which are in lookaside repos from regular repos. (Daniel Mach) -- Print repoid to make clear from which repo a package came. (Daniel Mach) -- Don't pull conditional deps in when --nodeps is used. (Daniel Mach) -- Multilib fix - consider only *.so* libs which are also listed in Provides. (Daniel Mach) -- Fix --nodeps by setting Pungi.is_resolve_deps according to config. (Daniel Mach) -- Add test_arch.py. (Daniel Mach) - -* Tue Aug 20 2013 Dennis Gilmore - 3.00-1 -- apply patches from Daniel Mach -- make sure we only use mac support on x86_64 -- make sure deltarpm is disabled - -* Sun Aug 04 2013 Fedora Release Engineering - 2.13-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild - -* Thu Feb 14 2013 Fedora Release Engineering - 2.13-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild - -* Fri Dec 21 2012 Dennis Gilmore - 2.13-1 -- strip groups from comps not listed in the kickstart -- fix ppc64 runtime installation (#888887) -- dont make isos on arm -- include ppc64 checksums (#888517) - -* Fri Aug 31 2012 Dennis Gilmore - 2.12-1 -- ppc64p7 support -- update locations for ppc files for image composition bz#849731 -- add 32 bit arm arches - -* Sat Jul 21 2012 Fedora Release Engineering - 2.11-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - -* Thu May 03 2012 Dennis Gilmore - 2.11-2 -- add patch for bz#816315 - -* Mon Apr 16 2012 Dennis Gilmore - 2.11-1 -- upstream 2.11 release - -* Thu Feb 09 2012 Dennis Gilmore - 2.10-1 -- drop all the patches merged into upstream 2.10 release - -* Thu Feb 09 2012 Dennis Gilmore - 2.9-3 -- hash the Packages dir for consistency between Fedora and Everything trees - -* Tue Jan 31 2012 Dennis Gilmore - 2.9-2 -- add patch from will woods for yaboot on ppc - -* Mon Jan 30 2012 Dennis Gilmore - 2.9-1 -- pass isfinal rather than is_beta to lorax - -* Sat Jan 14 2012 Fedora Release Engineering - 2.8-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild - -* Thu Oct 27 2011 Will Woods - 2.8-2 -- Fix DVD builds for ppc/ppc64 -- Use a consistent ISO label so the bootloader will work (#732298) - -* Mon Jul 18 2011 Jesse Keating - 2.8-1 -- Always re-init the yum object (#717089) - -* Mon May 16 2011 Dennis Gilmore - 2.7-1 -- add --isfinal for turning off the betanag - -* Fri Apr 29 2011 Jesse Keating - 2.6-1 -- Make sure lorax makes use of our gathered repo - -* Wed Jan 12 2011 Jesse Keating - 2.5-1 -- Use Lorax instead of buildinstall (mgracik) - -* Tue Dec 21 2010 Jesse Keating - 2.4-1 -- Enable EFI booting on x86_64 media - -* Mon Nov 15 2010 Jesse Keating - 2.3-1 -- Drop split-media support - -* Thu Oct 14 2010 Jesse Keating - 2.1.4-1 -- Further fix the pkgorder issue - -* Wed Oct 13 2010 Jesse Keating - 2.1.3-1 -- Fix a pkgorder issue - -* Tue Jun 29 2010 Jesse Keating - 2.1.2-1 -- Fix a yumconf traceback (thanks James!) - -* Fri Jun 04 2010 Jesse Keating - 2.1.1-1 -- Don't do multilib gathering. -- fixes --force when compose fails during split-tree process. (npetrov) -- fix pkgorder (npetrov) - -* Wed Apr 14 2010 Jesse Keating - 2.1.0-1 -- Update paths for new anaconda layout -- Drop hints about checksum type -- Add proxy support from the repo line in the kickstart file -- Catch all kernel packages - -* Tue Sep 15 2009 Jesse Keating - 2.0.20-1 -- One more upstream pkgorder fix - -* Tue Sep 15 2009 Jesse Keating - 2.0.19-1 -- More upstream fixes for pkgorder and selfhosting composes - -* Mon Sep 14 2009 Jesse Keating - 2.0.18-1 -- Search for dracut for pkgorder - -* Mon Aug 10 2009 Jesse Keating - 2.0.17-1 -- Fix pkgorder to not conflict with yum internals. -- Remove dead code from splittree - -* Thu May 21 2009 Jesse Keating - 2.0.16-1 -- Fix boot.iso being on DVD images - -* Tue May 19 2009 Jesse Keating - 2.0.15-1 -- Split media on demand rather than via guess work. - -* Mon Apr 13 2009 Jesse Keating - 2.0.14-1 -- Fix package excludes in kickstart files -- Correctly account for ppc bootable isofs overhead -- Wire in support for composing 'full' trees with all subpackages - -* Tue Mar 24 2009 Jesse Keating - 2.0.13-1 -- Add online-docs to pkgorder - -* Wed Mar 11 2009 Jesse Keating - 2.0.12-1 -- Update for yum API change - -* Mon Mar 09 2009 Jesse Keating - 2.0.11-1 -- Fix size estimation in splittree -- Disable arch test in splittree for now - -* Wed Feb 11 2009 Jesse Keating - 2.0.10-1 -- Fix CD1 overflow issue -- Name the checksum file after the isos being generated. -- Use sha256 for checksums -- Use unique md file names for repodata. -- Do not include boot.iso on any disc -- Add the packages that anaconda forces to be installed into the pkgorder - -* Thu Dec 04 2008 Jesse Keating - 2.0.9-1 -- Fix for python-2.6 ('default' is no longer a valid config section) -- Fix splitting srpms - -* Tue Nov 4 2008 Jesse Keating - 2.0.8-1 -- Set default disc size to 695 - -* Tue Nov 4 2008 Jesse Keating - 2.0.7-1 -- Fix splittree to actually use the iso size defined in kickstarts -- Use https url for bugzilla by default. - -* Thu Oct 09 2008 Jesse Keating - 2.0.6-1 -- Handle %%packages --default to pick up the default groups. -- Set iso name to be the same as --name -- Make sure we don't include the 'sha1:' in the iso SHA1SUM file. -- Fix .treeinfo to have proper case in file names - -* Thu Sep 11 2008 Jesse Keating - 2.0.5-1 -- Add input-methods to pkgorder. It's a new group, need to get ordering right. -- Make sure we output sha1sums in binary mode. This helps windows. -- Yum api changed, follow so that we don't break. - -* Mon Aug 11 2008 Jesse Keating 2.0.4-1 -- Remove unused discs option -- Don't try to make debuginfo repo for source arch -- Change the checksum output for images checksumming -- Get ppc boot images in checksum list -- Only get repodata and init yum object when needed -- Fix path issues in info files - -* Tue Jul 15 2008 Jesse Keating 2.0.3-1 -- Checksum various files from buildinstall output and put them in .treeinfo -- Use new hashsum utility to generate sha1sums - -* Fri Jul 11 2008 Jesse Keating 2.0.2-1 -- add ability to gather debuginfo. It is default. - -* Tue Jun 24 2008 Jesse Keating - 2.0.1-1 -- Take on splittree and pkgorder from anaconda. - -* Fri Jun 13 2008 Jesse Keating - 2.0.0-1 -- New major release -- Collapse the two classes into one Pungi class -- Create a pypungi.util module for utility functions -- Pass along repos/mirrorlists configured in ks file to buildinstall -- Repo cost is now "cost" in pykickstart - -* Tue May 06 2008 Jesse Keating - 1.2.18-1 -- Manifest change for F9, drop syslog-ng - -* Thu May 01 2008 Jesse Keating - 1.2.17-1 -- Add a config file for Fedora 9. - -* Wed Apr 16 2008 jkeating 1.2.16-1 -- Fix another issue with source repo stuff. - -* Wed Apr 16 2008 jkeating 1.2.15-1 -- Disable comps cleanup until xslt is fixed -- Add support for yum repo costs -- Adjust manifest for Fedora 9 (kernels, languages, flash) - -* Mon Apr 08 2008 Jesse Keating - 1.2.14-1 -- Create repodata for source. -- Fix SRPM splittree making -- Bump anaconda require up for fixed splittree - -* Tue Apr 01 2008 Jesse Keating - 1.2.13-1 -- Use the yum api for merging comps. - -* Fri Mar 14 2008 Jesse Keating - 1.2.12-1 -- Fix source isos -- Send the right options to buildinstall - -* Wed Mar 12 2008 Jesse Keating - 1.2.11-1 -- Make CDs fit again. - -* Tue Mar 11 2008 Jesse Keating - 1.2.10-1 -- Handle netinst.iso being renamed to boot.iso - -* Wed Mar 05 2008 Jesse Keating - 1.2.9-1 -- Fix ppc split iso generation -- Exclude repoview from isos - -* Fri Jan 25 2008 jkeating 1.2.8-1 -- Put createrepo arguments in correct order -- Fix comps mashup to be more lenient with the open/close of 1.2.7-1 -- Rework how repodata gets generated for media. -- use createrepo api - -* Wed Jan 2 2008 jkeating 1.2.6-1 -- Update the url field for new hosted urls. -- Add k3b to the Fedora manifest. - -* Mon Dec 10 2007 Jesse Keating 1.2.4-1 -- Remove extra files from tarball - -* Mon Dec 10 2007 Jesse Keating 1.2.3-1 -- Use a repoview cache. -- Use a createrepo cache. -- Change path to isomd5sum -- Add egg file to spec - -* Tue Dec 4 2007 Jesse Keating 1.2.0-1 -- Make logged output reusable in shell -- Default to making split media of CD size -- Enable repo includes/excludes. -- Put a constraint on flavor values -- Check for selinux enforcing and warn. -- Add a --force option to reuse an existing destdir -- Only check for root if you're doing root level tasks (buildinstall) -- Figure out number of isos on the fly, based on tree size -- Remove -S -P options, as splittree and packageorder are now -called from createIsos, if needed. -- Use downloadPkgs() from yum instead of a homebrew download function. -- Add a callback to show download progress - -* Thu Nov 22 2007 Jesse Keating - 1.1.10-1 -- Print a usage if no options are passed -- Correct a man page typo -- Update the F8 config to use released repos - -* Mon Oct 29 2007 Jesse Keating - 1.1.9-1 -- Remove oversized cached packages (fixes reget problem) - -* Sat Oct 27 2007 Jesse Keating - 1.1.8-1 -- Add eclipse group. - -* Tue Oct 23 2007 Jesse Keating - 1.1.7-1 -- Add java-development to the group set. - -* Fri Oct 19 2007 Jesse Keating - 1.1.6-1 -- Update the manifest - -* Thu Oct 11 2007 Jesse Keating - 1.1.5-1 -- Add a cost to the media repo - -* Tue Oct 02 2007 Jesse Keating - 1.1.4-1 -- Make sure we use strings in the config object - -* Wed Sep 26 2007 Jesse Keating - 1.1.3-1 -- Pull in all the optional Virt stuff -- Don't expire the metadata from Media repo. - -* Tue Sep 25 2007 Jesse Keating - 1.1.2-1 -- Fix location of media.repo file. - -* Tue Sep 18 2007 Jesse Keating - 1.1.1-1 -- Create a media.repo file on the first iso - -* Fri Sep 14 2007 Jesse Keating - 1.1.0-1 -- Create repoview content in the tree -- Move the .composeinfo file into the directory we actually publish -- Remove python2.5 needs (Mark McLoughlin) -- Consolidate the download code for easier maint. (Mark McLoughlin) -- Create a config class that can make using pungi modules easier. (Mark -McLoughlin) -- Use url line in kickstart files as a repo -- Fix a bug with default dest dir (notting) -- Include a man page (dcantrell) -- Fix a bug with file:// based repos - -* Thu Aug 30 2007 Jesse Keating - 1.0.2-1 -- Fix some bugs with source iso creation -- Add source repo to kickstart file -- Add %%end to %%packages in kickstart file - -* Tue Aug 28 2007 Jesse Keating - 1.0.1-1 -- Default flavor to blank. - -* Mon Aug 27 2007 Jesse Keating - 1.0.0-2 -- Fix the licensing tag. - -* Mon Aug 27 2007 Jesse Keating - 1.0.0-1 -- Add support for $releasever in repo uris. -- Add a kickstart file usable for composing Fedora 8 "Fedora" -- Fix bugs with $basearch and mirrorlist usage. -- Add a cache dir for pungi (/var/cache/pungi) and a cli option to override -- Add root check. -- Use a kickstart file as input now (for cdsize and package manifest) -- Remove a lot of configurable items and hard set them -- Move some items to cli flags only (part of moving to pykickstart) -- hard set product_path to 'Packages' -- Use group metadata from repos instead of our own comps file -- Get group files out of configured repos and create a mashup - of the comps. Filter it and make use of it when creating repos. -- Quiet down creatrepo calls -- Adjust logging to make use of new facility, use right levels -- Drop a note when all done with composing - -* Tue Aug 21 2007 Jesse Keating - 0.5.0-1 -- Rework how source rpms are pulled in - Always pull in 'src' arch packages, just filter them - when not needed. Saves having to reset or create new - yum objects. -- Create a base pungi class that sets logging -- Inherit this class in Gather and Pungi -- Adjust logging to make use of new facility, use right levels -- Drop a note when all done with composing -- Make Gather() no longer a subclass of yum -- Be verbose about what we clean (makefile) -- Create a subclass of yum to work around logging fun - -* Wed Aug 01 2007 Jesse Keating - 0.4.1-1 -- Create a new yum object for source downloads as yum - -* Sat Jul 28 2007 Jesse Keating - 0.4.0-1 -- split createrepo call to it's own function. This enables rawhide - composes to happen once again. Also breaks API. -- When raising an error, print the error too - -* Tue Jul 24 2007 Jesse Keating - 0.3.9-1 -- Add a few more desktopy things to manifest -- Rename f7 files to f8; set up config files for f8test1 -- Don't quote things passed to mkisofs, not a shell -- Always log stdout before checking for stderr output -- Include memtest86+ in the "Fedora" manifest - -* Wed Jun 20 2007 Jesse Keating - 0.3.8-1 -- Only grab the newest of deps. -- Don't use flavor for a log file if no flavor set (Trac #48) -- Point to the right manifest file in pungi.conf -- Add a install target to make (Trac #37) -- Enable the source repo in yum configs (Trac #47) -- Use universal newlines in getting process output (Trac #44) -- Fix logging of broken deps (Trac #39) - -* Wed May 30 2007 Jesse Keating - 0.3.7-1 -- Handle the cdsize variable correctly -- More fixes for cached download stuff -- Fix default CD size storing -- Update comps file with what shipped for F7 - -* Fri May 25 2007 Jesse Keating - 0.3.6-1 -- Handle the cdsize variable correctly - -* Thu May 24 2007 Jesse Keating - 0.3.5-1 -- Use the right flavor in the Everything configs - -* Thu May 24 2007 Jesse Keating - 0.3.4-1 -- Use a package checksum to verify cached download - -* Wed May 23 2007 Jesse Keating - 0.3.3-1 -- Commit config files used for producing Fedora 7 -- Default pungi.conf file to using Fedora 7 stuff - -* Mon May 21 2007 Jesse Keating - 0.3.2-1 -- Don't quote ISO label, not running mkisofs in shell -- Apply sparc patches (spot) -- Fix cached downloads comparing correctly -- Shorten 'development' to 'devel' in default config, more space for mkisofs -- Handle config file missing better (jgranado) - -* Fri Apr 06 2007 Jesse Keating - 0.3.1-1 -- Fix comments in default config file - -* Mon Apr 02 2007 Jesse Keating - 0.3.0-1 -- Remove incompatible fc6 config files -- Update default config file with comments / new options -- Update comps file -- Enable source iso building again. -- Don't try a rescue if the script doesn't exist (prarit) -- Pass flavor off to buildinstall if it is set (wwoods) -- Fix a logic flaw in the depsolving loop -- Use yum's built in exclude handling -- Use yum's built in conditional handling for things from comps -- Do excludes before group handling. -- Get all potential matches for deps, let install time figure - the best one to use. -- Work around false positive 'unmatched' packages (globs are fun) -- Change how depsolving is done - - Get all potential matches for a dep, instead of our 'best' - our 'best' may not be the same as install time best. - - Remove anaconda code, use direct yum functions to get deps - - Use a True/False flag to depsolve instead of iterating over - a dict. - - Log what packages are being added for which reasons. -- Do things faster/smarter if we've only asked for one disc -- log the rpm2cpio stuff for release notes -- correctly capture errors from subprocess - -* Fri Mar 09 2007 Jesse Keating - 0.2.8-1 -- Call createrepo ourselves for the tree, not buildinstall's job -- Convert from commands to subprocess for things we call out -- Add kickstart %%packages syntax support to package manifest -- Make the list we hand off to yum to search for as unique as we can - -* Wed Feb 28 2007 Jesse Keating - 0.2.7-1 -- Fix gathering of srpms (thanks skvidal) -- Update comps from F7 Test2 - -* Thu Feb 22 2007 Jesse Keating - 0.2.6-1 -- Don't use TMPDIR with buildinstall, it is broken - -* Wed Feb 21 2007 Jesse Keating - 0.2.5-1 -- Make use of anaconda's TMPDIR support -- Put yum tempdirs in the workdir -- Add a version option to cli arguments -- Make cdsize a config option - -* Thu Feb 15 2007 Jesse Keating - 0.2.4-1 -- Add support for globbing in manifest -- Add new Make targets (Essien Ita Essien) -- Add runtime flags for doing specific stages of the compose (Essien Ita Essien) -- Add ability to define destdir on the cli to override conf file -- Clean up optionparse stuff, print usage if arg list is too small -- Fix part of the patch from Essien -- Add Contributors to the Authors file -- Adjust the Makefile so that srpm doesn't cause a tag -- Merged changes from Will Woods - - Write out some tree description files - - Don't traceback on existing files in download area (not sure this will stay) -- Style fixed some stuff from Will -- Add logging patch from jbowes -- Various logging tweaks -- Use -d flag in createrepo for sqlite blobs -- Add pydoc stuff to various functions -- Support comments in the package manifest - -* Tue Feb 06 2007 Jesse Keating - 0.2.3-1 -- Be able to opt-out of a bugurl since buildinstall supports this -- Make isodir an object of pungi (wwoods) -- yum bestPackagesFromList takes an arch argument. Fixes ppc64 bug -- Don't use 'returnSimple' anymore, deprecated in yum api - -* Mon Jan 29 2007 Jesse Keating - 0.2.2-1 -- Update the comps file again from F7 -- Fix the ppc boot flags -- Clean up SRPM-disc junk -- add bugurl config option for anaconda betanag - -* Thu Jan 25 2007 Jesse Keating - 0.2.1-1 -- Add a "flavor" option (such as Desktop) -- Move packageorder file into workdir -- Update the comps file from F7 - -* Wed Jan 24 2007 Jesse Keating - 0.2.0-1 -- Now use a manifest to determine what to pull in, not comps itself -- Add a minimal-manifest for test composes -- Add current F7 comps file for test composes -- Use some anaconda code to depsolve, gets better (and more common) results -- Bump the iso size to what was used in FC6 -- Move splittree workdirs into work/ at the end of the run -- Remove our splittree for rawhide -- Remove old main() sections from pungi.py and gather.py -- Require yum 3.0.3 or newer -- Add rescueCD support - -* Wed Dec 13 2006 Jesse Keating - 0.1.2-1 -- Fix a bug in DVD repodata -- Add correct ppc boot args -- Set ppc arch correctly - -* Mon Dec 11 2006 Jesse Keating - 0.1.1-2 -- Need BR python-devel in rawhide - -* Mon Dec 11 2006 Jesse Keating - 0.1.1-1 -- Update to 0.1.1 -- Add ability to get srpms -- Add ability to get relnote files -- Use a config file system -- Clean up some docs -- Add config files for composing FC6 respins - -* Wed Nov 8 2006 Jesse Keating - 0.1.0-1 -- Initial spec diff --git a/sources b/sources index 426152bd..49ee352c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -1bbc1458424ab756551addfd52f924d5 pungi-4.0.tar.bz2 +c01ac8e04552381427decdf170469247 pungi-4.0.tar.bz2 From d26d13ea7f42a554209806c416b8d05dbb701302 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 20 May 2015 16:44:05 -0500 Subject: [PATCH 10/78] +* Wed May 20 2015 Dennis Gilmore - 4.0-0.8.20150520.gitff77a92 +- fix up bad += from early test of implementing different iso labels based on + if there is a variant or not (dennis) --- pungi.spec | 6 +++++- sources | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pungi.spec b/pungi.spec index 1617b57d..16e6a9a3 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.0 -Release: 0.7%{?dist}.20150520.gitdc1be3e +Release: 0.8%{?dist}.20150520.gitff77a92 Summary: Distribution compose tool Group: Development/Tools @@ -46,6 +46,10 @@ A tool to create anaconda based installation trees/isos of a set of rpms. /var/cache/pungi %changelog ++* Wed May 20 2015 Dennis Gilmore - 4.0-0.8.20150520.gitff77a92 ++- fix up bad += from early test of implementing different iso labels based on ++ if there is a variant or not (dennis) + * Wed May 20 2015 Dennis Gilmore - 4.0-0.7.20150520.gitdc1be3e - make sure we treat the isfinal option as a boolean when fetching it (dennis) - if there is a variant use it in the volume id and shorten it. this will make diff --git a/sources b/sources index 49ee352c..70c7f0fc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c01ac8e04552381427decdf170469247 pungi-4.0.tar.bz2 +3a3c6995cde83bf889bb104999faae13 pungi-4.0.tar.bz2 From 4dc0d87c9fe4b20ed47b1a20cb19177ae710a6e9 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 20 May 2015 17:58:36 -0500 Subject: [PATCH 11/78] fix up changelog Signed-off-by: Dennis Gilmore --- pungi.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pungi.spec b/pungi.spec index 16e6a9a3..e4ddb6da 100644 --- a/pungi.spec +++ b/pungi.spec @@ -46,9 +46,9 @@ A tool to create anaconda based installation trees/isos of a set of rpms. /var/cache/pungi %changelog -+* Wed May 20 2015 Dennis Gilmore - 4.0-0.8.20150520.gitff77a92 -+- fix up bad += from early test of implementing different iso labels based on -+ if there is a variant or not (dennis) +* Wed May 20 2015 Dennis Gilmore - 4.0-0.8.20150520.gitff77a92 +- fix up bad += from early test of implementing different iso labels based on + if there is a variant or not (dennis) * Wed May 20 2015 Dennis Gilmore - 4.0-0.7.20150520.gitdc1be3e - make sure we treat the isfinal option as a boolean when fetching it (dennis) From 1cd3e510d9d024daffc10046b5561870d807b86e Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sun, 7 Jun 2015 10:54:17 -0500 Subject: [PATCH 12/78] update docs now devel-4-pungi is merged to master, minor spelling fixes (pbrobinson) - Fix remaining productmd issues. (dmach) - Revert "refactor metadata.py to use productmd's compose.dump for composeinfo" (dmach) - Fix LoraxTreeInfo class inheritance. (dmach) - Fix pungi -> pungi_wrapper namespace issue. (dmach) - fix arg order for checksums.add (admiller) - update for productmd checksums.add to TreeInfo (admiller) - fix product -> release namespace change for productmd (admiller) - update arch manifest.add config order for productmd api call (admiller) - update for new productmd named args to rpms (admiller) - fix pungi vs pungi_wrapper namespacing in method_deps.py (admiller) - add createrepo_c Requires to pungi.spec (admiller) - add comps_filter (admiller) - refactor metadata.py to use productmd's compose.dump for composeinfo instead of pungi compose_to_composeinfo (admiller) - Update compose, phases{buildinstall,createiso,gather/__ini__} to use correct productmd API calls (admiller) - Use libselinux-python instead of subprocess (lmacken) - Add README for contributors (admiller) --- pungi.spec | 38 +++++++++++++++++++++++++++++++++++++- sources | 2 +- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/pungi.spec b/pungi.spec index e4ddb6da..b1df5c89 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.0 -Release: 0.8%{?dist}.20150520.gitff77a92 +iRelease: 0.9%{?dist}.20150607.gitef7c78c Summary: Distribution compose tool Group: Development/Tools @@ -13,8 +13,21 @@ Requires: lorax >= 22.1 Requires: repoview Requires: python-lockfile Requires: kobo +Requires: kobo-rpmlib Requires: python-productmd Requires: python-kickstart +Requires: libselinux-python +Requires: createrepo_c +Requires: python-lxml +Requires: koji +Requires: jigdo +Requires: cvs +Requires: yum-utils +Requires: isomd5sum +Requires: genisoimage +Requires: gettext +Requires: syslinux +Requires: git BuildRequires: python-devel, python-setuptools @@ -46,6 +59,29 @@ A tool to create anaconda based installation trees/isos of a set of rpms. /var/cache/pungi %changelog +* Sun Jun 07 2015 Dennis Gilmore - 4.0-0.9.20150607.gitef7c78c +- update docs now devel-4-pungi is merged to master, minor spelling fixes + (pbrobinson) +- Fix remaining productmd issues. (dmach) +- Revert "refactor metadata.py to use productmd's compose.dump for composeinfo" + (dmach) +- Fix LoraxTreeInfo class inheritance. (dmach) +- Fix pungi -> pungi_wrapper namespace issue. (dmach) +- fix arg order for checksums.add (admiller) +- update for productmd checksums.add to TreeInfo (admiller) +- fix product -> release namespace change for productmd (admiller) +- update arch manifest.add config order for productmd api call (admiller) +- update for new productmd named args to rpms (admiller) +- fix pungi vs pungi_wrapper namespacing in method_deps.py (admiller) +- add createrepo_c Requires to pungi.spec (admiller) +- add comps_filter (admiller) +- refactor metadata.py to use productmd's compose.dump for composeinfo instead + of pungi compose_to_composeinfo (admiller) +- Update compose, phases{buildinstall,createiso,gather/__ini__} to use correct + productmd API calls (admiller) +- Use libselinux-python instead of subprocess (lmacken) +- Add README for contributors (admiller) + * Wed May 20 2015 Dennis Gilmore - 4.0-0.8.20150520.gitff77a92 - fix up bad += from early test of implementing different iso labels based on if there is a variant or not (dennis) diff --git a/sources b/sources index 70c7f0fc..7f932d62 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -3a3c6995cde83bf889bb104999faae13 pungi-4.0.tar.bz2 +4e17f7403b6ff2edba287a8083a95c17 pungi-4.0.tar.bz2 From 75d34a3c4fb80b51f07664e104d536b679500166 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sun, 7 Jun 2015 10:58:31 -0500 Subject: [PATCH 13/78] fix up accidental i Signed-off-by: Dennis Gilmore --- pungi.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pungi.spec b/pungi.spec index b1df5c89..d9761acf 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.0 -iRelease: 0.9%{?dist}.20150607.gitef7c78c +Release: 0.9%{?dist}.20150607.gitef7c78c Summary: Distribution compose tool Group: Development/Tools From cd743220f144229b7be6cdefe058efc40b381200 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 11 Jun 2015 22:15:22 -0500 Subject: [PATCH 14/78] wrap check for selinux enforcing in a try except (dennis) - pull in gather.py patches from dmach for test compose (admiller) - Add some basic testing, dummy rpm creation, and a testing README (admiller) - pungi-koji: use logger instead of print when it's available (lkocman) - fix incorrect reference to variable 'product_is_layered' (lkocman) - pungi-koji: fix bad module path to verify_label() (lkocman) - update the package Requires to ensure we have everything installed to run pungi-koji (dennis) - update the package to be installed for productmd to python-productmd (dennis) --- .gitignore | 1 + pungi.spec | 17 ++++++++++++++--- sources | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 6301f429..169a960f 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ pungi-2.1.2.tar.bz2 /pungi-3.13.tar.bz2 /pungi-3.14.tar.bz2 /pungi-4.0.tar.bz2 +/pungi-4.0.1.tar.bz2 diff --git a/pungi.spec b/pungi.spec index d9761acf..ade77517 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi -Version: 4.0 -Release: 0.9%{?dist}.20150607.gitef7c78c +Version: 4.0.1 +Release: 1%{?dist} Summary: Distribution compose tool Group: Development/Tools @@ -26,7 +26,7 @@ Requires: yum-utils Requires: isomd5sum Requires: genisoimage Requires: gettext -Requires: syslinux +#Requires: syslinux Requires: git BuildRequires: python-devel, python-setuptools @@ -59,6 +59,17 @@ A tool to create anaconda based installation trees/isos of a set of rpms. /var/cache/pungi %changelog +* Thu Jun 11 2015 Dennis Gilmore - 4.0.1-1 +- wrap check for selinux enforcing in a try except (dennis) +- pull in gather.py patches from dmach for test compose (admiller) +- Add some basic testing, dummy rpm creation, and a testing README (admiller) +- pungi-koji: use logger instead of print when it's available (lkocman) +- fix incorrect reference to variable 'product_is_layered' (lkocman) +- pungi-koji: fix bad module path to verify_label() (lkocman) +- update the package Requires to ensure we have everything installed to run + pungi-koji (dennis) +- update the package to be installed for productmd to python-productmd (dennis) + * Sun Jun 07 2015 Dennis Gilmore - 4.0-0.9.20150607.gitef7c78c - update docs now devel-4-pungi is merged to master, minor spelling fixes (pbrobinson) diff --git a/sources b/sources index 7f932d62..470badd8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4e17f7403b6ff2edba287a8083a95c17 pungi-4.0.tar.bz2 +9083387639aa12bf57189dc78a7b63a4 pungi-4.0.1.tar.bz2 From e956304625f6a1bff39596efb7555a4cdea04ab6 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 18 Jun 2015 17:59:07 +0000 Subject: [PATCH 15/78] - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild --- pungi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pungi.spec b/pungi.spec index ade77517..de7f22a2 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.0.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distribution compose tool Group: Development/Tools @@ -59,6 +59,9 @@ A tool to create anaconda based installation trees/isos of a set of rpms. /var/cache/pungi %changelog +* Thu Jun 18 2015 Fedora Release Engineering - 4.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + * Thu Jun 11 2015 Dennis Gilmore - 4.0.1-1 - wrap check for selinux enforcing in a try except (dennis) - pull in gather.py patches from dmach for test compose (admiller) From d0b3003d7359a3b82cf5ff84ce1f8533df2ed1c5 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 24 Jul 2015 12:41:20 -0500 Subject: [PATCH 16/78] Merge #23 `fix treeinfo checksums` (dmach) - Fix treeinfo checksums. (dmach) - add basic setup for making arm iso's (dennis) - gather: Implement hashed directories. (dmach) - createiso: Add createiso_skip options to skip createiso on any variant/arch. (dmach) - Fix buildinstall for armhfp. (dmach) - Fix and document productimg phase. (dmach) - Add armhfp arch tests. (dmach) - Document configuration options. (dmach) - Add dependency of 'runroot' config option on 'koji_profile'. (dmach) - Rename product_* to release_*. (dmach) - Implement koji profiles. (dmach) - Drop repoclosure-%arch tests. (dmach) - Config option create_optional_isos now defaults to False. (dmach) - Change createrepo config options defaults. (dmach) - Rewrite documentation to Sphinx. (dmach) - Fix test data, improve Makefile. (dmach) - Update GPL to latest version from https://www.gnu.org/licenses/gpl-2.0.txt (dmach) --- .gitignore | 1 + pungi.spec | 26 ++++++++++++++++++++++++-- sources | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 169a960f..879f5518 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ pungi-2.1.2.tar.bz2 /pungi-3.14.tar.bz2 /pungi-4.0.tar.bz2 /pungi-4.0.1.tar.bz2 +/pungi-4.0.2.tar.bz2 diff --git a/pungi.spec b/pungi.spec index de7f22a2..d7050dd1 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi -Version: 4.0.1 -Release: 2%{?dist} +Version: 4.0.2 +Release: 1%{?dist} Summary: Distribution compose tool Group: Development/Tools @@ -59,6 +59,28 @@ A tool to create anaconda based installation trees/isos of a set of rpms. /var/cache/pungi %changelog +* Fri Jul 24 2015 Dennis Gilmore - 4.0.2-1 +- Merge #23 `fix treeinfo checksums` (dmach) +- Fix treeinfo checksums. (dmach) +- add basic setup for making arm iso's (dennis) +- gather: Implement hashed directories. (dmach) +- createiso: Add createiso_skip options to skip createiso on any variant/arch. + (dmach) +- Fix buildinstall for armhfp. (dmach) +- Fix and document productimg phase. (dmach) +- Add armhfp arch tests. (dmach) +- Document configuration options. (dmach) +- Add dependency of 'runroot' config option on 'koji_profile'. (dmach) +- Rename product_* to release_*. (dmach) +- Implement koji profiles. (dmach) +- Drop repoclosure-%arch tests. (dmach) +- Config option create_optional_isos now defaults to False. (dmach) +- Change createrepo config options defaults. (dmach) +- Rewrite documentation to Sphinx. (dmach) +- Fix test data, improve Makefile. (dmach) +- Update GPL to latest version from https://www.gnu.org/licenses/gpl-2.0.txt + (dmach) + * Thu Jun 18 2015 Fedora Release Engineering - 4.0.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild diff --git a/sources b/sources index 470badd8..decbcb9d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9083387639aa12bf57189dc78a7b63a4 pungi-4.0.1.tar.bz2 +00cda727ee15a676e476ef86771e4514 pungi-4.0.2.tar.bz2 From 521e80758aabf301edf099efc6693525d2199a09 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 24 Jul 2015 12:49:49 -0500 Subject: [PATCH 17/78] don't install the man pages Signed-off-by: Dennis Gilmore --- pungi.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/pungi.spec b/pungi.spec index d7050dd1..648b4cf8 100644 --- a/pungi.spec +++ b/pungi.spec @@ -45,8 +45,6 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %install %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT %{__install} -d $RPM_BUILD_ROOT/var/cache/pungi -%{__install} -d $RPM_BUILD_ROOT/%{_mandir}/man8 -%{__install} doc/pungi.8 $RPM_BUILD_ROOT/%{_mandir}/man8/ %files %license COPYING GPL @@ -55,7 +53,6 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %{python_sitelib}/%{name}-%{version}-py?.?.egg-info %{_bindir}/* %{_datadir}/pungi -%{_mandir}/man8/pungi.8.gz /var/cache/pungi %changelog From 12f81c23f1591a9c32e6c461a0bca580b8c895c2 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 24 Jul 2015 13:03:10 -0500 Subject: [PATCH 18/78] fix up doc selection Signed-off-by: Dennis Gilmore --- pungi.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pungi.spec b/pungi.spec index 648b4cf8..a474685d 100644 --- a/pungi.spec +++ b/pungi.spec @@ -48,7 +48,7 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %files %license COPYING GPL -%doc AUTHORS doc/README +%doc AUTHORS doc/* %{python_sitelib}/%{name} %{python_sitelib}/%{name}-%{version}-py?.?.egg-info %{_bindir}/* From a12462643ceae75bedf81e8e009db59b6fa12505 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 8 Sep 2015 22:11:43 -0500 Subject: [PATCH 19/78] Merge #54 `fix log_info for image_build (fails if image_build is skipped)` (lkocman) - image_build: self.log_info -> self.compose.log_info (lkocman) - Revert "Added params needed for Atomic compose to LoraxWrapper" (dennis) - Revert "fix up if/elif in _handle_optional_arg_type" (dennis) - Add image-build support (lkocman) - Add translate path support. Useful for passing pungi repos to image-build (lkocman) - import duplicate import of errno from buildinstall (lkocman) - handle openning missing images.json (image-less compose re-run) (lkocman) - compose: Add compose_label_major_version(). (lkocman) - pungi-koji: Don't print traceback if error occurred. (pbabinca) - More detailed message for unsigned rpms. (tkopecek) - New config option: product_type (default is 'ga'); Set to 'updates' for updates composes. (dmach) - kojiwrapper: Add get_signed_wrapped_rpms_paths() and get_build_nvrs() methods. (tmlcoch) - live_images: Copy built wrapped rpms from koji into compose. (tmlcoch) - kojiwrapper: Add get_wrapped_rpm_path() function. (tmlcoch) - live_images: Allow custom name prefix for live ISOs. (tmlcoch) - Do not require enabled runroot option for live_images phase. (tmlcoch) - Support for rpm wrapped live images. (tmlcoch) - Remove redundant line in variants wrapper. (tmlcoch) - Merge #36 `Add params needed for Atomic compose to LoraxWrapper` (admiller) - live_images: replace hardcoded path substition with translate_path() call (lkocman) - live_images fix reference from koji to koji_wrapper (lkocman) - fix up if/elif in _handle_optional_arg_type (admiller) - Added params needed for Atomic compose to LoraxWrapper (admiller) - Merge #24 `Fix empty repodata when hash directories were enabled. ` (dmach) - createrepo: Fix empty repodata when hash directories were enabled. (dmach) Signed-off-by: Dennis Gilmore --- .gitignore | 1 + pungi.spec | 35 ++++++++++++++++++++++++++++++++++- sources | 2 +- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 879f5518..ace6dd70 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ pungi-2.1.2.tar.bz2 /pungi-4.0.tar.bz2 /pungi-4.0.1.tar.bz2 /pungi-4.0.2.tar.bz2 +/pungi-4.0.3.tar.bz2 diff --git a/pungi.spec b/pungi.spec index a474685d..5b834c45 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,5 +1,5 @@ Name: pungi -Version: 4.0.2 +Version: 4.0.3 Release: 1%{?dist} Summary: Distribution compose tool @@ -56,6 +56,39 @@ A tool to create anaconda based installation trees/isos of a set of rpms. /var/cache/pungi %changelog +* Tue Aug 08 2015 Dennis Gilmore 4.0.3-1 +- Merge #54 `fix log_info for image_build (fails if image_build is skipped)` + (lkocman) +- image_build: self.log_info -> self.compose.log_info (lkocman) +- Revert "Added params needed for Atomic compose to LoraxWrapper" (dennis) +- Revert "fix up if/elif in _handle_optional_arg_type" (dennis) +- Add image-build support (lkocman) +- Add translate path support. Useful for passing pungi repos to image-build + (lkocman) +- import duplicate import of errno from buildinstall (lkocman) +- handle openning missing images.json (image-less compose re-run) (lkocman) +- compose: Add compose_label_major_version(). (lkocman) +- pungi-koji: Don't print traceback if error occurred. (pbabinca) +- More detailed message for unsigned rpms. (tkopecek) +- New config option: product_type (default is 'ga'); Set to 'updates' for + updates composes. (dmach) +- kojiwrapper: Add get_signed_wrapped_rpms_paths() and get_build_nvrs() + methods. (tmlcoch) +- live_images: Copy built wrapped rpms from koji into compose. (tmlcoch) +- kojiwrapper: Add get_wrapped_rpm_path() function. (tmlcoch) +- live_images: Allow custom name prefix for live ISOs. (tmlcoch) +- Do not require enabled runroot option for live_images phase. (tmlcoch) +- Support for rpm wrapped live images. (tmlcoch) +- Remove redundant line in variants wrapper. (tmlcoch) +- Merge #36 `Add params needed for Atomic compose to LoraxWrapper` (admiller) +- live_images: replace hardcoded path substition with translate_path() call + (lkocman) +- live_images fix reference from koji to koji_wrapper (lkocman) +- fix up if/elif in _handle_optional_arg_type (admiller) +- Added params needed for Atomic compose to LoraxWrapper (admiller) +- Merge #24 `Fix empty repodata when hash directories were enabled. ` (dmach) +- createrepo: Fix empty repodata when hash directories were enabled. (dmach) + * Fri Jul 24 2015 Dennis Gilmore - 4.0.2-1 - Merge #23 `fix treeinfo checksums` (dmach) - Fix treeinfo checksums. (dmach) diff --git a/sources b/sources index decbcb9d..59d772fe 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -00cda727ee15a676e476ef86771e4514 pungi-4.0.2.tar.bz2 +acf949751bb6896e25480fd91a557d40 pungi-4.0.3.tar.bz2 From 711467be6f6a146ea194b6fb9dfa7a4be4e4e8d8 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 20 Jan 2016 09:46:20 -0600 Subject: [PATCH 20/78] 4.0.4 release (dennis) - Merge #123 `Live images: add repo from another variant` (ausil) - Merge #125 `[image-build] Stop creating wrong arch dirs` (ausil) - Toggle multilib per variant (lsedlar) - [live-images] Code cleanup (lsedlar) - [live-images] Add documentation (lsedlar) - [live-images] Add repos from other variants (lsedlar) - [image-build] Stop creating wrong arch dirs (lsedlar) - Enable identifying variants in exception traces (lsedlar) - Store which deliverables failed (lsedlar) - scm.py: use git clone instead git archive for http(s):// (lkocman) - Fix filtering of system release packages (lsedlar) - Merge #114 `Use install tree/repo from another variant for image build` (ausil) - Make system release package filtering optional (lsedlar) - [image-build] Optionally do not break whole compose (lsedlar) - [image-build] Refactoring (lsedlar) - [image-build] Use repo from another variant (lsedlar) - [image-build] Take install tree from another variant (lsedlar) - Add missing formats to volumeid and image name (lsedlar) - [image-build] Use single koji task per variant (lsedlar) - Fix image-build modifying config (lsedlar) - Fix missing checksums in .treeinfo (lsedlar) - Don't crash on generating volid without variant (lsedlar) - Merge #99 `Add option to specify non-failing stuff` (ausil) - Add repo from current compose (lsedlar) - Fix getting compose topdir in CreateImage build thread (lsedlar) - Add option to specify non-failing stuff (lsedlar) - Allow customizing image name and volume id (lsedlar) - Fix notifier tests (lsedlar) - Publish a url instead of a file path. (rbean) - Add 'topdir' to all fedmsg/notifier messages. (rbean) - Merge #75 `Start of development guide` (ausil) - Merge #88 `Resolve HEAD in ksurl to actual hash` (ausil) - Merge #87 `Add support for customizing lorax options` (ausil) - Update fedmsg notification hook to use appropriate config. (rbean) - we need to ensure that we send all the tasks to koji on the correct arch (dennis) - Resolve HEAD in ksurl to actual hash (lsedlar) - Add support for customizing lorax options (lsedlar) - Run lorax in separate dirs for each variant (lsedlar) - Merge #84 `Allow specifying --installpkgs for lorax` (ausil) - Merge #83 `Fix recently discovered bugs` (ausil) - Merge #82 `indentation fixs correcting dvd creation` (ausil) - Merge #69 `Move messaging into cli options and simplify it` (ausil) - Start lorax for each variant separately (lsedlar) - Update lorax wrapper to use --installpkgs (lsedlar) - Allow specifying which packages to install in variants xml (lsedlar) - Add basic tests for buildinstall phase (lsedlar) - Fix generating checksum files (lsedlar) - Use lowercase hashed directories (lsedlar) - indentation fixs correcting dvd creation (dennis) - remove glibc32 from the runroot tasks (dennis) - fix up the pungi-fedmesg-notification script name (dennis) - Add overview of Pungi to documentation (lsedlar) - Move messaging into cli options (lsedlar) - Extend contributing guide (lsedlar) - Load multilib configuration from local dir in development (lsedlar) - Allow running scripts with any python in PATH (lsedlar) Signed-off-by: Dennis Gilmore --- .gitignore | 33 +-------------------------- pungi.spec | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++--- sources | 2 +- 3 files changed, 64 insertions(+), 36 deletions(-) diff --git a/.gitignore b/.gitignore index ace6dd70..5290548f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,32 +1 @@ -pungi-2.1.2.tar.bz2 -/pungi-2.1.3.tar.bz2 -/pungi-2.1.4.tar.bz2 -/pungi-2.3.tar.bz2 -/pungi-2.4.tar.bz2 -/pungi-2.5.tar.bz2 -/pungi-2.6.tar.bz2 -/pungi-2.8.tar.bz2 -/pungi-2.9.tar.bz2 -/pungi-2.10.tar.bz2 -/pungi-2.11.tar.bz2 -/pungi-2.12.tar.bz2 -/pungi-2.13.tar.bz2 -/pungi-3.00.tar.bz2 -/pungi-3.01.tar.bz2 -/pungi-3.02.tar.bz2 -/pungi-3.03.tar.bz2 -/pungi-3.04.tar.bz2 -/pungi-3.05.tar.bz2 -/pungi-3.06.tar.bz2 -/pungi-3.07.tar.bz2 -/pungi-3.08.tar.bz2 -/pungi-3.09.tar.bz2 -/pungi-3.10.tar.bz2 -/pungi-3.11.tar.bz2 -/pungi-3.12.tar.bz2 -/pungi-3.13.tar.bz2 -/pungi-3.14.tar.bz2 -/pungi-4.0.tar.bz2 -/pungi-4.0.1.tar.bz2 -/pungi-4.0.2.tar.bz2 -/pungi-4.0.3.tar.bz2 +/pungi-*.tar.bz2 diff --git a/pungi.spec b/pungi.spec index 5b834c45..b41e01bf 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,5 +1,5 @@ Name: pungi -Version: 4.0.3 +Version: 4.0.4 Release: 1%{?dist} Summary: Distribution compose tool @@ -20,13 +20,11 @@ Requires: libselinux-python Requires: createrepo_c Requires: python-lxml Requires: koji -Requires: jigdo Requires: cvs Requires: yum-utils Requires: isomd5sum Requires: genisoimage Requires: gettext -#Requires: syslinux Requires: git BuildRequires: python-devel, python-setuptools @@ -56,6 +54,67 @@ A tool to create anaconda based installation trees/isos of a set of rpms. /var/cache/pungi %changelog +* Wed Jan 20 2016 Dennis Gilmore - 4.0.4-1 +- 4.0.4 release (dennis) +- Merge #123 `Live images: add repo from another variant` (ausil) +- Merge #125 `[image-build] Stop creating wrong arch dirs` (ausil) +- Toggle multilib per variant (lsedlar) +- [live-images] Code cleanup (lsedlar) +- [live-images] Add documentation (lsedlar) +- [live-images] Add repos from other variants (lsedlar) +- [image-build] Stop creating wrong arch dirs (lsedlar) +- Enable identifying variants in exception traces (lsedlar) +- Store which deliverables failed (lsedlar) +- scm.py: use git clone instead git archive for http(s):// (lkocman) +- Fix filtering of system release packages (lsedlar) +- Merge #114 `Use install tree/repo from another variant for image build` + (ausil) +- Make system release package filtering optional (lsedlar) +- [image-build] Optionally do not break whole compose (lsedlar) +- [image-build] Refactoring (lsedlar) +- [image-build] Use repo from another variant (lsedlar) +- [image-build] Take install tree from another variant (lsedlar) +- Add missing formats to volumeid and image name (lsedlar) +- [image-build] Use single koji task per variant (lsedlar) +- Fix image-build modifying config (lsedlar) +- Fix missing checksums in .treeinfo (lsedlar) +- Don't crash on generating volid without variant (lsedlar) +- Merge #99 `Add option to specify non-failing stuff` (ausil) +- Add repo from current compose (lsedlar) +- Fix getting compose topdir in CreateImage build thread (lsedlar) +- Add option to specify non-failing stuff (lsedlar) +- Allow customizing image name and volume id (lsedlar) +- Fix notifier tests (lsedlar) +- Publish a url instead of a file path. (rbean) +- Add 'topdir' to all fedmsg/notifier messages. (rbean) +- Merge #75 `Start of development guide` (ausil) +- Merge #88 `Resolve HEAD in ksurl to actual hash` (ausil) +- Merge #87 `Add support for customizing lorax options` (ausil) +- Update fedmsg notification hook to use appropriate config. (rbean) +- we need to ensure that we send all the tasks to koji on the correct arch + (dennis) +- Resolve HEAD in ksurl to actual hash (lsedlar) +- Add support for customizing lorax options (lsedlar) +- Run lorax in separate dirs for each variant (lsedlar) +- Merge #84 `Allow specifying --installpkgs for lorax` (ausil) +- Merge #83 `Fix recently discovered bugs` (ausil) +- Merge #82 `indentation fixs correcting dvd creation` (ausil) +- Merge #69 `Move messaging into cli options and simplify it` (ausil) +- Start lorax for each variant separately (lsedlar) +- Update lorax wrapper to use --installpkgs (lsedlar) +- Allow specifying which packages to install in variants xml (lsedlar) +- Add basic tests for buildinstall phase (lsedlar) +- Fix generating checksum files (lsedlar) +- Use lowercase hashed directories (lsedlar) +- indentation fixs correcting dvd creation (dennis) +- remove glibc32 from the runroot tasks (dennis) +- fix up the pungi-fedmesg-notification script name (dennis) +- Add overview of Pungi to documentation (lsedlar) +- Move messaging into cli options (lsedlar) +- Extend contributing guide (lsedlar) +- Load multilib configuration from local dir in development (lsedlar) +- Allow running scripts with any python in PATH (lsedlar) + * Tue Aug 08 2015 Dennis Gilmore 4.0.3-1 - Merge #54 `fix log_info for image_build (fails if image_build is skipped)` (lkocman) diff --git a/sources b/sources index 59d772fe..843d68eb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -acf949751bb6896e25480fd91a557d40 pungi-4.0.3.tar.bz2 +b15fee10f5bf14e5e53593d3e0f283b8 pungi-4.0.4.tar.bz2 From 514ea85b36e910a958e403d5cd225f32bc67b448 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 4 Feb 2016 18:35:59 +0000 Subject: [PATCH 21/78] - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild --- pungi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pungi.spec b/pungi.spec index b41e01bf..26faca84 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.0.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distribution compose tool Group: Development/Tools @@ -54,6 +54,9 @@ A tool to create anaconda based installation trees/isos of a set of rpms. /var/cache/pungi %changelog +* Thu Feb 04 2016 Fedora Release Engineering - 4.0.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + * Wed Jan 20 2016 Dennis Gilmore - 4.0.4-1 - 4.0.4 release (dennis) - Merge #123 `Live images: add repo from another variant` (ausil) From 4cfe6613d7334e5fccecd38b81dee49999882565 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 23 Feb 2016 12:15:56 -0600 Subject: [PATCH 22/78] [tests] Fix wrong checks in buildinstall tests (lsedlar) - [tests] Use temporary files for buildinstall (lsedlar) - [tests] Do not mock open for koji wrapper tests (lsedlar) - Merge #179 `Update makefile targets for testing` (ausil) - Update makefile targets for testing (lsedlar) - [live-images] Set type to raw-xz for appliances (lsedlar) - [live-images] Correctly create format (lsedlar) - [tests] Dummy compose is no longer private (lsedlar) - [tests] Move buildinstall tests to new infrastructure (lsedlar) - [tests] Use real paths module in testing (lsedlar) - [tests] Move dummy testing compose into separate module (lsedlar) - [live-images] Create image dir if needed (lsedlar) - [live-images] Add images to manifest (lsedlar) - [live-images] Fix path processing (lsedlar) - [live-images] Move repo calculation to separate method (lsedlar) - [koji-wrapper] Fix getting results from spin-appliance (lsedlar) - [live-images] Filter non-image results (lsedlar) - [live-images] Rename repos_from to repo_from (lsedlar) - [koji-wrapper] Add test for passing release to image-build (lsedlar) - [live-images] Automatically populate release with date and respin (lsedlar) - [live-media] Respect release set in configuration (lsedlar) - [live-images] Build all images specified in config (lsedlar) - [live-media] Don't create $basedir arch (lsedlar) - Update tests (lsedlar) - do not ad to image build and live tasks the variant if it is empty (dennis) - when a variant is empty do not add it to the repolist for livemedia (dennis) - [live-media] Update tests to use $basearch (lsedlar) - [buildinstall] Don't run lorax for empty variants (lsedlar) - Merge #159 `use $basearch not $arch in livemedia tasks` (lubomir.sedlar) - Merge #158 `do not uses pipes.quotes in livemedia tasks` (lubomir.sedlar) - Add documentation for signing support that was added by previous commit (tmlcoch) - Support signing of rpm wrapped live images (tmlcoch) - Fix terminology - Koji uses sigkey not level (tmlcoch) - use $basearch not $arch in livemedia tasks (dennis) - do not uses pipes.quotes in livemedia tasks (dennis) - [live-images] Don't tweak kickstarts (lsedlar) - Allow specifying empty variants (lsedlar) - [createrepo] Remove dead assignments (lsedlar) - Keep empty query string in resolved git url (lsedlar) - [image-build] Use dashes as arch separator in log (lsedlar) - [buildinstall] Stop parsing task_id (lsedlar) - [koji-wrapper] Get task id from failed runroot (lsedlar) - [live-media] Pass ksurl to koji (lsedlar) - Merge #146 `[live-media] Properly calculate iso dir` (ausil) - [live-media] Properly calculate iso dir (lsedlar) - [image-build] Fix tests (lsedlar) - add image-build sections (lkocman) - [koji-wrapper] Add tests for get_create_image_cmd (lsedlar) - [live-images] Add support for spin-appliance (lsedlar) - [live-media] Koji option is ksfile, not kickstart (lsedlar) - [live-media] Use install tree from another variant (lsedlar) - [live-media] Put images into iso dir (lsedlar) - [image-build] Koji expects arches as a comma separated string (lsedlar) - Merge #139 `Log more details when any deliverable fails` (ausil) - [live-media] Version is required argument (lsedlar) - [koji-wrapper] Only parse output on success (lsedlar) - [koji-wrapper] Add tests for runroot wrapper (lsedlar) - [buildinstall] Improve logging (lsedlar) - Log more details about failed deliverable (lsedlar) - [image-build] Fix failable tests (lsedlar) - Merge #135 `Add live media support` (ausil) - Merge #133 `media_split: add logger support. Helps with debugging space issues on dvd media` (ausil) - [live-media] Add live media phase (lsedlar) - [koji-wrapper] Add support for spin-livemedia (lsedlar) - [koji-wrapper] Use more descriptive method names (lsedlar) - [image-build] Remove dead code (lsedlar) - media_split: add logger support. Helps with debugging space issues on dvd media (lkocman) - [image-build] Allow running image build scratch tasks (lsedlar) - [image-build] Allow dynamic release for images (lsedlar) Signed-off-by: Dennis Gilmore --- pungi.spec | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++--- sources | 2 +- 2 files changed, 87 insertions(+), 5 deletions(-) diff --git a/pungi.spec b/pungi.spec index 26faca84..30a70ebd 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,12 +1,15 @@ Name: pungi -Version: 4.0.4 -Release: 2%{?dist} +Version: 4.0.5 +Release: 1%{?dist} Summary: Distribution compose tool Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi Source0: https://fedorahosted.org/pungi/attachment/wiki/%{version}/%{name}-%{version}.tar.bz2 +BuildRequires: python-nose, python-nose-cov, python-mock +BuildRequires: python-devel, python-setuptools + Requires: createrepo >= 0.4.11 Requires: yum => 3.4.3-28 Requires: lorax >= 22.1 @@ -27,8 +30,6 @@ Requires: genisoimage Requires: gettext Requires: git -BuildRequires: python-devel, python-setuptools - BuildArch: noarch %description @@ -44,6 +45,13 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT %{__install} -d $RPM_BUILD_ROOT/var/cache/pungi +%check +./tests/data/specs/build.sh +%{__python} setup.py test +nosetests --exe --with-cov --cov-report html --cov-config tox.ini +#TODO: enable compose test +#cd tests && ./test_compose.sh + %files %license COPYING GPL %doc AUTHORS doc/* @@ -54,6 +62,80 @@ A tool to create anaconda based installation trees/isos of a set of rpms. /var/cache/pungi %changelog +* Tue Feb 23 2016 Dennis Gilmore - 4.0.5-1 +- [tests] Fix wrong checks in buildinstall tests (lsedlar) +- [tests] Use temporary files for buildinstall (lsedlar) +- [tests] Do not mock open for koji wrapper tests (lsedlar) +- Merge #179 `Update makefile targets for testing` (ausil) +- Update makefile targets for testing (lsedlar) +- [live-images] Set type to raw-xz for appliances (lsedlar) +- [live-images] Correctly create format (lsedlar) +- [tests] Dummy compose is no longer private (lsedlar) +- [tests] Move buildinstall tests to new infrastructure (lsedlar) +- [tests] Use real paths module in testing (lsedlar) +- [tests] Move dummy testing compose into separate module (lsedlar) +- [live-images] Create image dir if needed (lsedlar) +- [live-images] Add images to manifest (lsedlar) +- [live-images] Fix path processing (lsedlar) +- [live-images] Move repo calculation to separate method (lsedlar) +- [koji-wrapper] Fix getting results from spin-appliance (lsedlar) +- [live-images] Filter non-image results (lsedlar) +- [live-images] Rename repos_from to repo_from (lsedlar) +- [koji-wrapper] Add test for passing release to image-build (lsedlar) +- [live-images] Automatically populate release with date and respin (lsedlar) +- [live-media] Respect release set in configuration (lsedlar) +- [live-images] Build all images specified in config (lsedlar) +- [live-media] Don't create $basedir arch (lsedlar) +- Update tests (lsedlar) +- do not ad to image build and live tasks the variant if it is empty (dennis) +- when a variant is empty do not add it to the repolist for livemedia (dennis) +- [live-media] Update tests to use $basearch (lsedlar) +- [buildinstall] Don't run lorax for empty variants (lsedlar) +- Merge #159 `use $basearch not $arch in livemedia tasks` (lubomir.sedlar) +- Merge #158 `do not uses pipes.quotes in livemedia tasks` (lubomir.sedlar) +- Add documentation for signing support that was added by previous commit + (tmlcoch) +- Support signing of rpm wrapped live images (tmlcoch) +- Fix terminology - Koji uses sigkey not level (tmlcoch) +- use $basearch not $arch in livemedia tasks (dennis) +- do not uses pipes.quotes in livemedia tasks (dennis) +- [live-images] Don't tweak kickstarts (lsedlar) +- Allow specifying empty variants (lsedlar) +- [createrepo] Remove dead assignments (lsedlar) +- Keep empty query string in resolved git url (lsedlar) +- [image-build] Use dashes as arch separator in log (lsedlar) +- [buildinstall] Stop parsing task_id (lsedlar) +- [koji-wrapper] Get task id from failed runroot (lsedlar) +- [live-media] Pass ksurl to koji (lsedlar) +- Merge #146 `[live-media] Properly calculate iso dir` (ausil) +- [live-media] Properly calculate iso dir (lsedlar) +- [image-build] Fix tests (lsedlar) +- add image-build sections (lkocman) +- [koji-wrapper] Add tests for get_create_image_cmd (lsedlar) +- [live-images] Add support for spin-appliance (lsedlar) +- [live-media] Koji option is ksfile, not kickstart (lsedlar) +- [live-media] Use install tree from another variant (lsedlar) +- [live-media] Put images into iso dir (lsedlar) +- [image-build] Koji expects arches as a comma separated string (lsedlar) +- Merge #139 `Log more details when any deliverable fails` (ausil) +- [live-media] Version is required argument (lsedlar) +- [koji-wrapper] Only parse output on success (lsedlar) +- [koji-wrapper] Add tests for runroot wrapper (lsedlar) +- [buildinstall] Improve logging (lsedlar) +- Log more details about failed deliverable (lsedlar) +- [image-build] Fix failable tests (lsedlar) +- Merge #135 `Add live media support` (ausil) +- Merge #133 `media_split: add logger support. Helps with debugging space + issues on dvd media` (ausil) +- [live-media] Add live media phase (lsedlar) +- [koji-wrapper] Add support for spin-livemedia (lsedlar) +- [koji-wrapper] Use more descriptive method names (lsedlar) +- [image-build] Remove dead code (lsedlar) +- media_split: add logger support. Helps with debugging space issues on dvd + media (lkocman) +- [image-build] Allow running image build scratch tasks (lsedlar) +- [image-build] Allow dynamic release for images (lsedlar) + * Thu Feb 04 2016 Fedora Release Engineering - 4.0.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild diff --git a/sources b/sources index 843d68eb..af0baead 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b15fee10f5bf14e5e53593d3e0f283b8 pungi-4.0.4.tar.bz2 +152049463f19b9d83ad64ac2ee60ea53 pungi-4.0.5.tar.bz2 From 78ca0ae03122a808a70abb574d85790e363d52e9 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 23 Feb 2016 12:42:17 -0600 Subject: [PATCH 23/78] add missing BuildRequires to enable the test suites to run Signed-off-by: Dennis Gilmore --- pungi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pungi.spec b/pungi.spec index 30a70ebd..ebe3b920 100644 --- a/pungi.spec +++ b/pungi.spec @@ -8,7 +8,10 @@ License: GPLv2 URL: https://pagure.io/pungi Source0: https://fedorahosted.org/pungi/attachment/wiki/%{version}/%{name}-%{version}.tar.bz2 BuildRequires: python-nose, python-nose-cov, python-mock -BuildRequires: python-devel, python-setuptools +BuildRequires: python-devel, python-setuptools, python2-configparser, python2-productmd +BuildRequires: python-lockfile, kobo, kobo-rpmlib, python-kickstart, createrepo_c +BuildRequires: python-lxml, libselinux-python, yum-utils, lorax +BuildRequires: yum => 3.4.3-28, createrepo >= 0.4.11 Requires: createrepo >= 0.4.11 Requires: yum => 3.4.3-28 From 6236834e7597a32d2718aa08af905bee196a073a Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 23 Feb 2016 12:57:49 -0600 Subject: [PATCH 24/78] we do not really need python2-configparser Signed-off-by: Dennis Gilmore --- pungi.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pungi.spec b/pungi.spec index ebe3b920..2331ece2 100644 --- a/pungi.spec +++ b/pungi.spec @@ -8,7 +8,7 @@ License: GPLv2 URL: https://pagure.io/pungi Source0: https://fedorahosted.org/pungi/attachment/wiki/%{version}/%{name}-%{version}.tar.bz2 BuildRequires: python-nose, python-nose-cov, python-mock -BuildRequires: python-devel, python-setuptools, python2-configparser, python2-productmd +BuildRequires: python-devel, python-setuptools, python2-productmd BuildRequires: python-lockfile, kobo, kobo-rpmlib, python-kickstart, createrepo_c BuildRequires: python-lxml, libselinux-python, yum-utils, lorax BuildRequires: yum => 3.4.3-28, createrepo >= 0.4.11 From a9e8d0717d2c3bca0ddd0f9c60b3519130172302 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 26 Feb 2016 10:23:20 -0600 Subject: [PATCH 25/78] push the 4.0 docs to a 4.0 branch (dennis) - [live-images] Rename log file (lsedlar) - [buildinstall] Use -dvd- in volume ids instead of -boot- (lsedlar) - [buildinstall] Hardlink boot isos (lsedlar) - [doc] Write documentation for kickstart Git URLs (lsedlar) - [util] Resolve branches in git urls (lsedlar) - [live-images] Fix crash when repo_from is not a list (lsedlar) - [buildinstall] Don't copy files for empty variants (lsedlar) Signed-off-by: Dennis Gilmore --- pungi.spec | 12 +++++++++++- sources | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pungi.spec b/pungi.spec index ebe3b920..01e99202 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,5 +1,5 @@ Name: pungi -Version: 4.0.5 +Version: 4.0.6 Release: 1%{?dist} Summary: Distribution compose tool @@ -65,6 +65,16 @@ nosetests --exe --with-cov --cov-report html --cov-config tox.ini /var/cache/pungi %changelog +* Fri Feb 26 2016 Dennis Gilmore - 4.0.6-1 +- push the 4.0 docs to a 4.0 branch (dennis) +- [live-images] Rename log file (lsedlar) +- [buildinstall] Use -dvd- in volume ids instead of -boot- (lsedlar) +- [buildinstall] Hardlink boot isos (lsedlar) +- [doc] Write documentation for kickstart Git URLs (lsedlar) +- [util] Resolve branches in git urls (lsedlar) +- [live-images] Fix crash when repo_from is not a list (lsedlar) +- [buildinstall] Don't copy files for empty variants (lsedlar) + * Tue Feb 23 2016 Dennis Gilmore - 4.0.5-1 - [tests] Fix wrong checks in buildinstall tests (lsedlar) - [tests] Use temporary files for buildinstall (lsedlar) diff --git a/sources b/sources index af0baead..384c94dd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -152049463f19b9d83ad64ac2ee60ea53 pungi-4.0.5.tar.bz2 +f64b1e7593c22e20bcaa530b1ee5b489 pungi-4.0.6.tar.bz2 From 8a1ae9f76cce34103089d8cd522e048fa33b9dbb Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 3 Mar 2016 13:08:52 -0600 Subject: [PATCH 26/78] Limit the variants with config option 'tree_variants' (dennis) - [createrepo-wrapper] Fix --deltas argument (lsedlar) - [createrepo-wrapper] Add tests (lsedlar) - [koji-wrapper] Retry watching on connection errors (lsedlar) - [createrepo-wrapper] Refactor code (lsedlar) - [paths] Use variant.uid explicitly (lsedlar) - [createrepo] Add tests (lsedlar) - [createrepo] Refactor code (lsedlar) - [image-build] Fix resolving git urls (lsedlar) - [testphase] Don't run repoclosure for empty variants (lsedlar) - [live-images] No manifest for appliances (lsedlar) Signed-off-by: Dennis Gilmore --- pungi.spec | 15 ++++++++++++++- sources | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/pungi.spec b/pungi.spec index 8d40708a..d9703f17 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,5 +1,5 @@ Name: pungi -Version: 4.0.6 +Version: 4.0.7 Release: 1%{?dist} Summary: Distribution compose tool @@ -65,6 +65,19 @@ nosetests --exe --with-cov --cov-report html --cov-config tox.ini /var/cache/pungi %changelog +* Thu Mar 03 2016 Dennis Gilmore - 4.0.7-1 +- Limit the variants with config option 'tree_variants' (dennis) +- [createrepo-wrapper] Fix --deltas argument (lsedlar) +- [createrepo-wrapper] Add tests (lsedlar) +- [koji-wrapper] Retry watching on connection errors (lsedlar) +- [createrepo-wrapper] Refactor code (lsedlar) +- [paths] Use variant.uid explicitly (lsedlar) +- [createrepo] Add tests (lsedlar) +- [createrepo] Refactor code (lsedlar) +- [image-build] Fix resolving git urls (lsedlar) +- [testphase] Don't run repoclosure for empty variants (lsedlar) +- [live-images] No manifest for appliances (lsedlar) + * Fri Feb 26 2016 Dennis Gilmore - 4.0.6-1 - push the 4.0 docs to a 4.0 branch (dennis) - [live-images] Rename log file (lsedlar) diff --git a/sources b/sources index 384c94dd..366c0edb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -f64b1e7593c22e20bcaa530b1ee5b489 pungi-4.0.6.tar.bz2 +e274e8c914c45c3771a04de079967c9d pungi-4.0.7.tar.bz2 From 31ce7ba011c14f72ce8cf32fa3a17ea7c9cfc8fa Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 3 Mar 2016 14:16:14 -0600 Subject: [PATCH 27/78] update to fixed tarball Signed-off-by: Dennis Gilmore --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 366c0edb..89992f44 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -e274e8c914c45c3771a04de079967c9d pungi-4.0.7.tar.bz2 +dd8d6d80160d4d751c129cd90eae2a0a pungi-4.0.7.tar.bz2 From e615bfe44759c7b5cad5e4d82b4d94a214d7d260 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 8 Mar 2016 16:52:45 -0600 Subject: [PATCH 28/78] Add README (lsedlar) - [doc] Fix formatting (lsedlar) - [createiso] Add customizing disc type (lsedlar) - [live-images] Add customizing disc type (lsedlar) - [buildinstall] Add customizing disc type (lsedlar) - [buildinstall] Rename method to not mention symlinks (lsedlar) - [gather] Fix documentation of multilib white- and blacklist (lsedlar) - [paths] Document and test translate_path (lsedlar) - [createrepo] Compute delta RPMS against old compose (lsedlar) - [util] Add function to search for old composes (lsedlar) - [live-media] Add global settings (lsedlar) - [live-media] Rename test case (lsedlar) Signed-off-by: Dennis Gilmore --- pungi.spec | 16 +++++++++++++++- sources | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pungi.spec b/pungi.spec index d9703f17..346683f8 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,5 +1,5 @@ Name: pungi -Version: 4.0.7 +Version: 4.0.8 Release: 1%{?dist} Summary: Distribution compose tool @@ -65,6 +65,20 @@ nosetests --exe --with-cov --cov-report html --cov-config tox.ini /var/cache/pungi %changelog +* Tue Mar 08 2016 Dennis Gilmore - 4.0.8-1 +- Add README (lsedlar) +- [doc] Fix formatting (lsedlar) +- [createiso] Add customizing disc type (lsedlar) +- [live-images] Add customizing disc type (lsedlar) +- [buildinstall] Add customizing disc type (lsedlar) +- [buildinstall] Rename method to not mention symlinks (lsedlar) +- [gather] Fix documentation of multilib white- and blacklist (lsedlar) +- [paths] Document and test translate_path (lsedlar) +- [createrepo] Compute delta RPMS against old compose (lsedlar) +- [util] Add function to search for old composes (lsedlar) +- [live-media] Add global settings (lsedlar) +- [live-media] Rename test case (lsedlar) + * Thu Mar 03 2016 Dennis Gilmore - 4.0.7-1 - Limit the variants with config option 'tree_variants' (dennis) - [createrepo-wrapper] Fix --deltas argument (lsedlar) diff --git a/sources b/sources index 89992f44..ac4edc8d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -dd8d6d80160d4d751c129cd90eae2a0a pungi-4.0.7.tar.bz2 +c505e67fb747439383e65b413d313ed6 pungi-4.0.8.tar.bz2 From 3406d96c6cfb36af729f385f17a9471a00316169 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 9 Mar 2016 08:49:58 -0600 Subject: [PATCH 29/78] add patch to allow livemedia_release to be None globally Signed-off-by: Dennis Gilmore --- ...Support-release-set-to-None-globally.patch | 61 +++++++++++++++++++ pungi.spec | 8 ++- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 0001-live-media-Support-release-set-to-None-globally.patch diff --git a/0001-live-media-Support-release-set-to-None-globally.patch b/0001-live-media-Support-release-set-to-None-globally.patch new file mode 100644 index 00000000..a7902b9e --- /dev/null +++ b/0001-live-media-Support-release-set-to-None-globally.patch @@ -0,0 +1,61 @@ +From 4dd1cca9449f612c35891c58f9293491135074ad Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Wed, 9 Mar 2016 13:08:22 +0100 +Subject: [PATCH 1/2] [live-media] Support release set to None globally +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Lubomír Sedlář +--- + pungi/phases/livemedia_phase.py | 2 +- + tests/test_livemediaphase.py | 20 ++++++++++++++++++++ + 2 files changed, 21 insertions(+), 1 deletion(-) + +diff --git a/pungi/phases/livemedia_phase.py b/pungi/phases/livemedia_phase.py +index 1060317..c5f3ec2 100644 +--- a/pungi/phases/livemedia_phase.py ++++ b/pungi/phases/livemedia_phase.py +@@ -35,7 +35,7 @@ class LiveMediaPhase(PhaseBase): + }, + { + "name": "live_media_release", +- "expected_types": [str], ++ "expected_types": [str, type(None)], + "optional": True, + } + ) +diff --git a/tests/test_livemediaphase.py b/tests/test_livemediaphase.py +index 20ccdfc..493ffe2 100755 +--- a/tests/test_livemediaphase.py ++++ b/tests/test_livemediaphase.py +@@ -14,6 +14,26 @@ from tests.helpers import DummyCompose, PungiTestCase + + + class TestLiveMediaPhase(PungiTestCase): ++ ++ def test_global_config_validation(self): ++ compose = DummyCompose(self.topdir, { ++ 'live_media_ksurl': 'git://example.com/repo.git#HEAD', ++ 'live_media_target': 'f24', ++ 'live_media_release': 'RRR', ++ 'live_media_version': 'Rawhide', ++ }) ++ ++ phase = LiveMediaPhase(compose) ++ phase.validate() ++ ++ def test_global_config_null_release(self): ++ compose = DummyCompose(self.topdir, { ++ 'live_media_release': None, ++ }) ++ ++ phase = LiveMediaPhase(compose) ++ phase.validate() ++ + @mock.patch('pungi.phases.livemedia_phase.ThreadPool') + def test_live_media_minimal(self, ThreadPool): + compose = DummyCompose(self.topdir, { +-- +2.5.0 + diff --git a/pungi.spec b/pungi.spec index 346683f8..3dd0fb93 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,12 +1,14 @@ Name: pungi Version: 4.0.8 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distribution compose tool Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi Source0: https://fedorahosted.org/pungi/attachment/wiki/%{version}/%{name}-%{version}.tar.bz2 +Patch0: 0001-live-media-Support-release-set-to-None-globally.patch + BuildRequires: python-nose, python-nose-cov, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd BuildRequires: python-lockfile, kobo, kobo-rpmlib, python-kickstart, createrepo_c @@ -40,6 +42,7 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %prep %setup -q +%patch0 -p1 %build %{__python} setup.py build @@ -65,6 +68,9 @@ nosetests --exe --with-cov --cov-report html --cov-config tox.ini /var/cache/pungi %changelog +* Wed Mar 09 2016 Dennis Gilmore - 4.0.8-2 +- add patch to allow livemedia_release to be None globally + * Tue Mar 08 2016 Dennis Gilmore - 4.0.8-1 - Add README (lsedlar) - [doc] Fix formatting (lsedlar) From 4be067a4cd092db2d611699c4f54ca8563d61139 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 10 Mar 2016 10:30:21 -0600 Subject: [PATCH 30/78] [init] Update documentation (lsedlar) - [init] Iterate over arches just once (lsedlar) - [init] Remove duplicated checks for comps (lsedlar) - [init] Break long lines (lsedlar) - [init] Don't overwrite the same log file (lsedlar) - [init] Add config option for keeping original comps (lsedlar) - Add tests for the init phase (lsedlar) - [checks] Test printing in all cases (lsedlar) - [checks] Reduce code duplication (lsedlar) - [checks] Relax check for genisoimage (lsedlar) - [checks] Remove duplicate msgfmt line (lsedlar) - [checks] Relax check for isohybrid command (lsedlar) - [checks] Add tests for dependency checking (lsedlar) - [checks] Don't always require jigdo (lsedlar) - [pkgset] Respect inherit setting (lsedlar) - specify that the 4.0 docs are for 4.0.8 (dennis) - [live-media] Support release set to None globally (lsedlar) - include tests/fixtures/* in the tarball (dennis) Signed-off-by: Dennis Gilmore --- ...Support-release-set-to-None-globally.patch | 61 ------------------- pungi.spec | 26 ++++++-- sources | 2 +- 3 files changed, 23 insertions(+), 66 deletions(-) delete mode 100644 0001-live-media-Support-release-set-to-None-globally.patch diff --git a/0001-live-media-Support-release-set-to-None-globally.patch b/0001-live-media-Support-release-set-to-None-globally.patch deleted file mode 100644 index a7902b9e..00000000 --- a/0001-live-media-Support-release-set-to-None-globally.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 4dd1cca9449f612c35891c58f9293491135074ad Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= -Date: Wed, 9 Mar 2016 13:08:22 +0100 -Subject: [PATCH 1/2] [live-media] Support release set to None globally -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Lubomír Sedlář ---- - pungi/phases/livemedia_phase.py | 2 +- - tests/test_livemediaphase.py | 20 ++++++++++++++++++++ - 2 files changed, 21 insertions(+), 1 deletion(-) - -diff --git a/pungi/phases/livemedia_phase.py b/pungi/phases/livemedia_phase.py -index 1060317..c5f3ec2 100644 ---- a/pungi/phases/livemedia_phase.py -+++ b/pungi/phases/livemedia_phase.py -@@ -35,7 +35,7 @@ class LiveMediaPhase(PhaseBase): - }, - { - "name": "live_media_release", -- "expected_types": [str], -+ "expected_types": [str, type(None)], - "optional": True, - } - ) -diff --git a/tests/test_livemediaphase.py b/tests/test_livemediaphase.py -index 20ccdfc..493ffe2 100755 ---- a/tests/test_livemediaphase.py -+++ b/tests/test_livemediaphase.py -@@ -14,6 +14,26 @@ from tests.helpers import DummyCompose, PungiTestCase - - - class TestLiveMediaPhase(PungiTestCase): -+ -+ def test_global_config_validation(self): -+ compose = DummyCompose(self.topdir, { -+ 'live_media_ksurl': 'git://example.com/repo.git#HEAD', -+ 'live_media_target': 'f24', -+ 'live_media_release': 'RRR', -+ 'live_media_version': 'Rawhide', -+ }) -+ -+ phase = LiveMediaPhase(compose) -+ phase.validate() -+ -+ def test_global_config_null_release(self): -+ compose = DummyCompose(self.topdir, { -+ 'live_media_release': None, -+ }) -+ -+ phase = LiveMediaPhase(compose) -+ phase.validate() -+ - @mock.patch('pungi.phases.livemedia_phase.ThreadPool') - def test_live_media_minimal(self, ThreadPool): - compose = DummyCompose(self.topdir, { --- -2.5.0 - diff --git a/pungi.spec b/pungi.spec index 3dd0fb93..15eb9769 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,13 +1,12 @@ Name: pungi -Version: 4.0.8 -Release: 2%{?dist} +Version: 4.0.9 +Release: 1%{?dist} Summary: Distribution compose tool Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi Source0: https://fedorahosted.org/pungi/attachment/wiki/%{version}/%{name}-%{version}.tar.bz2 -Patch0: 0001-live-media-Support-release-set-to-None-globally.patch BuildRequires: python-nose, python-nose-cov, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd @@ -42,7 +41,6 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %prep %setup -q -%patch0 -p1 %build %{__python} setup.py build @@ -68,6 +66,26 @@ nosetests --exe --with-cov --cov-report html --cov-config tox.ini /var/cache/pungi %changelog +* Thu Mar 10 2016 Dennis Gilmore - 4.0.9-1 +- [init] Update documentation (lsedlar) +- [init] Iterate over arches just once (lsedlar) +- [init] Remove duplicated checks for comps (lsedlar) +- [init] Break long lines (lsedlar) +- [init] Don't overwrite the same log file (lsedlar) +- [init] Add config option for keeping original comps (lsedlar) +- Add tests for the init phase (lsedlar) +- [checks] Test printing in all cases (lsedlar) +- [checks] Reduce code duplication (lsedlar) +- [checks] Relax check for genisoimage (lsedlar) +- [checks] Remove duplicate msgfmt line (lsedlar) +- [checks] Relax check for isohybrid command (lsedlar) +- [checks] Add tests for dependency checking (lsedlar) +- [checks] Don't always require jigdo (lsedlar) +- [pkgset] Respect inherit setting (lsedlar) +- specify that the 4.0 docs are for 4.0.8 (dennis) +- [live-media] Support release set to None globally (lsedlar) +- include tests/fixtures/* in the tarball (dennis) + * Wed Mar 09 2016 Dennis Gilmore - 4.0.8-2 - add patch to allow livemedia_release to be None globally diff --git a/sources b/sources index ac4edc8d..c55a611b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c505e67fb747439383e65b413d313ed6 pungi-4.0.8.tar.bz2 +458d19d3d5c5c4ef1501749088e10b24 pungi-4.0.9.tar.bz2 From 007f2b8312d9563a3afe22a2211a201251fca827 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 10 Mar 2016 12:39:32 -0600 Subject: [PATCH 31/78] new tarball with upstream commits for test suite and pkgset Signed-off-by: Dennis Gilmore --- pungi.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pungi.spec b/pungi.spec index 15eb9769..be1d8c47 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.0.9 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distribution compose tool Group: Development/Tools @@ -66,6 +66,9 @@ nosetests --exe --with-cov --cov-report html --cov-config tox.ini /var/cache/pungi %changelog +* Thu Mar 10 2016 Dennis Gilmore - 4.0.9-2 +- new tarball with upstream commits for test suite and pkgset + * Thu Mar 10 2016 Dennis Gilmore - 4.0.9-1 - [init] Update documentation (lsedlar) - [init] Iterate over arches just once (lsedlar) diff --git a/sources b/sources index c55a611b..5afee229 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -458d19d3d5c5c4ef1501749088e10b24 pungi-4.0.9.tar.bz2 +961ea95f2c872aaac760f013a6707e9b pungi-4.0.9.tar.bz2 From 46cb8521acb5c079f6f50b0691ae71741b784bea Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 11 Mar 2016 09:38:04 -0600 Subject: [PATCH 32/78] upstream 4.1.0 release Signed-off-by: Dennis Gilmore --- pungi.spec | 7 +++++-- sources | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pungi.spec b/pungi.spec index be1d8c47..b1784336 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi -Version: 4.0.9 -Release: 2%{?dist} +Version: 4.1.0 +Release: 1%{?dist} Summary: Distribution compose tool Group: Development/Tools @@ -66,6 +66,9 @@ nosetests --exe --with-cov --cov-report html --cov-config tox.ini /var/cache/pungi %changelog +* Fri Mar 11 2016 Dennis Gilmore - 4.1.0-1 +- upstream 4.1.0 release + * Thu Mar 10 2016 Dennis Gilmore - 4.0.9-2 - new tarball with upstream commits for test suite and pkgset diff --git a/sources b/sources index 5afee229..a026a63e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -961ea95f2c872aaac760f013a6707e9b pungi-4.0.9.tar.bz2 +c0189e1e5462eecf9f4bba14fbfc2925 pungi-4.1.0.tar.bz2 From 4c3b989ea6a67f243da8c20242d71ebf03c78a44 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 1 Apr 2016 09:46:57 -0500 Subject: [PATCH 33/78] install scripts (dennis) - Merge #242 `Fix wrong file permissions` (ausil) - Add a utility to validate config (lsedlar) - [variants] Stop printing stuff to stderr unconditionally (lsedlar) - Fix atomic/ostree config validations (lsedlar) - [pungi-wrapper] Remove duplicated code (lsedlar) - [checks] Add a check for too restrictive umask (lsedlar) - [util] Remove umask manipulation from makedirs (lsedlar) - Merge #240 `Filter variants and architectures` (ausil) - Filter variants and architectures (lsedlar) - Refactor checking for failable deliverables (lsedlar) - [buildinstall] Do not crash on failure (lsedlar) - Reuse helper in all tests (lsedlar) - [atomic] Add atomic_installer phase (lsedlar) - [ostree] Add ostree phase (lsedlar) - [atomic] Add a script to create ostree repo (lsedlar) - Merge #232 `Improve logging by adding subvariants` (ausil) - Add compose type to release for images (lsedlar) - [image-build] Add traceback on failure (lsedlar) - [image-build] Use subvariants in logging output (lsedlar) - [live-media] Use subvariants in logging (lsedlar) - Add tracebacks to all failable phases (lsedlar) - ppc no longer needs magic bits in the iso (pbrobinson) - [buildinstall] Add more debugging output (lsedlar) - [metadata] Stop crashing on empty path from .treeinfo (lsedlar) - [checksums] Add label to file name (lsedlar) - [buildinstall] Use customized dvd disc type (lsedlar) - image_build: fix subvariant handling (awilliam) Signed-off-by: Dennis Gilmore --- pungi.spec | 52 ++++++++++++++++++++++++++++++++++++++++++++++++---- sources | 2 +- 2 files changed, 49 insertions(+), 5 deletions(-) diff --git a/pungi.spec b/pungi.spec index b1784336..5d103ea3 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,5 +1,5 @@ Name: pungi -Version: 4.1.0 +Version: 4.1.1 Release: 1%{?dist} Summary: Distribution compose tool @@ -13,6 +13,12 @@ BuildRequires: python-devel, python-setuptools, python2-productmd BuildRequires: python-lockfile, kobo, kobo-rpmlib, python-kickstart, createrepo_c BuildRequires: python-lxml, libselinux-python, yum-utils, lorax BuildRequires: yum => 3.4.3-28, createrepo >= 0.4.11 +#deps for doc building +BuildRequires: python-sphinx, texlive-latex-bin-bin, texlive-collection-fontsrecommended +BuildRequires: texlive-times, texlive-cmap, texlive-babel-english, texlive-fancyhdr +BuildRequires: texlive-fancybox, texlive-titlesec, texlive-framed, texlive-threeparttable +BuildRequires: texlive-mdwtools, texlive-wrapfig, texlive-parskip, texlive-upquote +BuildRequires: texlive-multirow Requires: createrepo >= 0.4.11 Requires: yum => 3.4.3-28 @@ -44,28 +50,66 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %build %{__python} setup.py build +cd doc +make latexpdf +make epub +make text +make man +gzip _build/man/pungi.1 %install %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT %{__install} -d $RPM_BUILD_ROOT/var/cache/pungi +%{__install} -d $RPM_BUILD_ROOT%{_mandir}/man1 +%{__install} doc/_build/man/pungi.1.gz $RPM_BUILD_ROOT%{_mandir}/man1 %check ./tests/data/specs/build.sh %{__python} setup.py test nosetests --exe --with-cov --cov-report html --cov-config tox.ini -#TODO: enable compose test -#cd tests && ./test_compose.sh +cd tests && ./test_compose.sh %files %license COPYING GPL -%doc AUTHORS doc/* +%doc AUTHORS doc/_build/latex/Pungi.pdf doc/_build/epub/Pungi.epub doc/_build/text/* %{python_sitelib}/%{name} %{python_sitelib}/%{name}-%{version}-py?.?.egg-info %{_bindir}/* +%{_mandir}/man1/pungi.1.gz %{_datadir}/pungi /var/cache/pungi %changelog +* Fri Apr 01 2016 Dennis Gilmore - 4.1.1-1 +- install scripts (dennis) +- Merge #242 `Fix wrong file permissions` (ausil) +- Add a utility to validate config (lsedlar) +- [variants] Stop printing stuff to stderr unconditionally (lsedlar) +- Fix atomic/ostree config validations (lsedlar) +- [pungi-wrapper] Remove duplicated code (lsedlar) +- [checks] Add a check for too restrictive umask (lsedlar) +- [util] Remove umask manipulation from makedirs (lsedlar) +- Merge #240 `Filter variants and architectures` (ausil) +- Filter variants and architectures (lsedlar) +- Refactor checking for failable deliverables (lsedlar) +- [buildinstall] Do not crash on failure (lsedlar) +- Reuse helper in all tests (lsedlar) +- [atomic] Add atomic_installer phase (lsedlar) +- [ostree] Add ostree phase (lsedlar) +- [atomic] Add a script to create ostree repo (lsedlar) +- Merge #232 `Improve logging by adding subvariants` (ausil) +- Add compose type to release for images (lsedlar) +- [image-build] Add traceback on failure (lsedlar) +- [image-build] Use subvariants in logging output (lsedlar) +- [live-media] Use subvariants in logging (lsedlar) +- Add tracebacks to all failable phases (lsedlar) +- ppc no longer needs magic bits in the iso (pbrobinson) +- [buildinstall] Add more debugging output (lsedlar) +- [metadata] Stop crashing on empty path from .treeinfo (lsedlar) +- [checksums] Add label to file name (lsedlar) +- [buildinstall] Use customized dvd disc type (lsedlar) +- image_build: fix subvariant handling (awilliam) + * Fri Mar 11 2016 Dennis Gilmore - 4.1.0-1 - upstream 4.1.0 release diff --git a/sources b/sources index a026a63e..638b8c75 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c0189e1e5462eecf9f4bba14fbfc2925 pungi-4.1.0.tar.bz2 +b53d104d3e4455cb1cf98c790e8d0ca1 pungi-4.1.1.tar.bz2 From adf40673ba1024b8711b5b14cc298aa04736b822 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 1 Apr 2016 09:58:43 -0500 Subject: [PATCH 34/78] add the missing BuildRequires Signed-off-by: Dennis Gilmore --- pungi.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/pungi.spec b/pungi.spec index 5d103ea3..4580b56a 100644 --- a/pungi.spec +++ b/pungi.spec @@ -13,6 +13,7 @@ BuildRequires: python-devel, python-setuptools, python2-productmd BuildRequires: python-lockfile, kobo, kobo-rpmlib, python-kickstart, createrepo_c BuildRequires: python-lxml, libselinux-python, yum-utils, lorax BuildRequires: yum => 3.4.3-28, createrepo >= 0.4.11 +BuildRequires: gettext, git-core, cvs #deps for doc building BuildRequires: python-sphinx, texlive-latex-bin-bin, texlive-collection-fontsrecommended BuildRequires: texlive-times, texlive-cmap, texlive-babel-english, texlive-fancyhdr From 8b2b243206273aab9146e85e7d61771a1654fd95 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Mon, 4 Apr 2016 09:04:54 -0500 Subject: [PATCH 35/78] add upstream patches for bugfixes in ostree and checksums Signed-off-by: Dennis Gilmore --- 0001-checksum-Add-arch-to-file-name.patch | 221 ++++++++++++++++++ ...tomic-Stop-creating-the-os-directory.patch | 42 ++++ ...stree-Fix-call-to-kobo.shortcuts.run.patch | 54 +++++ pungi.spec | 12 +- 4 files changed, 328 insertions(+), 1 deletion(-) create mode 100644 0001-checksum-Add-arch-to-file-name.patch create mode 100644 0002-atomic-Stop-creating-the-os-directory.patch create mode 100644 0003-ostree-Fix-call-to-kobo.shortcuts.run.patch diff --git a/0001-checksum-Add-arch-to-file-name.patch b/0001-checksum-Add-arch-to-file-name.patch new file mode 100644 index 00000000..3307257f --- /dev/null +++ b/0001-checksum-Add-arch-to-file-name.patch @@ -0,0 +1,221 @@ +From e34bd2763c0d0776693f8842639b35b55dcb511b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Mon, 4 Apr 2016 09:38:48 +0200 +Subject: [PATCH 1/3] [checksum] Add arch to file name +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This allows the checksum file to include the architecture. + +Fixes: #243 +Signed-off-by: Lubomír Sedlář +--- + doc/configuration.rst | 16 +++++++++++++--- + pungi/compose.py | 32 +++++++------------------------- + pungi/phases/image_checksum.py | 21 +++++++-------------- + pungi/util.py | 35 ++++++++++++++++++++++++++++------- + tests/helpers.py | 2 ++ + 5 files changed, 57 insertions(+), 49 deletions(-) + +diff --git a/doc/configuration.rst b/doc/configuration.rst +index 23bcbcf..7d4b91e 100644 +--- a/doc/configuration.rst ++++ b/doc/configuration.rst +@@ -1051,9 +1051,19 @@ Media Checksums Settings + prefix to that name + + It is possible to use format strings that will be replace by actual values. +- The allowed keys are ``%(release_showrt)s``, ``%(release_short)s``, +- ``%(release_id)s``, ``%(variant)s``, ``%(version)s``, ``%(date)s``, +- ``%(type_suffix)s``, ``%(label)s`` and ``%(respin)s`` ++ The allowed keys are: ++ ++ * ``arch`` ++ * ``compose_id`` ++ * ``date`` ++ * ``label`` ++ * ``label_major_version`` ++ * ``release_short`` ++ * ``respin`` ++ * ``type`` ++ * ``type_suffix`` ++ * ``version`` ++ * ``version`` + + For example, for Fedora the prefix should be + ``%(release_short)s-%(variant)s-%(version)s-%(date)s%(type_suffix)s.%(respin)s``. +diff --git a/pungi/compose.py b/pungi/compose.py +index 8935a0f..f764129 100644 +--- a/pungi/compose.py ++++ b/pungi/compose.py +@@ -33,7 +33,7 @@ from productmd.images import Images + from pungi.wrappers.variants import VariantsXmlParser + from pungi.paths import Paths + from pungi.wrappers.scm import get_file_from_scm +-from pungi.util import makedirs, get_arch_variant_data ++from pungi.util import makedirs, get_arch_variant_data, get_format_substs + from pungi.metadata import compose_to_composeinfo + + +@@ -270,25 +270,6 @@ class Compose(kobo.log.LoggingBase): + return + return open(self.status_file, "r").read().strip() + +- def get_format_substs(self, **kwargs): +- """Return a dict of basic format substitutions. +- +- Any kwargs will be added as well. +- """ +- substs = { +- 'compose_id': self.compose_id, +- 'release_short': self.ci_base.release.short, +- 'version': self.ci_base.release.version, +- 'date': self.compose_date, +- 'respin': self.compose_respin, +- 'type': self.compose_type, +- 'type_suffix': self.compose_type_suffix, +- 'label': self.compose_label, +- 'label_major_version': self.compose_label_major_version, +- } +- substs.update(kwargs) +- return substs +- + def get_image_name(self, arch, variant, disc_type='dvd', + disc_num=1, suffix='.iso', format=None): + """Create a filename for image with given parameters. +@@ -310,11 +291,12 @@ class Compose(kobo.log.LoggingBase): + variant_uid = variant.parent.uid + else: + variant_uid = variant.uid +- args = self.get_format_substs(variant=variant_uid, +- arch=arch, +- disc_type=disc_type, +- disc_num=disc_num, +- suffix=suffix) ++ args = get_format_substs(self, ++ variant=variant_uid, ++ arch=arch, ++ disc_type=disc_type, ++ disc_num=disc_num, ++ suffix=suffix) + try: + return format % args + except KeyError as err: +diff --git a/pungi/phases/image_checksum.py b/pungi/phases/image_checksum.py +index c9ef321..aa74c4f 100644 +--- a/pungi/phases/image_checksum.py ++++ b/pungi/phases/image_checksum.py +@@ -4,6 +4,7 @@ import os + from kobo import shortcuts + + from .base import PhaseBase ++from ..util import get_format_substs + + + MULTIPLE_CHECKSUMS_ERROR = ( +@@ -66,29 +67,21 @@ class ImageChecksumPhase(PhaseBase): + for arch in self.compose.im.images[variant]: + for image in self.compose.im.images[variant][arch]: + path = os.path.dirname(os.path.join(top_dir, image.path)) +- images.setdefault((variant, path), set()).add(image) ++ images.setdefault((variant, arch, path), set()).add(image) + return images + +- def _get_base_filename(self, variant): ++ def _get_base_filename(self, variant, arch): + base_checksum_name = self.compose.conf.get('media_checksum_base_filename', '') + if base_checksum_name: +- base_checksum_name = base_checksum_name % { +- 'release_short': self.compose.ci_base.release.short, +- 'release_id': self.compose.ci_base.release_id, +- 'variant': variant, +- 'version': self.compose.ci_base.release.version, +- 'date': self.compose.compose_date, +- 'type_suffix': self.compose.compose_type_suffix, +- 'respin': self.compose.compose_respin, +- 'label': self.compose.compose_label, +- } ++ substs = get_format_substs(self.compose, variant=variant, arch=arch) ++ base_checksum_name = base_checksum_name % substs + base_checksum_name += '-' + return base_checksum_name + + def run(self): +- for (variant, path), images in self._get_images().iteritems(): ++ for (variant, arch, path), images in self._get_images().iteritems(): + checksums = {} +- base_checksum_name = self._get_base_filename(variant) ++ base_checksum_name = self._get_base_filename(variant, arch) + for image in images: + filename = os.path.basename(image.path) + full_path = os.path.join(path, filename) +diff --git a/pungi/util.py b/pungi/util.py +index f4f5e33..6a6ccf3 100644 +--- a/pungi/util.py ++++ b/pungi/util.py +@@ -370,13 +370,14 @@ def get_volid(compose, arch, variant=None, escape_spaces=False, disc_type=False) + if not variant_uid and "%(variant)s" in i: + continue + try: +- volid = i % compose.get_format_substs(variant=variant_uid, +- release_short=release_short, +- version=release_version, +- arch=arch, +- disc_type=disc_type or '', +- base_product_short=base_product_short, +- base_product_version=base_product_version) ++ volid = i % get_format_substs(compose, ++ variant=variant_uid, ++ release_short=release_short, ++ version=release_version, ++ arch=arch, ++ disc_type=disc_type or '', ++ base_product_short=base_product_short, ++ base_product_version=base_product_version) + except KeyError as err: + raise RuntimeError('Failed to create volume id: unknown format element: %s' % err.message) + volid = _apply_substitutions(compose, volid) +@@ -472,3 +473,23 @@ def failable(compose, variant, arch, deliverable, msg=None): + compose.log_info(str(exc)) + tb = traceback.format_exc() + compose.log_debug(tb) ++ ++ ++def get_format_substs(compose, **kwargs): ++ """Return a dict of basic format substitutions. ++ ++ Any kwargs will be added as well. ++ """ ++ substs = { ++ 'compose_id': compose.compose_id, ++ 'release_short': compose.ci_base.release.short, ++ 'version': compose.ci_base.release.version, ++ 'date': compose.compose_date, ++ 'respin': compose.compose_respin, ++ 'type': compose.compose_type, ++ 'type_suffix': compose.compose_type_suffix, ++ 'label': compose.compose_label, ++ 'label_major_version': compose.compose_label_major_version, ++ } ++ substs.update(kwargs) ++ return substs +diff --git a/tests/helpers.py b/tests/helpers.py +index 9a0983c..11c07a4 100644 +--- a/tests/helpers.py ++++ b/tests/helpers.py +@@ -23,9 +23,11 @@ class DummyCompose(object): + self.supported = True + self.compose_date = '20151203' + self.compose_type_suffix = '.t' ++ self.compose_type = 'test' + self.compose_respin = 0 + self.compose_id = 'Test-20151203.0.t' + self.compose_label = None ++ self.compose_label_major_version = None + self.image_release = '20151203.t.0' + self.ci_base = mock.Mock( + release_id='Test-1.0', +-- +2.7.3 + diff --git a/0002-atomic-Stop-creating-the-os-directory.patch b/0002-atomic-Stop-creating-the-os-directory.patch new file mode 100644 index 00000000..4407a1bd --- /dev/null +++ b/0002-atomic-Stop-creating-the-os-directory.patch @@ -0,0 +1,42 @@ +From f18e32c5affad9bf376103a536c7ded19366d92f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Mon, 4 Apr 2016 14:24:18 +0200 +Subject: [PATCH 2/3] [atomic] Stop creating the os directory +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The output directory for Lorax can not exist beforehand, or the process +will fail. + +Signed-off-by: Lubomír Sedlář +--- + pungi/phases/atomic_installer.py | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/pungi/phases/atomic_installer.py b/pungi/phases/atomic_installer.py +index 476ad1c..3390a74 100644 +--- a/pungi/phases/atomic_installer.py ++++ b/pungi/phases/atomic_installer.py +@@ -49,7 +49,8 @@ class AtomicInstallerThread(WorkerThread): + self.logdir = compose.paths.log.topdir('{}/atomic'.format(arch)) + + source_variant = compose.variants[config['source_repo_from']] +- source_repo = translate_path(compose, compose.paths.compose.repository(arch, source_variant)) ++ source_repo = translate_path( ++ compose, compose.paths.compose.repository(arch, source_variant, create_dir=False)) + + self._run_atomic_cmd(compose, variant, arch, config, source_repo) + +@@ -100,7 +101,7 @@ class AtomicInstallerThread(WorkerThread): + compose.im.add(variant.uid, arch, img) + + def _run_atomic_cmd(self, compose, variant, arch, config, source_repo): +- image_dir = compose.paths.compose.os_tree(arch, variant) ++ image_dir = compose.paths.compose.os_tree(arch, variant, create_dir=False) + lorax_wrapper = lorax.LoraxWrapper() + cmd = lorax_wrapper.get_lorax_cmd( + compose.conf['release_name'], +-- +2.7.3 + diff --git a/0003-ostree-Fix-call-to-kobo.shortcuts.run.patch b/0003-ostree-Fix-call-to-kobo.shortcuts.run.patch new file mode 100644 index 00000000..ccc5fd19 --- /dev/null +++ b/0003-ostree-Fix-call-to-kobo.shortcuts.run.patch @@ -0,0 +1,54 @@ +From 05384eae584476bfca3bd4bf31958d1e5dbb20a6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Mon, 4 Apr 2016 15:13:35 +0200 +Subject: [PATCH 3/3] [ostree] Fix call to kobo.shortcuts.run +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Lubomír Sedlář +--- + pungi/atomic.py | 4 ++-- + tests/test_atomic_script.py | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/pungi/atomic.py b/pungi/atomic.py +index 95ccfe0..7c0075b 100644 +--- a/pungi/atomic.py ++++ b/pungi/atomic.py +@@ -22,13 +22,13 @@ def init_atomic_repo(repo, log_dir=None): + log_file = make_log_file(log_dir, 'init-atomic-repo') + if not os.path.isdir(repo): + shortcuts.run(['ostree', 'init', '--repo={}'.format(repo), '--mode=archive-z2'], +- log_file=log_file) ++ logfile=log_file) + + + def make_ostree_repo(repo, config, log_dir=None): + log_file = make_log_file(log_dir, 'create-atomic-repo') + shortcuts.run(['rpm-ostree', 'compose', 'tree', '--repo={}'.format(repo), config], +- log_file=log_file) ++ logfile=log_file) + + + def run(opts): +diff --git a/tests/test_atomic_script.py b/tests/test_atomic_script.py +index 13aa825..a871659 100755 +--- a/tests/test_atomic_script.py ++++ b/tests/test_atomic_script.py +@@ -28,10 +28,10 @@ class OstreeScriptTest(helpers.PungiTestCase): + self.assertItemsEqual( + run.call_args_list, + [mock.call(['ostree', 'init', '--repo={}/atomic'.format(self.topdir), '--mode=archive-z2'], +- log_file=self.topdir + '/logs/Atomic/init-atomic-repo.log'), ++ logfile=self.topdir + '/logs/Atomic/init-atomic-repo.log'), + mock.call(['rpm-ostree', 'compose', 'tree', '--repo={}/atomic'.format(self.topdir), + self.topdir + '/work/fedora-atomic-docker-host.json'], +- log_file=self.topdir + '/logs/Atomic/create-atomic-repo.log')]) ++ logfile=self.topdir + '/logs/Atomic/create-atomic-repo.log')]) + + + if __name__ == '__main__': +-- +2.7.3 + diff --git a/pungi.spec b/pungi.spec index 4580b56a..3693892f 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,12 +1,16 @@ Name: pungi Version: 4.1.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distribution compose tool Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi Source0: https://fedorahosted.org/pungi/attachment/wiki/%{version}/%{name}-%{version}.tar.bz2 +Patch0: 0001-checksum-Add-arch-to-file-name.patch +Patch1: 0002-atomic-Stop-creating-the-os-directory.patch +Patch2: 0003-ostree-Fix-call-to-kobo.shortcuts.run.patch + BuildRequires: python-nose, python-nose-cov, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd @@ -48,6 +52,9 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %prep %setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 %build %{__python} setup.py build @@ -81,6 +88,9 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Mon Apr 04 2016 Dennis Gilmore - 4.1.1-2 +- add upstream patches for bugfixes in ostree and checksums + * Fri Apr 01 2016 Dennis Gilmore - 4.1.1-1 - install scripts (dennis) - Merge #242 `Fix wrong file permissions` (ausil) From 32cfa08727b4cb6bd852f4bcf92ac28d57c801f2 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 5 Apr 2016 09:53:36 -0500 Subject: [PATCH 36/78] add some more ostree fixes - add a bandaid for ppc until we get a proper fix Signed-off-by: Dennis Gilmore --- 0001-checksum-Add-arch-to-file-name.patch | 2 +- ...tomic-Stop-creating-the-os-directory.patch | 2 +- ...stree-Fix-call-to-kobo.shortcuts.run.patch | 2 +- ...e-Move-cloning-config-repo-to-chroot.patch | 276 +++ 0005-ostree-Rename-atomic-to-ostree.patch | 1494 +++++++++++++++++ 0006-ostree-Use-explicit-work-directory.patch | 168 ++ ...b198c5ffc0593720c927f469793bedb3d4a4.patch | 54 + pungi.spec | 16 +- 8 files changed, 2009 insertions(+), 5 deletions(-) create mode 100644 0004-ostree-Move-cloning-config-repo-to-chroot.patch create mode 100644 0005-ostree-Rename-atomic-to-ostree.patch create mode 100644 0006-ostree-Use-explicit-work-directory.patch create mode 100644 c52cb198c5ffc0593720c927f469793bedb3d4a4.patch diff --git a/0001-checksum-Add-arch-to-file-name.patch b/0001-checksum-Add-arch-to-file-name.patch index 3307257f..e138bfe2 100644 --- a/0001-checksum-Add-arch-to-file-name.patch +++ b/0001-checksum-Add-arch-to-file-name.patch @@ -1,7 +1,7 @@ From e34bd2763c0d0776693f8842639b35b55dcb511b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Mon, 4 Apr 2016 09:38:48 +0200 -Subject: [PATCH 1/3] [checksum] Add arch to file name +Subject: [PATCH 1/6] [checksum] Add arch to file name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/0002-atomic-Stop-creating-the-os-directory.patch b/0002-atomic-Stop-creating-the-os-directory.patch index 4407a1bd..b600ae9a 100644 --- a/0002-atomic-Stop-creating-the-os-directory.patch +++ b/0002-atomic-Stop-creating-the-os-directory.patch @@ -1,7 +1,7 @@ From f18e32c5affad9bf376103a536c7ded19366d92f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Mon, 4 Apr 2016 14:24:18 +0200 -Subject: [PATCH 2/3] [atomic] Stop creating the os directory +Subject: [PATCH 2/6] [atomic] Stop creating the os directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/0003-ostree-Fix-call-to-kobo.shortcuts.run.patch b/0003-ostree-Fix-call-to-kobo.shortcuts.run.patch index ccc5fd19..3263325a 100644 --- a/0003-ostree-Fix-call-to-kobo.shortcuts.run.patch +++ b/0003-ostree-Fix-call-to-kobo.shortcuts.run.patch @@ -1,7 +1,7 @@ From 05384eae584476bfca3bd4bf31958d1e5dbb20a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Mon, 4 Apr 2016 15:13:35 +0200 -Subject: [PATCH 3/3] [ostree] Fix call to kobo.shortcuts.run +Subject: [PATCH 3/6] [ostree] Fix call to kobo.shortcuts.run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/0004-ostree-Move-cloning-config-repo-to-chroot.patch b/0004-ostree-Move-cloning-config-repo-to-chroot.patch new file mode 100644 index 00000000..fa1d32ff --- /dev/null +++ b/0004-ostree-Move-cloning-config-repo-to-chroot.patch @@ -0,0 +1,276 @@ +From 446d4b20cc508ae466a1c5bf9cc76f8b0fc12494 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Tue, 5 Apr 2016 08:40:54 +0200 +Subject: [PATCH 4/6] [ostree] Move cloning config repo to chroot +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Lubomír Sedlář +--- + pungi/atomic.py | 46 ++++++++++++++++++++++++++++++++++++++++++++- + pungi/phases/ostree.py | 29 ++++------------------------ + tests/helpers.py | 7 ++++++- + tests/test_atomic_script.py | 23 ++++++++++++++++++++--- + tests/test_ostree_phase.py | 15 ++++----------- + 5 files changed, 79 insertions(+), 41 deletions(-) + +diff --git a/pungi/atomic.py b/pungi/atomic.py +index 7c0075b..627ce34 100644 +--- a/pungi/atomic.py ++++ b/pungi/atomic.py +@@ -8,6 +8,11 @@ It is expected to be runnable in Koji runroot. + import argparse + import os + from kobo import shortcuts ++import tempfile ++import shutil ++import re ++ ++from .wrappers import scm + + + def make_log_file(log_dir, filename): +@@ -31,9 +36,42 @@ def make_ostree_repo(repo, config, log_dir=None): + logfile=log_file) + + ++def clone_repo(repodir, url, branch): ++ scm.get_dir_from_scm( ++ {'scm': 'git', 'repo': url, 'branch': branch, 'dir': '.'}, repodir) ++ ++ ++def tweak_mirrorlist(repodir, source_repo): ++ for file in os.listdir(repodir): ++ if file.endswith('.repo'): ++ tweak_file(os.path.join(repodir, file), source_repo) ++ ++ ++def tweak_file(path, source_repo): ++ """Replace mirrorlist line in repo file with baseurl pointing to source_repo.""" ++ with open(path, 'r') as f: ++ contents = f.read() ++ replacement = 'baseurl={}'.format(source_repo) ++ contents = re.sub(r'^mirrorlist=.*$', replacement, contents) ++ with open(path, 'w') as f: ++ f.write(contents) ++ ++ ++def prepare_config(workdir, config_url, config_branch, source_repo): ++ repodir = os.path.join(workdir, 'config_repo') ++ clone_repo(repodir, config_url, config_branch) ++ tweak_mirrorlist(repodir, source_repo) ++ return repodir ++ ++ + def run(opts): ++ workdir = tempfile.mkdtemp() ++ repodir = prepare_config(workdir, opts.config_url, opts.config_branch, ++ opts.source_repo) + init_atomic_repo(opts.atomic_repo, log_dir=opts.log_dir) +- make_ostree_repo(opts.atomic_repo, opts.treefile, log_dir=opts.log_dir) ++ treefile = os.path.join(repodir, opts.treefile) ++ make_ostree_repo(opts.atomic_repo, treefile, log_dir=opts.log_dir) ++ shutil.rmtree(workdir) + + + def main(args=None): +@@ -45,6 +83,12 @@ def main(args=None): + help='where to put the atomic repo') + parser.add_argument('--treefile', required=True, + help='treefile for rpm-ostree') ++ parser.add_argument('--config-url', required=True, ++ help='git repository with the treefile') ++ parser.add_argument('--config-branch', default='master', ++ help='git branch to be used') ++ parser.add_argument('--source-repo', required=True, ++ help='yum repo used as source for') + + opts = parser.parse_args(args) + +diff --git a/pungi/phases/ostree.py b/pungi/phases/ostree.py +index 36cbc97..79e58d4 100644 +--- a/pungi/phases/ostree.py ++++ b/pungi/phases/ostree.py +@@ -2,12 +2,11 @@ + + import os + from kobo.threads import ThreadPool, WorkerThread +-import re + + from .base import ConfigGuardedPhase + from .. import util + from ..paths import translate_path +-from ..wrappers import scm, kojiwrapper ++from ..wrappers import kojiwrapper + + + class OSTreePhase(ConfigGuardedPhase): +@@ -42,15 +41,11 @@ class OSTreeThread(WorkerThread): + + msg = 'OSTree phase for variant %s, arch %s' % (variant.uid, arch) + self.pool.log_info('[BEGIN] %s' % msg) +- workdir = compose.paths.work.topdir('atomic') + self.logdir = compose.paths.log.topdir('{}/atomic'.format(arch)) +- repodir = os.path.join(workdir, 'config_repo') + + source_variant = compose.variants[config['source_repo_from']] + source_repo = translate_path(compose, compose.paths.compose.repository(arch, source_variant)) + +- self._clone_repo(repodir, config['config_url'], config.get('config_branch', 'master')) +- self._tweak_mirrorlist(repodir, source_repo) + self._run_atomic_cmd(compose, variant, arch, config, source_repo) + + self.pool.log_info('[DONE ] %s' % msg) +@@ -60,6 +55,9 @@ class OSTreeThread(WorkerThread): + 'pungi-make-ostree', + '--log-dir={}'.format(self.logdir), + '--treefile={}'.format(config['treefile']), ++ '--config-url={}'.format(config['config_url']), ++ '--config-branch={}'.format(config.get('config_branch', 'master')), ++ '--source-repo={}'.format(source_repo), + config['atomic_repo'] + ] + +@@ -77,22 +75,3 @@ class OSTreeThread(WorkerThread): + if output["retcode"] != 0: + raise RuntimeError("Runroot task failed: %s. See %s for more details." + % (output["task_id"], log_file)) +- +- def _clone_repo(self, repodir, url, branch): +- scm.get_dir_from_scm({'scm': 'git', 'repo': url, 'branch': branch, 'dir': '.'}, +- repodir, logger=self.pool._logger) +- +- def _tweak_mirrorlist(self, repodir, source_repo): +- for file in os.listdir(repodir): +- if file.endswith('.repo'): +- tweak_file(os.path.join(repodir, file), source_repo) +- +- +-def tweak_file(path, source_repo): +- """Replace mirrorlist line in repo file with baseurl pointing to source_repo.""" +- with open(path, 'r') as f: +- contents = f.read() +- replacement = 'baseurl={}'.format(source_repo) +- contents = re.sub(r'^mirrorlist=.*$', replacement, contents) +- with open(path, 'w') as f: +- f.write(contents) +diff --git a/tests/helpers.py b/tests/helpers.py +index 11c07a4..d93e095 100644 +--- a/tests/helpers.py ++++ b/tests/helpers.py +@@ -5,6 +5,7 @@ import os + import unittest + import tempfile + import shutil ++import errno + + from pungi.util import get_arch_variant_data + from pungi import paths +@@ -15,7 +16,11 @@ class PungiTestCase(unittest.TestCase): + self.topdir = tempfile.mkdtemp() + + def tearDown(self): +- shutil.rmtree(self.topdir) ++ try: ++ shutil.rmtree(self.topdir) ++ except OSError as err: ++ if err.errno != errno.ENOENT: ++ raise + + + class DummyCompose(object): +diff --git a/tests/test_atomic_script.py b/tests/test_atomic_script.py +index a871659..4b0b396 100755 +--- a/tests/test_atomic_script.py ++++ b/tests/test_atomic_script.py +@@ -17,20 +17,37 @@ from pungi import atomic + + class OstreeScriptTest(helpers.PungiTestCase): + ++ def _dummy_config_repo(self, scm_dict, target, logger=None): ++ helpers.touch(os.path.join(target, 'fedora-atomic-docker-host.json')) ++ helpers.touch(os.path.join(target, 'fedora-rawhide.repo')) ++ ++ @mock.patch('tempfile.mkdtemp') + @mock.patch('kobo.shortcuts.run') +- def test_full_run(self, run): ++ @mock.patch('pungi.wrappers.scm.get_dir_from_scm') ++ def test_full_run(self, get_dir_from_scm, run, tempfile): ++ tempfile.return_value = self.topdir ++ get_dir_from_scm.side_effect = self._dummy_config_repo ++ + atomic.main([ + '--log-dir={}'.format(os.path.join(self.topdir, 'logs', 'Atomic')), +- '--treefile={}'.format(os.path.join(self.topdir, 'work', 'fedora-atomic-docker-host.json')), ++ '--treefile={}'.format('fedora-atomic-docker-host.json'), ++ '--config-url=https://git.fedorahosted.org/git/fedora-atomic.git', ++ '--config-branch=f24', ++ '--source-repo=https://kojipkgs.fedoraproject.org/repo', + os.path.join(self.topdir, 'atomic'), + ]) ++ + self.maxDiff = None ++ self.assertEqual(get_dir_from_scm.call_args_list, ++ [mock.call({'scm': 'git', 'repo': 'https://git.fedorahosted.org/git/fedora-atomic.git', ++ 'branch': 'f24', 'dir': '.'}, ++ self.topdir + '/config_repo')]) + self.assertItemsEqual( + run.call_args_list, + [mock.call(['ostree', 'init', '--repo={}/atomic'.format(self.topdir), '--mode=archive-z2'], + logfile=self.topdir + '/logs/Atomic/init-atomic-repo.log'), + mock.call(['rpm-ostree', 'compose', 'tree', '--repo={}/atomic'.format(self.topdir), +- self.topdir + '/work/fedora-atomic-docker-host.json'], ++ self.topdir + '/config_repo/fedora-atomic-docker-host.json'], + logfile=self.topdir + '/logs/Atomic/create-atomic-repo.log')]) + + +diff --git a/tests/test_ostree_phase.py b/tests/test_ostree_phase.py +index e4664e1..fe0036c 100755 +--- a/tests/test_ostree_phase.py ++++ b/tests/test_ostree_phase.py +@@ -74,13 +74,8 @@ class OSTreePhaseTest(helpers.PungiTestCase): + + class OSTreeThreadTest(helpers.PungiTestCase): + +- def _dummy_config_repo(self, scm_dict, target, logger=None): +- helpers.touch(os.path.join(target, 'fedora-atomic-docker-host.json')) +- helpers.touch(os.path.join(target, 'fedora-rawhide.repo')) +- +- @mock.patch('pungi.wrappers.scm.get_dir_from_scm') + @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') +- def test_run(self, KojiWrapper, get_dir_from_scm): ++ def test_run(self, KojiWrapper): + compose = helpers.DummyCompose(self.topdir, { + 'koji_profile': 'koji', + 'runroot_tag': 'rrt', +@@ -93,7 +88,6 @@ class OSTreeThreadTest(helpers.PungiTestCase): + 'treefile': 'fedora-atomic-docker-host.json', + 'atomic_repo': '/other/place/for/atomic' + } +- get_dir_from_scm.side_effect = self._dummy_config_repo + koji = KojiWrapper.return_value + koji.run_runroot_cmd.return_value = { + 'task_id': 1234, +@@ -105,15 +99,14 @@ class OSTreeThreadTest(helpers.PungiTestCase): + + t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) + +- self.assertEqual(get_dir_from_scm.call_args_list, +- [mock.call({'scm': 'git', 'repo': 'https://git.fedorahosted.org/git/fedora-atomic.git', +- 'branch': 'f24', 'dir': '.'}, +- self.topdir + '/work/atomic/config_repo', logger=pool._logger)]) + self.assertEqual(koji.get_runroot_cmd.call_args_list, + [mock.call('rrt', 'x86_64', + ['pungi-make-ostree', + '--log-dir={}/logs/x86_64/atomic'.format(self.topdir), + '--treefile=fedora-atomic-docker-host.json', ++ '--config-url=https://git.fedorahosted.org/git/fedora-atomic.git', ++ '--config-branch=f24', ++ '--source-repo={}/compose/Everything/x86_64/os'.format(self.topdir), + '/other/place/for/atomic'], + channel=None, mounts=[self.topdir], + packages=['pungi', 'ostree', 'rpm-ostree'], +-- +2.7.3 + diff --git a/0005-ostree-Rename-atomic-to-ostree.patch b/0005-ostree-Rename-atomic-to-ostree.patch new file mode 100644 index 00000000..d39592f4 --- /dev/null +++ b/0005-ostree-Rename-atomic-to-ostree.patch @@ -0,0 +1,1494 @@ +From f98a506e86e15409be6733d37695303443a5452d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Tue, 5 Apr 2016 09:13:01 +0200 +Subject: [PATCH 5/6] [ostree] Rename atomic to ostree +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Lubomír Sedlář +--- + bin/pungi-config-validate | 2 +- + bin/pungi-koji | 8 +- + bin/pungi-make-ostree | 4 +- + doc/configuration.rst | 14 +- + pungi/atomic.py | 95 ----------- + pungi/ostree.py | 95 +++++++++++ + pungi/phases/__init__.py | 2 +- + pungi/phases/atomic_installer.py | 134 --------------- + pungi/phases/ostree.py | 8 +- + pungi/phases/ostree_installer.py | 134 +++++++++++++++ + tests/test_atomic_installer_phase.py | 317 ----------------------------------- + tests/test_atomic_script.py | 55 ------ + tests/test_ostree_installer_phase.py | 317 +++++++++++++++++++++++++++++++++++ + tests/test_ostree_phase.py | 8 +- + tests/test_ostree_script.py | 57 +++++++ + 15 files changed, 626 insertions(+), 624 deletions(-) + delete mode 100644 pungi/atomic.py + create mode 100644 pungi/ostree.py + delete mode 100644 pungi/phases/atomic_installer.py + create mode 100644 pungi/phases/ostree_installer.py + delete mode 100644 tests/test_atomic_installer_phase.py + delete mode 100755 tests/test_atomic_script.py + create mode 100644 tests/test_ostree_installer_phase.py + create mode 100755 tests/test_ostree_script.py + +diff --git a/bin/pungi-config-validate b/bin/pungi-config-validate +index 20f8094..3d61f11 100755 +--- a/bin/pungi-config-validate ++++ b/bin/pungi-config-validate +@@ -54,7 +54,7 @@ def run(config, topdir, has_old): + pungi.phases.GatherPhase(compose, pkgset_phase), + pungi.phases.ExtraFilesPhase(compose, pkgset_phase), + pungi.phases.CreaterepoPhase(compose), +- pungi.phases.AtomicInstallerPhase(compose), ++ pungi.phases.OstreeInstallerPhase(compose), + pungi.phases.OSTreePhase(compose), + pungi.phases.ProductimgPhase(compose, pkgset_phase), + pungi.phases.CreateisoPhase(compose), +diff --git a/bin/pungi-koji b/bin/pungi-koji +index a0eba0e..de59621 100755 +--- a/bin/pungi-koji ++++ b/bin/pungi-koji +@@ -227,7 +227,7 @@ def run_compose(compose): + gather_phase = pungi.phases.GatherPhase(compose, pkgset_phase) + extrafiles_phase = pungi.phases.ExtraFilesPhase(compose, pkgset_phase) + createrepo_phase = pungi.phases.CreaterepoPhase(compose) +- atomic_installer_phase = pungi.phases.AtomicInstallerPhase(compose) ++ ostree_installer_phase = pungi.phases.OstreeInstallerPhase(compose) + ostree_phase = pungi.phases.OSTreePhase(compose) + productimg_phase = pungi.phases.ProductimgPhase(compose, pkgset_phase) + createiso_phase = pungi.phases.CreateisoPhase(compose) +@@ -242,7 +242,7 @@ def run_compose(compose): + buildinstall_phase, productimg_phase, gather_phase, + extrafiles_phase, createiso_phase, liveimages_phase, + livemedia_phase, image_build_phase, image_checksum_phase, +- test_phase, ostree_phase, atomic_installer_phase): ++ test_phase, ostree_phase, ostree_installer_phase): + if phase.skip(): + continue + try: +@@ -348,13 +348,13 @@ def run_compose(compose): + liveimages_phase.start() + image_build_phase.start() + livemedia_phase.start() +- atomic_installer_phase.start() ++ ostree_installer_phase.start() + + createiso_phase.stop() + liveimages_phase.stop() + image_build_phase.stop() + livemedia_phase.stop() +- atomic_installer_phase.stop() ++ ostree_installer_phase.stop() + + image_checksum_phase.start() + image_checksum_phase.stop() +diff --git a/bin/pungi-make-ostree b/bin/pungi-make-ostree +index 4066bdc..2800588 100755 +--- a/bin/pungi-make-ostree ++++ b/bin/pungi-make-ostree +@@ -8,8 +8,8 @@ here = sys.path[0] + if here != '/usr/bin': + sys.path.insert(0, os.path.dirname(here)) + +-from pungi import atomic ++from pungi import ostree + + + if __name__ == '__main__': +- atomic.main() ++ ostree.main() +diff --git a/doc/configuration.rst b/doc/configuration.rst +index 7d4b91e..36b332a 100644 +--- a/doc/configuration.rst ++++ b/doc/configuration.rst +@@ -142,7 +142,7 @@ Options + * live + * image-build + * live-media +- * atomic_installer ++ * ostree-installer + + .. note:: + +@@ -950,7 +950,7 @@ runroot environment. + * ``treefile`` -- (*str*) Filename of configuration for ``rpm-ostree``. + * ``config_url`` -- (*str*) URL for Git repository with the ``treefile``. + * ``source_repo_from`` -- (*str*) Name of variant serving as source repository. +- * ``atomic_repo`` -- (*str*) Where to put the atomic repository ++ * ``ostree_repo`` -- (*str*) Where to put the ostree repository + + These keys are optional: + +@@ -968,19 +968,19 @@ Example config + "treefile": "fedora-atomic-docker-host.json", + "config_url": "https://git.fedorahosted.org/git/fedora-atomic.git", + "source_repo_from": "Everything", +- "atomic_repo": "/mnt/koji/compose/atomic/Rawhide/" ++ "ostree_repo": "/mnt/koji/compose/atomic/Rawhide/" + } + }) + ] + + +-Atomic Installer Settings ++Ostree Installer Settings + ========================= + +-The ``atomic_installer`` phase of *Pungi* can produce installer image bundling ++The ``ostree_installer`` phase of *Pungi* can produce installer image bundling + an OSTree repository. This always runs in Koji as a ``runroot`` task. + +-**atomic** ++**ostree_installer** + (*dict*) -- a variant/arch mapping of configuration. The format should be + ``[(variant_uid_regex, {arch|*: config_dict})]``. + +@@ -1010,7 +1010,7 @@ Example config + -------------- + :: + +- atomic = [ ++ ostree_installer = [ + ("^Atomic$", { + "x86_64": { + "source_repo_from": "Everything", +diff --git a/pungi/atomic.py b/pungi/atomic.py +deleted file mode 100644 +index 627ce34..0000000 +--- a/pungi/atomic.py ++++ /dev/null +@@ -1,95 +0,0 @@ +-# -*- coding: utf-8 -*- +- +-""" +-This module contains functions required by pungi-make-atomic. +-It is expected to be runnable in Koji runroot. +-""" +- +-import argparse +-import os +-from kobo import shortcuts +-import tempfile +-import shutil +-import re +- +-from .wrappers import scm +- +- +-def make_log_file(log_dir, filename): +- """Return path to log file with given name, if log_dir is set.""" +- if not log_dir: +- return None +- return os.path.join(log_dir, '{}.log'.format(filename)) +- +- +-def init_atomic_repo(repo, log_dir=None): +- """If the atomic repo does not exist, initialize it.""" +- log_file = make_log_file(log_dir, 'init-atomic-repo') +- if not os.path.isdir(repo): +- shortcuts.run(['ostree', 'init', '--repo={}'.format(repo), '--mode=archive-z2'], +- logfile=log_file) +- +- +-def make_ostree_repo(repo, config, log_dir=None): +- log_file = make_log_file(log_dir, 'create-atomic-repo') +- shortcuts.run(['rpm-ostree', 'compose', 'tree', '--repo={}'.format(repo), config], +- logfile=log_file) +- +- +-def clone_repo(repodir, url, branch): +- scm.get_dir_from_scm( +- {'scm': 'git', 'repo': url, 'branch': branch, 'dir': '.'}, repodir) +- +- +-def tweak_mirrorlist(repodir, source_repo): +- for file in os.listdir(repodir): +- if file.endswith('.repo'): +- tweak_file(os.path.join(repodir, file), source_repo) +- +- +-def tweak_file(path, source_repo): +- """Replace mirrorlist line in repo file with baseurl pointing to source_repo.""" +- with open(path, 'r') as f: +- contents = f.read() +- replacement = 'baseurl={}'.format(source_repo) +- contents = re.sub(r'^mirrorlist=.*$', replacement, contents) +- with open(path, 'w') as f: +- f.write(contents) +- +- +-def prepare_config(workdir, config_url, config_branch, source_repo): +- repodir = os.path.join(workdir, 'config_repo') +- clone_repo(repodir, config_url, config_branch) +- tweak_mirrorlist(repodir, source_repo) +- return repodir +- +- +-def run(opts): +- workdir = tempfile.mkdtemp() +- repodir = prepare_config(workdir, opts.config_url, opts.config_branch, +- opts.source_repo) +- init_atomic_repo(opts.atomic_repo, log_dir=opts.log_dir) +- treefile = os.path.join(repodir, opts.treefile) +- make_ostree_repo(opts.atomic_repo, treefile, log_dir=opts.log_dir) +- shutil.rmtree(workdir) +- +- +-def main(args=None): +- parser = argparse.ArgumentParser() +- parser.add_argument('--log-dir', +- help='where to log output') +- +- parser.add_argument('atomic_repo', metavar='ATOMIC_REPO', +- help='where to put the atomic repo') +- parser.add_argument('--treefile', required=True, +- help='treefile for rpm-ostree') +- parser.add_argument('--config-url', required=True, +- help='git repository with the treefile') +- parser.add_argument('--config-branch', default='master', +- help='git branch to be used') +- parser.add_argument('--source-repo', required=True, +- help='yum repo used as source for') +- +- opts = parser.parse_args(args) +- +- run(opts) +diff --git a/pungi/ostree.py b/pungi/ostree.py +new file mode 100644 +index 0000000..de2cfcd +--- /dev/null ++++ b/pungi/ostree.py +@@ -0,0 +1,95 @@ ++# -*- coding: utf-8 -*- ++ ++""" ++This module contains functions required by pungi-make-ostree. ++It is expected to be runnable in Koji runroot. ++""" ++ ++import argparse ++import os ++from kobo import shortcuts ++import tempfile ++import shutil ++import re ++ ++from .wrappers import scm ++ ++ ++def make_log_file(log_dir, filename): ++ """Return path to log file with given name, if log_dir is set.""" ++ if not log_dir: ++ return None ++ return os.path.join(log_dir, '{}.log'.format(filename)) ++ ++ ++def init_ostree_repo(repo, log_dir=None): ++ """If the ostree repo does not exist, initialize it.""" ++ log_file = make_log_file(log_dir, 'init-ostree-repo') ++ if not os.path.isdir(repo): ++ shortcuts.run(['ostree', 'init', '--repo={}'.format(repo), '--mode=archive-z2'], ++ logfile=log_file) ++ ++ ++def make_ostree_repo(repo, config, log_dir=None): ++ log_file = make_log_file(log_dir, 'create-ostree-repo') ++ shortcuts.run(['rpm-ostree', 'compose', 'tree', '--repo={}'.format(repo), config], ++ logfile=log_file) ++ ++ ++def clone_repo(repodir, url, branch): ++ scm.get_dir_from_scm( ++ {'scm': 'git', 'repo': url, 'branch': branch, 'dir': '.'}, repodir) ++ ++ ++def tweak_mirrorlist(repodir, source_repo): ++ for file in os.listdir(repodir): ++ if file.endswith('.repo'): ++ tweak_file(os.path.join(repodir, file), source_repo) ++ ++ ++def tweak_file(path, source_repo): ++ """Replace mirrorlist line in repo file with baseurl pointing to source_repo.""" ++ with open(path, 'r') as f: ++ contents = f.read() ++ replacement = 'baseurl={}'.format(source_repo) ++ contents = re.sub(r'^mirrorlist=.*$', replacement, contents) ++ with open(path, 'w') as f: ++ f.write(contents) ++ ++ ++def prepare_config(workdir, config_url, config_branch, source_repo): ++ repodir = os.path.join(workdir, 'config_repo') ++ clone_repo(repodir, config_url, config_branch) ++ tweak_mirrorlist(repodir, source_repo) ++ return repodir ++ ++ ++def run(opts): ++ workdir = tempfile.mkdtemp() ++ repodir = prepare_config(workdir, opts.config_url, opts.config_branch, ++ opts.source_repo) ++ init_ostree_repo(opts.ostree_repo, log_dir=opts.log_dir) ++ treefile = os.path.join(repodir, opts.treefile) ++ make_ostree_repo(opts.ostree_repo, treefile, log_dir=opts.log_dir) ++ shutil.rmtree(workdir) ++ ++ ++def main(args=None): ++ parser = argparse.ArgumentParser() ++ parser.add_argument('--log-dir', ++ help='where to log output') ++ ++ parser.add_argument('ostree_repo', metavar='OSTREE_REPO', ++ help='where to put the ostree repo') ++ parser.add_argument('--treefile', required=True, ++ help='treefile for rpm-ostree') ++ parser.add_argument('--config-url', required=True, ++ help='git repository with the treefile') ++ parser.add_argument('--config-branch', default='master', ++ help='git branch to be used') ++ parser.add_argument('--source-repo', required=True, ++ help='yum repo used as source for') ++ ++ opts = parser.parse_args(args) ++ ++ run(opts) +diff --git a/pungi/phases/__init__.py b/pungi/phases/__init__.py +index 343266a..1dff888 100644 +--- a/pungi/phases/__init__.py ++++ b/pungi/phases/__init__.py +@@ -30,4 +30,4 @@ from test import TestPhase # noqa + from image_checksum import ImageChecksumPhase # noqa + from livemedia_phase import LiveMediaPhase # noqa + from ostree import OSTreePhase # noqa +-from atomic_installer import AtomicInstallerPhase # noqa ++from ostree_installer import OstreeInstallerPhase # noqa +diff --git a/pungi/phases/atomic_installer.py b/pungi/phases/atomic_installer.py +deleted file mode 100644 +index 3390a74..0000000 +--- a/pungi/phases/atomic_installer.py ++++ /dev/null +@@ -1,134 +0,0 @@ +-# -*- coding: utf-8 -*- +- +-import os +-from kobo.threads import ThreadPool, WorkerThread +-import shutil +-from productmd import images +- +-from .base import ConfigGuardedPhase +-from .. import util +-from ..paths import translate_path +-from ..wrappers import kojiwrapper, iso, lorax +- +- +-class AtomicInstallerPhase(ConfigGuardedPhase): +- name = 'atomic' +- +- config_options = [ +- { +- "name": "atomic", +- "expected_types": [list], +- "optional": True, +- } +- ] +- +- def __init__(self, compose): +- super(AtomicInstallerPhase, self).__init__(compose) +- self.pool = ThreadPool(logger=self.compose._logger) +- +- def run(self): +- for variant in self.compose.get_variants(): +- for arch in variant.arches: +- for conf in util.get_arch_variant_data(self.compose.conf, self.name, arch, variant): +- self.pool.add(AtomicInstallerThread(self.pool)) +- self.pool.queue_put((self.compose, variant, arch, conf)) +- +- self.pool.start() +- +- +-class AtomicInstallerThread(WorkerThread): +- def process(self, item, num): +- compose, variant, arch, config = item +- self.num = num +- with util.failable(compose, variant, arch, 'atomic_installer', 'Atomic'): +- self.worker(compose, variant, arch, config) +- +- def worker(self, compose, variant, arch, config): +- msg = 'Atomic phase for variant %s, arch %s' % (variant.uid, arch) +- self.pool.log_info('[BEGIN] %s' % msg) +- self.logdir = compose.paths.log.topdir('{}/atomic'.format(arch)) +- +- source_variant = compose.variants[config['source_repo_from']] +- source_repo = translate_path( +- compose, compose.paths.compose.repository(arch, source_variant, create_dir=False)) +- +- self._run_atomic_cmd(compose, variant, arch, config, source_repo) +- +- disc_type = compose.conf.get('disc_types', {}).get('dvd', 'dvd') +- filename = compose.get_image_name(arch, variant, disc_type=disc_type, +- format=config.get('filename')) +- self._copy_image(compose, variant, arch, filename) +- self._add_to_manifest(compose, variant, arch, filename) +- self.pool.log_info('[DONE ] %s' % msg) +- +- def _get_release(self, compose, config): +- if 'release' in config and config['release'] is None: +- return compose.image_release +- return config.get('release', None) +- +- def _copy_image(self, compose, variant, arch, filename): +- iso_path = compose.paths.compose.iso_path(arch, variant, filename) +- source_dir = compose.paths.compose.os_tree(arch, variant) +- boot_iso = os.path.join(source_dir, 'images', 'boot.iso') +- +- try: +- os.link(boot_iso, iso_path) +- except OSError: +- shutil.copy2(boot_iso, iso_path) +- +- def _add_to_manifest(self, compose, variant, arch, filename): +- full_iso_path = compose.paths.compose.iso_path(arch, variant, filename) +- iso_path = compose.paths.compose.iso_path(arch, variant, filename, relative=True) +- iso_wrapper = iso.IsoWrapper() +- implant_md5 = iso_wrapper.get_implanted_md5(full_iso_path) +- +- img = images.Image(compose.im) +- img.path = iso_path +- img.mtime = util.get_mtime(full_iso_path) +- img.size = util.get_file_size(full_iso_path) +- img.arch = arch +- img.type = "boot" +- img.format = "iso" +- img.disc_number = 1 +- img.disc_count = 1 +- img.bootable = True +- img.subvariant = variant.name +- img.implant_md5 = implant_md5 +- try: +- img.volume_id = iso_wrapper.get_volume_id(full_iso_path) +- except RuntimeError: +- pass +- compose.im.add(variant.uid, arch, img) +- +- def _run_atomic_cmd(self, compose, variant, arch, config, source_repo): +- image_dir = compose.paths.compose.os_tree(arch, variant, create_dir=False) +- lorax_wrapper = lorax.LoraxWrapper() +- cmd = lorax_wrapper.get_lorax_cmd( +- compose.conf['release_name'], +- compose.conf["release_version"], +- self._get_release(compose, config), +- repo_baseurl=source_repo, +- output_dir=image_dir, +- variant=variant.uid, +- nomacboot=True, +- buildinstallpackages=config.get('installpkgs'), +- add_template=config.get('add_template'), +- add_arch_template=config.get('add_arch_template'), +- add_template_var=config.get('add_template_var'), +- add_arch_template_var=config.get('add_arch_template_var') +- ) +- +- runroot_channel = compose.conf.get("runroot_channel", None) +- runroot_tag = compose.conf["runroot_tag"] +- +- packages = ['pungi', 'lorax'] +- log_file = os.path.join(self.logdir, 'runroot.log') +- koji = kojiwrapper.KojiWrapper(compose.conf["koji_profile"]) +- koji_cmd = koji.get_runroot_cmd(runroot_tag, arch, cmd, +- channel=runroot_channel, +- use_shell=True, task_id=True, +- packages=packages, mounts=[compose.topdir]) +- output = koji.run_runroot_cmd(koji_cmd, log_file=log_file) +- if output["retcode"] != 0: +- raise RuntimeError("Runroot task failed: %s. See %s for more details." +- % (output["task_id"], log_file)) +diff --git a/pungi/phases/ostree.py b/pungi/phases/ostree.py +index 79e58d4..810716e 100644 +--- a/pungi/phases/ostree.py ++++ b/pungi/phases/ostree.py +@@ -41,16 +41,16 @@ class OSTreeThread(WorkerThread): + + msg = 'OSTree phase for variant %s, arch %s' % (variant.uid, arch) + self.pool.log_info('[BEGIN] %s' % msg) +- self.logdir = compose.paths.log.topdir('{}/atomic'.format(arch)) ++ self.logdir = compose.paths.log.topdir('{}/ostree'.format(arch)) + + source_variant = compose.variants[config['source_repo_from']] + source_repo = translate_path(compose, compose.paths.compose.repository(arch, source_variant)) + +- self._run_atomic_cmd(compose, variant, arch, config, source_repo) ++ self._run_ostree_cmd(compose, variant, arch, config, source_repo) + + self.pool.log_info('[DONE ] %s' % msg) + +- def _run_atomic_cmd(self, compose, variant, arch, config, source_repo): ++ def _run_ostree_cmd(self, compose, variant, arch, config, source_repo): + cmd = [ + 'pungi-make-ostree', + '--log-dir={}'.format(self.logdir), +@@ -58,7 +58,7 @@ class OSTreeThread(WorkerThread): + '--config-url={}'.format(config['config_url']), + '--config-branch={}'.format(config.get('config_branch', 'master')), + '--source-repo={}'.format(source_repo), +- config['atomic_repo'] ++ config['ostree_repo'] + ] + + runroot_channel = compose.conf.get("runroot_channel", None) +diff --git a/pungi/phases/ostree_installer.py b/pungi/phases/ostree_installer.py +new file mode 100644 +index 0000000..a781c4f +--- /dev/null ++++ b/pungi/phases/ostree_installer.py +@@ -0,0 +1,134 @@ ++# -*- coding: utf-8 -*- ++ ++import os ++from kobo.threads import ThreadPool, WorkerThread ++import shutil ++from productmd import images ++ ++from .base import ConfigGuardedPhase ++from .. import util ++from ..paths import translate_path ++from ..wrappers import kojiwrapper, iso, lorax ++ ++ ++class OstreeInstallerPhase(ConfigGuardedPhase): ++ name = 'ostree_installer' ++ ++ config_options = [ ++ { ++ "name": "ostree_installer", ++ "expected_types": [list], ++ "optional": True, ++ } ++ ] ++ ++ def __init__(self, compose): ++ super(OstreeInstallerPhase, self).__init__(compose) ++ self.pool = ThreadPool(logger=self.compose._logger) ++ ++ def run(self): ++ for variant in self.compose.get_variants(): ++ for arch in variant.arches: ++ for conf in util.get_arch_variant_data(self.compose.conf, self.name, arch, variant): ++ self.pool.add(OstreeInstallerThread(self.pool)) ++ self.pool.queue_put((self.compose, variant, arch, conf)) ++ ++ self.pool.start() ++ ++ ++class OstreeInstallerThread(WorkerThread): ++ def process(self, item, num): ++ compose, variant, arch, config = item ++ self.num = num ++ with util.failable(compose, variant, arch, 'ostree-installer', 'Ostree installer'): ++ self.worker(compose, variant, arch, config) ++ ++ def worker(self, compose, variant, arch, config): ++ msg = 'Ostree phase for variant %s, arch %s' % (variant.uid, arch) ++ self.pool.log_info('[BEGIN] %s' % msg) ++ self.logdir = compose.paths.log.topdir('{}/ostree'.format(arch)) ++ ++ source_variant = compose.variants[config['source_repo_from']] ++ source_repo = translate_path( ++ compose, compose.paths.compose.repository(arch, source_variant, create_dir=False)) ++ ++ self._run_ostree_cmd(compose, variant, arch, config, source_repo) ++ ++ disc_type = compose.conf.get('disc_types', {}).get('dvd', 'dvd') ++ filename = compose.get_image_name(arch, variant, disc_type=disc_type, ++ format=config.get('filename')) ++ self._copy_image(compose, variant, arch, filename) ++ self._add_to_manifest(compose, variant, arch, filename) ++ self.pool.log_info('[DONE ] %s' % msg) ++ ++ def _get_release(self, compose, config): ++ if 'release' in config and config['release'] is None: ++ return compose.image_release ++ return config.get('release', None) ++ ++ def _copy_image(self, compose, variant, arch, filename): ++ iso_path = compose.paths.compose.iso_path(arch, variant, filename) ++ source_dir = compose.paths.compose.os_tree(arch, variant) ++ boot_iso = os.path.join(source_dir, 'images', 'boot.iso') ++ ++ try: ++ os.link(boot_iso, iso_path) ++ except OSError: ++ shutil.copy2(boot_iso, iso_path) ++ ++ def _add_to_manifest(self, compose, variant, arch, filename): ++ full_iso_path = compose.paths.compose.iso_path(arch, variant, filename) ++ iso_path = compose.paths.compose.iso_path(arch, variant, filename, relative=True) ++ iso_wrapper = iso.IsoWrapper() ++ implant_md5 = iso_wrapper.get_implanted_md5(full_iso_path) ++ ++ img = images.Image(compose.im) ++ img.path = iso_path ++ img.mtime = util.get_mtime(full_iso_path) ++ img.size = util.get_file_size(full_iso_path) ++ img.arch = arch ++ img.type = "boot" ++ img.format = "iso" ++ img.disc_number = 1 ++ img.disc_count = 1 ++ img.bootable = True ++ img.subvariant = variant.name ++ img.implant_md5 = implant_md5 ++ try: ++ img.volume_id = iso_wrapper.get_volume_id(full_iso_path) ++ except RuntimeError: ++ pass ++ compose.im.add(variant.uid, arch, img) ++ ++ def _run_ostree_cmd(self, compose, variant, arch, config, source_repo): ++ image_dir = compose.paths.compose.os_tree(arch, variant, create_dir=False) ++ lorax_wrapper = lorax.LoraxWrapper() ++ cmd = lorax_wrapper.get_lorax_cmd( ++ compose.conf['release_name'], ++ compose.conf["release_version"], ++ self._get_release(compose, config), ++ repo_baseurl=source_repo, ++ output_dir=image_dir, ++ variant=variant.uid, ++ nomacboot=True, ++ buildinstallpackages=config.get('installpkgs'), ++ add_template=config.get('add_template'), ++ add_arch_template=config.get('add_arch_template'), ++ add_template_var=config.get('add_template_var'), ++ add_arch_template_var=config.get('add_arch_template_var') ++ ) ++ ++ runroot_channel = compose.conf.get("runroot_channel", None) ++ runroot_tag = compose.conf["runroot_tag"] ++ ++ packages = ['pungi', 'lorax'] ++ log_file = os.path.join(self.logdir, 'runroot.log') ++ koji = kojiwrapper.KojiWrapper(compose.conf["koji_profile"]) ++ koji_cmd = koji.get_runroot_cmd(runroot_tag, arch, cmd, ++ channel=runroot_channel, ++ use_shell=True, task_id=True, ++ packages=packages, mounts=[compose.topdir]) ++ output = koji.run_runroot_cmd(koji_cmd, log_file=log_file) ++ if output["retcode"] != 0: ++ raise RuntimeError("Runroot task failed: %s. See %s for more details." ++ % (output["task_id"], log_file)) +diff --git a/tests/test_atomic_installer_phase.py b/tests/test_atomic_installer_phase.py +deleted file mode 100644 +index 33f4961..0000000 +--- a/tests/test_atomic_installer_phase.py ++++ /dev/null +@@ -1,317 +0,0 @@ +-#!/usr/bin/env python +-# -*- coding: utf-8 -*- +- +- +-import unittest +-import mock +- +-import os +-import sys +- +-sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) +- +-from tests import helpers +-from pungi.phases import atomic_installer as atomic +- +- +-class AtomicInstallerPhaseTest(helpers.PungiTestCase): +- +- def test_validate(self): +- compose = helpers.DummyCompose(self.topdir, { +- 'atomic': [ +- ("^Atomic$", { +- "x86_64": { +- "source_repo_from": "Everything", +- "release": None, +- "filename": "%(release_short)s-%(variant)s-%(arch)s-%(version)s-%(compose_date)s.iso", +- "installpkgs": ["fedora-productimg-atomic"], +- "add_template": ["/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl"], +- "add_template_var": [ +- "ostree_osname=fedora-atomic", +- "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", +- ], +- "add_arch_template": ["/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl"], +- "add_arch_template_var": [ +- "ostree_repo=https://kojipkgs.fedoraproject.org/compose/atomic/Rawhide/", +- "ostree_osname=fedora-atomic", +- "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", +- ] +- } +- }) +- ] +- }) +- +- phase = atomic.AtomicInstallerPhase(compose) +- try: +- phase.validate() +- except: +- self.fail('Correct config must validate') +- +- def test_validate_bad_conf(self): +- compose = helpers.DummyCompose(self.topdir, { +- 'atomic': 'yes please' +- }) +- +- phase = atomic.AtomicInstallerPhase(compose) +- with self.assertRaises(ValueError): +- phase.validate() +- +- @mock.patch('pungi.phases.atomic_installer.ThreadPool') +- def test_run(self, ThreadPool): +- cfg = mock.Mock() +- compose = helpers.DummyCompose(self.topdir, { +- 'atomic': [ +- ('^Everything$', {'x86_64': cfg}) +- ] +- }) +- +- pool = ThreadPool.return_value +- +- phase = atomic.AtomicInstallerPhase(compose) +- phase.run() +- +- self.assertEqual(len(pool.add.call_args_list), 1) +- self.assertEqual(pool.queue_put.call_args_list, +- [mock.call((compose, compose.variants['Everything'], 'x86_64', cfg))]) +- +- @mock.patch('pungi.phases.atomic_installer.ThreadPool') +- def test_skip_without_config(self, ThreadPool): +- compose = helpers.DummyCompose(self.topdir, {}) +- compose.just_phases = None +- compose.skip_phases = [] +- phase = atomic.AtomicInstallerPhase(compose) +- self.assertTrue(phase.skip()) +- +- +-class AtomicThreadTest(helpers.PungiTestCase): +- +- def assertImageAdded(self, compose, ImageCls, IsoWrapper): +- image = ImageCls.return_value +- self.assertEqual(image.path, 'Everything/x86_64/iso/image-name') +- self.assertEqual(image.mtime, 13579) +- self.assertEqual(image.size, 1024) +- self.assertEqual(image.arch, 'x86_64') +- self.assertEqual(image.type, "boot") +- self.assertEqual(image.format, "iso") +- self.assertEqual(image.disc_number, 1) +- self.assertEqual(image.disc_count, 1) +- self.assertEqual(image.bootable, True) +- self.assertEqual(image.implant_md5, IsoWrapper.return_value.get_implanted_md5.return_value) +- self.assertEqual(compose.im.add.mock_calls, +- [mock.call('Everything', 'x86_64', image)]) +- +- @mock.patch('productmd.images.Image') +- @mock.patch('pungi.util.get_mtime') +- @mock.patch('pungi.util.get_file_size') +- @mock.patch('pungi.wrappers.iso.IsoWrapper') +- @mock.patch('os.link') +- @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') +- def test_run(self, KojiWrapper, link, IsoWrapper, +- get_file_size, get_mtime, ImageCls): +- compose = helpers.DummyCompose(self.topdir, { +- 'release_name': 'Fedora', +- 'release_version': 'Rawhide', +- 'koji_profile': 'koji', +- 'runroot_tag': 'rrt', +- }) +- pool = mock.Mock() +- cfg = { +- 'source_repo_from': 'Everything', +- 'release': '20160321.n.0', +- 'filename': 'Fedora-Atomic.iso', +- } +- koji = KojiWrapper.return_value +- koji.run_runroot_cmd.return_value = { +- 'task_id': 1234, +- 'retcode': 0, +- 'output': 'Foo bar\n', +- } +- get_file_size.return_value = 1024 +- get_mtime.return_value = 13579 +- final_iso_path = self.topdir + '/compose/Everything/x86_64/iso/image-name' +- +- t = atomic.AtomicInstallerThread(pool) +- +- t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) +- +- self.assertEqual(koji.get_runroot_cmd.call_args_list, +- [mock.call('rrt', 'x86_64', +- ['lorax', +- '--product=Fedora', +- '--version=Rawhide', +- '--release=20160321.n.0', +- '--source=file://{}/compose/Everything/x86_64/os'.format(self.topdir), +- '--variant=Everything', +- '--nomacboot', +- self.topdir + '/compose/Everything/x86_64/os'], +- channel=None, mounts=[self.topdir], +- packages=['pungi', 'lorax'], +- task_id=True, use_shell=True)]) +- self.assertEqual(koji.run_runroot_cmd.call_args_list, +- [mock.call(koji.get_runroot_cmd.return_value, +- log_file=self.topdir + '/logs/x86_64/atomic/runroot.log')]) +- self.assertEqual(link.call_args_list, +- [mock.call(self.topdir + '/compose/Everything/x86_64/os/images/boot.iso', +- final_iso_path)]) +- self.assertEqual(get_file_size.call_args_list, [mock.call(final_iso_path)]) +- self.assertEqual(get_mtime.call_args_list, [mock.call(final_iso_path)]) +- self.assertImageAdded(compose, ImageCls, IsoWrapper) +- self.assertEqual(compose.get_image_name.call_args_list, +- [mock.call('x86_64', compose.variants['Everything'], +- disc_type='dvd', format='Fedora-Atomic.iso')]) +- +- @mock.patch('productmd.images.Image') +- @mock.patch('pungi.util.get_mtime') +- @mock.patch('pungi.util.get_file_size') +- @mock.patch('pungi.wrappers.iso.IsoWrapper') +- @mock.patch('os.link') +- @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') +- def test_run_with_implicit_release(self, KojiWrapper, link, +- IsoWrapper, get_file_size, get_mtime, ImageCls): +- compose = helpers.DummyCompose(self.topdir, { +- 'release_name': 'Fedora', +- 'release_version': 'Rawhide', +- 'koji_profile': 'koji', +- 'runroot_tag': 'rrt', +- }) +- pool = mock.Mock() +- cfg = { +- 'source_repo_from': 'Everything', +- 'release': None, +- "installpkgs": ["fedora-productimg-atomic"], +- "add_template": ["/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl"], +- "add_template_var": [ +- "ostree_osname=fedora-atomic", +- "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", +- ], +- "add_arch_template": ["/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl"], +- "add_arch_template_var": [ +- "ostree_repo=https://kojipkgs.fedoraproject.org/compose/atomic/Rawhide/", +- "ostree_osname=fedora-atomic", +- "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", +- ], +- } +- koji = KojiWrapper.return_value +- koji.run_runroot_cmd.return_value = { +- 'task_id': 1234, +- 'retcode': 0, +- 'output': 'Foo bar\n', +- } +- get_file_size.return_value = 1024 +- get_mtime.return_value = 13579 +- final_iso_path = self.topdir + '/compose/Everything/x86_64/iso/image-name' +- +- t = atomic.AtomicInstallerThread(pool) +- +- t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) +- +- self.assertEqual( +- koji.get_runroot_cmd.call_args_list, +- [mock.call('rrt', 'x86_64', +- ['lorax', +- '--product=Fedora', +- '--version=Rawhide', '--release=20151203.t.0', +- '--source=file://{}/compose/Everything/x86_64/os'.format(self.topdir), +- '--variant=Everything', +- '--nomacboot', +- '--installpkgs=fedora-productimg-atomic', +- '--add-template=/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl', +- '--add-arch-template=/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl', +- '--add-template-var=ostree_osname=fedora-atomic', +- '--add-template-var=ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host', +- '--add-arch-template-var=ostree_repo=https://kojipkgs.fedoraproject.org/compose/atomic/Rawhide/', +- '--add-arch-template-var=ostree_osname=fedora-atomic', +- '--add-arch-template-var=ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host', +- self.topdir + '/compose/Everything/x86_64/os'], +- channel=None, mounts=[self.topdir], +- packages=['pungi', 'lorax'], +- task_id=True, use_shell=True)]) +- self.assertEqual(koji.run_runroot_cmd.call_args_list, +- [mock.call(koji.get_runroot_cmd.return_value, +- log_file=self.topdir + '/logs/x86_64/atomic/runroot.log')]) +- self.assertEqual(link.call_args_list, +- [mock.call(self.topdir + '/compose/Everything/x86_64/os/images/boot.iso', +- final_iso_path)]) +- self.assertEqual(get_file_size.call_args_list, [mock.call(final_iso_path)]) +- self.assertEqual(get_mtime.call_args_list, [mock.call(final_iso_path)]) +- self.assertImageAdded(compose, ImageCls, IsoWrapper) +- self.assertEqual(compose.get_image_name.call_args_list, +- [mock.call('x86_64', compose.variants['Everything'], +- disc_type='dvd', format=None)]) +- +- @mock.patch('productmd.images.Image') +- @mock.patch('pungi.util.get_mtime') +- @mock.patch('pungi.util.get_file_size') +- @mock.patch('pungi.wrappers.iso.IsoWrapper') +- @mock.patch('os.link') +- @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') +- def test_fail_crash(self, KojiWrapper, link, +- IsoWrapper, get_file_size, get_mtime, ImageCls): +- compose = helpers.DummyCompose(self.topdir, { +- 'release_name': 'Fedora', +- 'release_version': 'Rawhide', +- 'koji_profile': 'koji', +- 'runroot_tag': 'rrt', +- 'failable_deliverables': [ +- ('^.+$', {'*': ['atomic_installer']}) +- ], +- }) +- pool = mock.Mock() +- cfg = { +- 'source_repo_from': 'Everything', +- 'release': None, +- 'filename': 'Fedora-Atomic.iso', +- } +- koji = KojiWrapper.return_value +- koji.run_runroot_cmd.side_effect = helpers.boom +- +- t = atomic.AtomicInstallerThread(pool) +- +- t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) +- compose.log_info.assert_has_calls([ +- mock.call('[FAIL] Atomic (variant Everything, arch x86_64) failed, but going on anyway.'), +- mock.call('BOOM') +- ]) +- +- @mock.patch('productmd.images.Image') +- @mock.patch('pungi.util.get_mtime') +- @mock.patch('pungi.util.get_file_size') +- @mock.patch('pungi.wrappers.iso.IsoWrapper') +- @mock.patch('os.link') +- @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') +- def test_fail_runroot_fail(self, KojiWrapper, link, +- IsoWrapper, get_file_size, get_mtime, ImageCls): +- compose = helpers.DummyCompose(self.topdir, { +- 'release_name': 'Fedora', +- 'release_version': 'Rawhide', +- 'koji_profile': 'koji', +- 'runroot_tag': 'rrt', +- 'failable_deliverables': [ +- ('^.+$', {'*': ['atomic_installer']}) +- ], +- }) +- pool = mock.Mock() +- cfg = { +- 'source_repo_from': 'Everything', +- 'release': None, +- 'filename': 'Fedora-Atomic.iso', +- } +- koji = KojiWrapper.return_value +- koji.run_runroot_cmd.return_value = { +- 'output': 'Failed', +- 'task_id': 1234, +- 'retcode': 1, +- } +- +- t = atomic.AtomicInstallerThread(pool) +- +- t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) +- compose.log_info.assert_has_calls([ +- mock.call('[FAIL] Atomic (variant Everything, arch x86_64) failed, but going on anyway.'), +- mock.call('Runroot task failed: 1234. See %s/logs/x86_64/atomic/runroot.log for more details.' +- % self.topdir) +- ]) +- +- +-if __name__ == '__main__': +- unittest.main() +diff --git a/tests/test_atomic_script.py b/tests/test_atomic_script.py +deleted file mode 100755 +index 4b0b396..0000000 +--- a/tests/test_atomic_script.py ++++ /dev/null +@@ -1,55 +0,0 @@ +-#!/usr/bin/env python +-# -*- coding: utf-8 -*- +- +- +-import unittest +-import mock +- +-import os +-import sys +- +-sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) +-sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'bin')) +- +-from tests import helpers +-from pungi import atomic +- +- +-class OstreeScriptTest(helpers.PungiTestCase): +- +- def _dummy_config_repo(self, scm_dict, target, logger=None): +- helpers.touch(os.path.join(target, 'fedora-atomic-docker-host.json')) +- helpers.touch(os.path.join(target, 'fedora-rawhide.repo')) +- +- @mock.patch('tempfile.mkdtemp') +- @mock.patch('kobo.shortcuts.run') +- @mock.patch('pungi.wrappers.scm.get_dir_from_scm') +- def test_full_run(self, get_dir_from_scm, run, tempfile): +- tempfile.return_value = self.topdir +- get_dir_from_scm.side_effect = self._dummy_config_repo +- +- atomic.main([ +- '--log-dir={}'.format(os.path.join(self.topdir, 'logs', 'Atomic')), +- '--treefile={}'.format('fedora-atomic-docker-host.json'), +- '--config-url=https://git.fedorahosted.org/git/fedora-atomic.git', +- '--config-branch=f24', +- '--source-repo=https://kojipkgs.fedoraproject.org/repo', +- os.path.join(self.topdir, 'atomic'), +- ]) +- +- self.maxDiff = None +- self.assertEqual(get_dir_from_scm.call_args_list, +- [mock.call({'scm': 'git', 'repo': 'https://git.fedorahosted.org/git/fedora-atomic.git', +- 'branch': 'f24', 'dir': '.'}, +- self.topdir + '/config_repo')]) +- self.assertItemsEqual( +- run.call_args_list, +- [mock.call(['ostree', 'init', '--repo={}/atomic'.format(self.topdir), '--mode=archive-z2'], +- logfile=self.topdir + '/logs/Atomic/init-atomic-repo.log'), +- mock.call(['rpm-ostree', 'compose', 'tree', '--repo={}/atomic'.format(self.topdir), +- self.topdir + '/config_repo/fedora-atomic-docker-host.json'], +- logfile=self.topdir + '/logs/Atomic/create-atomic-repo.log')]) +- +- +-if __name__ == '__main__': +- unittest.main() +diff --git a/tests/test_ostree_installer_phase.py b/tests/test_ostree_installer_phase.py +new file mode 100644 +index 0000000..add4528 +--- /dev/null ++++ b/tests/test_ostree_installer_phase.py +@@ -0,0 +1,317 @@ ++#!/usr/bin/env python ++# -*- coding: utf-8 -*- ++ ++ ++import unittest ++import mock ++ ++import os ++import sys ++ ++sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) ++ ++from tests import helpers ++from pungi.phases import ostree_installer as ostree ++ ++ ++class OstreeInstallerPhaseTest(helpers.PungiTestCase): ++ ++ def test_validate(self): ++ compose = helpers.DummyCompose(self.topdir, { ++ 'ostree_installer': [ ++ ("^Atomic$", { ++ "x86_64": { ++ "source_repo_from": "Everything", ++ "release": None, ++ "filename": "%(release_short)s-%(variant)s-%(arch)s-%(version)s-%(compose_date)s.iso", ++ "installpkgs": ["fedora-productimg-atomic"], ++ "add_template": ["/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl"], ++ "add_template_var": [ ++ "ostree_osname=fedora-atomic", ++ "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", ++ ], ++ "add_arch_template": ["/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl"], ++ "add_arch_template_var": [ ++ "ostree_repo=https://kojipkgs.fedoraproject.org/compose/atomic/Rawhide/", ++ "ostree_osname=fedora-atomic", ++ "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", ++ ] ++ } ++ }) ++ ] ++ }) ++ ++ phase = ostree.OstreeInstallerPhase(compose) ++ try: ++ phase.validate() ++ except: ++ self.fail('Correct config must validate') ++ ++ def test_validate_bad_conf(self): ++ compose = helpers.DummyCompose(self.topdir, { ++ 'ostree_installer': 'yes please' ++ }) ++ ++ phase = ostree.OstreeInstallerPhase(compose) ++ with self.assertRaises(ValueError): ++ phase.validate() ++ ++ @mock.patch('pungi.phases.ostree_installer.ThreadPool') ++ def test_run(self, ThreadPool): ++ cfg = mock.Mock() ++ compose = helpers.DummyCompose(self.topdir, { ++ 'ostree_installer': [ ++ ('^Everything$', {'x86_64': cfg}) ++ ] ++ }) ++ ++ pool = ThreadPool.return_value ++ ++ phase = ostree.OstreeInstallerPhase(compose) ++ phase.run() ++ ++ self.assertEqual(len(pool.add.call_args_list), 1) ++ self.assertEqual(pool.queue_put.call_args_list, ++ [mock.call((compose, compose.variants['Everything'], 'x86_64', cfg))]) ++ ++ @mock.patch('pungi.phases.ostree_installer.ThreadPool') ++ def test_skip_without_config(self, ThreadPool): ++ compose = helpers.DummyCompose(self.topdir, {}) ++ compose.just_phases = None ++ compose.skip_phases = [] ++ phase = ostree.OstreeInstallerPhase(compose) ++ self.assertTrue(phase.skip()) ++ ++ ++class OstreeThreadTest(helpers.PungiTestCase): ++ ++ def assertImageAdded(self, compose, ImageCls, IsoWrapper): ++ image = ImageCls.return_value ++ self.assertEqual(image.path, 'Everything/x86_64/iso/image-name') ++ self.assertEqual(image.mtime, 13579) ++ self.assertEqual(image.size, 1024) ++ self.assertEqual(image.arch, 'x86_64') ++ self.assertEqual(image.type, "boot") ++ self.assertEqual(image.format, "iso") ++ self.assertEqual(image.disc_number, 1) ++ self.assertEqual(image.disc_count, 1) ++ self.assertEqual(image.bootable, True) ++ self.assertEqual(image.implant_md5, IsoWrapper.return_value.get_implanted_md5.return_value) ++ self.assertEqual(compose.im.add.mock_calls, ++ [mock.call('Everything', 'x86_64', image)]) ++ ++ @mock.patch('productmd.images.Image') ++ @mock.patch('pungi.util.get_mtime') ++ @mock.patch('pungi.util.get_file_size') ++ @mock.patch('pungi.wrappers.iso.IsoWrapper') ++ @mock.patch('os.link') ++ @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') ++ def test_run(self, KojiWrapper, link, IsoWrapper, ++ get_file_size, get_mtime, ImageCls): ++ compose = helpers.DummyCompose(self.topdir, { ++ 'release_name': 'Fedora', ++ 'release_version': 'Rawhide', ++ 'koji_profile': 'koji', ++ 'runroot_tag': 'rrt', ++ }) ++ pool = mock.Mock() ++ cfg = { ++ 'source_repo_from': 'Everything', ++ 'release': '20160321.n.0', ++ 'filename': 'Fedora-Atomic.iso', ++ } ++ koji = KojiWrapper.return_value ++ koji.run_runroot_cmd.return_value = { ++ 'task_id': 1234, ++ 'retcode': 0, ++ 'output': 'Foo bar\n', ++ } ++ get_file_size.return_value = 1024 ++ get_mtime.return_value = 13579 ++ final_iso_path = self.topdir + '/compose/Everything/x86_64/iso/image-name' ++ ++ t = ostree.OstreeInstallerThread(pool) ++ ++ t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) ++ ++ self.assertEqual(koji.get_runroot_cmd.call_args_list, ++ [mock.call('rrt', 'x86_64', ++ ['lorax', ++ '--product=Fedora', ++ '--version=Rawhide', ++ '--release=20160321.n.0', ++ '--source=file://{}/compose/Everything/x86_64/os'.format(self.topdir), ++ '--variant=Everything', ++ '--nomacboot', ++ self.topdir + '/compose/Everything/x86_64/os'], ++ channel=None, mounts=[self.topdir], ++ packages=['pungi', 'lorax'], ++ task_id=True, use_shell=True)]) ++ self.assertEqual(koji.run_runroot_cmd.call_args_list, ++ [mock.call(koji.get_runroot_cmd.return_value, ++ log_file=self.topdir + '/logs/x86_64/ostree/runroot.log')]) ++ self.assertEqual(link.call_args_list, ++ [mock.call(self.topdir + '/compose/Everything/x86_64/os/images/boot.iso', ++ final_iso_path)]) ++ self.assertEqual(get_file_size.call_args_list, [mock.call(final_iso_path)]) ++ self.assertEqual(get_mtime.call_args_list, [mock.call(final_iso_path)]) ++ self.assertImageAdded(compose, ImageCls, IsoWrapper) ++ self.assertEqual(compose.get_image_name.call_args_list, ++ [mock.call('x86_64', compose.variants['Everything'], ++ disc_type='dvd', format='Fedora-Atomic.iso')]) ++ ++ @mock.patch('productmd.images.Image') ++ @mock.patch('pungi.util.get_mtime') ++ @mock.patch('pungi.util.get_file_size') ++ @mock.patch('pungi.wrappers.iso.IsoWrapper') ++ @mock.patch('os.link') ++ @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') ++ def test_run_with_implicit_release(self, KojiWrapper, link, ++ IsoWrapper, get_file_size, get_mtime, ImageCls): ++ compose = helpers.DummyCompose(self.topdir, { ++ 'release_name': 'Fedora', ++ 'release_version': 'Rawhide', ++ 'koji_profile': 'koji', ++ 'runroot_tag': 'rrt', ++ }) ++ pool = mock.Mock() ++ cfg = { ++ 'source_repo_from': 'Everything', ++ 'release': None, ++ "installpkgs": ["fedora-productimg-atomic"], ++ "add_template": ["/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl"], ++ "add_template_var": [ ++ "ostree_osname=fedora-atomic", ++ "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", ++ ], ++ "add_arch_template": ["/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl"], ++ "add_arch_template_var": [ ++ "ostree_repo=https://kojipkgs.fedoraproject.org/compose/atomic/Rawhide/", ++ "ostree_osname=fedora-atomic", ++ "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", ++ ], ++ } ++ koji = KojiWrapper.return_value ++ koji.run_runroot_cmd.return_value = { ++ 'task_id': 1234, ++ 'retcode': 0, ++ 'output': 'Foo bar\n', ++ } ++ get_file_size.return_value = 1024 ++ get_mtime.return_value = 13579 ++ final_iso_path = self.topdir + '/compose/Everything/x86_64/iso/image-name' ++ ++ t = ostree.OstreeInstallerThread(pool) ++ ++ t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) ++ ++ self.assertEqual( ++ koji.get_runroot_cmd.call_args_list, ++ [mock.call('rrt', 'x86_64', ++ ['lorax', ++ '--product=Fedora', ++ '--version=Rawhide', '--release=20151203.t.0', ++ '--source=file://{}/compose/Everything/x86_64/os'.format(self.topdir), ++ '--variant=Everything', ++ '--nomacboot', ++ '--installpkgs=fedora-productimg-atomic', ++ '--add-template=/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl', ++ '--add-arch-template=/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl', ++ '--add-template-var=ostree_osname=fedora-atomic', ++ '--add-template-var=ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host', ++ '--add-arch-template-var=ostree_repo=https://kojipkgs.fedoraproject.org/compose/atomic/Rawhide/', ++ '--add-arch-template-var=ostree_osname=fedora-atomic', ++ '--add-arch-template-var=ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host', ++ self.topdir + '/compose/Everything/x86_64/os'], ++ channel=None, mounts=[self.topdir], ++ packages=['pungi', 'lorax'], ++ task_id=True, use_shell=True)]) ++ self.assertEqual(koji.run_runroot_cmd.call_args_list, ++ [mock.call(koji.get_runroot_cmd.return_value, ++ log_file=self.topdir + '/logs/x86_64/ostree/runroot.log')]) ++ self.assertEqual(link.call_args_list, ++ [mock.call(self.topdir + '/compose/Everything/x86_64/os/images/boot.iso', ++ final_iso_path)]) ++ self.assertEqual(get_file_size.call_args_list, [mock.call(final_iso_path)]) ++ self.assertEqual(get_mtime.call_args_list, [mock.call(final_iso_path)]) ++ self.assertImageAdded(compose, ImageCls, IsoWrapper) ++ self.assertEqual(compose.get_image_name.call_args_list, ++ [mock.call('x86_64', compose.variants['Everything'], ++ disc_type='dvd', format=None)]) ++ ++ @mock.patch('productmd.images.Image') ++ @mock.patch('pungi.util.get_mtime') ++ @mock.patch('pungi.util.get_file_size') ++ @mock.patch('pungi.wrappers.iso.IsoWrapper') ++ @mock.patch('os.link') ++ @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') ++ def test_fail_crash(self, KojiWrapper, link, ++ IsoWrapper, get_file_size, get_mtime, ImageCls): ++ compose = helpers.DummyCompose(self.topdir, { ++ 'release_name': 'Fedora', ++ 'release_version': 'Rawhide', ++ 'koji_profile': 'koji', ++ 'runroot_tag': 'rrt', ++ 'failable_deliverables': [ ++ ('^.+$', {'*': ['ostree-installer']}) ++ ], ++ }) ++ pool = mock.Mock() ++ cfg = { ++ 'source_repo_from': 'Everything', ++ 'release': None, ++ 'filename': 'Fedora-Atomic.iso', ++ } ++ koji = KojiWrapper.return_value ++ koji.run_runroot_cmd.side_effect = helpers.boom ++ ++ t = ostree.OstreeInstallerThread(pool) ++ ++ t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) ++ compose.log_info.assert_has_calls([ ++ mock.call('[FAIL] Ostree installer (variant Everything, arch x86_64) failed, but going on anyway.'), ++ mock.call('BOOM') ++ ]) ++ ++ @mock.patch('productmd.images.Image') ++ @mock.patch('pungi.util.get_mtime') ++ @mock.patch('pungi.util.get_file_size') ++ @mock.patch('pungi.wrappers.iso.IsoWrapper') ++ @mock.patch('os.link') ++ @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') ++ def test_fail_runroot_fail(self, KojiWrapper, link, ++ IsoWrapper, get_file_size, get_mtime, ImageCls): ++ compose = helpers.DummyCompose(self.topdir, { ++ 'release_name': 'Fedora', ++ 'release_version': 'Rawhide', ++ 'koji_profile': 'koji', ++ 'runroot_tag': 'rrt', ++ 'failable_deliverables': [ ++ ('^.+$', {'*': ['ostree-installer']}) ++ ], ++ }) ++ pool = mock.Mock() ++ cfg = { ++ 'source_repo_from': 'Everything', ++ 'release': None, ++ 'filename': 'Fedora-Atomic.iso', ++ } ++ koji = KojiWrapper.return_value ++ koji.run_runroot_cmd.return_value = { ++ 'output': 'Failed', ++ 'task_id': 1234, ++ 'retcode': 1, ++ } ++ ++ t = ostree.OstreeInstallerThread(pool) ++ ++ t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) ++ compose.log_info.assert_has_calls([ ++ mock.call('[FAIL] Ostree installer (variant Everything, arch x86_64) failed, but going on anyway.'), ++ mock.call('Runroot task failed: 1234. See %s/logs/x86_64/ostree/runroot.log for more details.' ++ % self.topdir) ++ ]) ++ ++ ++if __name__ == '__main__': ++ unittest.main() +diff --git a/tests/test_ostree_phase.py b/tests/test_ostree_phase.py +index fe0036c..9f8fdf1 100755 +--- a/tests/test_ostree_phase.py ++++ b/tests/test_ostree_phase.py +@@ -24,7 +24,7 @@ class OSTreePhaseTest(helpers.PungiTestCase): + "treefile": "fedora-atomic-docker-host.json", + "config_url": "https://git.fedorahosted.org/git/fedora-atomic.git", + "source_repo_from": "Everything", +- "atomic_repo": "/mnt/koji/compose/atomic/Rawhide/" ++ "ostree_repo": "/mnt/koji/compose/atomic/Rawhide/" + } + }) + ] +@@ -86,7 +86,7 @@ class OSTreeThreadTest(helpers.PungiTestCase): + 'config_url': 'https://git.fedorahosted.org/git/fedora-atomic.git', + 'config_branch': 'f24', + 'treefile': 'fedora-atomic-docker-host.json', +- 'atomic_repo': '/other/place/for/atomic' ++ 'ostree_repo': '/other/place/for/atomic' + } + koji = KojiWrapper.return_value + koji.run_runroot_cmd.return_value = { +@@ -102,7 +102,7 @@ class OSTreeThreadTest(helpers.PungiTestCase): + self.assertEqual(koji.get_runroot_cmd.call_args_list, + [mock.call('rrt', 'x86_64', + ['pungi-make-ostree', +- '--log-dir={}/logs/x86_64/atomic'.format(self.topdir), ++ '--log-dir={}/logs/x86_64/ostree'.format(self.topdir), + '--treefile=fedora-atomic-docker-host.json', + '--config-url=https://git.fedorahosted.org/git/fedora-atomic.git', + '--config-branch=f24', +@@ -113,7 +113,7 @@ class OSTreeThreadTest(helpers.PungiTestCase): + task_id=True, use_shell=True)]) + self.assertEqual(koji.run_runroot_cmd.call_args_list, + [mock.call(koji.get_runroot_cmd.return_value, +- log_file=self.topdir + '/logs/x86_64/atomic/runroot.log')]) ++ log_file=self.topdir + '/logs/x86_64/ostree/runroot.log')]) + + + if __name__ == '__main__': +diff --git a/tests/test_ostree_script.py b/tests/test_ostree_script.py +new file mode 100755 +index 0000000..744af4d +--- /dev/null ++++ b/tests/test_ostree_script.py +@@ -0,0 +1,57 @@ ++#!/usr/bin/env python ++# -*- coding: utf-8 -*- ++ ++ ++import unittest ++import mock ++ ++import os ++import sys ++ ++sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) ++sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'bin')) ++ ++from tests import helpers ++from pungi import ostree ++ ++ ++class OstreeScriptTest(helpers.PungiTestCase): ++ ++ def _dummy_config_repo(self, scm_dict, target, logger=None): ++ helpers.touch(os.path.join(target, 'fedora-atomic-docker-host.json')) ++ helpers.touch(os.path.join(target, 'fedora-rawhide.repo')) ++ ++ @mock.patch('tempfile.mkdtemp') ++ @mock.patch('kobo.shortcuts.run') ++ @mock.patch('pungi.wrappers.scm.get_dir_from_scm') ++ def test_full_run(self, get_dir_from_scm, run, tempfile): ++ tempfile.return_value = self.topdir ++ get_dir_from_scm.side_effect = self._dummy_config_repo ++ ++ repo = os.path.join(self.topdir, 'atomic') ++ ++ ostree.main([ ++ '--log-dir={}'.format(os.path.join(self.topdir, 'logs', 'Atomic')), ++ '--treefile={}'.format('fedora-atomic-docker-host.json'), ++ '--config-url=https://git.fedorahosted.org/git/fedora-atomic.git', ++ '--config-branch=f24', ++ '--source-repo=https://kojipkgs.fedoraproject.org/repo', ++ repo, ++ ]) ++ ++ self.maxDiff = None ++ self.assertEqual(get_dir_from_scm.call_args_list, ++ [mock.call({'scm': 'git', 'repo': 'https://git.fedorahosted.org/git/fedora-atomic.git', ++ 'branch': 'f24', 'dir': '.'}, ++ self.topdir + '/config_repo')]) ++ self.assertItemsEqual( ++ run.call_args_list, ++ [mock.call(['ostree', 'init', '--repo={}'.format(repo), '--mode=archive-z2'], ++ logfile=self.topdir + '/logs/Atomic/init-ostree-repo.log'), ++ mock.call(['rpm-ostree', 'compose', 'tree', '--repo={}'.format(repo), ++ self.topdir + '/config_repo/fedora-atomic-docker-host.json'], ++ logfile=self.topdir + '/logs/Atomic/create-ostree-repo.log')]) ++ ++ ++if __name__ == '__main__': ++ unittest.main() +-- +2.7.3 + diff --git a/0006-ostree-Use-explicit-work-directory.patch b/0006-ostree-Use-explicit-work-directory.patch new file mode 100644 index 00000000..4e90eb5f --- /dev/null +++ b/0006-ostree-Use-explicit-work-directory.patch @@ -0,0 +1,168 @@ +From 79ee9a4ffaf4627eade703c9bd819c870258745f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Tue, 5 Apr 2016 12:46:59 +0200 +Subject: [PATCH 6/6] [ostree] Use explicit work directory +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Lubomír Sedlář +--- + pungi/ostree.py | 26 +++++++++++++++++++------- + pungi/phases/ostree.py | 2 ++ + tests/test_ostree_phase.py | 1 + + tests/test_ostree_script.py | 9 ++++----- + 4 files changed, 26 insertions(+), 12 deletions(-) + +diff --git a/pungi/ostree.py b/pungi/ostree.py +index de2cfcd..c0c8a04 100644 +--- a/pungi/ostree.py ++++ b/pungi/ostree.py +@@ -8,17 +8,26 @@ It is expected to be runnable in Koji runroot. + import argparse + import os + from kobo import shortcuts +-import tempfile +-import shutil + import re ++import errno + + from .wrappers import scm + + ++def ensure_dir(path): ++ try: ++ os.makedirs(path) ++ except OSError as err: ++ if err.errno != errno.EEXIST: ++ raise ++ return path ++ ++ + def make_log_file(log_dir, filename): + """Return path to log file with given name, if log_dir is set.""" + if not log_dir: + return None ++ ensure_dir(log_dir) + return os.path.join(log_dir, '{}.log'.format(filename)) + + +@@ -26,14 +35,15 @@ def init_ostree_repo(repo, log_dir=None): + """If the ostree repo does not exist, initialize it.""" + log_file = make_log_file(log_dir, 'init-ostree-repo') + if not os.path.isdir(repo): ++ ensure_dir(repo) + shortcuts.run(['ostree', 'init', '--repo={}'.format(repo), '--mode=archive-z2'], +- logfile=log_file) ++ show_cmd=True, logfile=log_file) + + + def make_ostree_repo(repo, config, log_dir=None): + log_file = make_log_file(log_dir, 'create-ostree-repo') + shortcuts.run(['rpm-ostree', 'compose', 'tree', '--repo={}'.format(repo), config], +- logfile=log_file) ++ show_cmd=True, logfile=log_file) + + + def clone_repo(repodir, url, branch): +@@ -52,7 +62,7 @@ def tweak_file(path, source_repo): + with open(path, 'r') as f: + contents = f.read() + replacement = 'baseurl={}'.format(source_repo) +- contents = re.sub(r'^mirrorlist=.*$', replacement, contents) ++ contents = re.sub(r'^mirrorlist=.*$', replacement, contents, flags=re.MULTILINE) + with open(path, 'w') as f: + f.write(contents) + +@@ -65,19 +75,21 @@ def prepare_config(workdir, config_url, config_branch, source_repo): + + + def run(opts): +- workdir = tempfile.mkdtemp() ++ workdir = ensure_dir(opts.work_dir) + repodir = prepare_config(workdir, opts.config_url, opts.config_branch, + opts.source_repo) ++ ensure_dir(repodir) + init_ostree_repo(opts.ostree_repo, log_dir=opts.log_dir) + treefile = os.path.join(repodir, opts.treefile) + make_ostree_repo(opts.ostree_repo, treefile, log_dir=opts.log_dir) +- shutil.rmtree(workdir) + + + def main(args=None): + parser = argparse.ArgumentParser() + parser.add_argument('--log-dir', + help='where to log output') ++ parser.add_argument('--work-dir', required=True, ++ help='where to put temporary files') + + parser.add_argument('ostree_repo', metavar='OSTREE_REPO', + help='where to put the ostree repo') +diff --git a/pungi/phases/ostree.py b/pungi/phases/ostree.py +index 810716e..77e4838 100644 +--- a/pungi/phases/ostree.py ++++ b/pungi/phases/ostree.py +@@ -51,9 +51,11 @@ class OSTreeThread(WorkerThread): + self.pool.log_info('[DONE ] %s' % msg) + + def _run_ostree_cmd(self, compose, variant, arch, config, source_repo): ++ workdir = os.path.join(compose.paths.work.topdir(arch), 'ostree') + cmd = [ + 'pungi-make-ostree', + '--log-dir={}'.format(self.logdir), ++ '--work-dir={}'.format(workdir), + '--treefile={}'.format(config['treefile']), + '--config-url={}'.format(config['config_url']), + '--config-branch={}'.format(config.get('config_branch', 'master')), +diff --git a/tests/test_ostree_phase.py b/tests/test_ostree_phase.py +index 9f8fdf1..7617dde 100755 +--- a/tests/test_ostree_phase.py ++++ b/tests/test_ostree_phase.py +@@ -103,6 +103,7 @@ class OSTreeThreadTest(helpers.PungiTestCase): + [mock.call('rrt', 'x86_64', + ['pungi-make-ostree', + '--log-dir={}/logs/x86_64/ostree'.format(self.topdir), ++ '--work-dir={}/work/x86_64/ostree'.format(self.topdir), + '--treefile=fedora-atomic-docker-host.json', + '--config-url=https://git.fedorahosted.org/git/fedora-atomic.git', + '--config-branch=f24', +diff --git a/tests/test_ostree_script.py b/tests/test_ostree_script.py +index 744af4d..7b59680 100755 +--- a/tests/test_ostree_script.py ++++ b/tests/test_ostree_script.py +@@ -21,17 +21,16 @@ class OstreeScriptTest(helpers.PungiTestCase): + helpers.touch(os.path.join(target, 'fedora-atomic-docker-host.json')) + helpers.touch(os.path.join(target, 'fedora-rawhide.repo')) + +- @mock.patch('tempfile.mkdtemp') + @mock.patch('kobo.shortcuts.run') + @mock.patch('pungi.wrappers.scm.get_dir_from_scm') +- def test_full_run(self, get_dir_from_scm, run, tempfile): +- tempfile.return_value = self.topdir ++ def test_full_run(self, get_dir_from_scm, run): + get_dir_from_scm.side_effect = self._dummy_config_repo + + repo = os.path.join(self.topdir, 'atomic') + + ostree.main([ + '--log-dir={}'.format(os.path.join(self.topdir, 'logs', 'Atomic')), ++ '--work-dir={}'.format(self.topdir), + '--treefile={}'.format('fedora-atomic-docker-host.json'), + '--config-url=https://git.fedorahosted.org/git/fedora-atomic.git', + '--config-branch=f24', +@@ -47,10 +46,10 @@ class OstreeScriptTest(helpers.PungiTestCase): + self.assertItemsEqual( + run.call_args_list, + [mock.call(['ostree', 'init', '--repo={}'.format(repo), '--mode=archive-z2'], +- logfile=self.topdir + '/logs/Atomic/init-ostree-repo.log'), ++ logfile=self.topdir + '/logs/Atomic/init-ostree-repo.log', show_cmd=True), + mock.call(['rpm-ostree', 'compose', 'tree', '--repo={}'.format(repo), + self.topdir + '/config_repo/fedora-atomic-docker-host.json'], +- logfile=self.topdir + '/logs/Atomic/create-ostree-repo.log')]) ++ logfile=self.topdir + '/logs/Atomic/create-ostree-repo.log', show_cmd=True)]) + + + if __name__ == '__main__': +-- +2.7.3 + diff --git a/c52cb198c5ffc0593720c927f469793bedb3d4a4.patch b/c52cb198c5ffc0593720c927f469793bedb3d4a4.patch new file mode 100644 index 00000000..e504d7ff --- /dev/null +++ b/c52cb198c5ffc0593720c927f469793bedb3d4a4.patch @@ -0,0 +1,54 @@ +From c52cb198c5ffc0593720c927f469793bedb3d4a4 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Mar 16 2016 22:03:33 +0000 +Subject: Fix locations of ppc lorax templates for PowerPC iso creation + + +PowerPC needs a mapping file for iso creation, with lorax moving the +templates locations in 24+ we need to update this so runroot iso +creation doesn't fail. + +Signed-off-by: Peter Robinson + +--- + +diff --git a/pungi/gather.py b/pungi/gather.py +index 2e5048c..c27070f 100644 +--- a/pungi/gather.py ++++ b/pungi/gather.py +@@ -1590,7 +1590,7 @@ class Pungi(PungiBase): + return + + isolist = [] +- ppcbootinfo = '/usr/share/lorax/config_files/ppc' ++ ppcbootinfo = '/usr/share/lorax/templates.d/99-generic/config_files/ppc' + + pungi.util._ensuredir(self.isodir, self.logger, + force=self.config.getboolean('pungi', 'force'), +diff --git a/pungi/phases/createiso.py b/pungi/phases/createiso.py +index f88b20d..eab3133 100644 +--- a/pungi/phases/createiso.py ++++ b/pungi/phases/createiso.py +@@ -142,7 +142,7 @@ class CreateisoPhase(PhaseBase): + buildinstall_method = self.compose.conf["buildinstall_method"] + if buildinstall_method == "lorax": + # TODO: $arch instead of ppc +- mkisofs_kwargs["boot_args"] = iso.get_boot_options(arch, "/usr/share/lorax/config_files/ppc") ++ mkisofs_kwargs["boot_args"] = iso.get_boot_options(arch, "/usr/share/lorax/templates.d/99-generic/config_files/ppc") + elif buildinstall_method == "buildinstall": + mkisofs_kwargs["boot_args"] = iso.get_boot_options(arch, "/usr/lib/anaconda-runtime/boot") + +diff --git a/pungi/phases/product_img.py b/pungi/phases/product_img.py +index 687d261..8da4e23 100644 +--- a/pungi/phases/product_img.py ++++ b/pungi/phases/product_img.py +@@ -230,7 +230,7 @@ def rebuild_boot_iso(compose, arch, variant, package_sets): + boot_files = None + if buildinstall_method == "lorax": + # TODO: $arch instead of ppc +- mkisofs_kwargs["boot_args"] = iso.get_boot_options(arch, "/usr/share/lorax/config_files/ppc") ++ mkisofs_kwargs["boot_args"] = iso.get_boot_options(arch, "/usr/share/lorax/templates.d/99-generic/config_files/ppc") + elif buildinstall_method == "buildinstall": + boot_files = explode_anaconda(compose, arch, variant, package_sets) + mkisofs_kwargs["boot_args"] = iso.get_boot_options(arch, boot_files) + diff --git a/pungi.spec b/pungi.spec index 3693892f..831434e8 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.1.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Distribution compose tool Group: Development/Tools @@ -10,7 +10,11 @@ Source0: https://fedorahosted.org/pungi/attachment/wiki/%{version}/%{name Patch0: 0001-checksum-Add-arch-to-file-name.patch Patch1: 0002-atomic-Stop-creating-the-os-directory.patch Patch2: 0003-ostree-Fix-call-to-kobo.shortcuts.run.patch - +Patch3: 0004-ostree-Move-cloning-config-repo-to-chroot.patch +Patch4: 0005-ostree-Rename-atomic-to-ostree.patch +Patch5: 0006-ostree-Use-explicit-work-directory.patch +# bandaid for https://pagure.io/pungi/issue/231 until we get things fixed properly upstream +Patch6: c52cb198c5ffc0593720c927f469793bedb3d4a4.patch BuildRequires: python-nose, python-nose-cov, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd @@ -55,6 +59,10 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 %build %{__python} setup.py build @@ -88,6 +96,10 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Tue Apr 05 2016 Dennis Gilmore - 4.1.1-3 +- add some more ostree fixes +- add a bandaid for ppc until we get a proper fix + * Mon Apr 04 2016 Dennis Gilmore - 4.1.1-2 - add upstream patches for bugfixes in ostree and checksums From bcae962ab3d015418dd6ea34e6e9a5a636f4525f Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 6 Apr 2016 18:09:58 -0500 Subject: [PATCH 37/78] Merge #257 `[ostree] Enable marking ostree phase as failable` (ausil) - [ostree] Enable marking ostree phase as failable (lsedlar) - [koji-wrapper] Initialize wrappers sequentially (lsedlar) - [createiso] Simplify code, test phase (lsedlar) - [createiso] Move runroot work to separate script (lsedlar) - [ostree] Use explicit work directory (lsedlar) - [ostree] Rename atomic to ostree (lsedlar) - [ostree] Move cloning config repo to chroot (lsedlar) - [ostree] Fix call to kobo.shortcuts.run (lsedlar) - [atomic] Stop creating the os directory (lsedlar) - [checksum] Add arch to file name (lsedlar) Signed-off-by: Dennis Gilmore --- 0001-checksum-Add-arch-to-file-name.patch | 221 --- ...tomic-Stop-creating-the-os-directory.patch | 42 - ...stree-Fix-call-to-kobo.shortcuts.run.patch | 54 - ...e-Move-cloning-config-repo-to-chroot.patch | 276 --- 0005-ostree-Rename-atomic-to-ostree.patch | 1494 ----------------- 0006-ostree-Use-explicit-work-directory.patch | 168 -- ...b198c5ffc0593720c927f469793bedb3d4a4.patch | 54 - pungi.spec | 32 +- sources | 2 +- 9 files changed, 16 insertions(+), 2327 deletions(-) delete mode 100644 0001-checksum-Add-arch-to-file-name.patch delete mode 100644 0002-atomic-Stop-creating-the-os-directory.patch delete mode 100644 0003-ostree-Fix-call-to-kobo.shortcuts.run.patch delete mode 100644 0004-ostree-Move-cloning-config-repo-to-chroot.patch delete mode 100644 0005-ostree-Rename-atomic-to-ostree.patch delete mode 100644 0006-ostree-Use-explicit-work-directory.patch delete mode 100644 c52cb198c5ffc0593720c927f469793bedb3d4a4.patch diff --git a/0001-checksum-Add-arch-to-file-name.patch b/0001-checksum-Add-arch-to-file-name.patch deleted file mode 100644 index e138bfe2..00000000 --- a/0001-checksum-Add-arch-to-file-name.patch +++ /dev/null @@ -1,221 +0,0 @@ -From e34bd2763c0d0776693f8842639b35b55dcb511b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= -Date: Mon, 4 Apr 2016 09:38:48 +0200 -Subject: [PATCH 1/6] [checksum] Add arch to file name -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This allows the checksum file to include the architecture. - -Fixes: #243 -Signed-off-by: Lubomír Sedlář ---- - doc/configuration.rst | 16 +++++++++++++--- - pungi/compose.py | 32 +++++++------------------------- - pungi/phases/image_checksum.py | 21 +++++++-------------- - pungi/util.py | 35 ++++++++++++++++++++++++++++------- - tests/helpers.py | 2 ++ - 5 files changed, 57 insertions(+), 49 deletions(-) - -diff --git a/doc/configuration.rst b/doc/configuration.rst -index 23bcbcf..7d4b91e 100644 ---- a/doc/configuration.rst -+++ b/doc/configuration.rst -@@ -1051,9 +1051,19 @@ Media Checksums Settings - prefix to that name - - It is possible to use format strings that will be replace by actual values. -- The allowed keys are ``%(release_showrt)s``, ``%(release_short)s``, -- ``%(release_id)s``, ``%(variant)s``, ``%(version)s``, ``%(date)s``, -- ``%(type_suffix)s``, ``%(label)s`` and ``%(respin)s`` -+ The allowed keys are: -+ -+ * ``arch`` -+ * ``compose_id`` -+ * ``date`` -+ * ``label`` -+ * ``label_major_version`` -+ * ``release_short`` -+ * ``respin`` -+ * ``type`` -+ * ``type_suffix`` -+ * ``version`` -+ * ``version`` - - For example, for Fedora the prefix should be - ``%(release_short)s-%(variant)s-%(version)s-%(date)s%(type_suffix)s.%(respin)s``. -diff --git a/pungi/compose.py b/pungi/compose.py -index 8935a0f..f764129 100644 ---- a/pungi/compose.py -+++ b/pungi/compose.py -@@ -33,7 +33,7 @@ from productmd.images import Images - from pungi.wrappers.variants import VariantsXmlParser - from pungi.paths import Paths - from pungi.wrappers.scm import get_file_from_scm --from pungi.util import makedirs, get_arch_variant_data -+from pungi.util import makedirs, get_arch_variant_data, get_format_substs - from pungi.metadata import compose_to_composeinfo - - -@@ -270,25 +270,6 @@ class Compose(kobo.log.LoggingBase): - return - return open(self.status_file, "r").read().strip() - -- def get_format_substs(self, **kwargs): -- """Return a dict of basic format substitutions. -- -- Any kwargs will be added as well. -- """ -- substs = { -- 'compose_id': self.compose_id, -- 'release_short': self.ci_base.release.short, -- 'version': self.ci_base.release.version, -- 'date': self.compose_date, -- 'respin': self.compose_respin, -- 'type': self.compose_type, -- 'type_suffix': self.compose_type_suffix, -- 'label': self.compose_label, -- 'label_major_version': self.compose_label_major_version, -- } -- substs.update(kwargs) -- return substs -- - def get_image_name(self, arch, variant, disc_type='dvd', - disc_num=1, suffix='.iso', format=None): - """Create a filename for image with given parameters. -@@ -310,11 +291,12 @@ class Compose(kobo.log.LoggingBase): - variant_uid = variant.parent.uid - else: - variant_uid = variant.uid -- args = self.get_format_substs(variant=variant_uid, -- arch=arch, -- disc_type=disc_type, -- disc_num=disc_num, -- suffix=suffix) -+ args = get_format_substs(self, -+ variant=variant_uid, -+ arch=arch, -+ disc_type=disc_type, -+ disc_num=disc_num, -+ suffix=suffix) - try: - return format % args - except KeyError as err: -diff --git a/pungi/phases/image_checksum.py b/pungi/phases/image_checksum.py -index c9ef321..aa74c4f 100644 ---- a/pungi/phases/image_checksum.py -+++ b/pungi/phases/image_checksum.py -@@ -4,6 +4,7 @@ import os - from kobo import shortcuts - - from .base import PhaseBase -+from ..util import get_format_substs - - - MULTIPLE_CHECKSUMS_ERROR = ( -@@ -66,29 +67,21 @@ class ImageChecksumPhase(PhaseBase): - for arch in self.compose.im.images[variant]: - for image in self.compose.im.images[variant][arch]: - path = os.path.dirname(os.path.join(top_dir, image.path)) -- images.setdefault((variant, path), set()).add(image) -+ images.setdefault((variant, arch, path), set()).add(image) - return images - -- def _get_base_filename(self, variant): -+ def _get_base_filename(self, variant, arch): - base_checksum_name = self.compose.conf.get('media_checksum_base_filename', '') - if base_checksum_name: -- base_checksum_name = base_checksum_name % { -- 'release_short': self.compose.ci_base.release.short, -- 'release_id': self.compose.ci_base.release_id, -- 'variant': variant, -- 'version': self.compose.ci_base.release.version, -- 'date': self.compose.compose_date, -- 'type_suffix': self.compose.compose_type_suffix, -- 'respin': self.compose.compose_respin, -- 'label': self.compose.compose_label, -- } -+ substs = get_format_substs(self.compose, variant=variant, arch=arch) -+ base_checksum_name = base_checksum_name % substs - base_checksum_name += '-' - return base_checksum_name - - def run(self): -- for (variant, path), images in self._get_images().iteritems(): -+ for (variant, arch, path), images in self._get_images().iteritems(): - checksums = {} -- base_checksum_name = self._get_base_filename(variant) -+ base_checksum_name = self._get_base_filename(variant, arch) - for image in images: - filename = os.path.basename(image.path) - full_path = os.path.join(path, filename) -diff --git a/pungi/util.py b/pungi/util.py -index f4f5e33..6a6ccf3 100644 ---- a/pungi/util.py -+++ b/pungi/util.py -@@ -370,13 +370,14 @@ def get_volid(compose, arch, variant=None, escape_spaces=False, disc_type=False) - if not variant_uid and "%(variant)s" in i: - continue - try: -- volid = i % compose.get_format_substs(variant=variant_uid, -- release_short=release_short, -- version=release_version, -- arch=arch, -- disc_type=disc_type or '', -- base_product_short=base_product_short, -- base_product_version=base_product_version) -+ volid = i % get_format_substs(compose, -+ variant=variant_uid, -+ release_short=release_short, -+ version=release_version, -+ arch=arch, -+ disc_type=disc_type or '', -+ base_product_short=base_product_short, -+ base_product_version=base_product_version) - except KeyError as err: - raise RuntimeError('Failed to create volume id: unknown format element: %s' % err.message) - volid = _apply_substitutions(compose, volid) -@@ -472,3 +473,23 @@ def failable(compose, variant, arch, deliverable, msg=None): - compose.log_info(str(exc)) - tb = traceback.format_exc() - compose.log_debug(tb) -+ -+ -+def get_format_substs(compose, **kwargs): -+ """Return a dict of basic format substitutions. -+ -+ Any kwargs will be added as well. -+ """ -+ substs = { -+ 'compose_id': compose.compose_id, -+ 'release_short': compose.ci_base.release.short, -+ 'version': compose.ci_base.release.version, -+ 'date': compose.compose_date, -+ 'respin': compose.compose_respin, -+ 'type': compose.compose_type, -+ 'type_suffix': compose.compose_type_suffix, -+ 'label': compose.compose_label, -+ 'label_major_version': compose.compose_label_major_version, -+ } -+ substs.update(kwargs) -+ return substs -diff --git a/tests/helpers.py b/tests/helpers.py -index 9a0983c..11c07a4 100644 ---- a/tests/helpers.py -+++ b/tests/helpers.py -@@ -23,9 +23,11 @@ class DummyCompose(object): - self.supported = True - self.compose_date = '20151203' - self.compose_type_suffix = '.t' -+ self.compose_type = 'test' - self.compose_respin = 0 - self.compose_id = 'Test-20151203.0.t' - self.compose_label = None -+ self.compose_label_major_version = None - self.image_release = '20151203.t.0' - self.ci_base = mock.Mock( - release_id='Test-1.0', --- -2.7.3 - diff --git a/0002-atomic-Stop-creating-the-os-directory.patch b/0002-atomic-Stop-creating-the-os-directory.patch deleted file mode 100644 index b600ae9a..00000000 --- a/0002-atomic-Stop-creating-the-os-directory.patch +++ /dev/null @@ -1,42 +0,0 @@ -From f18e32c5affad9bf376103a536c7ded19366d92f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= -Date: Mon, 4 Apr 2016 14:24:18 +0200 -Subject: [PATCH 2/6] [atomic] Stop creating the os directory -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The output directory for Lorax can not exist beforehand, or the process -will fail. - -Signed-off-by: Lubomír Sedlář ---- - pungi/phases/atomic_installer.py | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/pungi/phases/atomic_installer.py b/pungi/phases/atomic_installer.py -index 476ad1c..3390a74 100644 ---- a/pungi/phases/atomic_installer.py -+++ b/pungi/phases/atomic_installer.py -@@ -49,7 +49,8 @@ class AtomicInstallerThread(WorkerThread): - self.logdir = compose.paths.log.topdir('{}/atomic'.format(arch)) - - source_variant = compose.variants[config['source_repo_from']] -- source_repo = translate_path(compose, compose.paths.compose.repository(arch, source_variant)) -+ source_repo = translate_path( -+ compose, compose.paths.compose.repository(arch, source_variant, create_dir=False)) - - self._run_atomic_cmd(compose, variant, arch, config, source_repo) - -@@ -100,7 +101,7 @@ class AtomicInstallerThread(WorkerThread): - compose.im.add(variant.uid, arch, img) - - def _run_atomic_cmd(self, compose, variant, arch, config, source_repo): -- image_dir = compose.paths.compose.os_tree(arch, variant) -+ image_dir = compose.paths.compose.os_tree(arch, variant, create_dir=False) - lorax_wrapper = lorax.LoraxWrapper() - cmd = lorax_wrapper.get_lorax_cmd( - compose.conf['release_name'], --- -2.7.3 - diff --git a/0003-ostree-Fix-call-to-kobo.shortcuts.run.patch b/0003-ostree-Fix-call-to-kobo.shortcuts.run.patch deleted file mode 100644 index 3263325a..00000000 --- a/0003-ostree-Fix-call-to-kobo.shortcuts.run.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 05384eae584476bfca3bd4bf31958d1e5dbb20a6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= -Date: Mon, 4 Apr 2016 15:13:35 +0200 -Subject: [PATCH 3/6] [ostree] Fix call to kobo.shortcuts.run -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Lubomír Sedlář ---- - pungi/atomic.py | 4 ++-- - tests/test_atomic_script.py | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/pungi/atomic.py b/pungi/atomic.py -index 95ccfe0..7c0075b 100644 ---- a/pungi/atomic.py -+++ b/pungi/atomic.py -@@ -22,13 +22,13 @@ def init_atomic_repo(repo, log_dir=None): - log_file = make_log_file(log_dir, 'init-atomic-repo') - if not os.path.isdir(repo): - shortcuts.run(['ostree', 'init', '--repo={}'.format(repo), '--mode=archive-z2'], -- log_file=log_file) -+ logfile=log_file) - - - def make_ostree_repo(repo, config, log_dir=None): - log_file = make_log_file(log_dir, 'create-atomic-repo') - shortcuts.run(['rpm-ostree', 'compose', 'tree', '--repo={}'.format(repo), config], -- log_file=log_file) -+ logfile=log_file) - - - def run(opts): -diff --git a/tests/test_atomic_script.py b/tests/test_atomic_script.py -index 13aa825..a871659 100755 ---- a/tests/test_atomic_script.py -+++ b/tests/test_atomic_script.py -@@ -28,10 +28,10 @@ class OstreeScriptTest(helpers.PungiTestCase): - self.assertItemsEqual( - run.call_args_list, - [mock.call(['ostree', 'init', '--repo={}/atomic'.format(self.topdir), '--mode=archive-z2'], -- log_file=self.topdir + '/logs/Atomic/init-atomic-repo.log'), -+ logfile=self.topdir + '/logs/Atomic/init-atomic-repo.log'), - mock.call(['rpm-ostree', 'compose', 'tree', '--repo={}/atomic'.format(self.topdir), - self.topdir + '/work/fedora-atomic-docker-host.json'], -- log_file=self.topdir + '/logs/Atomic/create-atomic-repo.log')]) -+ logfile=self.topdir + '/logs/Atomic/create-atomic-repo.log')]) - - - if __name__ == '__main__': --- -2.7.3 - diff --git a/0004-ostree-Move-cloning-config-repo-to-chroot.patch b/0004-ostree-Move-cloning-config-repo-to-chroot.patch deleted file mode 100644 index fa1d32ff..00000000 --- a/0004-ostree-Move-cloning-config-repo-to-chroot.patch +++ /dev/null @@ -1,276 +0,0 @@ -From 446d4b20cc508ae466a1c5bf9cc76f8b0fc12494 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= -Date: Tue, 5 Apr 2016 08:40:54 +0200 -Subject: [PATCH 4/6] [ostree] Move cloning config repo to chroot -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Lubomír Sedlář ---- - pungi/atomic.py | 46 ++++++++++++++++++++++++++++++++++++++++++++- - pungi/phases/ostree.py | 29 ++++------------------------ - tests/helpers.py | 7 ++++++- - tests/test_atomic_script.py | 23 ++++++++++++++++++++--- - tests/test_ostree_phase.py | 15 ++++----------- - 5 files changed, 79 insertions(+), 41 deletions(-) - -diff --git a/pungi/atomic.py b/pungi/atomic.py -index 7c0075b..627ce34 100644 ---- a/pungi/atomic.py -+++ b/pungi/atomic.py -@@ -8,6 +8,11 @@ It is expected to be runnable in Koji runroot. - import argparse - import os - from kobo import shortcuts -+import tempfile -+import shutil -+import re -+ -+from .wrappers import scm - - - def make_log_file(log_dir, filename): -@@ -31,9 +36,42 @@ def make_ostree_repo(repo, config, log_dir=None): - logfile=log_file) - - -+def clone_repo(repodir, url, branch): -+ scm.get_dir_from_scm( -+ {'scm': 'git', 'repo': url, 'branch': branch, 'dir': '.'}, repodir) -+ -+ -+def tweak_mirrorlist(repodir, source_repo): -+ for file in os.listdir(repodir): -+ if file.endswith('.repo'): -+ tweak_file(os.path.join(repodir, file), source_repo) -+ -+ -+def tweak_file(path, source_repo): -+ """Replace mirrorlist line in repo file with baseurl pointing to source_repo.""" -+ with open(path, 'r') as f: -+ contents = f.read() -+ replacement = 'baseurl={}'.format(source_repo) -+ contents = re.sub(r'^mirrorlist=.*$', replacement, contents) -+ with open(path, 'w') as f: -+ f.write(contents) -+ -+ -+def prepare_config(workdir, config_url, config_branch, source_repo): -+ repodir = os.path.join(workdir, 'config_repo') -+ clone_repo(repodir, config_url, config_branch) -+ tweak_mirrorlist(repodir, source_repo) -+ return repodir -+ -+ - def run(opts): -+ workdir = tempfile.mkdtemp() -+ repodir = prepare_config(workdir, opts.config_url, opts.config_branch, -+ opts.source_repo) - init_atomic_repo(opts.atomic_repo, log_dir=opts.log_dir) -- make_ostree_repo(opts.atomic_repo, opts.treefile, log_dir=opts.log_dir) -+ treefile = os.path.join(repodir, opts.treefile) -+ make_ostree_repo(opts.atomic_repo, treefile, log_dir=opts.log_dir) -+ shutil.rmtree(workdir) - - - def main(args=None): -@@ -45,6 +83,12 @@ def main(args=None): - help='where to put the atomic repo') - parser.add_argument('--treefile', required=True, - help='treefile for rpm-ostree') -+ parser.add_argument('--config-url', required=True, -+ help='git repository with the treefile') -+ parser.add_argument('--config-branch', default='master', -+ help='git branch to be used') -+ parser.add_argument('--source-repo', required=True, -+ help='yum repo used as source for') - - opts = parser.parse_args(args) - -diff --git a/pungi/phases/ostree.py b/pungi/phases/ostree.py -index 36cbc97..79e58d4 100644 ---- a/pungi/phases/ostree.py -+++ b/pungi/phases/ostree.py -@@ -2,12 +2,11 @@ - - import os - from kobo.threads import ThreadPool, WorkerThread --import re - - from .base import ConfigGuardedPhase - from .. import util - from ..paths import translate_path --from ..wrappers import scm, kojiwrapper -+from ..wrappers import kojiwrapper - - - class OSTreePhase(ConfigGuardedPhase): -@@ -42,15 +41,11 @@ class OSTreeThread(WorkerThread): - - msg = 'OSTree phase for variant %s, arch %s' % (variant.uid, arch) - self.pool.log_info('[BEGIN] %s' % msg) -- workdir = compose.paths.work.topdir('atomic') - self.logdir = compose.paths.log.topdir('{}/atomic'.format(arch)) -- repodir = os.path.join(workdir, 'config_repo') - - source_variant = compose.variants[config['source_repo_from']] - source_repo = translate_path(compose, compose.paths.compose.repository(arch, source_variant)) - -- self._clone_repo(repodir, config['config_url'], config.get('config_branch', 'master')) -- self._tweak_mirrorlist(repodir, source_repo) - self._run_atomic_cmd(compose, variant, arch, config, source_repo) - - self.pool.log_info('[DONE ] %s' % msg) -@@ -60,6 +55,9 @@ class OSTreeThread(WorkerThread): - 'pungi-make-ostree', - '--log-dir={}'.format(self.logdir), - '--treefile={}'.format(config['treefile']), -+ '--config-url={}'.format(config['config_url']), -+ '--config-branch={}'.format(config.get('config_branch', 'master')), -+ '--source-repo={}'.format(source_repo), - config['atomic_repo'] - ] - -@@ -77,22 +75,3 @@ class OSTreeThread(WorkerThread): - if output["retcode"] != 0: - raise RuntimeError("Runroot task failed: %s. See %s for more details." - % (output["task_id"], log_file)) -- -- def _clone_repo(self, repodir, url, branch): -- scm.get_dir_from_scm({'scm': 'git', 'repo': url, 'branch': branch, 'dir': '.'}, -- repodir, logger=self.pool._logger) -- -- def _tweak_mirrorlist(self, repodir, source_repo): -- for file in os.listdir(repodir): -- if file.endswith('.repo'): -- tweak_file(os.path.join(repodir, file), source_repo) -- -- --def tweak_file(path, source_repo): -- """Replace mirrorlist line in repo file with baseurl pointing to source_repo.""" -- with open(path, 'r') as f: -- contents = f.read() -- replacement = 'baseurl={}'.format(source_repo) -- contents = re.sub(r'^mirrorlist=.*$', replacement, contents) -- with open(path, 'w') as f: -- f.write(contents) -diff --git a/tests/helpers.py b/tests/helpers.py -index 11c07a4..d93e095 100644 ---- a/tests/helpers.py -+++ b/tests/helpers.py -@@ -5,6 +5,7 @@ import os - import unittest - import tempfile - import shutil -+import errno - - from pungi.util import get_arch_variant_data - from pungi import paths -@@ -15,7 +16,11 @@ class PungiTestCase(unittest.TestCase): - self.topdir = tempfile.mkdtemp() - - def tearDown(self): -- shutil.rmtree(self.topdir) -+ try: -+ shutil.rmtree(self.topdir) -+ except OSError as err: -+ if err.errno != errno.ENOENT: -+ raise - - - class DummyCompose(object): -diff --git a/tests/test_atomic_script.py b/tests/test_atomic_script.py -index a871659..4b0b396 100755 ---- a/tests/test_atomic_script.py -+++ b/tests/test_atomic_script.py -@@ -17,20 +17,37 @@ from pungi import atomic - - class OstreeScriptTest(helpers.PungiTestCase): - -+ def _dummy_config_repo(self, scm_dict, target, logger=None): -+ helpers.touch(os.path.join(target, 'fedora-atomic-docker-host.json')) -+ helpers.touch(os.path.join(target, 'fedora-rawhide.repo')) -+ -+ @mock.patch('tempfile.mkdtemp') - @mock.patch('kobo.shortcuts.run') -- def test_full_run(self, run): -+ @mock.patch('pungi.wrappers.scm.get_dir_from_scm') -+ def test_full_run(self, get_dir_from_scm, run, tempfile): -+ tempfile.return_value = self.topdir -+ get_dir_from_scm.side_effect = self._dummy_config_repo -+ - atomic.main([ - '--log-dir={}'.format(os.path.join(self.topdir, 'logs', 'Atomic')), -- '--treefile={}'.format(os.path.join(self.topdir, 'work', 'fedora-atomic-docker-host.json')), -+ '--treefile={}'.format('fedora-atomic-docker-host.json'), -+ '--config-url=https://git.fedorahosted.org/git/fedora-atomic.git', -+ '--config-branch=f24', -+ '--source-repo=https://kojipkgs.fedoraproject.org/repo', - os.path.join(self.topdir, 'atomic'), - ]) -+ - self.maxDiff = None -+ self.assertEqual(get_dir_from_scm.call_args_list, -+ [mock.call({'scm': 'git', 'repo': 'https://git.fedorahosted.org/git/fedora-atomic.git', -+ 'branch': 'f24', 'dir': '.'}, -+ self.topdir + '/config_repo')]) - self.assertItemsEqual( - run.call_args_list, - [mock.call(['ostree', 'init', '--repo={}/atomic'.format(self.topdir), '--mode=archive-z2'], - logfile=self.topdir + '/logs/Atomic/init-atomic-repo.log'), - mock.call(['rpm-ostree', 'compose', 'tree', '--repo={}/atomic'.format(self.topdir), -- self.topdir + '/work/fedora-atomic-docker-host.json'], -+ self.topdir + '/config_repo/fedora-atomic-docker-host.json'], - logfile=self.topdir + '/logs/Atomic/create-atomic-repo.log')]) - - -diff --git a/tests/test_ostree_phase.py b/tests/test_ostree_phase.py -index e4664e1..fe0036c 100755 ---- a/tests/test_ostree_phase.py -+++ b/tests/test_ostree_phase.py -@@ -74,13 +74,8 @@ class OSTreePhaseTest(helpers.PungiTestCase): - - class OSTreeThreadTest(helpers.PungiTestCase): - -- def _dummy_config_repo(self, scm_dict, target, logger=None): -- helpers.touch(os.path.join(target, 'fedora-atomic-docker-host.json')) -- helpers.touch(os.path.join(target, 'fedora-rawhide.repo')) -- -- @mock.patch('pungi.wrappers.scm.get_dir_from_scm') - @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') -- def test_run(self, KojiWrapper, get_dir_from_scm): -+ def test_run(self, KojiWrapper): - compose = helpers.DummyCompose(self.topdir, { - 'koji_profile': 'koji', - 'runroot_tag': 'rrt', -@@ -93,7 +88,6 @@ class OSTreeThreadTest(helpers.PungiTestCase): - 'treefile': 'fedora-atomic-docker-host.json', - 'atomic_repo': '/other/place/for/atomic' - } -- get_dir_from_scm.side_effect = self._dummy_config_repo - koji = KojiWrapper.return_value - koji.run_runroot_cmd.return_value = { - 'task_id': 1234, -@@ -105,15 +99,14 @@ class OSTreeThreadTest(helpers.PungiTestCase): - - t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) - -- self.assertEqual(get_dir_from_scm.call_args_list, -- [mock.call({'scm': 'git', 'repo': 'https://git.fedorahosted.org/git/fedora-atomic.git', -- 'branch': 'f24', 'dir': '.'}, -- self.topdir + '/work/atomic/config_repo', logger=pool._logger)]) - self.assertEqual(koji.get_runroot_cmd.call_args_list, - [mock.call('rrt', 'x86_64', - ['pungi-make-ostree', - '--log-dir={}/logs/x86_64/atomic'.format(self.topdir), - '--treefile=fedora-atomic-docker-host.json', -+ '--config-url=https://git.fedorahosted.org/git/fedora-atomic.git', -+ '--config-branch=f24', -+ '--source-repo={}/compose/Everything/x86_64/os'.format(self.topdir), - '/other/place/for/atomic'], - channel=None, mounts=[self.topdir], - packages=['pungi', 'ostree', 'rpm-ostree'], --- -2.7.3 - diff --git a/0005-ostree-Rename-atomic-to-ostree.patch b/0005-ostree-Rename-atomic-to-ostree.patch deleted file mode 100644 index d39592f4..00000000 --- a/0005-ostree-Rename-atomic-to-ostree.patch +++ /dev/null @@ -1,1494 +0,0 @@ -From f98a506e86e15409be6733d37695303443a5452d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= -Date: Tue, 5 Apr 2016 09:13:01 +0200 -Subject: [PATCH 5/6] [ostree] Rename atomic to ostree -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Lubomír Sedlář ---- - bin/pungi-config-validate | 2 +- - bin/pungi-koji | 8 +- - bin/pungi-make-ostree | 4 +- - doc/configuration.rst | 14 +- - pungi/atomic.py | 95 ----------- - pungi/ostree.py | 95 +++++++++++ - pungi/phases/__init__.py | 2 +- - pungi/phases/atomic_installer.py | 134 --------------- - pungi/phases/ostree.py | 8 +- - pungi/phases/ostree_installer.py | 134 +++++++++++++++ - tests/test_atomic_installer_phase.py | 317 ----------------------------------- - tests/test_atomic_script.py | 55 ------ - tests/test_ostree_installer_phase.py | 317 +++++++++++++++++++++++++++++++++++ - tests/test_ostree_phase.py | 8 +- - tests/test_ostree_script.py | 57 +++++++ - 15 files changed, 626 insertions(+), 624 deletions(-) - delete mode 100644 pungi/atomic.py - create mode 100644 pungi/ostree.py - delete mode 100644 pungi/phases/atomic_installer.py - create mode 100644 pungi/phases/ostree_installer.py - delete mode 100644 tests/test_atomic_installer_phase.py - delete mode 100755 tests/test_atomic_script.py - create mode 100644 tests/test_ostree_installer_phase.py - create mode 100755 tests/test_ostree_script.py - -diff --git a/bin/pungi-config-validate b/bin/pungi-config-validate -index 20f8094..3d61f11 100755 ---- a/bin/pungi-config-validate -+++ b/bin/pungi-config-validate -@@ -54,7 +54,7 @@ def run(config, topdir, has_old): - pungi.phases.GatherPhase(compose, pkgset_phase), - pungi.phases.ExtraFilesPhase(compose, pkgset_phase), - pungi.phases.CreaterepoPhase(compose), -- pungi.phases.AtomicInstallerPhase(compose), -+ pungi.phases.OstreeInstallerPhase(compose), - pungi.phases.OSTreePhase(compose), - pungi.phases.ProductimgPhase(compose, pkgset_phase), - pungi.phases.CreateisoPhase(compose), -diff --git a/bin/pungi-koji b/bin/pungi-koji -index a0eba0e..de59621 100755 ---- a/bin/pungi-koji -+++ b/bin/pungi-koji -@@ -227,7 +227,7 @@ def run_compose(compose): - gather_phase = pungi.phases.GatherPhase(compose, pkgset_phase) - extrafiles_phase = pungi.phases.ExtraFilesPhase(compose, pkgset_phase) - createrepo_phase = pungi.phases.CreaterepoPhase(compose) -- atomic_installer_phase = pungi.phases.AtomicInstallerPhase(compose) -+ ostree_installer_phase = pungi.phases.OstreeInstallerPhase(compose) - ostree_phase = pungi.phases.OSTreePhase(compose) - productimg_phase = pungi.phases.ProductimgPhase(compose, pkgset_phase) - createiso_phase = pungi.phases.CreateisoPhase(compose) -@@ -242,7 +242,7 @@ def run_compose(compose): - buildinstall_phase, productimg_phase, gather_phase, - extrafiles_phase, createiso_phase, liveimages_phase, - livemedia_phase, image_build_phase, image_checksum_phase, -- test_phase, ostree_phase, atomic_installer_phase): -+ test_phase, ostree_phase, ostree_installer_phase): - if phase.skip(): - continue - try: -@@ -348,13 +348,13 @@ def run_compose(compose): - liveimages_phase.start() - image_build_phase.start() - livemedia_phase.start() -- atomic_installer_phase.start() -+ ostree_installer_phase.start() - - createiso_phase.stop() - liveimages_phase.stop() - image_build_phase.stop() - livemedia_phase.stop() -- atomic_installer_phase.stop() -+ ostree_installer_phase.stop() - - image_checksum_phase.start() - image_checksum_phase.stop() -diff --git a/bin/pungi-make-ostree b/bin/pungi-make-ostree -index 4066bdc..2800588 100755 ---- a/bin/pungi-make-ostree -+++ b/bin/pungi-make-ostree -@@ -8,8 +8,8 @@ here = sys.path[0] - if here != '/usr/bin': - sys.path.insert(0, os.path.dirname(here)) - --from pungi import atomic -+from pungi import ostree - - - if __name__ == '__main__': -- atomic.main() -+ ostree.main() -diff --git a/doc/configuration.rst b/doc/configuration.rst -index 7d4b91e..36b332a 100644 ---- a/doc/configuration.rst -+++ b/doc/configuration.rst -@@ -142,7 +142,7 @@ Options - * live - * image-build - * live-media -- * atomic_installer -+ * ostree-installer - - .. note:: - -@@ -950,7 +950,7 @@ runroot environment. - * ``treefile`` -- (*str*) Filename of configuration for ``rpm-ostree``. - * ``config_url`` -- (*str*) URL for Git repository with the ``treefile``. - * ``source_repo_from`` -- (*str*) Name of variant serving as source repository. -- * ``atomic_repo`` -- (*str*) Where to put the atomic repository -+ * ``ostree_repo`` -- (*str*) Where to put the ostree repository - - These keys are optional: - -@@ -968,19 +968,19 @@ Example config - "treefile": "fedora-atomic-docker-host.json", - "config_url": "https://git.fedorahosted.org/git/fedora-atomic.git", - "source_repo_from": "Everything", -- "atomic_repo": "/mnt/koji/compose/atomic/Rawhide/" -+ "ostree_repo": "/mnt/koji/compose/atomic/Rawhide/" - } - }) - ] - - --Atomic Installer Settings -+Ostree Installer Settings - ========================= - --The ``atomic_installer`` phase of *Pungi* can produce installer image bundling -+The ``ostree_installer`` phase of *Pungi* can produce installer image bundling - an OSTree repository. This always runs in Koji as a ``runroot`` task. - --**atomic** -+**ostree_installer** - (*dict*) -- a variant/arch mapping of configuration. The format should be - ``[(variant_uid_regex, {arch|*: config_dict})]``. - -@@ -1010,7 +1010,7 @@ Example config - -------------- - :: - -- atomic = [ -+ ostree_installer = [ - ("^Atomic$", { - "x86_64": { - "source_repo_from": "Everything", -diff --git a/pungi/atomic.py b/pungi/atomic.py -deleted file mode 100644 -index 627ce34..0000000 ---- a/pungi/atomic.py -+++ /dev/null -@@ -1,95 +0,0 @@ --# -*- coding: utf-8 -*- -- --""" --This module contains functions required by pungi-make-atomic. --It is expected to be runnable in Koji runroot. --""" -- --import argparse --import os --from kobo import shortcuts --import tempfile --import shutil --import re -- --from .wrappers import scm -- -- --def make_log_file(log_dir, filename): -- """Return path to log file with given name, if log_dir is set.""" -- if not log_dir: -- return None -- return os.path.join(log_dir, '{}.log'.format(filename)) -- -- --def init_atomic_repo(repo, log_dir=None): -- """If the atomic repo does not exist, initialize it.""" -- log_file = make_log_file(log_dir, 'init-atomic-repo') -- if not os.path.isdir(repo): -- shortcuts.run(['ostree', 'init', '--repo={}'.format(repo), '--mode=archive-z2'], -- logfile=log_file) -- -- --def make_ostree_repo(repo, config, log_dir=None): -- log_file = make_log_file(log_dir, 'create-atomic-repo') -- shortcuts.run(['rpm-ostree', 'compose', 'tree', '--repo={}'.format(repo), config], -- logfile=log_file) -- -- --def clone_repo(repodir, url, branch): -- scm.get_dir_from_scm( -- {'scm': 'git', 'repo': url, 'branch': branch, 'dir': '.'}, repodir) -- -- --def tweak_mirrorlist(repodir, source_repo): -- for file in os.listdir(repodir): -- if file.endswith('.repo'): -- tweak_file(os.path.join(repodir, file), source_repo) -- -- --def tweak_file(path, source_repo): -- """Replace mirrorlist line in repo file with baseurl pointing to source_repo.""" -- with open(path, 'r') as f: -- contents = f.read() -- replacement = 'baseurl={}'.format(source_repo) -- contents = re.sub(r'^mirrorlist=.*$', replacement, contents) -- with open(path, 'w') as f: -- f.write(contents) -- -- --def prepare_config(workdir, config_url, config_branch, source_repo): -- repodir = os.path.join(workdir, 'config_repo') -- clone_repo(repodir, config_url, config_branch) -- tweak_mirrorlist(repodir, source_repo) -- return repodir -- -- --def run(opts): -- workdir = tempfile.mkdtemp() -- repodir = prepare_config(workdir, opts.config_url, opts.config_branch, -- opts.source_repo) -- init_atomic_repo(opts.atomic_repo, log_dir=opts.log_dir) -- treefile = os.path.join(repodir, opts.treefile) -- make_ostree_repo(opts.atomic_repo, treefile, log_dir=opts.log_dir) -- shutil.rmtree(workdir) -- -- --def main(args=None): -- parser = argparse.ArgumentParser() -- parser.add_argument('--log-dir', -- help='where to log output') -- -- parser.add_argument('atomic_repo', metavar='ATOMIC_REPO', -- help='where to put the atomic repo') -- parser.add_argument('--treefile', required=True, -- help='treefile for rpm-ostree') -- parser.add_argument('--config-url', required=True, -- help='git repository with the treefile') -- parser.add_argument('--config-branch', default='master', -- help='git branch to be used') -- parser.add_argument('--source-repo', required=True, -- help='yum repo used as source for') -- -- opts = parser.parse_args(args) -- -- run(opts) -diff --git a/pungi/ostree.py b/pungi/ostree.py -new file mode 100644 -index 0000000..de2cfcd ---- /dev/null -+++ b/pungi/ostree.py -@@ -0,0 +1,95 @@ -+# -*- coding: utf-8 -*- -+ -+""" -+This module contains functions required by pungi-make-ostree. -+It is expected to be runnable in Koji runroot. -+""" -+ -+import argparse -+import os -+from kobo import shortcuts -+import tempfile -+import shutil -+import re -+ -+from .wrappers import scm -+ -+ -+def make_log_file(log_dir, filename): -+ """Return path to log file with given name, if log_dir is set.""" -+ if not log_dir: -+ return None -+ return os.path.join(log_dir, '{}.log'.format(filename)) -+ -+ -+def init_ostree_repo(repo, log_dir=None): -+ """If the ostree repo does not exist, initialize it.""" -+ log_file = make_log_file(log_dir, 'init-ostree-repo') -+ if not os.path.isdir(repo): -+ shortcuts.run(['ostree', 'init', '--repo={}'.format(repo), '--mode=archive-z2'], -+ logfile=log_file) -+ -+ -+def make_ostree_repo(repo, config, log_dir=None): -+ log_file = make_log_file(log_dir, 'create-ostree-repo') -+ shortcuts.run(['rpm-ostree', 'compose', 'tree', '--repo={}'.format(repo), config], -+ logfile=log_file) -+ -+ -+def clone_repo(repodir, url, branch): -+ scm.get_dir_from_scm( -+ {'scm': 'git', 'repo': url, 'branch': branch, 'dir': '.'}, repodir) -+ -+ -+def tweak_mirrorlist(repodir, source_repo): -+ for file in os.listdir(repodir): -+ if file.endswith('.repo'): -+ tweak_file(os.path.join(repodir, file), source_repo) -+ -+ -+def tweak_file(path, source_repo): -+ """Replace mirrorlist line in repo file with baseurl pointing to source_repo.""" -+ with open(path, 'r') as f: -+ contents = f.read() -+ replacement = 'baseurl={}'.format(source_repo) -+ contents = re.sub(r'^mirrorlist=.*$', replacement, contents) -+ with open(path, 'w') as f: -+ f.write(contents) -+ -+ -+def prepare_config(workdir, config_url, config_branch, source_repo): -+ repodir = os.path.join(workdir, 'config_repo') -+ clone_repo(repodir, config_url, config_branch) -+ tweak_mirrorlist(repodir, source_repo) -+ return repodir -+ -+ -+def run(opts): -+ workdir = tempfile.mkdtemp() -+ repodir = prepare_config(workdir, opts.config_url, opts.config_branch, -+ opts.source_repo) -+ init_ostree_repo(opts.ostree_repo, log_dir=opts.log_dir) -+ treefile = os.path.join(repodir, opts.treefile) -+ make_ostree_repo(opts.ostree_repo, treefile, log_dir=opts.log_dir) -+ shutil.rmtree(workdir) -+ -+ -+def main(args=None): -+ parser = argparse.ArgumentParser() -+ parser.add_argument('--log-dir', -+ help='where to log output') -+ -+ parser.add_argument('ostree_repo', metavar='OSTREE_REPO', -+ help='where to put the ostree repo') -+ parser.add_argument('--treefile', required=True, -+ help='treefile for rpm-ostree') -+ parser.add_argument('--config-url', required=True, -+ help='git repository with the treefile') -+ parser.add_argument('--config-branch', default='master', -+ help='git branch to be used') -+ parser.add_argument('--source-repo', required=True, -+ help='yum repo used as source for') -+ -+ opts = parser.parse_args(args) -+ -+ run(opts) -diff --git a/pungi/phases/__init__.py b/pungi/phases/__init__.py -index 343266a..1dff888 100644 ---- a/pungi/phases/__init__.py -+++ b/pungi/phases/__init__.py -@@ -30,4 +30,4 @@ from test import TestPhase # noqa - from image_checksum import ImageChecksumPhase # noqa - from livemedia_phase import LiveMediaPhase # noqa - from ostree import OSTreePhase # noqa --from atomic_installer import AtomicInstallerPhase # noqa -+from ostree_installer import OstreeInstallerPhase # noqa -diff --git a/pungi/phases/atomic_installer.py b/pungi/phases/atomic_installer.py -deleted file mode 100644 -index 3390a74..0000000 ---- a/pungi/phases/atomic_installer.py -+++ /dev/null -@@ -1,134 +0,0 @@ --# -*- coding: utf-8 -*- -- --import os --from kobo.threads import ThreadPool, WorkerThread --import shutil --from productmd import images -- --from .base import ConfigGuardedPhase --from .. import util --from ..paths import translate_path --from ..wrappers import kojiwrapper, iso, lorax -- -- --class AtomicInstallerPhase(ConfigGuardedPhase): -- name = 'atomic' -- -- config_options = [ -- { -- "name": "atomic", -- "expected_types": [list], -- "optional": True, -- } -- ] -- -- def __init__(self, compose): -- super(AtomicInstallerPhase, self).__init__(compose) -- self.pool = ThreadPool(logger=self.compose._logger) -- -- def run(self): -- for variant in self.compose.get_variants(): -- for arch in variant.arches: -- for conf in util.get_arch_variant_data(self.compose.conf, self.name, arch, variant): -- self.pool.add(AtomicInstallerThread(self.pool)) -- self.pool.queue_put((self.compose, variant, arch, conf)) -- -- self.pool.start() -- -- --class AtomicInstallerThread(WorkerThread): -- def process(self, item, num): -- compose, variant, arch, config = item -- self.num = num -- with util.failable(compose, variant, arch, 'atomic_installer', 'Atomic'): -- self.worker(compose, variant, arch, config) -- -- def worker(self, compose, variant, arch, config): -- msg = 'Atomic phase for variant %s, arch %s' % (variant.uid, arch) -- self.pool.log_info('[BEGIN] %s' % msg) -- self.logdir = compose.paths.log.topdir('{}/atomic'.format(arch)) -- -- source_variant = compose.variants[config['source_repo_from']] -- source_repo = translate_path( -- compose, compose.paths.compose.repository(arch, source_variant, create_dir=False)) -- -- self._run_atomic_cmd(compose, variant, arch, config, source_repo) -- -- disc_type = compose.conf.get('disc_types', {}).get('dvd', 'dvd') -- filename = compose.get_image_name(arch, variant, disc_type=disc_type, -- format=config.get('filename')) -- self._copy_image(compose, variant, arch, filename) -- self._add_to_manifest(compose, variant, arch, filename) -- self.pool.log_info('[DONE ] %s' % msg) -- -- def _get_release(self, compose, config): -- if 'release' in config and config['release'] is None: -- return compose.image_release -- return config.get('release', None) -- -- def _copy_image(self, compose, variant, arch, filename): -- iso_path = compose.paths.compose.iso_path(arch, variant, filename) -- source_dir = compose.paths.compose.os_tree(arch, variant) -- boot_iso = os.path.join(source_dir, 'images', 'boot.iso') -- -- try: -- os.link(boot_iso, iso_path) -- except OSError: -- shutil.copy2(boot_iso, iso_path) -- -- def _add_to_manifest(self, compose, variant, arch, filename): -- full_iso_path = compose.paths.compose.iso_path(arch, variant, filename) -- iso_path = compose.paths.compose.iso_path(arch, variant, filename, relative=True) -- iso_wrapper = iso.IsoWrapper() -- implant_md5 = iso_wrapper.get_implanted_md5(full_iso_path) -- -- img = images.Image(compose.im) -- img.path = iso_path -- img.mtime = util.get_mtime(full_iso_path) -- img.size = util.get_file_size(full_iso_path) -- img.arch = arch -- img.type = "boot" -- img.format = "iso" -- img.disc_number = 1 -- img.disc_count = 1 -- img.bootable = True -- img.subvariant = variant.name -- img.implant_md5 = implant_md5 -- try: -- img.volume_id = iso_wrapper.get_volume_id(full_iso_path) -- except RuntimeError: -- pass -- compose.im.add(variant.uid, arch, img) -- -- def _run_atomic_cmd(self, compose, variant, arch, config, source_repo): -- image_dir = compose.paths.compose.os_tree(arch, variant, create_dir=False) -- lorax_wrapper = lorax.LoraxWrapper() -- cmd = lorax_wrapper.get_lorax_cmd( -- compose.conf['release_name'], -- compose.conf["release_version"], -- self._get_release(compose, config), -- repo_baseurl=source_repo, -- output_dir=image_dir, -- variant=variant.uid, -- nomacboot=True, -- buildinstallpackages=config.get('installpkgs'), -- add_template=config.get('add_template'), -- add_arch_template=config.get('add_arch_template'), -- add_template_var=config.get('add_template_var'), -- add_arch_template_var=config.get('add_arch_template_var') -- ) -- -- runroot_channel = compose.conf.get("runroot_channel", None) -- runroot_tag = compose.conf["runroot_tag"] -- -- packages = ['pungi', 'lorax'] -- log_file = os.path.join(self.logdir, 'runroot.log') -- koji = kojiwrapper.KojiWrapper(compose.conf["koji_profile"]) -- koji_cmd = koji.get_runroot_cmd(runroot_tag, arch, cmd, -- channel=runroot_channel, -- use_shell=True, task_id=True, -- packages=packages, mounts=[compose.topdir]) -- output = koji.run_runroot_cmd(koji_cmd, log_file=log_file) -- if output["retcode"] != 0: -- raise RuntimeError("Runroot task failed: %s. See %s for more details." -- % (output["task_id"], log_file)) -diff --git a/pungi/phases/ostree.py b/pungi/phases/ostree.py -index 79e58d4..810716e 100644 ---- a/pungi/phases/ostree.py -+++ b/pungi/phases/ostree.py -@@ -41,16 +41,16 @@ class OSTreeThread(WorkerThread): - - msg = 'OSTree phase for variant %s, arch %s' % (variant.uid, arch) - self.pool.log_info('[BEGIN] %s' % msg) -- self.logdir = compose.paths.log.topdir('{}/atomic'.format(arch)) -+ self.logdir = compose.paths.log.topdir('{}/ostree'.format(arch)) - - source_variant = compose.variants[config['source_repo_from']] - source_repo = translate_path(compose, compose.paths.compose.repository(arch, source_variant)) - -- self._run_atomic_cmd(compose, variant, arch, config, source_repo) -+ self._run_ostree_cmd(compose, variant, arch, config, source_repo) - - self.pool.log_info('[DONE ] %s' % msg) - -- def _run_atomic_cmd(self, compose, variant, arch, config, source_repo): -+ def _run_ostree_cmd(self, compose, variant, arch, config, source_repo): - cmd = [ - 'pungi-make-ostree', - '--log-dir={}'.format(self.logdir), -@@ -58,7 +58,7 @@ class OSTreeThread(WorkerThread): - '--config-url={}'.format(config['config_url']), - '--config-branch={}'.format(config.get('config_branch', 'master')), - '--source-repo={}'.format(source_repo), -- config['atomic_repo'] -+ config['ostree_repo'] - ] - - runroot_channel = compose.conf.get("runroot_channel", None) -diff --git a/pungi/phases/ostree_installer.py b/pungi/phases/ostree_installer.py -new file mode 100644 -index 0000000..a781c4f ---- /dev/null -+++ b/pungi/phases/ostree_installer.py -@@ -0,0 +1,134 @@ -+# -*- coding: utf-8 -*- -+ -+import os -+from kobo.threads import ThreadPool, WorkerThread -+import shutil -+from productmd import images -+ -+from .base import ConfigGuardedPhase -+from .. import util -+from ..paths import translate_path -+from ..wrappers import kojiwrapper, iso, lorax -+ -+ -+class OstreeInstallerPhase(ConfigGuardedPhase): -+ name = 'ostree_installer' -+ -+ config_options = [ -+ { -+ "name": "ostree_installer", -+ "expected_types": [list], -+ "optional": True, -+ } -+ ] -+ -+ def __init__(self, compose): -+ super(OstreeInstallerPhase, self).__init__(compose) -+ self.pool = ThreadPool(logger=self.compose._logger) -+ -+ def run(self): -+ for variant in self.compose.get_variants(): -+ for arch in variant.arches: -+ for conf in util.get_arch_variant_data(self.compose.conf, self.name, arch, variant): -+ self.pool.add(OstreeInstallerThread(self.pool)) -+ self.pool.queue_put((self.compose, variant, arch, conf)) -+ -+ self.pool.start() -+ -+ -+class OstreeInstallerThread(WorkerThread): -+ def process(self, item, num): -+ compose, variant, arch, config = item -+ self.num = num -+ with util.failable(compose, variant, arch, 'ostree-installer', 'Ostree installer'): -+ self.worker(compose, variant, arch, config) -+ -+ def worker(self, compose, variant, arch, config): -+ msg = 'Ostree phase for variant %s, arch %s' % (variant.uid, arch) -+ self.pool.log_info('[BEGIN] %s' % msg) -+ self.logdir = compose.paths.log.topdir('{}/ostree'.format(arch)) -+ -+ source_variant = compose.variants[config['source_repo_from']] -+ source_repo = translate_path( -+ compose, compose.paths.compose.repository(arch, source_variant, create_dir=False)) -+ -+ self._run_ostree_cmd(compose, variant, arch, config, source_repo) -+ -+ disc_type = compose.conf.get('disc_types', {}).get('dvd', 'dvd') -+ filename = compose.get_image_name(arch, variant, disc_type=disc_type, -+ format=config.get('filename')) -+ self._copy_image(compose, variant, arch, filename) -+ self._add_to_manifest(compose, variant, arch, filename) -+ self.pool.log_info('[DONE ] %s' % msg) -+ -+ def _get_release(self, compose, config): -+ if 'release' in config and config['release'] is None: -+ return compose.image_release -+ return config.get('release', None) -+ -+ def _copy_image(self, compose, variant, arch, filename): -+ iso_path = compose.paths.compose.iso_path(arch, variant, filename) -+ source_dir = compose.paths.compose.os_tree(arch, variant) -+ boot_iso = os.path.join(source_dir, 'images', 'boot.iso') -+ -+ try: -+ os.link(boot_iso, iso_path) -+ except OSError: -+ shutil.copy2(boot_iso, iso_path) -+ -+ def _add_to_manifest(self, compose, variant, arch, filename): -+ full_iso_path = compose.paths.compose.iso_path(arch, variant, filename) -+ iso_path = compose.paths.compose.iso_path(arch, variant, filename, relative=True) -+ iso_wrapper = iso.IsoWrapper() -+ implant_md5 = iso_wrapper.get_implanted_md5(full_iso_path) -+ -+ img = images.Image(compose.im) -+ img.path = iso_path -+ img.mtime = util.get_mtime(full_iso_path) -+ img.size = util.get_file_size(full_iso_path) -+ img.arch = arch -+ img.type = "boot" -+ img.format = "iso" -+ img.disc_number = 1 -+ img.disc_count = 1 -+ img.bootable = True -+ img.subvariant = variant.name -+ img.implant_md5 = implant_md5 -+ try: -+ img.volume_id = iso_wrapper.get_volume_id(full_iso_path) -+ except RuntimeError: -+ pass -+ compose.im.add(variant.uid, arch, img) -+ -+ def _run_ostree_cmd(self, compose, variant, arch, config, source_repo): -+ image_dir = compose.paths.compose.os_tree(arch, variant, create_dir=False) -+ lorax_wrapper = lorax.LoraxWrapper() -+ cmd = lorax_wrapper.get_lorax_cmd( -+ compose.conf['release_name'], -+ compose.conf["release_version"], -+ self._get_release(compose, config), -+ repo_baseurl=source_repo, -+ output_dir=image_dir, -+ variant=variant.uid, -+ nomacboot=True, -+ buildinstallpackages=config.get('installpkgs'), -+ add_template=config.get('add_template'), -+ add_arch_template=config.get('add_arch_template'), -+ add_template_var=config.get('add_template_var'), -+ add_arch_template_var=config.get('add_arch_template_var') -+ ) -+ -+ runroot_channel = compose.conf.get("runroot_channel", None) -+ runroot_tag = compose.conf["runroot_tag"] -+ -+ packages = ['pungi', 'lorax'] -+ log_file = os.path.join(self.logdir, 'runroot.log') -+ koji = kojiwrapper.KojiWrapper(compose.conf["koji_profile"]) -+ koji_cmd = koji.get_runroot_cmd(runroot_tag, arch, cmd, -+ channel=runroot_channel, -+ use_shell=True, task_id=True, -+ packages=packages, mounts=[compose.topdir]) -+ output = koji.run_runroot_cmd(koji_cmd, log_file=log_file) -+ if output["retcode"] != 0: -+ raise RuntimeError("Runroot task failed: %s. See %s for more details." -+ % (output["task_id"], log_file)) -diff --git a/tests/test_atomic_installer_phase.py b/tests/test_atomic_installer_phase.py -deleted file mode 100644 -index 33f4961..0000000 ---- a/tests/test_atomic_installer_phase.py -+++ /dev/null -@@ -1,317 +0,0 @@ --#!/usr/bin/env python --# -*- coding: utf-8 -*- -- -- --import unittest --import mock -- --import os --import sys -- --sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) -- --from tests import helpers --from pungi.phases import atomic_installer as atomic -- -- --class AtomicInstallerPhaseTest(helpers.PungiTestCase): -- -- def test_validate(self): -- compose = helpers.DummyCompose(self.topdir, { -- 'atomic': [ -- ("^Atomic$", { -- "x86_64": { -- "source_repo_from": "Everything", -- "release": None, -- "filename": "%(release_short)s-%(variant)s-%(arch)s-%(version)s-%(compose_date)s.iso", -- "installpkgs": ["fedora-productimg-atomic"], -- "add_template": ["/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl"], -- "add_template_var": [ -- "ostree_osname=fedora-atomic", -- "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", -- ], -- "add_arch_template": ["/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl"], -- "add_arch_template_var": [ -- "ostree_repo=https://kojipkgs.fedoraproject.org/compose/atomic/Rawhide/", -- "ostree_osname=fedora-atomic", -- "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", -- ] -- } -- }) -- ] -- }) -- -- phase = atomic.AtomicInstallerPhase(compose) -- try: -- phase.validate() -- except: -- self.fail('Correct config must validate') -- -- def test_validate_bad_conf(self): -- compose = helpers.DummyCompose(self.topdir, { -- 'atomic': 'yes please' -- }) -- -- phase = atomic.AtomicInstallerPhase(compose) -- with self.assertRaises(ValueError): -- phase.validate() -- -- @mock.patch('pungi.phases.atomic_installer.ThreadPool') -- def test_run(self, ThreadPool): -- cfg = mock.Mock() -- compose = helpers.DummyCompose(self.topdir, { -- 'atomic': [ -- ('^Everything$', {'x86_64': cfg}) -- ] -- }) -- -- pool = ThreadPool.return_value -- -- phase = atomic.AtomicInstallerPhase(compose) -- phase.run() -- -- self.assertEqual(len(pool.add.call_args_list), 1) -- self.assertEqual(pool.queue_put.call_args_list, -- [mock.call((compose, compose.variants['Everything'], 'x86_64', cfg))]) -- -- @mock.patch('pungi.phases.atomic_installer.ThreadPool') -- def test_skip_without_config(self, ThreadPool): -- compose = helpers.DummyCompose(self.topdir, {}) -- compose.just_phases = None -- compose.skip_phases = [] -- phase = atomic.AtomicInstallerPhase(compose) -- self.assertTrue(phase.skip()) -- -- --class AtomicThreadTest(helpers.PungiTestCase): -- -- def assertImageAdded(self, compose, ImageCls, IsoWrapper): -- image = ImageCls.return_value -- self.assertEqual(image.path, 'Everything/x86_64/iso/image-name') -- self.assertEqual(image.mtime, 13579) -- self.assertEqual(image.size, 1024) -- self.assertEqual(image.arch, 'x86_64') -- self.assertEqual(image.type, "boot") -- self.assertEqual(image.format, "iso") -- self.assertEqual(image.disc_number, 1) -- self.assertEqual(image.disc_count, 1) -- self.assertEqual(image.bootable, True) -- self.assertEqual(image.implant_md5, IsoWrapper.return_value.get_implanted_md5.return_value) -- self.assertEqual(compose.im.add.mock_calls, -- [mock.call('Everything', 'x86_64', image)]) -- -- @mock.patch('productmd.images.Image') -- @mock.patch('pungi.util.get_mtime') -- @mock.patch('pungi.util.get_file_size') -- @mock.patch('pungi.wrappers.iso.IsoWrapper') -- @mock.patch('os.link') -- @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') -- def test_run(self, KojiWrapper, link, IsoWrapper, -- get_file_size, get_mtime, ImageCls): -- compose = helpers.DummyCompose(self.topdir, { -- 'release_name': 'Fedora', -- 'release_version': 'Rawhide', -- 'koji_profile': 'koji', -- 'runroot_tag': 'rrt', -- }) -- pool = mock.Mock() -- cfg = { -- 'source_repo_from': 'Everything', -- 'release': '20160321.n.0', -- 'filename': 'Fedora-Atomic.iso', -- } -- koji = KojiWrapper.return_value -- koji.run_runroot_cmd.return_value = { -- 'task_id': 1234, -- 'retcode': 0, -- 'output': 'Foo bar\n', -- } -- get_file_size.return_value = 1024 -- get_mtime.return_value = 13579 -- final_iso_path = self.topdir + '/compose/Everything/x86_64/iso/image-name' -- -- t = atomic.AtomicInstallerThread(pool) -- -- t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) -- -- self.assertEqual(koji.get_runroot_cmd.call_args_list, -- [mock.call('rrt', 'x86_64', -- ['lorax', -- '--product=Fedora', -- '--version=Rawhide', -- '--release=20160321.n.0', -- '--source=file://{}/compose/Everything/x86_64/os'.format(self.topdir), -- '--variant=Everything', -- '--nomacboot', -- self.topdir + '/compose/Everything/x86_64/os'], -- channel=None, mounts=[self.topdir], -- packages=['pungi', 'lorax'], -- task_id=True, use_shell=True)]) -- self.assertEqual(koji.run_runroot_cmd.call_args_list, -- [mock.call(koji.get_runroot_cmd.return_value, -- log_file=self.topdir + '/logs/x86_64/atomic/runroot.log')]) -- self.assertEqual(link.call_args_list, -- [mock.call(self.topdir + '/compose/Everything/x86_64/os/images/boot.iso', -- final_iso_path)]) -- self.assertEqual(get_file_size.call_args_list, [mock.call(final_iso_path)]) -- self.assertEqual(get_mtime.call_args_list, [mock.call(final_iso_path)]) -- self.assertImageAdded(compose, ImageCls, IsoWrapper) -- self.assertEqual(compose.get_image_name.call_args_list, -- [mock.call('x86_64', compose.variants['Everything'], -- disc_type='dvd', format='Fedora-Atomic.iso')]) -- -- @mock.patch('productmd.images.Image') -- @mock.patch('pungi.util.get_mtime') -- @mock.patch('pungi.util.get_file_size') -- @mock.patch('pungi.wrappers.iso.IsoWrapper') -- @mock.patch('os.link') -- @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') -- def test_run_with_implicit_release(self, KojiWrapper, link, -- IsoWrapper, get_file_size, get_mtime, ImageCls): -- compose = helpers.DummyCompose(self.topdir, { -- 'release_name': 'Fedora', -- 'release_version': 'Rawhide', -- 'koji_profile': 'koji', -- 'runroot_tag': 'rrt', -- }) -- pool = mock.Mock() -- cfg = { -- 'source_repo_from': 'Everything', -- 'release': None, -- "installpkgs": ["fedora-productimg-atomic"], -- "add_template": ["/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl"], -- "add_template_var": [ -- "ostree_osname=fedora-atomic", -- "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", -- ], -- "add_arch_template": ["/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl"], -- "add_arch_template_var": [ -- "ostree_repo=https://kojipkgs.fedoraproject.org/compose/atomic/Rawhide/", -- "ostree_osname=fedora-atomic", -- "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", -- ], -- } -- koji = KojiWrapper.return_value -- koji.run_runroot_cmd.return_value = { -- 'task_id': 1234, -- 'retcode': 0, -- 'output': 'Foo bar\n', -- } -- get_file_size.return_value = 1024 -- get_mtime.return_value = 13579 -- final_iso_path = self.topdir + '/compose/Everything/x86_64/iso/image-name' -- -- t = atomic.AtomicInstallerThread(pool) -- -- t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) -- -- self.assertEqual( -- koji.get_runroot_cmd.call_args_list, -- [mock.call('rrt', 'x86_64', -- ['lorax', -- '--product=Fedora', -- '--version=Rawhide', '--release=20151203.t.0', -- '--source=file://{}/compose/Everything/x86_64/os'.format(self.topdir), -- '--variant=Everything', -- '--nomacboot', -- '--installpkgs=fedora-productimg-atomic', -- '--add-template=/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl', -- '--add-arch-template=/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl', -- '--add-template-var=ostree_osname=fedora-atomic', -- '--add-template-var=ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host', -- '--add-arch-template-var=ostree_repo=https://kojipkgs.fedoraproject.org/compose/atomic/Rawhide/', -- '--add-arch-template-var=ostree_osname=fedora-atomic', -- '--add-arch-template-var=ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host', -- self.topdir + '/compose/Everything/x86_64/os'], -- channel=None, mounts=[self.topdir], -- packages=['pungi', 'lorax'], -- task_id=True, use_shell=True)]) -- self.assertEqual(koji.run_runroot_cmd.call_args_list, -- [mock.call(koji.get_runroot_cmd.return_value, -- log_file=self.topdir + '/logs/x86_64/atomic/runroot.log')]) -- self.assertEqual(link.call_args_list, -- [mock.call(self.topdir + '/compose/Everything/x86_64/os/images/boot.iso', -- final_iso_path)]) -- self.assertEqual(get_file_size.call_args_list, [mock.call(final_iso_path)]) -- self.assertEqual(get_mtime.call_args_list, [mock.call(final_iso_path)]) -- self.assertImageAdded(compose, ImageCls, IsoWrapper) -- self.assertEqual(compose.get_image_name.call_args_list, -- [mock.call('x86_64', compose.variants['Everything'], -- disc_type='dvd', format=None)]) -- -- @mock.patch('productmd.images.Image') -- @mock.patch('pungi.util.get_mtime') -- @mock.patch('pungi.util.get_file_size') -- @mock.patch('pungi.wrappers.iso.IsoWrapper') -- @mock.patch('os.link') -- @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') -- def test_fail_crash(self, KojiWrapper, link, -- IsoWrapper, get_file_size, get_mtime, ImageCls): -- compose = helpers.DummyCompose(self.topdir, { -- 'release_name': 'Fedora', -- 'release_version': 'Rawhide', -- 'koji_profile': 'koji', -- 'runroot_tag': 'rrt', -- 'failable_deliverables': [ -- ('^.+$', {'*': ['atomic_installer']}) -- ], -- }) -- pool = mock.Mock() -- cfg = { -- 'source_repo_from': 'Everything', -- 'release': None, -- 'filename': 'Fedora-Atomic.iso', -- } -- koji = KojiWrapper.return_value -- koji.run_runroot_cmd.side_effect = helpers.boom -- -- t = atomic.AtomicInstallerThread(pool) -- -- t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) -- compose.log_info.assert_has_calls([ -- mock.call('[FAIL] Atomic (variant Everything, arch x86_64) failed, but going on anyway.'), -- mock.call('BOOM') -- ]) -- -- @mock.patch('productmd.images.Image') -- @mock.patch('pungi.util.get_mtime') -- @mock.patch('pungi.util.get_file_size') -- @mock.patch('pungi.wrappers.iso.IsoWrapper') -- @mock.patch('os.link') -- @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') -- def test_fail_runroot_fail(self, KojiWrapper, link, -- IsoWrapper, get_file_size, get_mtime, ImageCls): -- compose = helpers.DummyCompose(self.topdir, { -- 'release_name': 'Fedora', -- 'release_version': 'Rawhide', -- 'koji_profile': 'koji', -- 'runroot_tag': 'rrt', -- 'failable_deliverables': [ -- ('^.+$', {'*': ['atomic_installer']}) -- ], -- }) -- pool = mock.Mock() -- cfg = { -- 'source_repo_from': 'Everything', -- 'release': None, -- 'filename': 'Fedora-Atomic.iso', -- } -- koji = KojiWrapper.return_value -- koji.run_runroot_cmd.return_value = { -- 'output': 'Failed', -- 'task_id': 1234, -- 'retcode': 1, -- } -- -- t = atomic.AtomicInstallerThread(pool) -- -- t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) -- compose.log_info.assert_has_calls([ -- mock.call('[FAIL] Atomic (variant Everything, arch x86_64) failed, but going on anyway.'), -- mock.call('Runroot task failed: 1234. See %s/logs/x86_64/atomic/runroot.log for more details.' -- % self.topdir) -- ]) -- -- --if __name__ == '__main__': -- unittest.main() -diff --git a/tests/test_atomic_script.py b/tests/test_atomic_script.py -deleted file mode 100755 -index 4b0b396..0000000 ---- a/tests/test_atomic_script.py -+++ /dev/null -@@ -1,55 +0,0 @@ --#!/usr/bin/env python --# -*- coding: utf-8 -*- -- -- --import unittest --import mock -- --import os --import sys -- --sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) --sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'bin')) -- --from tests import helpers --from pungi import atomic -- -- --class OstreeScriptTest(helpers.PungiTestCase): -- -- def _dummy_config_repo(self, scm_dict, target, logger=None): -- helpers.touch(os.path.join(target, 'fedora-atomic-docker-host.json')) -- helpers.touch(os.path.join(target, 'fedora-rawhide.repo')) -- -- @mock.patch('tempfile.mkdtemp') -- @mock.patch('kobo.shortcuts.run') -- @mock.patch('pungi.wrappers.scm.get_dir_from_scm') -- def test_full_run(self, get_dir_from_scm, run, tempfile): -- tempfile.return_value = self.topdir -- get_dir_from_scm.side_effect = self._dummy_config_repo -- -- atomic.main([ -- '--log-dir={}'.format(os.path.join(self.topdir, 'logs', 'Atomic')), -- '--treefile={}'.format('fedora-atomic-docker-host.json'), -- '--config-url=https://git.fedorahosted.org/git/fedora-atomic.git', -- '--config-branch=f24', -- '--source-repo=https://kojipkgs.fedoraproject.org/repo', -- os.path.join(self.topdir, 'atomic'), -- ]) -- -- self.maxDiff = None -- self.assertEqual(get_dir_from_scm.call_args_list, -- [mock.call({'scm': 'git', 'repo': 'https://git.fedorahosted.org/git/fedora-atomic.git', -- 'branch': 'f24', 'dir': '.'}, -- self.topdir + '/config_repo')]) -- self.assertItemsEqual( -- run.call_args_list, -- [mock.call(['ostree', 'init', '--repo={}/atomic'.format(self.topdir), '--mode=archive-z2'], -- logfile=self.topdir + '/logs/Atomic/init-atomic-repo.log'), -- mock.call(['rpm-ostree', 'compose', 'tree', '--repo={}/atomic'.format(self.topdir), -- self.topdir + '/config_repo/fedora-atomic-docker-host.json'], -- logfile=self.topdir + '/logs/Atomic/create-atomic-repo.log')]) -- -- --if __name__ == '__main__': -- unittest.main() -diff --git a/tests/test_ostree_installer_phase.py b/tests/test_ostree_installer_phase.py -new file mode 100644 -index 0000000..add4528 ---- /dev/null -+++ b/tests/test_ostree_installer_phase.py -@@ -0,0 +1,317 @@ -+#!/usr/bin/env python -+# -*- coding: utf-8 -*- -+ -+ -+import unittest -+import mock -+ -+import os -+import sys -+ -+sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) -+ -+from tests import helpers -+from pungi.phases import ostree_installer as ostree -+ -+ -+class OstreeInstallerPhaseTest(helpers.PungiTestCase): -+ -+ def test_validate(self): -+ compose = helpers.DummyCompose(self.topdir, { -+ 'ostree_installer': [ -+ ("^Atomic$", { -+ "x86_64": { -+ "source_repo_from": "Everything", -+ "release": None, -+ "filename": "%(release_short)s-%(variant)s-%(arch)s-%(version)s-%(compose_date)s.iso", -+ "installpkgs": ["fedora-productimg-atomic"], -+ "add_template": ["/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl"], -+ "add_template_var": [ -+ "ostree_osname=fedora-atomic", -+ "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", -+ ], -+ "add_arch_template": ["/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl"], -+ "add_arch_template_var": [ -+ "ostree_repo=https://kojipkgs.fedoraproject.org/compose/atomic/Rawhide/", -+ "ostree_osname=fedora-atomic", -+ "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", -+ ] -+ } -+ }) -+ ] -+ }) -+ -+ phase = ostree.OstreeInstallerPhase(compose) -+ try: -+ phase.validate() -+ except: -+ self.fail('Correct config must validate') -+ -+ def test_validate_bad_conf(self): -+ compose = helpers.DummyCompose(self.topdir, { -+ 'ostree_installer': 'yes please' -+ }) -+ -+ phase = ostree.OstreeInstallerPhase(compose) -+ with self.assertRaises(ValueError): -+ phase.validate() -+ -+ @mock.patch('pungi.phases.ostree_installer.ThreadPool') -+ def test_run(self, ThreadPool): -+ cfg = mock.Mock() -+ compose = helpers.DummyCompose(self.topdir, { -+ 'ostree_installer': [ -+ ('^Everything$', {'x86_64': cfg}) -+ ] -+ }) -+ -+ pool = ThreadPool.return_value -+ -+ phase = ostree.OstreeInstallerPhase(compose) -+ phase.run() -+ -+ self.assertEqual(len(pool.add.call_args_list), 1) -+ self.assertEqual(pool.queue_put.call_args_list, -+ [mock.call((compose, compose.variants['Everything'], 'x86_64', cfg))]) -+ -+ @mock.patch('pungi.phases.ostree_installer.ThreadPool') -+ def test_skip_without_config(self, ThreadPool): -+ compose = helpers.DummyCompose(self.topdir, {}) -+ compose.just_phases = None -+ compose.skip_phases = [] -+ phase = ostree.OstreeInstallerPhase(compose) -+ self.assertTrue(phase.skip()) -+ -+ -+class OstreeThreadTest(helpers.PungiTestCase): -+ -+ def assertImageAdded(self, compose, ImageCls, IsoWrapper): -+ image = ImageCls.return_value -+ self.assertEqual(image.path, 'Everything/x86_64/iso/image-name') -+ self.assertEqual(image.mtime, 13579) -+ self.assertEqual(image.size, 1024) -+ self.assertEqual(image.arch, 'x86_64') -+ self.assertEqual(image.type, "boot") -+ self.assertEqual(image.format, "iso") -+ self.assertEqual(image.disc_number, 1) -+ self.assertEqual(image.disc_count, 1) -+ self.assertEqual(image.bootable, True) -+ self.assertEqual(image.implant_md5, IsoWrapper.return_value.get_implanted_md5.return_value) -+ self.assertEqual(compose.im.add.mock_calls, -+ [mock.call('Everything', 'x86_64', image)]) -+ -+ @mock.patch('productmd.images.Image') -+ @mock.patch('pungi.util.get_mtime') -+ @mock.patch('pungi.util.get_file_size') -+ @mock.patch('pungi.wrappers.iso.IsoWrapper') -+ @mock.patch('os.link') -+ @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') -+ def test_run(self, KojiWrapper, link, IsoWrapper, -+ get_file_size, get_mtime, ImageCls): -+ compose = helpers.DummyCompose(self.topdir, { -+ 'release_name': 'Fedora', -+ 'release_version': 'Rawhide', -+ 'koji_profile': 'koji', -+ 'runroot_tag': 'rrt', -+ }) -+ pool = mock.Mock() -+ cfg = { -+ 'source_repo_from': 'Everything', -+ 'release': '20160321.n.0', -+ 'filename': 'Fedora-Atomic.iso', -+ } -+ koji = KojiWrapper.return_value -+ koji.run_runroot_cmd.return_value = { -+ 'task_id': 1234, -+ 'retcode': 0, -+ 'output': 'Foo bar\n', -+ } -+ get_file_size.return_value = 1024 -+ get_mtime.return_value = 13579 -+ final_iso_path = self.topdir + '/compose/Everything/x86_64/iso/image-name' -+ -+ t = ostree.OstreeInstallerThread(pool) -+ -+ t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) -+ -+ self.assertEqual(koji.get_runroot_cmd.call_args_list, -+ [mock.call('rrt', 'x86_64', -+ ['lorax', -+ '--product=Fedora', -+ '--version=Rawhide', -+ '--release=20160321.n.0', -+ '--source=file://{}/compose/Everything/x86_64/os'.format(self.topdir), -+ '--variant=Everything', -+ '--nomacboot', -+ self.topdir + '/compose/Everything/x86_64/os'], -+ channel=None, mounts=[self.topdir], -+ packages=['pungi', 'lorax'], -+ task_id=True, use_shell=True)]) -+ self.assertEqual(koji.run_runroot_cmd.call_args_list, -+ [mock.call(koji.get_runroot_cmd.return_value, -+ log_file=self.topdir + '/logs/x86_64/ostree/runroot.log')]) -+ self.assertEqual(link.call_args_list, -+ [mock.call(self.topdir + '/compose/Everything/x86_64/os/images/boot.iso', -+ final_iso_path)]) -+ self.assertEqual(get_file_size.call_args_list, [mock.call(final_iso_path)]) -+ self.assertEqual(get_mtime.call_args_list, [mock.call(final_iso_path)]) -+ self.assertImageAdded(compose, ImageCls, IsoWrapper) -+ self.assertEqual(compose.get_image_name.call_args_list, -+ [mock.call('x86_64', compose.variants['Everything'], -+ disc_type='dvd', format='Fedora-Atomic.iso')]) -+ -+ @mock.patch('productmd.images.Image') -+ @mock.patch('pungi.util.get_mtime') -+ @mock.patch('pungi.util.get_file_size') -+ @mock.patch('pungi.wrappers.iso.IsoWrapper') -+ @mock.patch('os.link') -+ @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') -+ def test_run_with_implicit_release(self, KojiWrapper, link, -+ IsoWrapper, get_file_size, get_mtime, ImageCls): -+ compose = helpers.DummyCompose(self.topdir, { -+ 'release_name': 'Fedora', -+ 'release_version': 'Rawhide', -+ 'koji_profile': 'koji', -+ 'runroot_tag': 'rrt', -+ }) -+ pool = mock.Mock() -+ cfg = { -+ 'source_repo_from': 'Everything', -+ 'release': None, -+ "installpkgs": ["fedora-productimg-atomic"], -+ "add_template": ["/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl"], -+ "add_template_var": [ -+ "ostree_osname=fedora-atomic", -+ "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", -+ ], -+ "add_arch_template": ["/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl"], -+ "add_arch_template_var": [ -+ "ostree_repo=https://kojipkgs.fedoraproject.org/compose/atomic/Rawhide/", -+ "ostree_osname=fedora-atomic", -+ "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", -+ ], -+ } -+ koji = KojiWrapper.return_value -+ koji.run_runroot_cmd.return_value = { -+ 'task_id': 1234, -+ 'retcode': 0, -+ 'output': 'Foo bar\n', -+ } -+ get_file_size.return_value = 1024 -+ get_mtime.return_value = 13579 -+ final_iso_path = self.topdir + '/compose/Everything/x86_64/iso/image-name' -+ -+ t = ostree.OstreeInstallerThread(pool) -+ -+ t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) -+ -+ self.assertEqual( -+ koji.get_runroot_cmd.call_args_list, -+ [mock.call('rrt', 'x86_64', -+ ['lorax', -+ '--product=Fedora', -+ '--version=Rawhide', '--release=20151203.t.0', -+ '--source=file://{}/compose/Everything/x86_64/os'.format(self.topdir), -+ '--variant=Everything', -+ '--nomacboot', -+ '--installpkgs=fedora-productimg-atomic', -+ '--add-template=/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl', -+ '--add-arch-template=/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl', -+ '--add-template-var=ostree_osname=fedora-atomic', -+ '--add-template-var=ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host', -+ '--add-arch-template-var=ostree_repo=https://kojipkgs.fedoraproject.org/compose/atomic/Rawhide/', -+ '--add-arch-template-var=ostree_osname=fedora-atomic', -+ '--add-arch-template-var=ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host', -+ self.topdir + '/compose/Everything/x86_64/os'], -+ channel=None, mounts=[self.topdir], -+ packages=['pungi', 'lorax'], -+ task_id=True, use_shell=True)]) -+ self.assertEqual(koji.run_runroot_cmd.call_args_list, -+ [mock.call(koji.get_runroot_cmd.return_value, -+ log_file=self.topdir + '/logs/x86_64/ostree/runroot.log')]) -+ self.assertEqual(link.call_args_list, -+ [mock.call(self.topdir + '/compose/Everything/x86_64/os/images/boot.iso', -+ final_iso_path)]) -+ self.assertEqual(get_file_size.call_args_list, [mock.call(final_iso_path)]) -+ self.assertEqual(get_mtime.call_args_list, [mock.call(final_iso_path)]) -+ self.assertImageAdded(compose, ImageCls, IsoWrapper) -+ self.assertEqual(compose.get_image_name.call_args_list, -+ [mock.call('x86_64', compose.variants['Everything'], -+ disc_type='dvd', format=None)]) -+ -+ @mock.patch('productmd.images.Image') -+ @mock.patch('pungi.util.get_mtime') -+ @mock.patch('pungi.util.get_file_size') -+ @mock.patch('pungi.wrappers.iso.IsoWrapper') -+ @mock.patch('os.link') -+ @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') -+ def test_fail_crash(self, KojiWrapper, link, -+ IsoWrapper, get_file_size, get_mtime, ImageCls): -+ compose = helpers.DummyCompose(self.topdir, { -+ 'release_name': 'Fedora', -+ 'release_version': 'Rawhide', -+ 'koji_profile': 'koji', -+ 'runroot_tag': 'rrt', -+ 'failable_deliverables': [ -+ ('^.+$', {'*': ['ostree-installer']}) -+ ], -+ }) -+ pool = mock.Mock() -+ cfg = { -+ 'source_repo_from': 'Everything', -+ 'release': None, -+ 'filename': 'Fedora-Atomic.iso', -+ } -+ koji = KojiWrapper.return_value -+ koji.run_runroot_cmd.side_effect = helpers.boom -+ -+ t = ostree.OstreeInstallerThread(pool) -+ -+ t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) -+ compose.log_info.assert_has_calls([ -+ mock.call('[FAIL] Ostree installer (variant Everything, arch x86_64) failed, but going on anyway.'), -+ mock.call('BOOM') -+ ]) -+ -+ @mock.patch('productmd.images.Image') -+ @mock.patch('pungi.util.get_mtime') -+ @mock.patch('pungi.util.get_file_size') -+ @mock.patch('pungi.wrappers.iso.IsoWrapper') -+ @mock.patch('os.link') -+ @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') -+ def test_fail_runroot_fail(self, KojiWrapper, link, -+ IsoWrapper, get_file_size, get_mtime, ImageCls): -+ compose = helpers.DummyCompose(self.topdir, { -+ 'release_name': 'Fedora', -+ 'release_version': 'Rawhide', -+ 'koji_profile': 'koji', -+ 'runroot_tag': 'rrt', -+ 'failable_deliverables': [ -+ ('^.+$', {'*': ['ostree-installer']}) -+ ], -+ }) -+ pool = mock.Mock() -+ cfg = { -+ 'source_repo_from': 'Everything', -+ 'release': None, -+ 'filename': 'Fedora-Atomic.iso', -+ } -+ koji = KojiWrapper.return_value -+ koji.run_runroot_cmd.return_value = { -+ 'output': 'Failed', -+ 'task_id': 1234, -+ 'retcode': 1, -+ } -+ -+ t = ostree.OstreeInstallerThread(pool) -+ -+ t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) -+ compose.log_info.assert_has_calls([ -+ mock.call('[FAIL] Ostree installer (variant Everything, arch x86_64) failed, but going on anyway.'), -+ mock.call('Runroot task failed: 1234. See %s/logs/x86_64/ostree/runroot.log for more details.' -+ % self.topdir) -+ ]) -+ -+ -+if __name__ == '__main__': -+ unittest.main() -diff --git a/tests/test_ostree_phase.py b/tests/test_ostree_phase.py -index fe0036c..9f8fdf1 100755 ---- a/tests/test_ostree_phase.py -+++ b/tests/test_ostree_phase.py -@@ -24,7 +24,7 @@ class OSTreePhaseTest(helpers.PungiTestCase): - "treefile": "fedora-atomic-docker-host.json", - "config_url": "https://git.fedorahosted.org/git/fedora-atomic.git", - "source_repo_from": "Everything", -- "atomic_repo": "/mnt/koji/compose/atomic/Rawhide/" -+ "ostree_repo": "/mnt/koji/compose/atomic/Rawhide/" - } - }) - ] -@@ -86,7 +86,7 @@ class OSTreeThreadTest(helpers.PungiTestCase): - 'config_url': 'https://git.fedorahosted.org/git/fedora-atomic.git', - 'config_branch': 'f24', - 'treefile': 'fedora-atomic-docker-host.json', -- 'atomic_repo': '/other/place/for/atomic' -+ 'ostree_repo': '/other/place/for/atomic' - } - koji = KojiWrapper.return_value - koji.run_runroot_cmd.return_value = { -@@ -102,7 +102,7 @@ class OSTreeThreadTest(helpers.PungiTestCase): - self.assertEqual(koji.get_runroot_cmd.call_args_list, - [mock.call('rrt', 'x86_64', - ['pungi-make-ostree', -- '--log-dir={}/logs/x86_64/atomic'.format(self.topdir), -+ '--log-dir={}/logs/x86_64/ostree'.format(self.topdir), - '--treefile=fedora-atomic-docker-host.json', - '--config-url=https://git.fedorahosted.org/git/fedora-atomic.git', - '--config-branch=f24', -@@ -113,7 +113,7 @@ class OSTreeThreadTest(helpers.PungiTestCase): - task_id=True, use_shell=True)]) - self.assertEqual(koji.run_runroot_cmd.call_args_list, - [mock.call(koji.get_runroot_cmd.return_value, -- log_file=self.topdir + '/logs/x86_64/atomic/runroot.log')]) -+ log_file=self.topdir + '/logs/x86_64/ostree/runroot.log')]) - - - if __name__ == '__main__': -diff --git a/tests/test_ostree_script.py b/tests/test_ostree_script.py -new file mode 100755 -index 0000000..744af4d ---- /dev/null -+++ b/tests/test_ostree_script.py -@@ -0,0 +1,57 @@ -+#!/usr/bin/env python -+# -*- coding: utf-8 -*- -+ -+ -+import unittest -+import mock -+ -+import os -+import sys -+ -+sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) -+sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'bin')) -+ -+from tests import helpers -+from pungi import ostree -+ -+ -+class OstreeScriptTest(helpers.PungiTestCase): -+ -+ def _dummy_config_repo(self, scm_dict, target, logger=None): -+ helpers.touch(os.path.join(target, 'fedora-atomic-docker-host.json')) -+ helpers.touch(os.path.join(target, 'fedora-rawhide.repo')) -+ -+ @mock.patch('tempfile.mkdtemp') -+ @mock.patch('kobo.shortcuts.run') -+ @mock.patch('pungi.wrappers.scm.get_dir_from_scm') -+ def test_full_run(self, get_dir_from_scm, run, tempfile): -+ tempfile.return_value = self.topdir -+ get_dir_from_scm.side_effect = self._dummy_config_repo -+ -+ repo = os.path.join(self.topdir, 'atomic') -+ -+ ostree.main([ -+ '--log-dir={}'.format(os.path.join(self.topdir, 'logs', 'Atomic')), -+ '--treefile={}'.format('fedora-atomic-docker-host.json'), -+ '--config-url=https://git.fedorahosted.org/git/fedora-atomic.git', -+ '--config-branch=f24', -+ '--source-repo=https://kojipkgs.fedoraproject.org/repo', -+ repo, -+ ]) -+ -+ self.maxDiff = None -+ self.assertEqual(get_dir_from_scm.call_args_list, -+ [mock.call({'scm': 'git', 'repo': 'https://git.fedorahosted.org/git/fedora-atomic.git', -+ 'branch': 'f24', 'dir': '.'}, -+ self.topdir + '/config_repo')]) -+ self.assertItemsEqual( -+ run.call_args_list, -+ [mock.call(['ostree', 'init', '--repo={}'.format(repo), '--mode=archive-z2'], -+ logfile=self.topdir + '/logs/Atomic/init-ostree-repo.log'), -+ mock.call(['rpm-ostree', 'compose', 'tree', '--repo={}'.format(repo), -+ self.topdir + '/config_repo/fedora-atomic-docker-host.json'], -+ logfile=self.topdir + '/logs/Atomic/create-ostree-repo.log')]) -+ -+ -+if __name__ == '__main__': -+ unittest.main() --- -2.7.3 - diff --git a/0006-ostree-Use-explicit-work-directory.patch b/0006-ostree-Use-explicit-work-directory.patch deleted file mode 100644 index 4e90eb5f..00000000 --- a/0006-ostree-Use-explicit-work-directory.patch +++ /dev/null @@ -1,168 +0,0 @@ -From 79ee9a4ffaf4627eade703c9bd819c870258745f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= -Date: Tue, 5 Apr 2016 12:46:59 +0200 -Subject: [PATCH 6/6] [ostree] Use explicit work directory -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Lubomír Sedlář ---- - pungi/ostree.py | 26 +++++++++++++++++++------- - pungi/phases/ostree.py | 2 ++ - tests/test_ostree_phase.py | 1 + - tests/test_ostree_script.py | 9 ++++----- - 4 files changed, 26 insertions(+), 12 deletions(-) - -diff --git a/pungi/ostree.py b/pungi/ostree.py -index de2cfcd..c0c8a04 100644 ---- a/pungi/ostree.py -+++ b/pungi/ostree.py -@@ -8,17 +8,26 @@ It is expected to be runnable in Koji runroot. - import argparse - import os - from kobo import shortcuts --import tempfile --import shutil - import re -+import errno - - from .wrappers import scm - - -+def ensure_dir(path): -+ try: -+ os.makedirs(path) -+ except OSError as err: -+ if err.errno != errno.EEXIST: -+ raise -+ return path -+ -+ - def make_log_file(log_dir, filename): - """Return path to log file with given name, if log_dir is set.""" - if not log_dir: - return None -+ ensure_dir(log_dir) - return os.path.join(log_dir, '{}.log'.format(filename)) - - -@@ -26,14 +35,15 @@ def init_ostree_repo(repo, log_dir=None): - """If the ostree repo does not exist, initialize it.""" - log_file = make_log_file(log_dir, 'init-ostree-repo') - if not os.path.isdir(repo): -+ ensure_dir(repo) - shortcuts.run(['ostree', 'init', '--repo={}'.format(repo), '--mode=archive-z2'], -- logfile=log_file) -+ show_cmd=True, logfile=log_file) - - - def make_ostree_repo(repo, config, log_dir=None): - log_file = make_log_file(log_dir, 'create-ostree-repo') - shortcuts.run(['rpm-ostree', 'compose', 'tree', '--repo={}'.format(repo), config], -- logfile=log_file) -+ show_cmd=True, logfile=log_file) - - - def clone_repo(repodir, url, branch): -@@ -52,7 +62,7 @@ def tweak_file(path, source_repo): - with open(path, 'r') as f: - contents = f.read() - replacement = 'baseurl={}'.format(source_repo) -- contents = re.sub(r'^mirrorlist=.*$', replacement, contents) -+ contents = re.sub(r'^mirrorlist=.*$', replacement, contents, flags=re.MULTILINE) - with open(path, 'w') as f: - f.write(contents) - -@@ -65,19 +75,21 @@ def prepare_config(workdir, config_url, config_branch, source_repo): - - - def run(opts): -- workdir = tempfile.mkdtemp() -+ workdir = ensure_dir(opts.work_dir) - repodir = prepare_config(workdir, opts.config_url, opts.config_branch, - opts.source_repo) -+ ensure_dir(repodir) - init_ostree_repo(opts.ostree_repo, log_dir=opts.log_dir) - treefile = os.path.join(repodir, opts.treefile) - make_ostree_repo(opts.ostree_repo, treefile, log_dir=opts.log_dir) -- shutil.rmtree(workdir) - - - def main(args=None): - parser = argparse.ArgumentParser() - parser.add_argument('--log-dir', - help='where to log output') -+ parser.add_argument('--work-dir', required=True, -+ help='where to put temporary files') - - parser.add_argument('ostree_repo', metavar='OSTREE_REPO', - help='where to put the ostree repo') -diff --git a/pungi/phases/ostree.py b/pungi/phases/ostree.py -index 810716e..77e4838 100644 ---- a/pungi/phases/ostree.py -+++ b/pungi/phases/ostree.py -@@ -51,9 +51,11 @@ class OSTreeThread(WorkerThread): - self.pool.log_info('[DONE ] %s' % msg) - - def _run_ostree_cmd(self, compose, variant, arch, config, source_repo): -+ workdir = os.path.join(compose.paths.work.topdir(arch), 'ostree') - cmd = [ - 'pungi-make-ostree', - '--log-dir={}'.format(self.logdir), -+ '--work-dir={}'.format(workdir), - '--treefile={}'.format(config['treefile']), - '--config-url={}'.format(config['config_url']), - '--config-branch={}'.format(config.get('config_branch', 'master')), -diff --git a/tests/test_ostree_phase.py b/tests/test_ostree_phase.py -index 9f8fdf1..7617dde 100755 ---- a/tests/test_ostree_phase.py -+++ b/tests/test_ostree_phase.py -@@ -103,6 +103,7 @@ class OSTreeThreadTest(helpers.PungiTestCase): - [mock.call('rrt', 'x86_64', - ['pungi-make-ostree', - '--log-dir={}/logs/x86_64/ostree'.format(self.topdir), -+ '--work-dir={}/work/x86_64/ostree'.format(self.topdir), - '--treefile=fedora-atomic-docker-host.json', - '--config-url=https://git.fedorahosted.org/git/fedora-atomic.git', - '--config-branch=f24', -diff --git a/tests/test_ostree_script.py b/tests/test_ostree_script.py -index 744af4d..7b59680 100755 ---- a/tests/test_ostree_script.py -+++ b/tests/test_ostree_script.py -@@ -21,17 +21,16 @@ class OstreeScriptTest(helpers.PungiTestCase): - helpers.touch(os.path.join(target, 'fedora-atomic-docker-host.json')) - helpers.touch(os.path.join(target, 'fedora-rawhide.repo')) - -- @mock.patch('tempfile.mkdtemp') - @mock.patch('kobo.shortcuts.run') - @mock.patch('pungi.wrappers.scm.get_dir_from_scm') -- def test_full_run(self, get_dir_from_scm, run, tempfile): -- tempfile.return_value = self.topdir -+ def test_full_run(self, get_dir_from_scm, run): - get_dir_from_scm.side_effect = self._dummy_config_repo - - repo = os.path.join(self.topdir, 'atomic') - - ostree.main([ - '--log-dir={}'.format(os.path.join(self.topdir, 'logs', 'Atomic')), -+ '--work-dir={}'.format(self.topdir), - '--treefile={}'.format('fedora-atomic-docker-host.json'), - '--config-url=https://git.fedorahosted.org/git/fedora-atomic.git', - '--config-branch=f24', -@@ -47,10 +46,10 @@ class OstreeScriptTest(helpers.PungiTestCase): - self.assertItemsEqual( - run.call_args_list, - [mock.call(['ostree', 'init', '--repo={}'.format(repo), '--mode=archive-z2'], -- logfile=self.topdir + '/logs/Atomic/init-ostree-repo.log'), -+ logfile=self.topdir + '/logs/Atomic/init-ostree-repo.log', show_cmd=True), - mock.call(['rpm-ostree', 'compose', 'tree', '--repo={}'.format(repo), - self.topdir + '/config_repo/fedora-atomic-docker-host.json'], -- logfile=self.topdir + '/logs/Atomic/create-ostree-repo.log')]) -+ logfile=self.topdir + '/logs/Atomic/create-ostree-repo.log', show_cmd=True)]) - - - if __name__ == '__main__': --- -2.7.3 - diff --git a/c52cb198c5ffc0593720c927f469793bedb3d4a4.patch b/c52cb198c5ffc0593720c927f469793bedb3d4a4.patch deleted file mode 100644 index e504d7ff..00000000 --- a/c52cb198c5ffc0593720c927f469793bedb3d4a4.patch +++ /dev/null @@ -1,54 +0,0 @@ -From c52cb198c5ffc0593720c927f469793bedb3d4a4 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Mar 16 2016 22:03:33 +0000 -Subject: Fix locations of ppc lorax templates for PowerPC iso creation - - -PowerPC needs a mapping file for iso creation, with lorax moving the -templates locations in 24+ we need to update this so runroot iso -creation doesn't fail. - -Signed-off-by: Peter Robinson - ---- - -diff --git a/pungi/gather.py b/pungi/gather.py -index 2e5048c..c27070f 100644 ---- a/pungi/gather.py -+++ b/pungi/gather.py -@@ -1590,7 +1590,7 @@ class Pungi(PungiBase): - return - - isolist = [] -- ppcbootinfo = '/usr/share/lorax/config_files/ppc' -+ ppcbootinfo = '/usr/share/lorax/templates.d/99-generic/config_files/ppc' - - pungi.util._ensuredir(self.isodir, self.logger, - force=self.config.getboolean('pungi', 'force'), -diff --git a/pungi/phases/createiso.py b/pungi/phases/createiso.py -index f88b20d..eab3133 100644 ---- a/pungi/phases/createiso.py -+++ b/pungi/phases/createiso.py -@@ -142,7 +142,7 @@ class CreateisoPhase(PhaseBase): - buildinstall_method = self.compose.conf["buildinstall_method"] - if buildinstall_method == "lorax": - # TODO: $arch instead of ppc -- mkisofs_kwargs["boot_args"] = iso.get_boot_options(arch, "/usr/share/lorax/config_files/ppc") -+ mkisofs_kwargs["boot_args"] = iso.get_boot_options(arch, "/usr/share/lorax/templates.d/99-generic/config_files/ppc") - elif buildinstall_method == "buildinstall": - mkisofs_kwargs["boot_args"] = iso.get_boot_options(arch, "/usr/lib/anaconda-runtime/boot") - -diff --git a/pungi/phases/product_img.py b/pungi/phases/product_img.py -index 687d261..8da4e23 100644 ---- a/pungi/phases/product_img.py -+++ b/pungi/phases/product_img.py -@@ -230,7 +230,7 @@ def rebuild_boot_iso(compose, arch, variant, package_sets): - boot_files = None - if buildinstall_method == "lorax": - # TODO: $arch instead of ppc -- mkisofs_kwargs["boot_args"] = iso.get_boot_options(arch, "/usr/share/lorax/config_files/ppc") -+ mkisofs_kwargs["boot_args"] = iso.get_boot_options(arch, "/usr/share/lorax/templates.d/99-generic/config_files/ppc") - elif buildinstall_method == "buildinstall": - boot_files = explode_anaconda(compose, arch, variant, package_sets) - mkisofs_kwargs["boot_args"] = iso.get_boot_options(arch, boot_files) - diff --git a/pungi.spec b/pungi.spec index 831434e8..5bf60c2e 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,20 +1,12 @@ Name: pungi -Version: 4.1.1 -Release: 3%{?dist} +Version: 4.1.2 +Release: 1%{?dist} Summary: Distribution compose tool Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi Source0: https://fedorahosted.org/pungi/attachment/wiki/%{version}/%{name}-%{version}.tar.bz2 -Patch0: 0001-checksum-Add-arch-to-file-name.patch -Patch1: 0002-atomic-Stop-creating-the-os-directory.patch -Patch2: 0003-ostree-Fix-call-to-kobo.shortcuts.run.patch -Patch3: 0004-ostree-Move-cloning-config-repo-to-chroot.patch -Patch4: 0005-ostree-Rename-atomic-to-ostree.patch -Patch5: 0006-ostree-Use-explicit-work-directory.patch -# bandaid for https://pagure.io/pungi/issue/231 until we get things fixed properly upstream -Patch6: c52cb198c5ffc0593720c927f469793bedb3d4a4.patch BuildRequires: python-nose, python-nose-cov, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd @@ -56,13 +48,6 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %prep %setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 %build %{__python} setup.py build @@ -96,6 +81,19 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Wed Apr 05 2016 Dennis Gilmore - 4.1.2-1 +- Merge #257 `[ostree] Enable marking ostree phase as failable` (ausil) +- [ostree] Enable marking ostree phase as failable (lsedlar) +- [koji-wrapper] Initialize wrappers sequentially (lsedlar) +- [createiso] Simplify code, test phase (lsedlar) +- [createiso] Move runroot work to separate script (lsedlar) +- [ostree] Use explicit work directory (lsedlar) +- [ostree] Rename atomic to ostree (lsedlar) +- [ostree] Move cloning config repo to chroot (lsedlar) +- [ostree] Fix call to kobo.shortcuts.run (lsedlar) +- [atomic] Stop creating the os directory (lsedlar) +- [checksum] Add arch to file name (lsedlar) + * Tue Apr 05 2016 Dennis Gilmore - 4.1.1-3 - add some more ostree fixes - add a bandaid for ppc until we get a proper fix diff --git a/sources b/sources index 638b8c75..59ad149d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b53d104d3e4455cb1cf98c790e8d0ca1 pungi-4.1.1.tar.bz2 +4b63f8b87a43da6f3946f537c7b2f83c pungi-4.1.2.tar.bz2 From 05244c6bf9a0fc136f3a1741a5abcae460055786 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 6 Apr 2016 19:37:57 -0500 Subject: [PATCH 38/78] upload fixed tarball Signed-off-by: Dennis Gilmore --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 59ad149d..04365550 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4b63f8b87a43da6f3946f537c7b2f83c pungi-4.1.2.tar.bz2 +a3eb06514a58ff27308ae9fa6532dcf7 pungi-4.1.2.tar.bz2 From 08ace1313914d6ce26b5ca3f3c42c0482ba2e267 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 7 Apr 2016 16:01:12 -0500 Subject: [PATCH 39/78] make sure that the shebang of pungi-pylorax-find-templates is python3 Signed-off-by: Dennis Gilmore --- pungi.spec | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pungi.spec b/pungi.spec index 5bf60c2e..12ebf48a 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.1.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distribution compose tool Group: Development/Tools @@ -59,10 +59,12 @@ make man gzip _build/man/pungi.1 %install -%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT -%{__install} -d $RPM_BUILD_ROOT/var/cache/pungi -%{__install} -d $RPM_BUILD_ROOT%{_mandir}/man1 -%{__install} doc/_build/man/pungi.1.gz $RPM_BUILD_ROOT%{_mandir}/man1 +%{__python} setup.py install -O1 --skip-build --root %{buildroot} +%{__install} -d %{buildroot}/var/cache/pungi +%{__install} -d %{buildroot}%{_mandir}/man1 +%{__install} doc/_build/man/pungi.1.gz %{buildroot}%{_mandir}/man1 +# this script has to be run by python3 and setup.py is too dumb +sed -i 's|/usr/bin/python$|/usr/bin/python3|' %{buildroot}/%{_bindir}/pungi-pylorax-find-templates %check ./tests/data/specs/build.sh @@ -81,6 +83,9 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Thu Apr 06 2016 Dennis Gilmore - 4.1.2-2 +- make sure that the shebang of pungi-pylorax-find-templates is python3 + * Wed Apr 05 2016 Dennis Gilmore - 4.1.2-1 - Merge #257 `[ostree] Enable marking ostree phase as failable` (ausil) - [ostree] Enable marking ostree phase as failable (lsedlar) From 684d9d06eb8b1b31fe8f88292f3aa4864beb16e2 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 8 Apr 2016 08:45:42 -0500 Subject: [PATCH 40/78] enable the compose test (dennis) - [ostree-installer] Copy all lorax outputs (lsedlar) - [ostree] Log to stdout as well (lsedlar) - [ostree-installer] Use separate directory for logs (lsedlar) - Merge #260 `Maybe fix ostree?` (ausil) - [ostree-installer] Put lorax output into work dir (lsedlar) - [ostree] Add test check for modified repo baseurl (lsedlar) - [ostree] Move cloning repo back to compose box (lsedlar) - [ostree] Mount ostree directory in koji (lsedlar) Signed-off-by: Dennis Gilmore --- pungi.spec | 15 +++++++++++++-- sources | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/pungi.spec b/pungi.spec index 12ebf48a..7ac9afa0 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi -Version: 4.1.2 -Release: 2%{?dist} +Version: 4.1.3 +Release: 1%{?dist} Summary: Distribution compose tool Group: Development/Tools @@ -83,6 +83,17 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Fri Apr 08 2016 Dennis Gilmore - 4.1.3-1 +- enable the compose test (dennis) +- [ostree-installer] Copy all lorax outputs (lsedlar) +- [ostree] Log to stdout as well (lsedlar) +- [ostree-installer] Use separate directory for logs (lsedlar) +- Merge #260 `Maybe fix ostree?` (ausil) +- [ostree-installer] Put lorax output into work dir (lsedlar) +- [ostree] Add test check for modified repo baseurl (lsedlar) +- [ostree] Move cloning repo back to compose box (lsedlar) +- [ostree] Mount ostree directory in koji (lsedlar) + * Thu Apr 06 2016 Dennis Gilmore - 4.1.2-2 - make sure that the shebang of pungi-pylorax-find-templates is python3 diff --git a/sources b/sources index 04365550..ea55aff5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a3eb06514a58ff27308ae9fa6532dcf7 pungi-4.1.2.tar.bz2 +433f1fd9b0d039d6b478eb8a5ce3b5e4 pungi-4.1.3.tar.bz2 From 16b5af464003a3744638aafee812f8f1e9011db5 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Mon, 11 Apr 2016 12:27:19 -0500 Subject: [PATCH 41/78] add patch to print more info for missing rpms - add patch to clone repo with extra lorax templates for ostree_installer Signed-off-by: Dennis Gilmore --- ...-installer-Clone-repo-with-templates.patch | 260 ++++++++++++++++++ ...e-detailed-logs-when-rpm-is-not-foun.patch | 56 ++++ pungi.spec | 10 +- 3 files changed, 325 insertions(+), 1 deletion(-) create mode 100644 0001-ostree-installer-Clone-repo-with-templates.patch create mode 100644 0002-pkgset-Print-more-detailed-logs-when-rpm-is-not-foun.patch diff --git a/0001-ostree-installer-Clone-repo-with-templates.patch b/0001-ostree-installer-Clone-repo-with-templates.patch new file mode 100644 index 00000000..a53b2cf7 --- /dev/null +++ b/0001-ostree-installer-Clone-repo-with-templates.patch @@ -0,0 +1,260 @@ +From a696eb4f3ada1f6872dc6967f61bf8af905ab107 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Mon, 11 Apr 2016 10:25:10 +0200 +Subject: [PATCH 1/2] [ostree-installer] Clone repo with templates +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +We can't assume the templates will just be available. This patch adds a +configuration option to point to the git repo with them. It will be +cloned at compose box and relative paths to templates will be made +absolute respective to this clone. + +Signed-off-by: Lubomír Sedlář +--- + doc/configuration.rst | 13 +++- + pungi/phases/ostree_installer.py | 30 ++++++++- + tests/test_ostree_installer_phase.py | 117 +++++++++++++++++++++++++++++++++++ + 3 files changed, 155 insertions(+), 5 deletions(-) + +diff --git a/doc/configuration.rst b/doc/configuration.rst +index ff26b44..94704ae 100644 +--- a/doc/configuration.rst ++++ b/doc/configuration.rst +@@ -1005,6 +1005,13 @@ an OSTree repository. This always runs in Koji as a ``runroot`` task. + * ``add_arch_template`` -- (*[str]*) + * ``add_template_var`` -- (*[str]*) + * ``add_arch_template_var`` -- (*[str]*) ++ * ``template_repo`` -- (*str*) Git repository with extra templates. ++ * ``template_branch`` -- (*str*) Branch to use from ``template_repo``. ++ ++ The templates can either be absolute paths, in which case they will be used ++ as configured; or they can be relative paths, in which case ++ ``template_repo`` needs to point to a Git repository from which to take the ++ templates. + + + Example config +@@ -1018,17 +1025,19 @@ Example config + "release": None, + "filename": "%(release_short)s-%(variant)s-%(arch)s-%(version)s-%(compose_date)s.iso", + "installpkgs": ["fedora-productimg-atomic"], +- "add_template": ["/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl"], ++ "add_template": ["atomic-installer/lorax-configure-repo.tmpl"], + "add_template_var": [ + "ostree_osname=fedora-atomic", + "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", + ], +- "add_arch_template": ["/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl"], ++ "add_arch_template": ["atomic-installer/lorax-embed-repo.tmpl"], + "add_arch_template_var": [ + "ostree_repo=https://kojipkgs.fedoraproject.org/compose/atomic/Rawhide/", + "ostree_osname=fedora-atomic", + "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", + ] ++ 'template_repo': 'https://git.fedorahosted.org/git/spin-kickstarts.git', ++ 'template_branch': 'f24', + } + }) + ] +diff --git a/pungi/phases/ostree_installer.py b/pungi/phases/ostree_installer.py +index c73bbea..7399874 100644 +--- a/pungi/phases/ostree_installer.py ++++ b/pungi/phases/ostree_installer.py +@@ -10,7 +10,7 @@ from kobo import shortcuts + from .base import ConfigGuardedPhase + from .. import util + from ..paths import translate_path +-from ..wrappers import kojiwrapper, iso, lorax ++from ..wrappers import kojiwrapper, iso, lorax, scm + + + class OstreeInstallerPhase(ConfigGuardedPhase): +@@ -56,6 +56,9 @@ class OstreeInstallerThread(WorkerThread): + output_dir = os.path.join(compose.paths.work.topdir(arch), variant.uid, 'ostree_installer') + util.makedirs(os.path.dirname(output_dir)) + ++ self.template_dir = os.path.join(compose.paths.work.topdir(arch), variant.uid, 'lorax_templates') ++ self._clone_templates(config.get('template_repo'), config.get('template_branch')) ++ + self._run_ostree_cmd(compose, variant, arch, config, source_repo, output_dir) + + disc_type = compose.conf.get('disc_types', {}).get('dvd', 'dvd') +@@ -65,6 +68,13 @@ class OstreeInstallerThread(WorkerThread): + self._add_to_manifest(compose, variant, arch, filename) + self.pool.log_info('[DONE ] %s' % msg) + ++ def _clone_templates(self, url, branch='master'): ++ if not url: ++ self.template_dir = None ++ return ++ scm.get_dir_from_scm({'scm': 'git', 'repo': url, 'branch': branch, 'dir': '.'}, ++ self.template_dir, logger=self.pool._logger) ++ + def _get_release(self, compose, config): + if 'release' in config and config['release'] is None: + return compose.image_release +@@ -105,6 +115,20 @@ class OstreeInstallerThread(WorkerThread): + pass + compose.im.add(variant.uid, arch, img) + ++ def _get_templates(self, config, key): ++ """Retrieve all templates from configuration and make sure the paths ++ are absolute. Raises RuntimeError if template repo is needed but not ++ configured. ++ """ ++ templates = [] ++ for template in config.get(key, []): ++ if template[0] != '/': ++ if not self.template_dir: ++ raise RuntimeError('Relative path to template without setting template_repo.') ++ template = os.path.join(self.template_dir, template) ++ templates.append(template) ++ return templates ++ + def _run_ostree_cmd(self, compose, variant, arch, config, source_repo, output_dir): + lorax_wrapper = lorax.LoraxWrapper() + cmd = lorax_wrapper.get_lorax_cmd( +@@ -116,8 +140,8 @@ class OstreeInstallerThread(WorkerThread): + variant=variant.uid, + nomacboot=True, + buildinstallpackages=config.get('installpkgs'), +- add_template=config.get('add_template'), +- add_arch_template=config.get('add_arch_template'), ++ add_template=self._get_templates(config, 'add_template'), ++ add_arch_template=self._get_templates(config, 'add_arch_template'), + add_template_var=config.get('add_template_var'), + add_arch_template_var=config.get('add_arch_template_var') + ) +diff --git a/tests/test_ostree_installer_phase.py b/tests/test_ostree_installer_phase.py +index 6a8205c..7007a3f 100644 +--- a/tests/test_ostree_installer_phase.py ++++ b/tests/test_ostree_installer_phase.py +@@ -172,6 +172,123 @@ class OstreeThreadTest(helpers.PungiTestCase): + @mock.patch('pungi.wrappers.iso.IsoWrapper') + @mock.patch('os.link') + @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') ++ def test_fail_with_relative_template_path_but_no_repo(self, KojiWrapper, link, ++ IsoWrapper, get_file_size, ++ get_mtime, ImageCls, run): ++ compose = helpers.DummyCompose(self.topdir, { ++ 'release_name': 'Fedora', ++ 'release_version': 'Rawhide', ++ 'koji_profile': 'koji', ++ 'runroot_tag': 'rrt', ++ }) ++ pool = mock.Mock() ++ cfg = { ++ 'source_repo_from': 'Everything', ++ 'release': '20160321.n.0', ++ 'filename': 'Fedora-Atomic.iso', ++ 'add_template': ['some-file.txt'], ++ } ++ koji = KojiWrapper.return_value ++ koji.run_runroot_cmd.return_value = { ++ 'task_id': 1234, ++ 'retcode': 0, ++ 'output': 'Foo bar\n', ++ } ++ get_file_size.return_value = 1024 ++ get_mtime.return_value = 13579 ++ ++ t = ostree.OstreeInstallerThread(pool) ++ ++ with self.assertRaises(RuntimeError) as ctx: ++ t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) ++ ++ self.assertIn('template_repo', str(ctx.exception)) ++ ++ @mock.patch('pungi.wrappers.scm.get_dir_from_scm') ++ @mock.patch('kobo.shortcuts.run') ++ @mock.patch('productmd.images.Image') ++ @mock.patch('pungi.util.get_mtime') ++ @mock.patch('pungi.util.get_file_size') ++ @mock.patch('pungi.wrappers.iso.IsoWrapper') ++ @mock.patch('os.link') ++ @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') ++ def test_run_clone_templates(self, KojiWrapper, link, IsoWrapper, ++ get_file_size, get_mtime, ImageCls, run, ++ get_dir_from_scm): ++ compose = helpers.DummyCompose(self.topdir, { ++ 'release_name': 'Fedora', ++ 'release_version': 'Rawhide', ++ 'koji_profile': 'koji', ++ 'runroot_tag': 'rrt', ++ }) ++ pool = mock.Mock() ++ cfg = { ++ 'source_repo_from': 'Everything', ++ 'release': '20160321.n.0', ++ 'filename': 'Fedora-Atomic.iso', ++ 'add_template': ['some_file.txt'], ++ 'add_arch_template': ['other_file.txt'], ++ 'template_repo': 'git://example.com/templates.git', ++ 'template_branch': 'f24', ++ } ++ koji = KojiWrapper.return_value ++ koji.run_runroot_cmd.return_value = { ++ 'task_id': 1234, ++ 'retcode': 0, ++ 'output': 'Foo bar\n', ++ } ++ get_file_size.return_value = 1024 ++ get_mtime.return_value = 13579 ++ final_iso_path = self.topdir + '/compose/Everything/x86_64/iso/image-name' ++ templ_dir = self.topdir + '/work/x86_64/Everything/lorax_templates' ++ ++ t = ostree.OstreeInstallerThread(pool) ++ ++ t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) ++ ++ self.assertEqual(get_dir_from_scm.call_args_list, ++ [mock.call({'scm': 'git', 'repo': 'git://example.com/templates.git', ++ 'branch': 'f24', 'dir': '.'}, ++ templ_dir, logger=pool._logger)]) ++ self.assertEqual(koji.get_runroot_cmd.call_args_list, ++ [mock.call('rrt', 'x86_64', ++ ['lorax', ++ '--product=Fedora', ++ '--version=Rawhide', ++ '--release=20160321.n.0', ++ '--source=file://{}/compose/Everything/x86_64/os'.format(self.topdir), ++ '--variant=Everything', ++ '--nomacboot', ++ '--add-template={}/some_file.txt'.format(templ_dir), ++ '--add-arch-template={}/other_file.txt'.format(templ_dir), ++ self.topdir + '/work/x86_64/Everything/ostree_installer'], ++ channel=None, mounts=[self.topdir], ++ packages=['pungi', 'lorax'], ++ task_id=True, use_shell=True)]) ++ self.assertEqual(koji.run_runroot_cmd.call_args_list, ++ [mock.call(koji.get_runroot_cmd.return_value, ++ log_file=self.topdir + '/logs/x86_64/ostree_installer/runroot.log')]) ++ self.assertEqual(link.call_args_list, ++ [mock.call(self.topdir + '/work/x86_64/Everything/ostree_installer/images/boot.iso', ++ final_iso_path)]) ++ self.assertEqual(get_file_size.call_args_list, [mock.call(final_iso_path)]) ++ self.assertEqual(get_mtime.call_args_list, [mock.call(final_iso_path)]) ++ self.assertImageAdded(compose, ImageCls, IsoWrapper) ++ self.assertEqual(compose.get_image_name.call_args_list, ++ [mock.call('x86_64', compose.variants['Everything'], ++ disc_type='dvd', format='Fedora-Atomic.iso')]) ++ self.assertTrue(os.path.isdir(self.topdir + '/work/x86_64/Everything/')) ++ self.assertFalse(os.path.isdir(self.topdir + '/work/x86_64/Everything/ostree_installer')) ++ self.assertEqual(run.call_args_list, ++ [mock.call('cp -av {0}/work/x86_64/Everything/ostree_installer/* {0}/compose/Everything/x86_64/iso/'.format(self.topdir))]) ++ ++ @mock.patch('kobo.shortcuts.run') ++ @mock.patch('productmd.images.Image') ++ @mock.patch('pungi.util.get_mtime') ++ @mock.patch('pungi.util.get_file_size') ++ @mock.patch('pungi.wrappers.iso.IsoWrapper') ++ @mock.patch('os.link') ++ @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') + def test_run_with_implicit_release(self, KojiWrapper, link, IsoWrapper, + get_file_size, get_mtime, ImageCls, run): + compose = helpers.DummyCompose(self.topdir, { +-- +2.7.3 + diff --git a/0002-pkgset-Print-more-detailed-logs-when-rpm-is-not-foun.patch b/0002-pkgset-Print-more-detailed-logs-when-rpm-is-not-foun.patch new file mode 100644 index 00000000..3f0f6378 --- /dev/null +++ b/0002-pkgset-Print-more-detailed-logs-when-rpm-is-not-foun.patch @@ -0,0 +1,56 @@ +From 31d922692f20e67a08e51b0cb8e6840e1db547a1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Mon, 11 Apr 2016 15:34:26 +0200 +Subject: [PATCH 2/2] [pkgset] Print more detailed logs when rpm is not found +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes: #265 +Signed-off-by: Lubomír Sedlář +--- + pungi/phases/pkgset/pkgsets.py | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/pungi/phases/pkgset/pkgsets.py b/pungi/phases/pkgset/pkgsets.py +index 834fe31..adc2d07 100644 +--- a/pungi/phases/pkgset/pkgsets.py ++++ b/pungi/phases/pkgset/pkgsets.py +@@ -225,12 +225,14 @@ class KojiPackageSet(PackageSetBase): + rpm_path = None + found = False + pathinfo = self.koji_wrapper.koji_module.pathinfo ++ paths = [] + for sigkey in self.sigkey_ordering: + if sigkey is None: + # we're looking for *signed* copies here + continue + sigkey = sigkey.lower() + rpm_path = os.path.join(pathinfo.build(build_info), pathinfo.signed(rpm_info, sigkey)) ++ paths.append(rpm_path) + if os.path.isfile(rpm_path): + found = True + break +@@ -239,14 +241,17 @@ class KojiPackageSet(PackageSetBase): + if None in self.sigkey_ordering: + # use an unsigned copy (if allowed) + rpm_path = os.path.join(pathinfo.build(build_info), pathinfo.rpm(rpm_info)) ++ paths.append(rpm_path) + if os.path.isfile(rpm_path): + found = True + else: + # or raise an exception +- raise RuntimeError("RPM %s not found for sigs: %s" % (rpm_info, self.sigkey_ordering)) ++ raise RuntimeError("RPM %s not found for sigs: %s. Paths checked: %s" ++ % (rpm_info, self.sigkey_ordering, paths)) + + if not found: +- raise RuntimeError("Package not found: %s" % rpm_info) ++ raise RuntimeError("Package not found: %s. Paths checked: %s" ++ % (rpm_info, paths)) + return rpm_path + + def populate(self, tag, event=None, inherit=True): +-- +2.7.3 + diff --git a/pungi.spec b/pungi.spec index 7ac9afa0..7d878c18 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,12 +1,14 @@ Name: pungi Version: 4.1.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distribution compose tool Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi Source0: https://fedorahosted.org/pungi/attachment/wiki/%{version}/%{name}-%{version}.tar.bz2 +Patch0: 0001-ostree-installer-Clone-repo-with-templates.patch +Patch1: 0002-pkgset-Print-more-detailed-logs-when-rpm-is-not-foun.patch BuildRequires: python-nose, python-nose-cov, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd @@ -48,6 +50,8 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %prep %setup -q +%patch0 -p1 +%patch1 -p1 %build %{__python} setup.py build @@ -83,6 +87,10 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Mon Apr 11 2016 Dennis Gilmore - 4.1.3-2 +- add patch to print more info for missing rpms +- add patch to clone repo with extra lorax templates for ostree_installer + * Fri Apr 08 2016 Dennis Gilmore - 4.1.3-1 - enable the compose test (dennis) - [ostree-installer] Copy all lorax outputs (lsedlar) From f90d62ae7184d97d0d6c96004c9ecc373de5e190 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 12 Apr 2016 11:16:08 -0500 Subject: [PATCH 42/78] add patch to install ostree in the ostree_installer runroot Signed-off-by: Dennis Gilmore --- ...-installer-Install-ostree-in-runroot.patch | 61 +++++++++++++++++++ pungi.spec | 7 ++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 0001-ostree-installer-Install-ostree-in-runroot.patch diff --git a/0001-ostree-installer-Install-ostree-in-runroot.patch b/0001-ostree-installer-Install-ostree-in-runroot.patch new file mode 100644 index 00000000..adb3cf98 --- /dev/null +++ b/0001-ostree-installer-Install-ostree-in-runroot.patch @@ -0,0 +1,61 @@ +From ad32b73918961170126f1af7f1c385f7542f536d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Tue, 12 Apr 2016 12:45:28 +0200 +Subject: [PATCH] [ostree-installer] Install ostree in runroot +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Lubomír Sedlář +--- + pungi/phases/ostree_installer.py | 2 +- + tests/test_ostree_installer_phase.py | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/pungi/phases/ostree_installer.py b/pungi/phases/ostree_installer.py +index 7399874..934c304 100644 +--- a/pungi/phases/ostree_installer.py ++++ b/pungi/phases/ostree_installer.py +@@ -149,7 +149,7 @@ class OstreeInstallerThread(WorkerThread): + runroot_channel = compose.conf.get("runroot_channel", None) + runroot_tag = compose.conf["runroot_tag"] + +- packages = ['pungi', 'lorax'] ++ packages = ['pungi', 'lorax', 'ostree'] + log_file = os.path.join(self.logdir, 'runroot.log') + koji = kojiwrapper.KojiWrapper(compose.conf["koji_profile"]) + koji_cmd = koji.get_runroot_cmd(runroot_tag, arch, cmd, +diff --git a/tests/test_ostree_installer_phase.py b/tests/test_ostree_installer_phase.py +index 7007a3f..34489a7 100644 +--- a/tests/test_ostree_installer_phase.py ++++ b/tests/test_ostree_installer_phase.py +@@ -146,7 +146,7 @@ class OstreeThreadTest(helpers.PungiTestCase): + '--nomacboot', + self.topdir + '/work/x86_64/Everything/ostree_installer'], + channel=None, mounts=[self.topdir], +- packages=['pungi', 'lorax'], ++ packages=['pungi', 'lorax', 'ostree'], + task_id=True, use_shell=True)]) + self.assertEqual(koji.run_runroot_cmd.call_args_list, + [mock.call(koji.get_runroot_cmd.return_value, +@@ -263,7 +263,7 @@ class OstreeThreadTest(helpers.PungiTestCase): + '--add-arch-template={}/other_file.txt'.format(templ_dir), + self.topdir + '/work/x86_64/Everything/ostree_installer'], + channel=None, mounts=[self.topdir], +- packages=['pungi', 'lorax'], ++ packages=['pungi', 'lorax', 'ostree'], + task_id=True, use_shell=True)]) + self.assertEqual(koji.run_runroot_cmd.call_args_list, + [mock.call(koji.get_runroot_cmd.return_value, +@@ -347,7 +347,7 @@ class OstreeThreadTest(helpers.PungiTestCase): + '--add-arch-template-var=ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host', + self.topdir + '/work/x86_64/Everything/ostree_installer'], + channel=None, mounts=[self.topdir], +- packages=['pungi', 'lorax'], ++ packages=['pungi', 'lorax', 'ostree'], + task_id=True, use_shell=True)]) + self.assertEqual(koji.run_runroot_cmd.call_args_list, + [mock.call(koji.get_runroot_cmd.return_value, +-- +2.7.3 + diff --git a/pungi.spec b/pungi.spec index 7d878c18..742dd849 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.1.3 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Distribution compose tool Group: Development/Tools @@ -9,6 +9,7 @@ URL: https://pagure.io/pungi Source0: https://fedorahosted.org/pungi/attachment/wiki/%{version}/%{name}-%{version}.tar.bz2 Patch0: 0001-ostree-installer-Clone-repo-with-templates.patch Patch1: 0002-pkgset-Print-more-detailed-logs-when-rpm-is-not-foun.patch +Patch2: 0001-ostree-installer-Install-ostree-in-runroot.patch BuildRequires: python-nose, python-nose-cov, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd @@ -52,6 +53,7 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build %{__python} setup.py build @@ -87,6 +89,9 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Tue Apr 12 2016 Dennis Gilmore - 4.1.3-3 +- add patch to install ostree in the ostree_installer runroot + * Mon Apr 11 2016 Dennis Gilmore - 4.1.3-2 - add patch to print more info for missing rpms - add patch to clone repo with extra lorax templates for ostree_installer From 7668cbfc4d30bc76ced9edd50f62a2c202bc8f23 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 29 Apr 2016 15:39:02 -0500 Subject: [PATCH 43/78] Merge #273 `Deduplicate configuration a bit` (dennis) - Merge #280 `[createrepo] Use more verbose output` (dennis) - Merge #283 `Pungi should log when it tries to publish notifications.` (dennis) - [createiso] Add back running isohybrid on x86 disk images (dennis) - [createiso] Remove chdir() (lsedlar) - [pkgset] Fix caching RPMs (lsedlar) - [createrepo] Use more verbose output (lsedlar) - Pungi should log when it tries to publish notifications. (rbean) - [pkgset] Use context manager for opening file list (lsedlar) - [pkgset] Add tests for writing filelists (lsedlar) - [pkgset] Simplify finding RPM in koji buildroot (lsedlar) - [pkgset] Clean up koji package set (lsedlar) - [pkgset] Add test for pkgset merging (lsedlar) - [pkgset] Add tests for KojiPackageSet (lsedlar) - [pkgset] Clean up Koji source (lsedlar) - [pkgset] Add tests for Koji source (lsedlar) - Add common global settings for images (lsedlar) - Remove duplicated and dead code (lsedlar) - [live-media] Add check for live_media_version option (lsedlar) - [scm-wrapper] Remove unused method (lsedlar) - [scm-wrapper] Report when file wrapper did not match anything (lsedlar) - [scm-wrapper] Use context manager for managing temp dir (lsedlar) - [scm-wrapper] Reduce code duplication in RPM wrapper (lsedlar) - [scm-wrapper] Copy files directly (lsedlar) - [scm-wrapper] Reduce code duplication (lsedlar) - [scm-wrapper] Add tests for SCM wrappers (lsedlar) - [ostree] Set each repo to point to current compose (lsedlar) - [ostree-installer] Drop filename setting (lsedlar) - Merge #269 `Improve logging of failable deliverables` (ausil) - [ostree-installer] Fix example documentation (lsedlar) - Improve logging of failable deliverables (lsedlar) - [ostree-installer] Install ostree in runroot (lsedlar) - [pkgset] Print more detailed logs when rpm is not found (lsedlar) - [ostree-installer] Clone repo with templates (lsedlar) Signed-off-by: Dennis Gilmore --- ...-installer-Clone-repo-with-templates.patch | 260 ------------------ ...-installer-Install-ostree-in-runroot.patch | 61 ---- ...e-detailed-logs-when-rpm-is-not-foun.patch | 56 ---- pungi.spec | 47 +++- sources | 2 +- 5 files changed, 40 insertions(+), 386 deletions(-) delete mode 100644 0001-ostree-installer-Clone-repo-with-templates.patch delete mode 100644 0001-ostree-installer-Install-ostree-in-runroot.patch delete mode 100644 0002-pkgset-Print-more-detailed-logs-when-rpm-is-not-foun.patch diff --git a/0001-ostree-installer-Clone-repo-with-templates.patch b/0001-ostree-installer-Clone-repo-with-templates.patch deleted file mode 100644 index a53b2cf7..00000000 --- a/0001-ostree-installer-Clone-repo-with-templates.patch +++ /dev/null @@ -1,260 +0,0 @@ -From a696eb4f3ada1f6872dc6967f61bf8af905ab107 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= -Date: Mon, 11 Apr 2016 10:25:10 +0200 -Subject: [PATCH 1/2] [ostree-installer] Clone repo with templates -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -We can't assume the templates will just be available. This patch adds a -configuration option to point to the git repo with them. It will be -cloned at compose box and relative paths to templates will be made -absolute respective to this clone. - -Signed-off-by: Lubomír Sedlář ---- - doc/configuration.rst | 13 +++- - pungi/phases/ostree_installer.py | 30 ++++++++- - tests/test_ostree_installer_phase.py | 117 +++++++++++++++++++++++++++++++++++ - 3 files changed, 155 insertions(+), 5 deletions(-) - -diff --git a/doc/configuration.rst b/doc/configuration.rst -index ff26b44..94704ae 100644 ---- a/doc/configuration.rst -+++ b/doc/configuration.rst -@@ -1005,6 +1005,13 @@ an OSTree repository. This always runs in Koji as a ``runroot`` task. - * ``add_arch_template`` -- (*[str]*) - * ``add_template_var`` -- (*[str]*) - * ``add_arch_template_var`` -- (*[str]*) -+ * ``template_repo`` -- (*str*) Git repository with extra templates. -+ * ``template_branch`` -- (*str*) Branch to use from ``template_repo``. -+ -+ The templates can either be absolute paths, in which case they will be used -+ as configured; or they can be relative paths, in which case -+ ``template_repo`` needs to point to a Git repository from which to take the -+ templates. - - - Example config -@@ -1018,17 +1025,19 @@ Example config - "release": None, - "filename": "%(release_short)s-%(variant)s-%(arch)s-%(version)s-%(compose_date)s.iso", - "installpkgs": ["fedora-productimg-atomic"], -- "add_template": ["/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl"], -+ "add_template": ["atomic-installer/lorax-configure-repo.tmpl"], - "add_template_var": [ - "ostree_osname=fedora-atomic", - "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", - ], -- "add_arch_template": ["/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl"], -+ "add_arch_template": ["atomic-installer/lorax-embed-repo.tmpl"], - "add_arch_template_var": [ - "ostree_repo=https://kojipkgs.fedoraproject.org/compose/atomic/Rawhide/", - "ostree_osname=fedora-atomic", - "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", - ] -+ 'template_repo': 'https://git.fedorahosted.org/git/spin-kickstarts.git', -+ 'template_branch': 'f24', - } - }) - ] -diff --git a/pungi/phases/ostree_installer.py b/pungi/phases/ostree_installer.py -index c73bbea..7399874 100644 ---- a/pungi/phases/ostree_installer.py -+++ b/pungi/phases/ostree_installer.py -@@ -10,7 +10,7 @@ from kobo import shortcuts - from .base import ConfigGuardedPhase - from .. import util - from ..paths import translate_path --from ..wrappers import kojiwrapper, iso, lorax -+from ..wrappers import kojiwrapper, iso, lorax, scm - - - class OstreeInstallerPhase(ConfigGuardedPhase): -@@ -56,6 +56,9 @@ class OstreeInstallerThread(WorkerThread): - output_dir = os.path.join(compose.paths.work.topdir(arch), variant.uid, 'ostree_installer') - util.makedirs(os.path.dirname(output_dir)) - -+ self.template_dir = os.path.join(compose.paths.work.topdir(arch), variant.uid, 'lorax_templates') -+ self._clone_templates(config.get('template_repo'), config.get('template_branch')) -+ - self._run_ostree_cmd(compose, variant, arch, config, source_repo, output_dir) - - disc_type = compose.conf.get('disc_types', {}).get('dvd', 'dvd') -@@ -65,6 +68,13 @@ class OstreeInstallerThread(WorkerThread): - self._add_to_manifest(compose, variant, arch, filename) - self.pool.log_info('[DONE ] %s' % msg) - -+ def _clone_templates(self, url, branch='master'): -+ if not url: -+ self.template_dir = None -+ return -+ scm.get_dir_from_scm({'scm': 'git', 'repo': url, 'branch': branch, 'dir': '.'}, -+ self.template_dir, logger=self.pool._logger) -+ - def _get_release(self, compose, config): - if 'release' in config and config['release'] is None: - return compose.image_release -@@ -105,6 +115,20 @@ class OstreeInstallerThread(WorkerThread): - pass - compose.im.add(variant.uid, arch, img) - -+ def _get_templates(self, config, key): -+ """Retrieve all templates from configuration and make sure the paths -+ are absolute. Raises RuntimeError if template repo is needed but not -+ configured. -+ """ -+ templates = [] -+ for template in config.get(key, []): -+ if template[0] != '/': -+ if not self.template_dir: -+ raise RuntimeError('Relative path to template without setting template_repo.') -+ template = os.path.join(self.template_dir, template) -+ templates.append(template) -+ return templates -+ - def _run_ostree_cmd(self, compose, variant, arch, config, source_repo, output_dir): - lorax_wrapper = lorax.LoraxWrapper() - cmd = lorax_wrapper.get_lorax_cmd( -@@ -116,8 +140,8 @@ class OstreeInstallerThread(WorkerThread): - variant=variant.uid, - nomacboot=True, - buildinstallpackages=config.get('installpkgs'), -- add_template=config.get('add_template'), -- add_arch_template=config.get('add_arch_template'), -+ add_template=self._get_templates(config, 'add_template'), -+ add_arch_template=self._get_templates(config, 'add_arch_template'), - add_template_var=config.get('add_template_var'), - add_arch_template_var=config.get('add_arch_template_var') - ) -diff --git a/tests/test_ostree_installer_phase.py b/tests/test_ostree_installer_phase.py -index 6a8205c..7007a3f 100644 ---- a/tests/test_ostree_installer_phase.py -+++ b/tests/test_ostree_installer_phase.py -@@ -172,6 +172,123 @@ class OstreeThreadTest(helpers.PungiTestCase): - @mock.patch('pungi.wrappers.iso.IsoWrapper') - @mock.patch('os.link') - @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') -+ def test_fail_with_relative_template_path_but_no_repo(self, KojiWrapper, link, -+ IsoWrapper, get_file_size, -+ get_mtime, ImageCls, run): -+ compose = helpers.DummyCompose(self.topdir, { -+ 'release_name': 'Fedora', -+ 'release_version': 'Rawhide', -+ 'koji_profile': 'koji', -+ 'runroot_tag': 'rrt', -+ }) -+ pool = mock.Mock() -+ cfg = { -+ 'source_repo_from': 'Everything', -+ 'release': '20160321.n.0', -+ 'filename': 'Fedora-Atomic.iso', -+ 'add_template': ['some-file.txt'], -+ } -+ koji = KojiWrapper.return_value -+ koji.run_runroot_cmd.return_value = { -+ 'task_id': 1234, -+ 'retcode': 0, -+ 'output': 'Foo bar\n', -+ } -+ get_file_size.return_value = 1024 -+ get_mtime.return_value = 13579 -+ -+ t = ostree.OstreeInstallerThread(pool) -+ -+ with self.assertRaises(RuntimeError) as ctx: -+ t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) -+ -+ self.assertIn('template_repo', str(ctx.exception)) -+ -+ @mock.patch('pungi.wrappers.scm.get_dir_from_scm') -+ @mock.patch('kobo.shortcuts.run') -+ @mock.patch('productmd.images.Image') -+ @mock.patch('pungi.util.get_mtime') -+ @mock.patch('pungi.util.get_file_size') -+ @mock.patch('pungi.wrappers.iso.IsoWrapper') -+ @mock.patch('os.link') -+ @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') -+ def test_run_clone_templates(self, KojiWrapper, link, IsoWrapper, -+ get_file_size, get_mtime, ImageCls, run, -+ get_dir_from_scm): -+ compose = helpers.DummyCompose(self.topdir, { -+ 'release_name': 'Fedora', -+ 'release_version': 'Rawhide', -+ 'koji_profile': 'koji', -+ 'runroot_tag': 'rrt', -+ }) -+ pool = mock.Mock() -+ cfg = { -+ 'source_repo_from': 'Everything', -+ 'release': '20160321.n.0', -+ 'filename': 'Fedora-Atomic.iso', -+ 'add_template': ['some_file.txt'], -+ 'add_arch_template': ['other_file.txt'], -+ 'template_repo': 'git://example.com/templates.git', -+ 'template_branch': 'f24', -+ } -+ koji = KojiWrapper.return_value -+ koji.run_runroot_cmd.return_value = { -+ 'task_id': 1234, -+ 'retcode': 0, -+ 'output': 'Foo bar\n', -+ } -+ get_file_size.return_value = 1024 -+ get_mtime.return_value = 13579 -+ final_iso_path = self.topdir + '/compose/Everything/x86_64/iso/image-name' -+ templ_dir = self.topdir + '/work/x86_64/Everything/lorax_templates' -+ -+ t = ostree.OstreeInstallerThread(pool) -+ -+ t.process((compose, compose.variants['Everything'], 'x86_64', cfg), 1) -+ -+ self.assertEqual(get_dir_from_scm.call_args_list, -+ [mock.call({'scm': 'git', 'repo': 'git://example.com/templates.git', -+ 'branch': 'f24', 'dir': '.'}, -+ templ_dir, logger=pool._logger)]) -+ self.assertEqual(koji.get_runroot_cmd.call_args_list, -+ [mock.call('rrt', 'x86_64', -+ ['lorax', -+ '--product=Fedora', -+ '--version=Rawhide', -+ '--release=20160321.n.0', -+ '--source=file://{}/compose/Everything/x86_64/os'.format(self.topdir), -+ '--variant=Everything', -+ '--nomacboot', -+ '--add-template={}/some_file.txt'.format(templ_dir), -+ '--add-arch-template={}/other_file.txt'.format(templ_dir), -+ self.topdir + '/work/x86_64/Everything/ostree_installer'], -+ channel=None, mounts=[self.topdir], -+ packages=['pungi', 'lorax'], -+ task_id=True, use_shell=True)]) -+ self.assertEqual(koji.run_runroot_cmd.call_args_list, -+ [mock.call(koji.get_runroot_cmd.return_value, -+ log_file=self.topdir + '/logs/x86_64/ostree_installer/runroot.log')]) -+ self.assertEqual(link.call_args_list, -+ [mock.call(self.topdir + '/work/x86_64/Everything/ostree_installer/images/boot.iso', -+ final_iso_path)]) -+ self.assertEqual(get_file_size.call_args_list, [mock.call(final_iso_path)]) -+ self.assertEqual(get_mtime.call_args_list, [mock.call(final_iso_path)]) -+ self.assertImageAdded(compose, ImageCls, IsoWrapper) -+ self.assertEqual(compose.get_image_name.call_args_list, -+ [mock.call('x86_64', compose.variants['Everything'], -+ disc_type='dvd', format='Fedora-Atomic.iso')]) -+ self.assertTrue(os.path.isdir(self.topdir + '/work/x86_64/Everything/')) -+ self.assertFalse(os.path.isdir(self.topdir + '/work/x86_64/Everything/ostree_installer')) -+ self.assertEqual(run.call_args_list, -+ [mock.call('cp -av {0}/work/x86_64/Everything/ostree_installer/* {0}/compose/Everything/x86_64/iso/'.format(self.topdir))]) -+ -+ @mock.patch('kobo.shortcuts.run') -+ @mock.patch('productmd.images.Image') -+ @mock.patch('pungi.util.get_mtime') -+ @mock.patch('pungi.util.get_file_size') -+ @mock.patch('pungi.wrappers.iso.IsoWrapper') -+ @mock.patch('os.link') -+ @mock.patch('pungi.wrappers.kojiwrapper.KojiWrapper') - def test_run_with_implicit_release(self, KojiWrapper, link, IsoWrapper, - get_file_size, get_mtime, ImageCls, run): - compose = helpers.DummyCompose(self.topdir, { --- -2.7.3 - diff --git a/0001-ostree-installer-Install-ostree-in-runroot.patch b/0001-ostree-installer-Install-ostree-in-runroot.patch deleted file mode 100644 index adb3cf98..00000000 --- a/0001-ostree-installer-Install-ostree-in-runroot.patch +++ /dev/null @@ -1,61 +0,0 @@ -From ad32b73918961170126f1af7f1c385f7542f536d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= -Date: Tue, 12 Apr 2016 12:45:28 +0200 -Subject: [PATCH] [ostree-installer] Install ostree in runroot -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Lubomír Sedlář ---- - pungi/phases/ostree_installer.py | 2 +- - tests/test_ostree_installer_phase.py | 6 +++--- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/pungi/phases/ostree_installer.py b/pungi/phases/ostree_installer.py -index 7399874..934c304 100644 ---- a/pungi/phases/ostree_installer.py -+++ b/pungi/phases/ostree_installer.py -@@ -149,7 +149,7 @@ class OstreeInstallerThread(WorkerThread): - runroot_channel = compose.conf.get("runroot_channel", None) - runroot_tag = compose.conf["runroot_tag"] - -- packages = ['pungi', 'lorax'] -+ packages = ['pungi', 'lorax', 'ostree'] - log_file = os.path.join(self.logdir, 'runroot.log') - koji = kojiwrapper.KojiWrapper(compose.conf["koji_profile"]) - koji_cmd = koji.get_runroot_cmd(runroot_tag, arch, cmd, -diff --git a/tests/test_ostree_installer_phase.py b/tests/test_ostree_installer_phase.py -index 7007a3f..34489a7 100644 ---- a/tests/test_ostree_installer_phase.py -+++ b/tests/test_ostree_installer_phase.py -@@ -146,7 +146,7 @@ class OstreeThreadTest(helpers.PungiTestCase): - '--nomacboot', - self.topdir + '/work/x86_64/Everything/ostree_installer'], - channel=None, mounts=[self.topdir], -- packages=['pungi', 'lorax'], -+ packages=['pungi', 'lorax', 'ostree'], - task_id=True, use_shell=True)]) - self.assertEqual(koji.run_runroot_cmd.call_args_list, - [mock.call(koji.get_runroot_cmd.return_value, -@@ -263,7 +263,7 @@ class OstreeThreadTest(helpers.PungiTestCase): - '--add-arch-template={}/other_file.txt'.format(templ_dir), - self.topdir + '/work/x86_64/Everything/ostree_installer'], - channel=None, mounts=[self.topdir], -- packages=['pungi', 'lorax'], -+ packages=['pungi', 'lorax', 'ostree'], - task_id=True, use_shell=True)]) - self.assertEqual(koji.run_runroot_cmd.call_args_list, - [mock.call(koji.get_runroot_cmd.return_value, -@@ -347,7 +347,7 @@ class OstreeThreadTest(helpers.PungiTestCase): - '--add-arch-template-var=ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host', - self.topdir + '/work/x86_64/Everything/ostree_installer'], - channel=None, mounts=[self.topdir], -- packages=['pungi', 'lorax'], -+ packages=['pungi', 'lorax', 'ostree'], - task_id=True, use_shell=True)]) - self.assertEqual(koji.run_runroot_cmd.call_args_list, - [mock.call(koji.get_runroot_cmd.return_value, --- -2.7.3 - diff --git a/0002-pkgset-Print-more-detailed-logs-when-rpm-is-not-foun.patch b/0002-pkgset-Print-more-detailed-logs-when-rpm-is-not-foun.patch deleted file mode 100644 index 3f0f6378..00000000 --- a/0002-pkgset-Print-more-detailed-logs-when-rpm-is-not-foun.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 31d922692f20e67a08e51b0cb8e6840e1db547a1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= -Date: Mon, 11 Apr 2016 15:34:26 +0200 -Subject: [PATCH 2/2] [pkgset] Print more detailed logs when rpm is not found -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Fixes: #265 -Signed-off-by: Lubomír Sedlář ---- - pungi/phases/pkgset/pkgsets.py | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/pungi/phases/pkgset/pkgsets.py b/pungi/phases/pkgset/pkgsets.py -index 834fe31..adc2d07 100644 ---- a/pungi/phases/pkgset/pkgsets.py -+++ b/pungi/phases/pkgset/pkgsets.py -@@ -225,12 +225,14 @@ class KojiPackageSet(PackageSetBase): - rpm_path = None - found = False - pathinfo = self.koji_wrapper.koji_module.pathinfo -+ paths = [] - for sigkey in self.sigkey_ordering: - if sigkey is None: - # we're looking for *signed* copies here - continue - sigkey = sigkey.lower() - rpm_path = os.path.join(pathinfo.build(build_info), pathinfo.signed(rpm_info, sigkey)) -+ paths.append(rpm_path) - if os.path.isfile(rpm_path): - found = True - break -@@ -239,14 +241,17 @@ class KojiPackageSet(PackageSetBase): - if None in self.sigkey_ordering: - # use an unsigned copy (if allowed) - rpm_path = os.path.join(pathinfo.build(build_info), pathinfo.rpm(rpm_info)) -+ paths.append(rpm_path) - if os.path.isfile(rpm_path): - found = True - else: - # or raise an exception -- raise RuntimeError("RPM %s not found for sigs: %s" % (rpm_info, self.sigkey_ordering)) -+ raise RuntimeError("RPM %s not found for sigs: %s. Paths checked: %s" -+ % (rpm_info, self.sigkey_ordering, paths)) - - if not found: -- raise RuntimeError("Package not found: %s" % rpm_info) -+ raise RuntimeError("Package not found: %s. Paths checked: %s" -+ % (rpm_info, paths)) - return rpm_path - - def populate(self, tag, event=None, inherit=True): --- -2.7.3 - diff --git a/pungi.spec b/pungi.spec index 742dd849..f43bb893 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,15 +1,12 @@ Name: pungi -Version: 4.1.3 -Release: 3%{?dist} +Version: 4.1.4 +Release: 1%{?dist} Summary: Distribution compose tool Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi Source0: https://fedorahosted.org/pungi/attachment/wiki/%{version}/%{name}-%{version}.tar.bz2 -Patch0: 0001-ostree-installer-Clone-repo-with-templates.patch -Patch1: 0002-pkgset-Print-more-detailed-logs-when-rpm-is-not-foun.patch -Patch2: 0001-ostree-installer-Install-ostree-in-runroot.patch BuildRequires: python-nose, python-nose-cov, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd @@ -51,9 +48,6 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %prep %setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 %build %{__python} setup.py build @@ -89,6 +83,43 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Fri Apr 29 2016 Dennis Gilmore - 4.1.4-1 +- Merge #273 `Deduplicate configuration a bit` (dennis) +- Merge #280 `[createrepo] Use more verbose output` (dennis) +- Merge #283 `Pungi should log when it tries to publish notifications.` + (dennis) +- [createiso] Add back running isohybrid on x86 disk images (dennis) +- [createiso] Remove chdir() (lsedlar) +- [pkgset] Fix caching RPMs (lsedlar) +- [createrepo] Use more verbose output (lsedlar) +- Pungi should log when it tries to publish notifications. (rbean) +- [pkgset] Use context manager for opening file list (lsedlar) +- [pkgset] Add tests for writing filelists (lsedlar) +- [pkgset] Simplify finding RPM in koji buildroot (lsedlar) +- [pkgset] Clean up koji package set (lsedlar) +- [pkgset] Add test for pkgset merging (lsedlar) +- [pkgset] Add tests for KojiPackageSet (lsedlar) +- [pkgset] Clean up Koji source (lsedlar) +- [pkgset] Add tests for Koji source (lsedlar) +- Add common global settings for images (lsedlar) +- Remove duplicated and dead code (lsedlar) +- [live-media] Add check for live_media_version option (lsedlar) +- [scm-wrapper] Remove unused method (lsedlar) +- [scm-wrapper] Report when file wrapper did not match anything (lsedlar) +- [scm-wrapper] Use context manager for managing temp dir (lsedlar) +- [scm-wrapper] Reduce code duplication in RPM wrapper (lsedlar) +- [scm-wrapper] Copy files directly (lsedlar) +- [scm-wrapper] Reduce code duplication (lsedlar) +- [scm-wrapper] Add tests for SCM wrappers (lsedlar) +- [ostree] Set each repo to point to current compose (lsedlar) +- [ostree-installer] Drop filename setting (lsedlar) +- Merge #269 `Improve logging of failable deliverables` (ausil) +- [ostree-installer] Fix example documentation (lsedlar) +- Improve logging of failable deliverables (lsedlar) +- [ostree-installer] Install ostree in runroot (lsedlar) +- [pkgset] Print more detailed logs when rpm is not found (lsedlar) +- [ostree-installer] Clone repo with templates (lsedlar) + * Tue Apr 12 2016 Dennis Gilmore - 4.1.3-3 - add patch to install ostree in the ostree_installer runroot diff --git a/sources b/sources index ea55aff5..c3aa64f5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -433f1fd9b0d039d6b478eb8a5ce3b5e4 pungi-4.1.3.tar.bz2 +a87a9748bf284c751a583ea5198acf97 pungi-4.1.4.tar.bz2 From e00a72c93b6d0bde99b136bb6f79e2efb270ae46 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 29 Apr 2016 21:12:37 -0500 Subject: [PATCH 44/78] fixed tarball Signed-off-by: Dennis Gilmore --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index c3aa64f5..326f01e1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a87a9748bf284c751a583ea5198acf97 pungi-4.1.4.tar.bz2 +f99681cf108f781bd71885fe87433b5b pungi-4.1.4.tar.bz2 From afad477505ff9ec90899aa2198cdd946e042a39d Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 6 May 2016 16:30:19 -0500 Subject: [PATCH 45/78] add patch to fix caching global ksurl Signed-off-by: Dennis Gilmore --- pungi.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pungi.spec b/pungi.spec index f43bb893..32745734 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,12 +1,13 @@ Name: pungi Version: 4.1.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distribution compose tool Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi Source0: https://fedorahosted.org/pungi/attachment/wiki/%{version}/%{name}-%{version}.tar.bz2 +Patch0: 0001-Fix-caching-global-ksurl.patch BuildRequires: python-nose, python-nose-cov, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd @@ -48,6 +49,7 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %prep %setup -q +%patch0 -p1 %build %{__python} setup.py build @@ -83,6 +85,9 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Fri May 06 2016 Dennis Gilmore - 4.1.4-2 +- add patch to fix caching global ksurl + * Fri Apr 29 2016 Dennis Gilmore - 4.1.4-1 - Merge #273 `Deduplicate configuration a bit` (dennis) - Merge #280 `[createrepo] Use more verbose output` (dennis) From f5fcadc9bb1a2376b25c6a1d8b6d743f195ea0ad Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 6 May 2016 16:34:00 -0500 Subject: [PATCH 46/78] add forgotten patch Signed-off-by: Dennis Gilmore --- 0001-Fix-caching-global-ksurl.patch | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 0001-Fix-caching-global-ksurl.patch diff --git a/0001-Fix-caching-global-ksurl.patch b/0001-Fix-caching-global-ksurl.patch new file mode 100644 index 00000000..c4ad4ada --- /dev/null +++ b/0001-Fix-caching-global-ksurl.patch @@ -0,0 +1,34 @@ +From 5aadf4ac39d85eeee969d7f3edd474e170a0c86c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Thu, 5 May 2016 10:44:27 +0200 +Subject: [PATCH] Fix caching global ksurl +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The config object from Kobo does not allow keys starting with +underscore, so we prefix it with `private_` instead. + +Signed-off-by: Lubomír Sedlář +--- + pungi/phases/base.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/pungi/phases/base.py b/pungi/phases/base.py +index 18d6f8a..6e24249 100644 +--- a/pungi/phases/base.py ++++ b/pungi/phases/base.py +@@ -145,7 +145,7 @@ class ImageConfigMixin(object): + def global_ksurl(self): + """Get global ksurl setting, making sure to resolve it only once.""" + # The global setting is cached in the configuration object. +- if '_global_ksurl' not in self.compose.conf: ++ if 'private_global_ksurl' not in self.compose.conf: + ksurl = self.compose.conf.get('global_ksurl') +- self.compose.conf['_global_ksurl'] = util.resolve_git_url(ksurl) +- return self.compose.conf['_global_ksurl'] ++ self.compose.conf['private_global_ksurl'] = util.resolve_git_url(ksurl) ++ return self.compose.conf['private_global_ksurl'] +-- +2.7.4 + From c6de2d81141a8f82cd1180d6964ad9bb25c95c61 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Mon, 16 May 2016 21:00:11 -0500 Subject: [PATCH 47/78] [ostree] Put variant name in ostree log dir (lsedlar) - Merge #294 `[ostree] Initialize empty repo` (dennis) - [util] Resolve git+https URLs (lsedlar) - [ostree] Initialize empty repo (lsedlar) - [test] Add checks for created images (lsedlar) - Fix caching global ksurl (lsedlar) - include tests/fixtures in manifest (dennis) Signed-off-by: Dennis Gilmore --- 0001-Fix-caching-global-ksurl.patch | 34 ----------------------------- pungi.spec | 15 +++++++++---- sources | 2 +- 3 files changed, 12 insertions(+), 39 deletions(-) delete mode 100644 0001-Fix-caching-global-ksurl.patch diff --git a/0001-Fix-caching-global-ksurl.patch b/0001-Fix-caching-global-ksurl.patch deleted file mode 100644 index c4ad4ada..00000000 --- a/0001-Fix-caching-global-ksurl.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 5aadf4ac39d85eeee969d7f3edd474e170a0c86c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= -Date: Thu, 5 May 2016 10:44:27 +0200 -Subject: [PATCH] Fix caching global ksurl -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The config object from Kobo does not allow keys starting with -underscore, so we prefix it with `private_` instead. - -Signed-off-by: Lubomír Sedlář ---- - pungi/phases/base.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/pungi/phases/base.py b/pungi/phases/base.py -index 18d6f8a..6e24249 100644 ---- a/pungi/phases/base.py -+++ b/pungi/phases/base.py -@@ -145,7 +145,7 @@ class ImageConfigMixin(object): - def global_ksurl(self): - """Get global ksurl setting, making sure to resolve it only once.""" - # The global setting is cached in the configuration object. -- if '_global_ksurl' not in self.compose.conf: -+ if 'private_global_ksurl' not in self.compose.conf: - ksurl = self.compose.conf.get('global_ksurl') -- self.compose.conf['_global_ksurl'] = util.resolve_git_url(ksurl) -- return self.compose.conf['_global_ksurl'] -+ self.compose.conf['private_global_ksurl'] = util.resolve_git_url(ksurl) -+ return self.compose.conf['private_global_ksurl'] --- -2.7.4 - diff --git a/pungi.spec b/pungi.spec index 32745734..dd21e8a8 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,13 +1,12 @@ Name: pungi -Version: 4.1.4 -Release: 2%{?dist} +Version: 4.1.5 +Release: 1%{?dist} Summary: Distribution compose tool Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi Source0: https://fedorahosted.org/pungi/attachment/wiki/%{version}/%{name}-%{version}.tar.bz2 -Patch0: 0001-Fix-caching-global-ksurl.patch BuildRequires: python-nose, python-nose-cov, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd @@ -49,7 +48,6 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %prep %setup -q -%patch0 -p1 %build %{__python} setup.py build @@ -85,6 +83,15 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Mon May 16 2016 Dennis Gilmore - 4.1.5-1 +- [ostree] Put variant name in ostree log dir (lsedlar) +- Merge #294 `[ostree] Initialize empty repo` (dennis) +- [util] Resolve git+https URLs (lsedlar) +- [ostree] Initialize empty repo (lsedlar) +- [test] Add checks for created images (lsedlar) +- Fix caching global ksurl (lsedlar) +- include tests/fixtures in manifest (dennis) + * Fri May 06 2016 Dennis Gilmore - 4.1.4-2 - add patch to fix caching global ksurl diff --git a/sources b/sources index 326f01e1..652a4976 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -f99681cf108f781bd71885fe87433b5b pungi-4.1.4.tar.bz2 +9b9b0d74ece1d0479b90350315197e5e pungi-4.1.5.tar.bz2 From 647d654de9039afddda078ddfffb07079d403ae9 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 24 May 2016 16:46:57 -0500 Subject: [PATCH 48/78] [ostree-installer] Allow using external repos as source (lsedlar) - [image-build] Allow using external install trees (lsedlar) - Add type to base product for layered releases (lsedlar) - Merge #303 `[ostree] Use unique work and log paths` (dennis) - [ostree] Use unique work and log paths (lsedlar) - [arch] Add mock rpmUtils module (lsedlar) Signed-off-by: Dennis Gilmore --- pungi.spec | 10 +++++++++- sources | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pungi.spec b/pungi.spec index dd21e8a8..a63a05d6 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,5 +1,5 @@ Name: pungi -Version: 4.1.5 +Version: 4.1.6 Release: 1%{?dist} Summary: Distribution compose tool @@ -83,6 +83,14 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Tue May 24 2016 Dennis Gilmore - 4.1.6-1 +- [ostree-installer] Allow using external repos as source (lsedlar) +- [image-build] Allow using external install trees (lsedlar) +- Add type to base product for layered releases (lsedlar) +- Merge #303 `[ostree] Use unique work and log paths` (dennis) +- [ostree] Use unique work and log paths (lsedlar) +- [arch] Add mock rpmUtils module (lsedlar) + * Mon May 16 2016 Dennis Gilmore - 4.1.5-1 - [ostree] Put variant name in ostree log dir (lsedlar) - Merge #294 `[ostree] Initialize empty repo` (dennis) diff --git a/sources b/sources index 652a4976..1c5cf32a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9b9b0d74ece1d0479b90350315197e5e pungi-4.1.5.tar.bz2 +98e49fcbbaf5a7baaee6910f2053033f pungi-4.1.6.tar.bz2 From 5d394cbcf3ce3fd686993f35a9f7d5f2cfa3f39d Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 23 Jun 2016 05:18:28 -0500 Subject: [PATCH 49/78] [scm] Add logging for exporting local files (lsedlar) - [extra-files] Only copy files when there is a config (lsedlar) - [extra-files] Refactoring (lsedlar) - [extra-files] Skip whole phase if not configured (lsedlar) - [extra-files] Copy files using existing function (lsedlar) - [extra-files] Add tests (lsedlar) - [osbs] Add a phase to build images in OSBS (lsedlar) - Setup global log file before logging anything (lsedlar) - [metadata] Correctly save final flag (lsedlar) - Merge #326 `add missing dependencies` (dennis) - [createiso] Add test for adding source iso to metadata (lsedlar) - Merge #325 `Fix checking optional ISO images in test phase` (dennis) - Merge #321 `Add support for top-level variant IDs with dashes.` (dennis) - Merge #320 `images.json: Move src images under binary arches.` (dennis) - add missing dependencies (nils) - Fix checking optional ISO images in test phase (lsedlar) - add lxml dependency (nils) - images.json: Move src images under binary arches. (dmach) - Add support for top-level variant IDs with dashes. (dmach) - Fix PYTHONPATH usage in test_compose.sh. (dmach) - [createiso] Enable customizing media reserve (lsedlar) - [createiso] Add test for splitting media (lsedlar) - [media-split] Remove commented-out code (lsedlar) - [media-split] Simplify code (lsedlar) - [media-split] Add code documentation (lsedlar) - [media-split] Add unit tests (lsedlar) - Add missing documentation (lsedlar) - [buildinstall] Fix bad error message (lsedlar) - Merge #309 `Add compatibility for Python 2.6` (dennis) - Merge #293 `Add tests for generating discinfo and media.repo files` (dennis) - Merge #287 `Use koji profiles to list RPMs in buildroot` (dennis) - [ostree-installer] Put images to os/ directory (lsedlar) - [ostree] Rename duplicated test (lsedlar) - [util] Use koji profile for getting RPMs from buildroot (lsedlar) - [util] Add test for getting list of buildroot RPMs (lsedlar) - pungi-koji: fix up latest symlink creation (dennis) - Use unittest2 if available (lsedlar) - Stop using str.format (lsedlar) - Stop using functools.total_ordering (lsedlar) - The message attribute on exception is deprecated (lsedlar) - [ostree] Rename duplicated test (lsedlar) - [metadata] Simplify writing media.repo (lsedlar) - [metadata] Add test for writing media.repo (lsedlar) - [discinfo] Use context manager for file access (lsedlar) - [metadata] Add tests for discinfo files (lsedlar) Signed-off-by: Dennis Gilmore --- pungi.spec | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- sources | 2 +- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/pungi.spec b/pungi.spec index a63a05d6..147ecc3e 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,5 +1,5 @@ Name: pungi -Version: 4.1.6 +Version: 4.1.7 Release: 1%{?dist} Summary: Distribution compose tool @@ -83,6 +83,53 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Thu Jun 23 2016 Dennis Gilmore - 4.1.7-1 +- [scm] Add logging for exporting local files (lsedlar) +- [extra-files] Only copy files when there is a config (lsedlar) +- [extra-files] Refactoring (lsedlar) +- [extra-files] Skip whole phase if not configured (lsedlar) +- [extra-files] Copy files using existing function (lsedlar) +- [extra-files] Add tests (lsedlar) +- [osbs] Add a phase to build images in OSBS (lsedlar) +- Setup global log file before logging anything (lsedlar) +- [metadata] Correctly save final flag (lsedlar) +- Merge #326 `add missing dependencies` (dennis) +- [createiso] Add test for adding source iso to metadata (lsedlar) +- Merge #325 `Fix checking optional ISO images in test phase` (dennis) +- Merge #321 `Add support for top-level variant IDs with dashes.` (dennis) +- Merge #320 `images.json: Move src images under binary arches.` (dennis) +- add missing dependencies (nils) +- Fix checking optional ISO images in test phase (lsedlar) +- add lxml dependency (nils) +- images.json: Move src images under binary arches. (dmach) +- Add support for top-level variant IDs with dashes. (dmach) +- Fix PYTHONPATH usage in test_compose.sh. (dmach) +- [createiso] Enable customizing media reserve (lsedlar) +- [createiso] Add test for splitting media (lsedlar) +- [media-split] Remove commented-out code (lsedlar) +- [media-split] Simplify code (lsedlar) +- [media-split] Add code documentation (lsedlar) +- [media-split] Add unit tests (lsedlar) +- Add missing documentation (lsedlar) +- [buildinstall] Fix bad error message (lsedlar) +- Merge #309 `Add compatibility for Python 2.6` (dennis) +- Merge #293 `Add tests for generating discinfo and media.repo files` (dennis) +- Merge #287 `Use koji profiles to list RPMs in buildroot` (dennis) +- [ostree-installer] Put images to os/ directory (lsedlar) +- [ostree] Rename duplicated test (lsedlar) +- [util] Use koji profile for getting RPMs from buildroot (lsedlar) +- [util] Add test for getting list of buildroot RPMs (lsedlar) +- pungi-koji: fix up latest symlink creation (dennis) +- Use unittest2 if available (lsedlar) +- Stop using str.format (lsedlar) +- Stop using functools.total_ordering (lsedlar) +- The message attribute on exception is deprecated (lsedlar) +- [ostree] Rename duplicated test (lsedlar) +- [metadata] Simplify writing media.repo (lsedlar) +- [metadata] Add test for writing media.repo (lsedlar) +- [discinfo] Use context manager for file access (lsedlar) +- [metadata] Add tests for discinfo files (lsedlar) + * Tue May 24 2016 Dennis Gilmore - 4.1.6-1 - [ostree-installer] Allow using external repos as source (lsedlar) - [image-build] Allow using external install trees (lsedlar) diff --git a/sources b/sources index 1c5cf32a..5f982b46 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -98e49fcbbaf5a7baaee6910f2053033f pungi-4.1.6.tar.bz2 +d5dd6887392147aed1720af42bcb26e5 pungi-4.1.7.tar.bz2 From f93b794610e4746c46c4e4014dd73fa8c000bcb4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 19 Jul 2016 08:24:08 +0000 Subject: [PATCH 50/78] - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages --- pungi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pungi.spec b/pungi.spec index 147ecc3e..04c4960d 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.1.7 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distribution compose tool Group: Development/Tools @@ -83,6 +83,9 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Tue Jul 19 2016 Fedora Release Engineering - 4.1.7-2 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + * Thu Jun 23 2016 Dennis Gilmore - 4.1.7-1 - [scm] Add logging for exporting local files (lsedlar) - [extra-files] Only copy files when there is a config (lsedlar) From 2eae39e3c9f24ad9c4612933fb79b68ca63d5ea8 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 10 Aug 2016 07:53:09 -0500 Subject: [PATCH 51/78] [createiso] Use shell script for runroot (lsedlar) - Merge #357 `Improve error messages for gathering packages` (dennis) - [test] Only check bootability for images on x86_64 and i386 (lsedlar) - Improve error messages for gathering packages (lsedlar) - Merge #339 `Refactor failables, step 1` (dennis) - Refactor failables (lsedlar) - Stop setting release in OSBS phase (lsedlar) - Merge #351 `Remove ambiguous imports` (dennis) - [test] Correctly check bootable ISOs (lsedlar) - Remove ambiguous imports (lsedlar) - Merge #347 `Remove duplicate definition of find_old_composes.` (lubomir.sedlar) - Merge #342 `Simplify naming format placeholders` (dennis) - Merge #345 `createrepo: use separate logs for different pkg_type` (dennis) - Remove duplicate definition of find_old_composes... (rbean) - [createrepo] fix 'createrepo_deltas' option (qwan) - createrepo: use separate logs for different pkg_type (lsedlar) - Simplify naming format placeholders (lsedlar) - Treat variants without comps groups as having all of them (lsedlar) - Always generate rpms.json file (lsedlar) Signed-off-by: Dennis Gilmore --- pungi.spec | 26 ++++++++++++++++++++++++-- sources | 2 +- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/pungi.spec b/pungi.spec index 04c4960d..ddb79bd5 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi -Version: 4.1.7 -Release: 2%{?dist} +Version: 4.1.8 +Release: 1%{?dist} Summary: Distribution compose tool Group: Development/Tools @@ -83,6 +83,28 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Wed Aug 10 2016 Dennis Gilmore - 4.1.8-1 +- [createiso] Use shell script for runroot (lsedlar) +- Merge #357 `Improve error messages for gathering packages` (dennis) +- [test] Only check bootability for images on x86_64 and i386 (lsedlar) +- Improve error messages for gathering packages (lsedlar) +- Merge #339 `Refactor failables, step 1` (dennis) +- Refactor failables (lsedlar) +- Stop setting release in OSBS phase (lsedlar) +- Merge #351 `Remove ambiguous imports` (dennis) +- [test] Correctly check bootable ISOs (lsedlar) +- Remove ambiguous imports (lsedlar) +- Merge #347 `Remove duplicate definition of find_old_composes.` + (lubomir.sedlar) +- Merge #342 `Simplify naming format placeholders` (dennis) +- Merge #345 `createrepo: use separate logs for different pkg_type` (dennis) +- Remove duplicate definition of find_old_composes... (rbean) +- [createrepo] fix 'createrepo_deltas' option (qwan) +- createrepo: use separate logs for different pkg_type (lsedlar) +- Simplify naming format placeholders (lsedlar) +- Treat variants without comps groups as having all of them (lsedlar) +- Always generate rpms.json file (lsedlar) + * Tue Jul 19 2016 Fedora Release Engineering - 4.1.7-2 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages diff --git a/sources b/sources index 5f982b46..9211a5aa 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d5dd6887392147aed1720af42bcb26e5 pungi-4.1.7.tar.bz2 +a34d0c02ab0c947a185d37717d0dc3f1 pungi-4.1.8.tar.bz2 From 5dca89821c988751cda49fefa3e680b1adfda2f8 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 10 Aug 2016 07:56:04 -0500 Subject: [PATCH 52/78] the python3 script is now gone Signed-off-by: Dennis Gilmore --- pungi.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/pungi.spec b/pungi.spec index ddb79bd5..822a5371 100644 --- a/pungi.spec +++ b/pungi.spec @@ -63,8 +63,6 @@ gzip _build/man/pungi.1 %{__install} -d %{buildroot}/var/cache/pungi %{__install} -d %{buildroot}%{_mandir}/man1 %{__install} doc/_build/man/pungi.1.gz %{buildroot}%{_mandir}/man1 -# this script has to be run by python3 and setup.py is too dumb -sed -i 's|/usr/bin/python$|/usr/bin/python3|' %{buildroot}/%{_bindir}/pungi-pylorax-find-templates %check ./tests/data/specs/build.sh From a27fef4233763d47b2aefff35a64c6a1f77fadb0 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 10 Aug 2016 08:20:27 -0500 Subject: [PATCH 53/78] add missing BR Signed-off-by: Dennis Gilmore --- pungi.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pungi.spec b/pungi.spec index 822a5371..3ad7921b 100644 --- a/pungi.spec +++ b/pungi.spec @@ -19,7 +19,7 @@ BuildRequires: python-sphinx, texlive-latex-bin-bin, texlive-collection-fontsre BuildRequires: texlive-times, texlive-cmap, texlive-babel-english, texlive-fancyhdr BuildRequires: texlive-fancybox, texlive-titlesec, texlive-framed, texlive-threeparttable BuildRequires: texlive-mdwtools, texlive-wrapfig, texlive-parskip, texlive-upquote -BuildRequires: texlive-multirow +BuildRequires: texlive-multirow, texlive-capt-of, texlive-eqparbox Requires: createrepo >= 0.4.11 Requires: yum => 3.4.3-28 From 03ec58085453f858e23bedab9e84a1956f7a3da7 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 21 Sep 2016 08:12:29 -0500 Subject: [PATCH 54/78] ostree_installer: Add --isfinal lorax argument (lsedlar) - Recreate JSON dump of configuration (lsedlar) - Merge #385 `Test and clean up pungi.linker` (dennis) - Merge #390 `checksums: Never skip checksumming phase` (dennis) - variants: Allow multiple explicit optional variants (lsedlar) - checksums: Never skip checksumming phase (lsedlar) - [linker] Remove dead code (lsedlar) - [linker] Add tests (lsedlar) - Dump original pungi conf (cqi) - ostree: Add tests for sending ostree messages (lsedlar) - Send fedmsg message on ostree compose finishg (puiterwijk) - createrepo: Add option to use xz compression (lsedlar) - Allow user to set a ~/.pungirc for some defaults (riehecky) - metadata: Improve error reporting on failed checksum (lsedlar) - extra-files: Write a metadata file enumerating extra files (jeremy) - Merge #381 `Automatically generate missing image version` (dennis) - Automatically generate missing image version (lsedlar) - Add JSON Schema for configuration (lsedlar) - Allow arbitrary arguments in make test (lsedlar) - createiso: Report nice error when tag does not exist (lsedlar) - Fix test data build script (lsedlar) - [osbs] Add NVRA of created image into main log (lsedlar) - [createiso] Remove unused script (lsedlar) - Update doc about generating release value (lsedlar) - Use label to populate image release (lsedlar) - doc: Fix example for image_build (lsedlar) - Ignore module imports not at top of file (lsedlar) - Merge #367 `Remove unused imports` (dennis) - [buildinstall] Fix cleaning output dir (lsedlar) - Remove unused imports (lsedlar) - Merge #360 `[osbs] Convert build_id to int` (dennis) - Merge #361 `Fix config validation script` (dennis) - Merge #365 `Make image test at end of compose less strict` (dennis) - [test] Make image test at end of compose less strict (lsedlar) - [iso] Fix check on failable ISO (lsedlar) - Add full Pungi version to log output (lsedlar) - Fix config validation script (lsedlar) - [osbs] Convert build_id to int (lsedlar) - [image-build] Get failable config from correct place (lsedlar) Signed-off-by: Dennis Gilmore --- pungi.spec | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- sources | 2 +- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/pungi.spec b/pungi.spec index 3ad7921b..f0ba517b 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,5 +1,5 @@ Name: pungi -Version: 4.1.8 +Version: 4.1.9 Release: 1%{?dist} Summary: Distribution compose tool @@ -14,6 +14,8 @@ BuildRequires: python-lockfile, kobo, kobo-rpmlib, python-kickstart, createrepo BuildRequires: python-lxml, libselinux-python, yum-utils, lorax BuildRequires: yum => 3.4.3-28, createrepo >= 0.4.11 BuildRequires: gettext, git-core, cvs +BuildRequires: python-jsonschema + #deps for doc building BuildRequires: python-sphinx, texlive-latex-bin-bin, texlive-collection-fontsrecommended BuildRequires: texlive-times, texlive-cmap, texlive-babel-english, texlive-fancyhdr @@ -34,12 +36,16 @@ Requires: libselinux-python Requires: createrepo_c Requires: python-lxml Requires: koji +Requires: jigdo Requires: cvs Requires: yum-utils Requires: isomd5sum Requires: genisoimage Requires: gettext +# this is x86 only +#Requires: syslinux Requires: git +Requires: python-jsonschema BuildArch: noarch @@ -81,6 +87,47 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Wed Sep 21 2016 Lubomír Sedlář - 4.1.9-1 +- ostree_installer: Add --isfinal lorax argument (lsedlar) +- Recreate JSON dump of configuration (lsedlar) +- Merge #385 `Test and clean up pungi.linker` (dennis) +- Merge #390 `checksums: Never skip checksumming phase` (dennis) +- variants: Allow multiple explicit optional variants (lsedlar) +- checksums: Never skip checksumming phase (lsedlar) +- [linker] Remove dead code (lsedlar) +- [linker] Add tests (lsedlar) +- Dump original pungi conf (cqi) +- ostree: Add tests for sending ostree messages (lsedlar) +- Send fedmsg message on ostree compose finishg (puiterwijk) +- createrepo: Add option to use xz compression (lsedlar) +- Allow user to set a ~/.pungirc for some defaults (riehecky) +- metadata: Improve error reporting on failed checksum (lsedlar) +- extra-files: Write a metadata file enumerating extra files (jeremy) +- Merge #381 `Automatically generate missing image version` (dennis) +- Automatically generate missing image version (lsedlar) +- Add JSON Schema for configuration (lsedlar) +- Allow arbitrary arguments in make test (lsedlar) +- createiso: Report nice error when tag does not exist (lsedlar) +- Fix test data build script (lsedlar) +- [osbs] Add NVRA of created image into main log (lsedlar) +- [createiso] Remove unused script (lsedlar) +- Update doc about generating release value (lsedlar) +- Use label to populate image release (lsedlar) +- doc: Fix example for image_build (lsedlar) +- Ignore module imports not at top of file (lsedlar) +- Merge #367 `Remove unused imports` (dennis) +- [buildinstall] Fix cleaning output dir (lsedlar) +- Remove unused imports (lsedlar) +- Merge #360 `[osbs] Convert build_id to int` (dennis) +- Merge #361 `Fix config validation script` (dennis) +- Merge #365 `Make image test at end of compose less strict` (dennis) +- [test] Make image test at end of compose less strict (lsedlar) +- [iso] Fix check on failable ISO (lsedlar) +- Add full Pungi version to log output (lsedlar) +- Fix config validation script (lsedlar) +- [osbs] Convert build_id to int (lsedlar) +- [image-build] Get failable config from correct place (lsedlar) + * Wed Aug 10 2016 Dennis Gilmore - 4.1.8-1 - [createiso] Use shell script for runroot (lsedlar) - Merge #357 `Improve error messages for gathering packages` (dennis) diff --git a/sources b/sources index 9211a5aa..9b21cf69 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a34d0c02ab0c947a185d37717d0dc3f1 pungi-4.1.8.tar.bz2 +670ca9ec0210b6025921aeeb22b22c42 pungi-4.1.9.tar.bz2 From f2c6aeb93cc22b553f5078235869b39ebe098b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 22 Sep 2016 12:21:04 +0200 Subject: [PATCH 55/78] Fix bogus dates in changelog based on when the commits were made. --- pungi.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pungi.spec b/pungi.spec index f0ba517b..9aae0a6b 100644 --- a/pungi.spec +++ b/pungi.spec @@ -275,10 +275,10 @@ cd tests && ./test_compose.sh - [ostree] Move cloning repo back to compose box (lsedlar) - [ostree] Mount ostree directory in koji (lsedlar) -* Thu Apr 06 2016 Dennis Gilmore - 4.1.2-2 +* Thu Apr 07 2016 Dennis Gilmore - 4.1.2-2 - make sure that the shebang of pungi-pylorax-find-templates is python3 -* Wed Apr 05 2016 Dennis Gilmore - 4.1.2-1 +* Wed Apr 06 2016 Dennis Gilmore - 4.1.2-1 - Merge #257 `[ostree] Enable marking ostree phase as failable` (ausil) - [ostree] Enable marking ostree phase as failable (lsedlar) - [koji-wrapper] Initialize wrappers sequentially (lsedlar) @@ -532,7 +532,7 @@ cd tests && ./test_compose.sh - Load multilib configuration from local dir in development (lsedlar) - Allow running scripts with any python in PATH (lsedlar) -* Tue Aug 08 2015 Dennis Gilmore 4.0.3-1 +* Tue Sep 08 2015 Dennis Gilmore 4.0.3-1 - Merge #54 `fix log_info for image_build (fails if image_build is skipped)` (lkocman) - image_build: self.log_info -> self.compose.log_info (lkocman) From e72a0377cc35eb5bb3e6acb49de1d03084ac0e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 22 Sep 2016 12:22:03 +0200 Subject: [PATCH 56/78] Update upstream url The tarballs are now hosted on Pagure. --- pungi.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pungi.spec b/pungi.spec index 9aae0a6b..4aa93ed5 100644 --- a/pungi.spec +++ b/pungi.spec @@ -6,7 +6,7 @@ Summary: Distribution compose tool Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi -Source0: https://fedorahosted.org/pungi/attachment/wiki/%{version}/%{name}-%{version}.tar.bz2 +Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2 BuildRequires: python-nose, python-nose-cov, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd From 99d8f1f3094cedfb14abea35957ef832aec9afe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 22 Sep 2016 12:22:21 +0200 Subject: [PATCH 57/78] Install man page as non-executable --- pungi.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pungi.spec b/pungi.spec index 4aa93ed5..8baa5f74 100644 --- a/pungi.spec +++ b/pungi.spec @@ -68,7 +68,7 @@ gzip _build/man/pungi.1 %{__python} setup.py install -O1 --skip-build --root %{buildroot} %{__install} -d %{buildroot}/var/cache/pungi %{__install} -d %{buildroot}%{_mandir}/man1 -%{__install} doc/_build/man/pungi.1.gz %{buildroot}%{_mandir}/man1 +%{__install} -m 0644 doc/_build/man/pungi.1.gz %{buildroot}%{_mandir}/man1 %check ./tests/data/specs/build.sh From d4fd082b9ef775dcc42fefd07abad0dc0cddb645 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 29 Sep 2016 09:27:04 -0500 Subject: [PATCH 58/78] add patch to enable use of --new-chroot for ostree tasks Signed-off-by: Dennis Gilmore --- ...-use-new-chroot-when-making-ostree-s.patch | 82 +++++++++++++++++++ pungi.spec | 12 ++- 2 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 0001-use-new-chroot-when-making-ostree-s.patch diff --git a/0001-use-new-chroot-when-making-ostree-s.patch b/0001-use-new-chroot-when-making-ostree-s.patch new file mode 100644 index 00000000..652346d4 --- /dev/null +++ b/0001-use-new-chroot-when-making-ostree-s.patch @@ -0,0 +1,82 @@ +From 4e90f81fc149f2f13f558c158eee158df2f9c563 Mon Sep 17 00:00:00 2001 +From: Dennis Gilmore +Date: Wed, 28 Sep 2016 20:58:17 -0500 +Subject: [PATCH] use --new-chroot when making ostree's + +to complement https://pagure.io/koji/pull-request/162 we need to adjust pungi +rpm-ostree uses bublewrap that does not work in mock. --new-chroot to mock +enables the use of systemd-nspawn instead of chroot resulting in working +rpm-ostree again + +Signed-off-by: Dennis Gilmore +--- + pungi.spec | 2 +- + pungi/phases/ostree.py | 3 ++- + pungi/wrappers/kojiwrapper.py | 5 ++++- + tests/test_ostree_phase.py | 2 +- + 4 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/pungi.spec b/pungi.spec +index 45df630..32f13e0 100644 +--- a/pungi.spec ++++ b/pungi.spec +@@ -27,7 +27,7 @@ Requires: python-kickstart + Requires: libselinux-python + Requires: createrepo_c + Requires: python-lxml +-Requires: koji ++Requires: koji >= 1.10.1-13 + Requires: jigdo + Requires: cvs + Requires: yum-utils +diff --git a/pungi/phases/ostree.py b/pungi/phases/ostree.py +index c25ab84..d60bb68 100644 +--- a/pungi/phases/ostree.py ++++ b/pungi/phases/ostree.py +@@ -93,7 +93,8 @@ class OSTreeThread(WorkerThread): + koji_cmd = koji.get_runroot_cmd(runroot_tag, arch, cmd, + channel=runroot_channel, + use_shell=True, task_id=True, +- packages=packages, mounts=mounts) ++ packages=packages, mounts=mounts, ++ new_chroot=True) + output = koji.run_runroot_cmd(koji_cmd, log_file=log_file) + if output["retcode"] != 0: + raise RuntimeError("Runroot task failed: %s. See %s for more details." +diff --git a/pungi/wrappers/kojiwrapper.py b/pungi/wrappers/kojiwrapper.py +index 98626ca..85a933a 100644 +--- a/pungi/wrappers/kojiwrapper.py ++++ b/pungi/wrappers/kojiwrapper.py +@@ -59,12 +59,15 @@ class KojiWrapper(object): + else: + raise RuntimeError('Unsupported authentication type in Koji') + +- def get_runroot_cmd(self, target, arch, command, quiet=False, use_shell=True, channel=None, packages=None, mounts=None, weight=None, task_id=True): ++ def get_runroot_cmd(self, target, arch, command, quiet=False, use_shell=True, channel=None, packages=None, mounts=None, weight=None, task_id=True, new_chroot=False): + cmd = [self.executable, "runroot"] + + if quiet: + cmd.append("--quiet") + ++ if new_chroot: ++ cmd.append("--new-chroot") ++ + if use_shell: + cmd.append("--use-shell") + +diff --git a/tests/test_ostree_phase.py b/tests/test_ostree_phase.py +index 8a4092f..dcf583a 100755 +--- a/tests/test_ostree_phase.py ++++ b/tests/test_ostree_phase.py +@@ -108,7 +108,7 @@ class OSTreeThreadTest(helpers.PungiTestCase): + self.repo], + channel=None, mounts=[self.topdir, self.repo], + packages=['pungi', 'ostree', 'rpm-ostree'], +- task_id=True, use_shell=True)]) ++ task_id=True, use_shell=True, new_chroot=True)]) + self.assertEqual(koji.run_runroot_cmd.call_args_list, + [mock.call(koji.get_runroot_cmd.return_value, + log_file=self.topdir + '/logs/x86_64/Everything/ostree-1/runroot.log')]) +-- +2.9.3 + diff --git a/pungi.spec b/pungi.spec index 8baa5f74..74691411 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,12 +1,13 @@ Name: pungi Version: 4.1.9 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distribution compose tool Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2 +Patch0: 0001-use-new-chroot-when-making-ostree-s.patch BuildRequires: python-nose, python-nose-cov, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd @@ -35,8 +36,9 @@ Requires: python-kickstart Requires: libselinux-python Requires: createrepo_c Requires: python-lxml -Requires: koji -Requires: jigdo +Requires: koji >= 1.10.1-13 +# This is optional do not Require it +#eRquires: jigdo Requires: cvs Requires: yum-utils Requires: isomd5sum @@ -54,6 +56,7 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %prep %setup -q +%patch0 -p1 %build %{__python} setup.py build @@ -87,6 +90,9 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Thu Sep 29 2016 Dennis Gilmore - 4.1.9-2 +- add patch to enable use of --new-chroot for ostree tasks + * Wed Sep 21 2016 Lubomír Sedlář - 4.1.9-1 - ostree_installer: Add --isfinal lorax argument (lsedlar) - Recreate JSON dump of configuration (lsedlar) From 020f1c9a88eab1faf650f1d9c0088e92b787b73a Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 8 Oct 2016 12:22:54 -0500 Subject: [PATCH 59/78] pungi: Replace kickstart repo url (mark) - ostree-installer: Reduce duplication in tests (lsedlar) - ostree-installer: Generate correct volume ID (lsedlar) - ostree-installer: Use ostree as type in filename (lsedlar) - ostree: Use $basearch in repo file (lsedlar) - config: Accept empty branch in SCM dict (lsedlar) - Remove duplicated version from pungi script (lsedlar) - use --new-chroot when making ostree's (dennis) - Create git tags without release (lsedlar) - Translate paths without double slash (lsedlar) - Remove shebangs from non-executable files (lsedlar) - Remove FSF address from comments (lsedlar) - Update contributing guide (lsedlar) - init: Remove keep_original_comps option (lsedlar) - tests: Use unittest2 consistently (lsedlar) Signed-off-by: Dennis Gilmore --- pungi.spec | 23 +++++++++++++++++++---- sources | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/pungi.spec b/pungi.spec index 74691411..ae81e402 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,13 +1,12 @@ Name: pungi -Version: 4.1.9 -Release: 2%{?dist} +Version: 4.1.10 +Release: 1%{?dist} Summary: Distribution compose tool Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2 -Patch0: 0001-use-new-chroot-when-making-ostree-s.patch BuildRequires: python-nose, python-nose-cov, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd @@ -56,7 +55,6 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %prep %setup -q -%patch0 -p1 %build %{__python} setup.py build @@ -90,6 +88,23 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Sat Oct 08 2016 Dennis Gilmore - 4.1.10-1 +- pungi: Replace kickstart repo url (mark) +- ostree-installer: Reduce duplication in tests (lsedlar) +- ostree-installer: Generate correct volume ID (lsedlar) +- ostree-installer: Use ostree as type in filename (lsedlar) +- ostree: Use $basearch in repo file (lsedlar) +- config: Accept empty branch in SCM dict (lsedlar) +- Remove duplicated version from pungi script (lsedlar) +- use --new-chroot when making ostree's (dennis) +- Create git tags without release (lsedlar) +- Translate paths without double slash (lsedlar) +- Remove shebangs from non-executable files (lsedlar) +- Remove FSF address from comments (lsedlar) +- Update contributing guide (lsedlar) +- init: Remove keep_original_comps option (lsedlar) +- tests: Use unittest2 consistently (lsedlar) + * Thu Sep 29 2016 Dennis Gilmore - 4.1.9-2 - add patch to enable use of --new-chroot for ostree tasks diff --git a/sources b/sources index 9b21cf69..08c15835 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -670ca9ec0210b6025921aeeb22b22c42 pungi-4.1.9.tar.bz2 +239214545262977696897cf681e0a5fb pungi-4.1.10.tar.bz2 From 3c2e0c652930266f8b57902a84d47e1c1a12c7f2 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 8 Oct 2016 12:23:11 -0500 Subject: [PATCH 60/78] remove upstreamed patch Signed-off-by: Dennis Gilmore --- ...-use-new-chroot-when-making-ostree-s.patch | 82 ------------------- 1 file changed, 82 deletions(-) delete mode 100644 0001-use-new-chroot-when-making-ostree-s.patch diff --git a/0001-use-new-chroot-when-making-ostree-s.patch b/0001-use-new-chroot-when-making-ostree-s.patch deleted file mode 100644 index 652346d4..00000000 --- a/0001-use-new-chroot-when-making-ostree-s.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 4e90f81fc149f2f13f558c158eee158df2f9c563 Mon Sep 17 00:00:00 2001 -From: Dennis Gilmore -Date: Wed, 28 Sep 2016 20:58:17 -0500 -Subject: [PATCH] use --new-chroot when making ostree's - -to complement https://pagure.io/koji/pull-request/162 we need to adjust pungi -rpm-ostree uses bublewrap that does not work in mock. --new-chroot to mock -enables the use of systemd-nspawn instead of chroot resulting in working -rpm-ostree again - -Signed-off-by: Dennis Gilmore ---- - pungi.spec | 2 +- - pungi/phases/ostree.py | 3 ++- - pungi/wrappers/kojiwrapper.py | 5 ++++- - tests/test_ostree_phase.py | 2 +- - 4 files changed, 8 insertions(+), 4 deletions(-) - -diff --git a/pungi.spec b/pungi.spec -index 45df630..32f13e0 100644 ---- a/pungi.spec -+++ b/pungi.spec -@@ -27,7 +27,7 @@ Requires: python-kickstart - Requires: libselinux-python - Requires: createrepo_c - Requires: python-lxml --Requires: koji -+Requires: koji >= 1.10.1-13 - Requires: jigdo - Requires: cvs - Requires: yum-utils -diff --git a/pungi/phases/ostree.py b/pungi/phases/ostree.py -index c25ab84..d60bb68 100644 ---- a/pungi/phases/ostree.py -+++ b/pungi/phases/ostree.py -@@ -93,7 +93,8 @@ class OSTreeThread(WorkerThread): - koji_cmd = koji.get_runroot_cmd(runroot_tag, arch, cmd, - channel=runroot_channel, - use_shell=True, task_id=True, -- packages=packages, mounts=mounts) -+ packages=packages, mounts=mounts, -+ new_chroot=True) - output = koji.run_runroot_cmd(koji_cmd, log_file=log_file) - if output["retcode"] != 0: - raise RuntimeError("Runroot task failed: %s. See %s for more details." -diff --git a/pungi/wrappers/kojiwrapper.py b/pungi/wrappers/kojiwrapper.py -index 98626ca..85a933a 100644 ---- a/pungi/wrappers/kojiwrapper.py -+++ b/pungi/wrappers/kojiwrapper.py -@@ -59,12 +59,15 @@ class KojiWrapper(object): - else: - raise RuntimeError('Unsupported authentication type in Koji') - -- def get_runroot_cmd(self, target, arch, command, quiet=False, use_shell=True, channel=None, packages=None, mounts=None, weight=None, task_id=True): -+ def get_runroot_cmd(self, target, arch, command, quiet=False, use_shell=True, channel=None, packages=None, mounts=None, weight=None, task_id=True, new_chroot=False): - cmd = [self.executable, "runroot"] - - if quiet: - cmd.append("--quiet") - -+ if new_chroot: -+ cmd.append("--new-chroot") -+ - if use_shell: - cmd.append("--use-shell") - -diff --git a/tests/test_ostree_phase.py b/tests/test_ostree_phase.py -index 8a4092f..dcf583a 100755 ---- a/tests/test_ostree_phase.py -+++ b/tests/test_ostree_phase.py -@@ -108,7 +108,7 @@ class OSTreeThreadTest(helpers.PungiTestCase): - self.repo], - channel=None, mounts=[self.topdir, self.repo], - packages=['pungi', 'ostree', 'rpm-ostree'], -- task_id=True, use_shell=True)]) -+ task_id=True, use_shell=True, new_chroot=True)]) - self.assertEqual(koji.run_runroot_cmd.call_args_list, - [mock.call(koji.get_runroot_cmd.return_value, - log_file=self.topdir + '/logs/x86_64/Everything/ostree-1/runroot.log')]) --- -2.9.3 - From 1b20dce0c1452e5a2dc094751a7cc0f3b49ad604 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 15 Nov 2016 15:19:30 -0600 Subject: [PATCH 61/78] [ostree] Allow extra repos to get packages for composing OSTree repository (qwan) - pungi: Run in-process for testing (lsedlar) - pungi: Only add logger once (lsedlar) - pungi: Connect yum callback to logger (lsedlar) - extra-files: Nice error message on missing RPM (lsedlar) - compose: Drop unused argument (lsedlar) - compose: Search all nested variants (lsedlar) - ostree-installer: Capture all lorax logs (lsedlar) - lorax-wrapper: Put all log files into compose logs (lsedlar) - pungi: Fix reading multilib config files (lsedlar) - pungi: Fulltree should not apply for input multilib package (lsedlar) - pungi: Add tests for depsolving (lsedlar) - Update ostree phase documentation (lsedlar) - [ostree] Allow adding versioning metadata (qwan) (lubomir.sedlar) - [ostree] New option to enable generating ostree summary file (qwan) - pungi: Avoid removing from list (lsedlar) - pungi: Allow globs in %multilib-whitelist (dmach) - pungi: Exclude RPMs that are in lookaside (dmach) - pungi: Fix excluding SRPMs (dmach) - pungi: Speed up blacklist processing (dmach) - Update tests to use ostree write-commit-id (puiterwijk) - ostree: Use the write-commitid-to feature rather than parsing ostree logs (puiterwijk) - checks: Check for createrepo_c (lsedlar) - checks: Update tests to not require python modules (lsedlar) - Remove executable permissions on test scripts (puiterwijk) - Add more require checks (puiterwijk) - Fix package name for createrepo and mergerepo (puiterwijk) - not using 'git -C path' which is not supported by git 1.x (qwan) - pungi-koji: add option for not creating latest symbol link (qwan) - Replace mount/umount with guestfsmount and 'fusermount -u' (qwan) - config: Don't abort on deprecated options (lsedlar) - metadata: Treeinfo should point to packages and repo (lsedlar) - Send notification when compose fails to start (lsedlar) - metadata: Stop crashing for non-bootable products (lsedlar) - createiso: Do not split bootable media (lsedlar) - doc: Fix a typo in progress notification example (lsedlar) - Dump images.json after checksumming (lsedlar) - metadata: Correctly clone buildinstall .treeinfo (lsedlar) - createiso: Include layered product name in iso name (lsedlar) - buildinstall: Only transform arch for lorax (lsedlar) - iso-wrapper: Remove the class (lsedlar) - config: Validate variant regular expressions (lsedlar) Signed-off-by: Dennis Gilmore --- pungi.spec | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- sources | 2 +- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/pungi.spec b/pungi.spec index ae81e402..83f085b9 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,5 +1,5 @@ Name: pungi -Version: 4.1.10 +Version: 4.1.11 Release: 1%{?dist} Summary: Distribution compose tool @@ -88,6 +88,53 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Tue Nov 15 2016 Dennis Gilmore - 4.1.11-1 +- [ostree] Allow extra repos to get packages for composing OSTree repository + (qwan) +- pungi: Run in-process for testing (lsedlar) +- pungi: Only add logger once (lsedlar) +- pungi: Connect yum callback to logger (lsedlar) +- extra-files: Nice error message on missing RPM (lsedlar) +- compose: Drop unused argument (lsedlar) +- compose: Search all nested variants (lsedlar) +- ostree-installer: Capture all lorax logs (lsedlar) +- lorax-wrapper: Put all log files into compose logs (lsedlar) +- pungi: Fix reading multilib config files (lsedlar) +- pungi: Fulltree should not apply for input multilib package (lsedlar) +- pungi: Add tests for depsolving (lsedlar) +- Update ostree phase documentation (lsedlar) +- [ostree] Allow adding versioning metadata (qwan) + (lubomir.sedlar) +- [ostree] New option to enable generating ostree summary file (qwan) +- pungi: Avoid removing from list (lsedlar) +- pungi: Allow globs in %multilib-whitelist (dmach) +- pungi: Exclude RPMs that are in lookaside (dmach) +- pungi: Fix excluding SRPMs (dmach) +- pungi: Speed up blacklist processing (dmach) +- Update tests to use ostree write-commit-id (puiterwijk) +- ostree: Use the write-commitid-to feature rather than parsing ostree logs + (puiterwijk) +- checks: Check for createrepo_c (lsedlar) +- checks: Update tests to not require python modules (lsedlar) +- Remove executable permissions on test scripts (puiterwijk) +- Add more require checks (puiterwijk) +- Fix package name for createrepo and mergerepo (puiterwijk) +- not using 'git -C path' which is not supported by git 1.x (qwan) +- pungi-koji: add option for not creating latest symbol link (qwan) +- Replace mount/umount with guestfsmount and 'fusermount -u' (qwan) +- config: Don't abort on deprecated options (lsedlar) +- metadata: Treeinfo should point to packages and repo (lsedlar) +- Send notification when compose fails to start (lsedlar) +- metadata: Stop crashing for non-bootable products (lsedlar) +- createiso: Do not split bootable media (lsedlar) +- doc: Fix a typo in progress notification example (lsedlar) +- Dump images.json after checksumming (lsedlar) +- metadata: Correctly clone buildinstall .treeinfo (lsedlar) +- createiso: Include layered product name in iso name (lsedlar) +- buildinstall: Only transform arch for lorax (lsedlar) +- iso-wrapper: Remove the class (lsedlar) +- config: Validate variant regular expressions (lsedlar) + * Sat Oct 08 2016 Dennis Gilmore - 4.1.10-1 - pungi: Replace kickstart repo url (mark) - ostree-installer: Reduce duplication in tests (lsedlar) diff --git a/sources b/sources index 08c15835..72482271 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -239214545262977696897cf681e0a5fb pungi-4.1.10.tar.bz2 +dd0fbbaf2fa3e9e08330727fa7615e8d pungi-4.1.11.tar.bz2 From 2142ad1c05fd9b758492221c92c95ba6c0e52e91 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 15 Nov 2016 17:38:15 -0600 Subject: [PATCH 62/78] add BR on tex(color.cfg) rawhide split up things in texlive again. we need to add an extra BR Signed-off-by: Dennis Gilmore --- pungi.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pungi.spec b/pungi.spec index 83f085b9..4eb3c48e 100644 --- a/pungi.spec +++ b/pungi.spec @@ -21,7 +21,7 @@ BuildRequires: python-sphinx, texlive-latex-bin-bin, texlive-collection-fontsre BuildRequires: texlive-times, texlive-cmap, texlive-babel-english, texlive-fancyhdr BuildRequires: texlive-fancybox, texlive-titlesec, texlive-framed, texlive-threeparttable BuildRequires: texlive-mdwtools, texlive-wrapfig, texlive-parskip, texlive-upquote -BuildRequires: texlive-multirow, texlive-capt-of, texlive-eqparbox +BuildRequires: texlive-multirow, texlive-capt-of, texlive-eqparbox, tex(color.cfg) Requires: createrepo >= 0.4.11 Requires: yum => 3.4.3-28 From 107727fa5c85a0ab10a02cd7d05527999a417c30 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 15 Nov 2016 19:57:42 -0600 Subject: [PATCH 63/78] update tarball Signed-off-by: Dennis Gilmore --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 72482271..43bef367 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -dd0fbbaf2fa3e9e08330727fa7615e8d pungi-4.1.11.tar.bz2 +d29783dccd912fca8092adb3e09037ba pungi-4.1.11.tar.bz2 From 2a2ed408b8766ea1655f4edf702388ab990c5bc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 16 Nov 2016 09:23:03 +0100 Subject: [PATCH 64/78] Backport upstream patches to fix running tests --- ...pungi-Fix-tests-on-non-x86_64-arches.patch | 36 +++++++++++++++++++ ...-pungi-Fix-incorrectly-skipped-tests.patch | 33 +++++++++++++++++ pungi.spec | 5 +++ 3 files changed, 74 insertions(+) create mode 100644 0001-pungi-Fix-tests-on-non-x86_64-arches.patch create mode 100644 0002-pungi-Fix-incorrectly-skipped-tests.patch diff --git a/0001-pungi-Fix-tests-on-non-x86_64-arches.patch b/0001-pungi-Fix-tests-on-non-x86_64-arches.patch new file mode 100644 index 00000000..5e3c461a --- /dev/null +++ b/0001-pungi-Fix-tests-on-non-x86_64-arches.patch @@ -0,0 +1,36 @@ +From 3c1e2fba662cd635b20d2daf2c5acacfee407876 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Wed, 16 Nov 2016 09:20:10 +0100 +Subject: [PATCH] pungi: Fix tests on non-x86_64 arches +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If the test did not specify an arch explicitly, it fell back on whatever +arch the current machine has. This was causing failures when building +RPM. + +Signed-off-by: Lubomír Sedlář +--- + tests/test_pungi.py | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/tests/test_pungi.py b/tests/test_pungi.py +index a3297e7..d770d2a 100644 +--- a/tests/test_pungi.py ++++ b/tests/test_pungi.py +@@ -65,6 +65,11 @@ class TestPungi(unittest.TestCase): + p.write_kickstart(self.ks, repos, groups, packages, prepopulate=prepopulate, + multilib_whitelist=multilib_whitelist) + kwargs.setdefault('cache_dir', self.tmp_dir) ++ # Unless the test specifies an arch, we need to default to x86_64. ++ # Otherwise the arch of current machine will be used, which will cause ++ # failure most of the time. ++ kwargs.setdefault('arch', 'x86_64') ++ + p.run_pungi(self.ks, self.tmp_dir, 'DP', **kwargs) + with open(self.out, "r") as f: + pkg_map = p.get_packages(f.read()) +-- +2.7.4 + diff --git a/0002-pungi-Fix-incorrectly-skipped-tests.patch b/0002-pungi-Fix-incorrectly-skipped-tests.patch new file mode 100644 index 00000000..bee99c11 --- /dev/null +++ b/0002-pungi-Fix-incorrectly-skipped-tests.patch @@ -0,0 +1,33 @@ +From b7813d34ac8e7986fbf2e8b1e4fc35427655ee8a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Wed, 16 Nov 2016 09:43:19 +0100 +Subject: [PATCH 2/2] pungi: Fix incorrectly skipped tests +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The test was not correctly being skipped in Koji build, causing build +failure. + +Signed-off-by: Lubomír Sedlář +--- + tests/test_pungi.py | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/tests/test_pungi.py b/tests/test_pungi.py +index d770d2a..a519ddf 100644 +--- a/tests/test_pungi.py ++++ b/tests/test_pungi.py +@@ -776,8 +776,7 @@ class TestPungi(unittest.TestCase): + "dummy-glibc-debuginfo-common-2.14-5.x86_64.rpm", + ]) + +- # This test is broken. +- @unittest.skip ++ @unittest.skip('This test is broken') + def test_bash_multilib_nogreedy(self): + packages = [ + "dummy-bash.+", +-- +2.7.4 + diff --git a/pungi.spec b/pungi.spec index 4eb3c48e..28cd987b 100644 --- a/pungi.spec +++ b/pungi.spec @@ -7,6 +7,9 @@ Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2 +# These patches are added here to fix running tests. They are proposed in upstream as well. +Patch0: 0001-pungi-Fix-tests-on-non-x86_64-arches.patch +Patch1: 0002-pungi-Fix-incorrectly-skipped-tests.patch BuildRequires: python-nose, python-nose-cov, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd @@ -55,6 +58,8 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %prep %setup -q +%patch0 -p1 +%patch1 -p1 %build %{__python} setup.py build From 39a95b7f870d85a68692d64820427b757c4edfcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 16 Nov 2016 09:45:02 +0100 Subject: [PATCH 65/78] Simplify running tests There is no need to run the tests both by setup.py and nose: it just runs the same tests twice. Also, generating coverage data is useless and it will not be visible anywhere anyway. This allows us to get rid of one build requires. Also we should first run unittests and only then build the data for dummy compose: if the tests fail, we get the info earlier. --- pungi.spec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pungi.spec b/pungi.spec index 28cd987b..defb781c 100644 --- a/pungi.spec +++ b/pungi.spec @@ -11,7 +11,7 @@ Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2 Patch0: 0001-pungi-Fix-tests-on-non-x86_64-arches.patch Patch1: 0002-pungi-Fix-incorrectly-skipped-tests.patch -BuildRequires: python-nose, python-nose-cov, python-mock +BuildRequires: python-nose, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd BuildRequires: python-lockfile, kobo, kobo-rpmlib, python-kickstart, createrepo_c BuildRequires: python-lxml, libselinux-python, yum-utils, lorax @@ -77,9 +77,8 @@ gzip _build/man/pungi.1 %{__install} -m 0644 doc/_build/man/pungi.1.gz %{buildroot}%{_mandir}/man1 %check +nosetests --exe ./tests/data/specs/build.sh -%{__python} setup.py test -nosetests --exe --with-cov --cov-report html --cov-config tox.ini cd tests && ./test_compose.sh %files From a3ac81a977d662c06aa626477c2e6fa0568ab829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 16 Nov 2016 10:16:19 +0100 Subject: [PATCH 66/78] Escape % sign in changelog to silence rpmlint complaining about macro-in-%changelog. --- pungi.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pungi.spec b/pungi.spec index defb781c..da879323 100644 --- a/pungi.spec +++ b/pungi.spec @@ -111,7 +111,7 @@ cd tests && ./test_compose.sh (lubomir.sedlar) - [ostree] New option to enable generating ostree summary file (qwan) - pungi: Avoid removing from list (lsedlar) -- pungi: Allow globs in %multilib-whitelist (dmach) +- pungi: Allow globs in %%multilib-whitelist (dmach) - pungi: Exclude RPMs that are in lookaside (dmach) - pungi: Fix excluding SRPMs (dmach) - pungi: Speed up blacklist processing (dmach) @@ -651,7 +651,7 @@ cd tests && ./test_compose.sh - Add dependency of 'runroot' config option on 'koji_profile'. (dmach) - Rename product_* to release_*. (dmach) - Implement koji profiles. (dmach) -- Drop repoclosure-%arch tests. (dmach) +- Drop repoclosure-%%arch tests. (dmach) - Config option create_optional_isos now defaults to False. (dmach) - Change createrepo config options defaults. (dmach) - Rewrite documentation to Sphinx. (dmach) From 5908d4f781cf1d0ec85393ba9809ac427b33ae18 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 16 Nov 2016 07:41:42 -0600 Subject: [PATCH 67/78] updated source Signed-off-by: Dennis Gilmore --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 43bef367..d1eb6b96 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d29783dccd912fca8092adb3e09037ba pungi-4.1.11.tar.bz2 +0085862673872aceb25674dd492f2795 pungi-4.1.11.tar.bz2 From 6db0406068c38f2051a5092a1f4cd806e14ceeef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Mon, 21 Nov 2016 07:57:45 +0100 Subject: [PATCH 68/78] Add missing dependency on libguestfs-tools-c also remove patches applied to tarball. --- ...pungi-Fix-tests-on-non-x86_64-arches.patch | 36 ------------------- ...-pungi-Fix-incorrectly-skipped-tests.patch | 33 ----------------- pungi.spec | 11 +++--- 3 files changed, 5 insertions(+), 75 deletions(-) delete mode 100644 0001-pungi-Fix-tests-on-non-x86_64-arches.patch delete mode 100644 0002-pungi-Fix-incorrectly-skipped-tests.patch diff --git a/0001-pungi-Fix-tests-on-non-x86_64-arches.patch b/0001-pungi-Fix-tests-on-non-x86_64-arches.patch deleted file mode 100644 index 5e3c461a..00000000 --- a/0001-pungi-Fix-tests-on-non-x86_64-arches.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 3c1e2fba662cd635b20d2daf2c5acacfee407876 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= -Date: Wed, 16 Nov 2016 09:20:10 +0100 -Subject: [PATCH] pungi: Fix tests on non-x86_64 arches -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -If the test did not specify an arch explicitly, it fell back on whatever -arch the current machine has. This was causing failures when building -RPM. - -Signed-off-by: Lubomír Sedlář ---- - tests/test_pungi.py | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/tests/test_pungi.py b/tests/test_pungi.py -index a3297e7..d770d2a 100644 ---- a/tests/test_pungi.py -+++ b/tests/test_pungi.py -@@ -65,6 +65,11 @@ class TestPungi(unittest.TestCase): - p.write_kickstart(self.ks, repos, groups, packages, prepopulate=prepopulate, - multilib_whitelist=multilib_whitelist) - kwargs.setdefault('cache_dir', self.tmp_dir) -+ # Unless the test specifies an arch, we need to default to x86_64. -+ # Otherwise the arch of current machine will be used, which will cause -+ # failure most of the time. -+ kwargs.setdefault('arch', 'x86_64') -+ - p.run_pungi(self.ks, self.tmp_dir, 'DP', **kwargs) - with open(self.out, "r") as f: - pkg_map = p.get_packages(f.read()) --- -2.7.4 - diff --git a/0002-pungi-Fix-incorrectly-skipped-tests.patch b/0002-pungi-Fix-incorrectly-skipped-tests.patch deleted file mode 100644 index bee99c11..00000000 --- a/0002-pungi-Fix-incorrectly-skipped-tests.patch +++ /dev/null @@ -1,33 +0,0 @@ -From b7813d34ac8e7986fbf2e8b1e4fc35427655ee8a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= -Date: Wed, 16 Nov 2016 09:43:19 +0100 -Subject: [PATCH 2/2] pungi: Fix incorrectly skipped tests -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The test was not correctly being skipped in Koji build, causing build -failure. - -Signed-off-by: Lubomír Sedlář ---- - tests/test_pungi.py | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/tests/test_pungi.py b/tests/test_pungi.py -index d770d2a..a519ddf 100644 ---- a/tests/test_pungi.py -+++ b/tests/test_pungi.py -@@ -776,8 +776,7 @@ class TestPungi(unittest.TestCase): - "dummy-glibc-debuginfo-common-2.14-5.x86_64.rpm", - ]) - -- # This test is broken. -- @unittest.skip -+ @unittest.skip('This test is broken') - def test_bash_multilib_nogreedy(self): - packages = [ - "dummy-bash.+", --- -2.7.4 - diff --git a/pungi.spec b/pungi.spec index da879323..92d9ed0e 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,15 +1,12 @@ Name: pungi Version: 4.1.11 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distribution compose tool Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2 -# These patches are added here to fix running tests. They are proposed in upstream as well. -Patch0: 0001-pungi-Fix-tests-on-non-x86_64-arches.patch -Patch1: 0002-pungi-Fix-incorrectly-skipped-tests.patch BuildRequires: python-nose, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd @@ -50,6 +47,7 @@ Requires: gettext #Requires: syslinux Requires: git Requires: python-jsonschema +Requires: libguestfs-tools-c BuildArch: noarch @@ -58,8 +56,6 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %prep %setup -q -%patch0 -p1 -%patch1 -p1 %build %{__python} setup.py build @@ -92,6 +88,9 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Mon Nov 21 2016 Lubomír Sedlář - 4.1.11-2 +- Add missing dependency on libguestfs-tools-c + * Tue Nov 15 2016 Dennis Gilmore - 4.1.11-1 - [ostree] Allow extra repos to get packages for composing OSTree repository (qwan) From 6f725976773240dc6f704a75240e9c7d53050a81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 8 Dec 2016 08:59:47 +0100 Subject: [PATCH 69/78] Backport patches for ostree installer * Expose lorax's rootfs-size argument * Use dvd-ostree as type in metadata --- ...-Expose-lorax-s-rootfs-size-argument.patch | 90 +++++++++++++++++++ ...r-Use-dvd-ostree-as-type-in-metadata.patch | 46 ++++++++++ pungi.spec | 9 +- 3 files changed, 144 insertions(+), 1 deletion(-) create mode 100644 0001-Expose-lorax-s-rootfs-size-argument.patch create mode 100644 0002-ostree-installer-Use-dvd-ostree-as-type-in-metadata.patch diff --git a/0001-Expose-lorax-s-rootfs-size-argument.patch b/0001-Expose-lorax-s-rootfs-size-argument.patch new file mode 100644 index 00000000..bb446cbd --- /dev/null +++ b/0001-Expose-lorax-s-rootfs-size-argument.patch @@ -0,0 +1,90 @@ +From e7e6adfb14c7c0bae7c98454975624c71d1ee1c6 Mon Sep 17 00:00:00 2001 +From: Colin Walters +Date: Thu, 17 Nov 2016 10:15:03 -0500 +Subject: [PATCH 1/2] Expose lorax's --rootfs-size argument + +This is going to be necessary for reworking the Atomic Host ISO, +see: https://pagure.io/fedora-lorax-templates/pull-request/6 + +Signed-off-by: Colin Walters +--- + doc/configuration.rst | 1 + + pungi/checks.py | 1 + + pungi/phases/ostree_installer.py | 1 + + pungi/wrappers/lorax.py | 4 ++++ + tests/test_config.py | 1 + + 5 files changed, 8 insertions(+) + +diff --git a/doc/configuration.rst b/doc/configuration.rst +index e22ae44..58be31e 100644 +--- a/doc/configuration.rst ++++ b/doc/configuration.rst +@@ -1171,6 +1171,7 @@ an OSTree repository. This always runs in Koji as a ``runroot`` task. + * ``add_arch_template`` -- (*[str]*) + * ``add_template_var`` -- (*[str]*) + * ``add_arch_template_var`` -- (*[str]*) ++ * ``rootfs_size`` -- (*[str]*) + * ``template_repo`` -- (*str*) Git repository with extra templates. + * ``template_branch`` -- (*str*) Branch to use from ``template_repo``. + +diff --git a/pungi/checks.py b/pungi/checks.py +index edf7020..be7cfc7 100644 +--- a/pungi/checks.py ++++ b/pungi/checks.py +@@ -715,6 +715,7 @@ def _make_schema(): + "add_arch_template": {"$ref": "#/definitions/list_of_strings"}, + "add_template_var": {"$ref": "#/definitions/list_of_strings"}, + "add_arch_template_var": {"$ref": "#/definitions/list_of_strings"}, ++ "rootfs_size": {"type": "string"}, + "template_repo": {"type": "string"}, + "template_branch": {"type": "string"}, + }, +diff --git a/pungi/phases/ostree_installer.py b/pungi/phases/ostree_installer.py +index 8cde3d7..b07d7a4 100644 +--- a/pungi/phases/ostree_installer.py ++++ b/pungi/phases/ostree_installer.py +@@ -152,6 +152,7 @@ class OstreeInstallerThread(WorkerThread): + add_arch_template=self._get_templates(config, 'add_arch_template'), + add_template_var=config.get('add_template_var'), + add_arch_template_var=config.get('add_arch_template_var'), ++ rootfs_size=config.get('rootfs_size'), + is_final=compose.supported, + log_dir=self.logdir, + ) +diff --git a/pungi/wrappers/lorax.py b/pungi/wrappers/lorax.py +index 12263fa..50b91c0 100644 +--- a/pungi/wrappers/lorax.py ++++ b/pungi/wrappers/lorax.py +@@ -26,6 +26,7 @@ class LoraxWrapper(object): + is_final=False, buildarch=None, volid=None, buildinstallpackages=None, + add_template=None, add_arch_template=None, + add_template_var=None, add_arch_template_var=None, ++ rootfs_size=None, + log_dir=None): + cmd = ["lorax"] + cmd.append("--product=%s" % product) +@@ -67,6 +68,9 @@ class LoraxWrapper(object): + if log_dir: + cmd.append('--logfile=%s' % os.path.join(log_dir, 'lorax.log')) + ++ if rootfs_size is not None: ++ cmd.append('--rootfs-size=%s' % (rootfs_size)) ++ + output_dir = os.path.abspath(output_dir) + cmd.append(output_dir) + +diff --git a/tests/test_config.py b/tests/test_config.py +index b49b2c1..7f49f5d 100644 +--- a/tests/test_config.py ++++ b/tests/test_config.py +@@ -310,6 +310,7 @@ class OstreeInstallerConfigTestCase(unittest.TestCase): + "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", + ], + "add_arch_template": ["/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl"], ++ "rootfs_size": "3", + "add_arch_template_var": [ + "ostree_repo=https://kojipkgs.fedoraproject.org/compose/atomic/Rawhide/", + "ostree_osname=fedora-atomic", +-- +2.9.3 + diff --git a/0002-ostree-installer-Use-dvd-ostree-as-type-in-metadata.patch b/0002-ostree-installer-Use-dvd-ostree-as-type-in-metadata.patch new file mode 100644 index 00000000..bf9fbd70 --- /dev/null +++ b/0002-ostree-installer-Use-dvd-ostree-as-type-in-metadata.patch @@ -0,0 +1,46 @@ +From ec4fb785e5e68d09b6790963085d33787337ac0d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Thu, 6 Oct 2016 13:12:34 +0200 +Subject: [PATCH 2/2] ostree-installer: Use dvd-ostree as type in metadata +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This depends on python-productmd >= 1.3 that understands this format. + +Fixes: #417 +Signed-off-by: Lubomír Sedlář +--- + pungi/phases/ostree_installer.py | 2 +- + tests/test_ostree_installer_phase.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pungi/phases/ostree_installer.py b/pungi/phases/ostree_installer.py +index b07d7a4..5b8d89d 100644 +--- a/pungi/phases/ostree_installer.py ++++ b/pungi/phases/ostree_installer.py +@@ -107,7 +107,7 @@ class OstreeInstallerThread(WorkerThread): + img.mtime = util.get_mtime(full_iso_path) + img.size = util.get_file_size(full_iso_path) + img.arch = arch +- img.type = "boot" ++ img.type = "dvd-ostree" + img.format = "iso" + img.disc_number = 1 + img.disc_count = 1 +diff --git a/tests/test_ostree_installer_phase.py b/tests/test_ostree_installer_phase.py +index ad7ee2f..b3e04b6 100644 +--- a/tests/test_ostree_installer_phase.py ++++ b/tests/test_ostree_installer_phase.py +@@ -61,7 +61,7 @@ class OstreeThreadTest(helpers.PungiTestCase): + self.assertEqual(image.mtime, 13579) + self.assertEqual(image.size, 1024) + self.assertEqual(image.arch, 'x86_64') +- self.assertEqual(image.type, "boot") ++ self.assertEqual(image.type, "dvd-ostree") + self.assertEqual(image.format, "iso") + self.assertEqual(image.disc_number, 1) + self.assertEqual(image.disc_count, 1) +-- +2.9.3 + diff --git a/pungi.spec b/pungi.spec index 92d9ed0e..6476957e 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,12 +1,14 @@ Name: pungi Version: 4.1.11 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Distribution compose tool Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2 +Patch0: 0001-Expose-lorax-s-rootfs-size-argument.patch +Patch1: 0002-ostree-installer-Use-dvd-ostree-as-type-in-metadata.patch BuildRequires: python-nose, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd @@ -56,6 +58,8 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %prep %setup -q +%patch0 -p1 +%patch1 -p1 %build %{__python} setup.py build @@ -88,6 +92,9 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Thu Dec 08 2016 Lubomír Sedlář - 4.1.11-3 +- Backport patches for ostree installer + * Mon Nov 21 2016 Lubomír Sedlář - 4.1.11-2 - Add missing dependency on libguestfs-tools-c From e0249a029f7f51fbdd24c6cc18189393c223f9f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 14 Dec 2016 14:07:50 +0100 Subject: [PATCH 70/78] Add patches for koji kerberos auth --- ...-Expose-lorax-s-rootfs-size-argument.patch | 2 +- ...r-Use-dvd-ostree-as-type-in-metadata.patch | 2 +- 0003-Make-KojiWrapper-parse-krb_rdns.patch | 26 ++++++++++++++++ ...rapper-support-krb_login-with-keytab.patch | 31 +++++++++++++++++++ pungi.spec | 9 +++++- 5 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 0003-Make-KojiWrapper-parse-krb_rdns.patch create mode 100644 0004-Make-KojiWrapper-support-krb_login-with-keytab.patch diff --git a/0001-Expose-lorax-s-rootfs-size-argument.patch b/0001-Expose-lorax-s-rootfs-size-argument.patch index bb446cbd..60662980 100644 --- a/0001-Expose-lorax-s-rootfs-size-argument.patch +++ b/0001-Expose-lorax-s-rootfs-size-argument.patch @@ -1,7 +1,7 @@ From e7e6adfb14c7c0bae7c98454975624c71d1ee1c6 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 17 Nov 2016 10:15:03 -0500 -Subject: [PATCH 1/2] Expose lorax's --rootfs-size argument +Subject: [PATCH 1/4] Expose lorax's --rootfs-size argument This is going to be necessary for reworking the Atomic Host ISO, see: https://pagure.io/fedora-lorax-templates/pull-request/6 diff --git a/0002-ostree-installer-Use-dvd-ostree-as-type-in-metadata.patch b/0002-ostree-installer-Use-dvd-ostree-as-type-in-metadata.patch index bf9fbd70..ee3af784 100644 --- a/0002-ostree-installer-Use-dvd-ostree-as-type-in-metadata.patch +++ b/0002-ostree-installer-Use-dvd-ostree-as-type-in-metadata.patch @@ -1,7 +1,7 @@ From ec4fb785e5e68d09b6790963085d33787337ac0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 6 Oct 2016 13:12:34 +0200 -Subject: [PATCH 2/2] ostree-installer: Use dvd-ostree as type in metadata +Subject: [PATCH 2/4] ostree-installer: Use dvd-ostree as type in metadata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/0003-Make-KojiWrapper-parse-krb_rdns.patch b/0003-Make-KojiWrapper-parse-krb_rdns.patch new file mode 100644 index 00000000..d760301a --- /dev/null +++ b/0003-Make-KojiWrapper-parse-krb_rdns.patch @@ -0,0 +1,26 @@ +From 364956064eab5e53c7eb4af4ec78888784cfc9d2 Mon Sep 17 00:00:00 2001 +From: Patrick Uiterwijk +Date: Tue, 13 Dec 2016 13:48:58 +0000 +Subject: [PATCH 3/4] Make KojiWrapper parse krb_rdns + +Signed-off-by: Patrick Uiterwijk +--- + pungi/wrappers/kojiwrapper.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pungi/wrappers/kojiwrapper.py b/pungi/wrappers/kojiwrapper.py +index 85a933a..8dcb5aa 100644 +--- a/pungi/wrappers/kojiwrapper.py ++++ b/pungi/wrappers/kojiwrapper.py +@@ -39,7 +39,7 @@ class KojiWrapper(object): + for key in ('krbservice', 'timeout', 'keepalive', + 'max_retries', 'retry_interval', 'anon_retry', + 'offline_retry', 'offline_retry_interval', +- 'debug', 'debug_xmlrpc', ++ 'debug', 'debug_xmlrpc', 'krb_rdns', + 'use_fast_upload'): + value = getattr(self.koji_module.config, key, None) + if value is not None: +-- +2.9.3 + diff --git a/0004-Make-KojiWrapper-support-krb_login-with-keytab.patch b/0004-Make-KojiWrapper-support-krb_login-with-keytab.patch new file mode 100644 index 00000000..b615eb43 --- /dev/null +++ b/0004-Make-KojiWrapper-support-krb_login-with-keytab.patch @@ -0,0 +1,31 @@ +From c17d72c5e1a73dd7c173ba791710d66b92e73e24 Mon Sep 17 00:00:00 2001 +From: Patrick Uiterwijk +Date: Tue, 13 Dec 2016 13:51:48 +0000 +Subject: [PATCH 4/4] Make KojiWrapper support krb_login with keytab + +Using getattr so we also work with versions of koji that do not +read principal and keytab from the config file. + +Signed-off-by: Patrick Uiterwijk +--- + pungi/wrappers/kojiwrapper.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/pungi/wrappers/kojiwrapper.py b/pungi/wrappers/kojiwrapper.py +index 8dcb5aa..0dcac90 100644 +--- a/pungi/wrappers/kojiwrapper.py ++++ b/pungi/wrappers/kojiwrapper.py +@@ -55,7 +55,9 @@ class KojiWrapper(object): + os.path.expanduser(self.koji_module.config.ca), + os.path.expanduser(self.koji_module.config.serverca)) + elif auth_type == 'kerberos': +- self.koji_proxy.krb_login() ++ self.koji_proxy.krb_login( ++ getattr(self.koji_module.config, 'principal', None), ++ getattr(self.koji_module.config, 'keytab', None)) + else: + raise RuntimeError('Unsupported authentication type in Koji') + +-- +2.9.3 + diff --git a/pungi.spec b/pungi.spec index 6476957e..448d5825 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.1.11 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Distribution compose tool Group: Development/Tools @@ -9,6 +9,8 @@ URL: https://pagure.io/pungi Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2 Patch0: 0001-Expose-lorax-s-rootfs-size-argument.patch Patch1: 0002-ostree-installer-Use-dvd-ostree-as-type-in-metadata.patch +Patch2: 0003-Make-KojiWrapper-parse-krb_rdns.patch +Patch3: 0004-Make-KojiWrapper-support-krb_login-with-keytab.patch BuildRequires: python-nose, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd @@ -60,6 +62,8 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build %{__python} setup.py build @@ -92,6 +96,9 @@ cd tests && ./test_compose.sh /var/cache/pungi %changelog +* Wed Dec 14 2016 Lubomír Sedlář - 4.1.11-4 +- Add patches for koji kerberos auth + * Thu Dec 08 2016 Lubomír Sedlář - 4.1.11-3 - Backport patches for ostree installer From b7b404a6e06ee5e9d84ce7b9162c4e58a4d18bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 18 Jan 2017 14:42:22 +0100 Subject: [PATCH 71/78] New upstream release 4.1.12 --- ...-Expose-lorax-s-rootfs-size-argument.patch | 90 ------------------- ...r-Use-dvd-ostree-as-type-in-metadata.patch | 46 ---------- 0003-Make-KojiWrapper-parse-krb_rdns.patch | 26 ------ ...rapper-support-krb_login-with-keytab.patch | 31 ------- pungi.spec | 80 ++++++++++++++--- sources | 2 +- 6 files changed, 70 insertions(+), 205 deletions(-) delete mode 100644 0001-Expose-lorax-s-rootfs-size-argument.patch delete mode 100644 0002-ostree-installer-Use-dvd-ostree-as-type-in-metadata.patch delete mode 100644 0003-Make-KojiWrapper-parse-krb_rdns.patch delete mode 100644 0004-Make-KojiWrapper-support-krb_login-with-keytab.patch diff --git a/0001-Expose-lorax-s-rootfs-size-argument.patch b/0001-Expose-lorax-s-rootfs-size-argument.patch deleted file mode 100644 index 60662980..00000000 --- a/0001-Expose-lorax-s-rootfs-size-argument.patch +++ /dev/null @@ -1,90 +0,0 @@ -From e7e6adfb14c7c0bae7c98454975624c71d1ee1c6 Mon Sep 17 00:00:00 2001 -From: Colin Walters -Date: Thu, 17 Nov 2016 10:15:03 -0500 -Subject: [PATCH 1/4] Expose lorax's --rootfs-size argument - -This is going to be necessary for reworking the Atomic Host ISO, -see: https://pagure.io/fedora-lorax-templates/pull-request/6 - -Signed-off-by: Colin Walters ---- - doc/configuration.rst | 1 + - pungi/checks.py | 1 + - pungi/phases/ostree_installer.py | 1 + - pungi/wrappers/lorax.py | 4 ++++ - tests/test_config.py | 1 + - 5 files changed, 8 insertions(+) - -diff --git a/doc/configuration.rst b/doc/configuration.rst -index e22ae44..58be31e 100644 ---- a/doc/configuration.rst -+++ b/doc/configuration.rst -@@ -1171,6 +1171,7 @@ an OSTree repository. This always runs in Koji as a ``runroot`` task. - * ``add_arch_template`` -- (*[str]*) - * ``add_template_var`` -- (*[str]*) - * ``add_arch_template_var`` -- (*[str]*) -+ * ``rootfs_size`` -- (*[str]*) - * ``template_repo`` -- (*str*) Git repository with extra templates. - * ``template_branch`` -- (*str*) Branch to use from ``template_repo``. - -diff --git a/pungi/checks.py b/pungi/checks.py -index edf7020..be7cfc7 100644 ---- a/pungi/checks.py -+++ b/pungi/checks.py -@@ -715,6 +715,7 @@ def _make_schema(): - "add_arch_template": {"$ref": "#/definitions/list_of_strings"}, - "add_template_var": {"$ref": "#/definitions/list_of_strings"}, - "add_arch_template_var": {"$ref": "#/definitions/list_of_strings"}, -+ "rootfs_size": {"type": "string"}, - "template_repo": {"type": "string"}, - "template_branch": {"type": "string"}, - }, -diff --git a/pungi/phases/ostree_installer.py b/pungi/phases/ostree_installer.py -index 8cde3d7..b07d7a4 100644 ---- a/pungi/phases/ostree_installer.py -+++ b/pungi/phases/ostree_installer.py -@@ -152,6 +152,7 @@ class OstreeInstallerThread(WorkerThread): - add_arch_template=self._get_templates(config, 'add_arch_template'), - add_template_var=config.get('add_template_var'), - add_arch_template_var=config.get('add_arch_template_var'), -+ rootfs_size=config.get('rootfs_size'), - is_final=compose.supported, - log_dir=self.logdir, - ) -diff --git a/pungi/wrappers/lorax.py b/pungi/wrappers/lorax.py -index 12263fa..50b91c0 100644 ---- a/pungi/wrappers/lorax.py -+++ b/pungi/wrappers/lorax.py -@@ -26,6 +26,7 @@ class LoraxWrapper(object): - is_final=False, buildarch=None, volid=None, buildinstallpackages=None, - add_template=None, add_arch_template=None, - add_template_var=None, add_arch_template_var=None, -+ rootfs_size=None, - log_dir=None): - cmd = ["lorax"] - cmd.append("--product=%s" % product) -@@ -67,6 +68,9 @@ class LoraxWrapper(object): - if log_dir: - cmd.append('--logfile=%s' % os.path.join(log_dir, 'lorax.log')) - -+ if rootfs_size is not None: -+ cmd.append('--rootfs-size=%s' % (rootfs_size)) -+ - output_dir = os.path.abspath(output_dir) - cmd.append(output_dir) - -diff --git a/tests/test_config.py b/tests/test_config.py -index b49b2c1..7f49f5d 100644 ---- a/tests/test_config.py -+++ b/tests/test_config.py -@@ -310,6 +310,7 @@ class OstreeInstallerConfigTestCase(unittest.TestCase): - "ostree_ref=fedora-atomic/Rawhide/x86_64/docker-host", - ], - "add_arch_template": ["/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl"], -+ "rootfs_size": "3", - "add_arch_template_var": [ - "ostree_repo=https://kojipkgs.fedoraproject.org/compose/atomic/Rawhide/", - "ostree_osname=fedora-atomic", --- -2.9.3 - diff --git a/0002-ostree-installer-Use-dvd-ostree-as-type-in-metadata.patch b/0002-ostree-installer-Use-dvd-ostree-as-type-in-metadata.patch deleted file mode 100644 index ee3af784..00000000 --- a/0002-ostree-installer-Use-dvd-ostree-as-type-in-metadata.patch +++ /dev/null @@ -1,46 +0,0 @@ -From ec4fb785e5e68d09b6790963085d33787337ac0d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= -Date: Thu, 6 Oct 2016 13:12:34 +0200 -Subject: [PATCH 2/4] ostree-installer: Use dvd-ostree as type in metadata -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This depends on python-productmd >= 1.3 that understands this format. - -Fixes: #417 -Signed-off-by: Lubomír Sedlář ---- - pungi/phases/ostree_installer.py | 2 +- - tests/test_ostree_installer_phase.py | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/pungi/phases/ostree_installer.py b/pungi/phases/ostree_installer.py -index b07d7a4..5b8d89d 100644 ---- a/pungi/phases/ostree_installer.py -+++ b/pungi/phases/ostree_installer.py -@@ -107,7 +107,7 @@ class OstreeInstallerThread(WorkerThread): - img.mtime = util.get_mtime(full_iso_path) - img.size = util.get_file_size(full_iso_path) - img.arch = arch -- img.type = "boot" -+ img.type = "dvd-ostree" - img.format = "iso" - img.disc_number = 1 - img.disc_count = 1 -diff --git a/tests/test_ostree_installer_phase.py b/tests/test_ostree_installer_phase.py -index ad7ee2f..b3e04b6 100644 ---- a/tests/test_ostree_installer_phase.py -+++ b/tests/test_ostree_installer_phase.py -@@ -61,7 +61,7 @@ class OstreeThreadTest(helpers.PungiTestCase): - self.assertEqual(image.mtime, 13579) - self.assertEqual(image.size, 1024) - self.assertEqual(image.arch, 'x86_64') -- self.assertEqual(image.type, "boot") -+ self.assertEqual(image.type, "dvd-ostree") - self.assertEqual(image.format, "iso") - self.assertEqual(image.disc_number, 1) - self.assertEqual(image.disc_count, 1) --- -2.9.3 - diff --git a/0003-Make-KojiWrapper-parse-krb_rdns.patch b/0003-Make-KojiWrapper-parse-krb_rdns.patch deleted file mode 100644 index d760301a..00000000 --- a/0003-Make-KojiWrapper-parse-krb_rdns.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 364956064eab5e53c7eb4af4ec78888784cfc9d2 Mon Sep 17 00:00:00 2001 -From: Patrick Uiterwijk -Date: Tue, 13 Dec 2016 13:48:58 +0000 -Subject: [PATCH 3/4] Make KojiWrapper parse krb_rdns - -Signed-off-by: Patrick Uiterwijk ---- - pungi/wrappers/kojiwrapper.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pungi/wrappers/kojiwrapper.py b/pungi/wrappers/kojiwrapper.py -index 85a933a..8dcb5aa 100644 ---- a/pungi/wrappers/kojiwrapper.py -+++ b/pungi/wrappers/kojiwrapper.py -@@ -39,7 +39,7 @@ class KojiWrapper(object): - for key in ('krbservice', 'timeout', 'keepalive', - 'max_retries', 'retry_interval', 'anon_retry', - 'offline_retry', 'offline_retry_interval', -- 'debug', 'debug_xmlrpc', -+ 'debug', 'debug_xmlrpc', 'krb_rdns', - 'use_fast_upload'): - value = getattr(self.koji_module.config, key, None) - if value is not None: --- -2.9.3 - diff --git a/0004-Make-KojiWrapper-support-krb_login-with-keytab.patch b/0004-Make-KojiWrapper-support-krb_login-with-keytab.patch deleted file mode 100644 index b615eb43..00000000 --- a/0004-Make-KojiWrapper-support-krb_login-with-keytab.patch +++ /dev/null @@ -1,31 +0,0 @@ -From c17d72c5e1a73dd7c173ba791710d66b92e73e24 Mon Sep 17 00:00:00 2001 -From: Patrick Uiterwijk -Date: Tue, 13 Dec 2016 13:51:48 +0000 -Subject: [PATCH 4/4] Make KojiWrapper support krb_login with keytab - -Using getattr so we also work with versions of koji that do not -read principal and keytab from the config file. - -Signed-off-by: Patrick Uiterwijk ---- - pungi/wrappers/kojiwrapper.py | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/pungi/wrappers/kojiwrapper.py b/pungi/wrappers/kojiwrapper.py -index 8dcb5aa..0dcac90 100644 ---- a/pungi/wrappers/kojiwrapper.py -+++ b/pungi/wrappers/kojiwrapper.py -@@ -55,7 +55,9 @@ class KojiWrapper(object): - os.path.expanduser(self.koji_module.config.ca), - os.path.expanduser(self.koji_module.config.serverca)) - elif auth_type == 'kerberos': -- self.koji_proxy.krb_login() -+ self.koji_proxy.krb_login( -+ getattr(self.koji_module.config, 'principal', None), -+ getattr(self.koji_module.config, 'keytab', None)) - else: - raise RuntimeError('Unsupported authentication type in Koji') - --- -2.9.3 - diff --git a/pungi.spec b/pungi.spec index 448d5825..e17a3bf2 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,16 +1,12 @@ Name: pungi -Version: 4.1.11 -Release: 4%{?dist} +Version: 4.1.12 +Release: 1%{?dist} Summary: Distribution compose tool Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2 -Patch0: 0001-Expose-lorax-s-rootfs-size-argument.patch -Patch1: 0002-ostree-installer-Use-dvd-ostree-as-type-in-metadata.patch -Patch2: 0003-Make-KojiWrapper-parse-krb_rdns.patch -Patch3: 0004-Make-KojiWrapper-support-krb_login-with-keytab.patch BuildRequires: python-nose, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd @@ -26,6 +22,8 @@ BuildRequires: texlive-times, texlive-cmap, texlive-babel-english, texlive-fanc BuildRequires: texlive-fancybox, texlive-titlesec, texlive-framed, texlive-threeparttable BuildRequires: texlive-mdwtools, texlive-wrapfig, texlive-parskip, texlive-upquote BuildRequires: texlive-multirow, texlive-capt-of, texlive-eqparbox, tex(color.cfg) +BuildRequires: tex(fncychap.sty) +BuildRequires: tex(tabulary.sty) Requires: createrepo >= 0.4.11 Requires: yum => 3.4.3-28 @@ -58,12 +56,18 @@ BuildArch: noarch %description A tool to create anaconda based installation trees/isos of a set of rpms. +%package utils +Summary: Utilities for working with finished composes +Requires: pungi = %{version}-%{release} + +%description utils +These utilities work with finished composes produced by Pungi. They can be used +for creating unified ISO images, validating config file or sending progress +notification to Fedora Message Bus. + + %prep %setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 %build %{__python} setup.py build @@ -90,12 +94,66 @@ cd tests && ./test_compose.sh %doc AUTHORS doc/_build/latex/Pungi.pdf doc/_build/epub/Pungi.epub doc/_build/text/* %{python_sitelib}/%{name} %{python_sitelib}/%{name}-%{version}-py?.?.egg-info -%{_bindir}/* +%{_bindir}/%{name} +%{_bindir}/%{name}-koji +%{_bindir}/comps_filter +%{_bindir}/%{name}-make-ostree %{_mandir}/man1/pungi.1.gz %{_datadir}/pungi /var/cache/pungi +%files utils +%{python_sitelib}/%{name}_utils +%{_bindir}/%{name}-create-unified-isos +%{_bindir}/%{name}-config-validate +%{_bindir}/%{name}-fedmsg-notification + %changelog +* Tue Jan 17 2017 Lubomír Sedlář - 4.1.12-1 +- unified-iso: Fall back to default config (lsedlar) +- osbs: optionally check GPG signatures (qwan) +- ostree-installer: Allow multiple repos in ostree installer (qwan) +- Update tox.ini (lsedlar) +- unified-iso: Create isos with debuginfo packages (lsedlar) +- Create temporary dirs under compose's workdir (qwan) +- spec: Update upstream and source URL (lsedlar) +- unified-iso: Create work/ dir if missing (lsedlar) +- spec: Copy %%check section from Fedora (lsedlar) +- Update MANIFEST.in to include test data (lsedlar) +- osbs: Add better example to documentation (lsedlar) +- metadata: Correctly parse lorax .treeinfo (lsedlar) +- spec: Add a separate subpackage for extra utils (lsedlar) +- Add script to generate unified ISOs (lsedlar) +- osbs: Validate config in tests (lsedlar) +- osbs: Verify the .repo files contain correct URL (lsedlar) +- osbs: Enable specifying extra repos (lsedlar) +- pungi-make-ostree: change 'tree' command '--log-dir' arg to be required + (qwan) +- Add test for krb_login with principal and keytab (puiterwijk) +- Make sure that the profile name is parsed correctly (puiterwijk) +- Make KojiWrapper support krb_login with keytab (puiterwijk) +- Make KojiWrapper parse krb_rdns (puiterwijk) +- Update documentation (lsedlar) +- image-build: Allow failure only on some arches (lsedlar) +- live-media: Allow some arches to fail (lsedlar) +- image-build: Use install_tree from parent for nested variants (lsedlar) +- config: Report unknown options as warnings (lsedlar) +- pungi: Fix --nosource option (lsedlar) +- pungi: Handle missing SRPM (lsedlar) +- ostree-installer: Add 'installer' sub-command to pungi-make-ostree (qwan) +- ostree: Add 'tree' sub-command to pungi-make-ostree script (qwan) +- metadata: Allow creating internal releases (lsedlar) +- Add CLI option to create ci compose (lsedlar) +- Fix PhaseLoggerMixin in case of compose has _logger = None (qwan) +- ostree-installer: Use dvd-ostree as type in metadata (lsedlar) +- image-build: Reduce duplication (lsedlar) +- createrepo: Add tests for adding product certificates (lsedlar) +- createrepo: Add tests for retrieving product certificates (lsedlar) +- Include phase name in log for some phases (qwan) +- Expose lorax's --rootfs-size argument (walters) +- pungi: Include noarch debuginfo (lsedlar) +- media-split: Print sensible message for unlimited size (lsedlar) + * Wed Dec 14 2016 Lubomír Sedlář - 4.1.11-4 - Add patches for koji kerberos auth diff --git a/sources b/sources index d1eb6b96..364c7379 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -0085862673872aceb25674dd492f2795 pungi-4.1.11.tar.bz2 +SHA512 (pungi-4.1.12.tar.bz2) = 036a4e27bae2af2dac60eabe5c0de253fc0becd5fb6303b745c0cac5db7485617a91c3f9af359e400f2e3c4868043b7f16c2f375cba9c4553153473701d97da1 From 6aede5be206021de62b5bd3d36a0639a818ce528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 18 Jan 2017 15:14:14 +0100 Subject: [PATCH 72/78] Require newer python-productmd --- pungi.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pungi.spec b/pungi.spec index e17a3bf2..f2997d48 100644 --- a/pungi.spec +++ b/pungi.spec @@ -9,7 +9,7 @@ URL: https://pagure.io/pungi Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2 BuildRequires: python-nose, python-mock -BuildRequires: python-devel, python-setuptools, python2-productmd +BuildRequires: python-devel, python-setuptools, python2-productmd >= 1.3 BuildRequires: python-lockfile, kobo, kobo-rpmlib, python-kickstart, createrepo_c BuildRequires: python-lxml, libselinux-python, yum-utils, lorax BuildRequires: yum => 3.4.3-28, createrepo >= 0.4.11 @@ -32,7 +32,7 @@ Requires: repoview Requires: python-lockfile Requires: kobo Requires: kobo-rpmlib -Requires: python-productmd +Requires: python-productmd >= 1.3 Requires: python-kickstart Requires: libselinux-python Requires: createrepo_c From ef582340b6d2959c5f0cace37693457dc108efe7 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 18 Jan 2017 12:56:04 -0600 Subject: [PATCH 73/78] add patch from Patrick to give us some ostree debuging Signed-off-by: Dennis Gilmore --- ...eb06e2cb8fc3cc3f7a97378a7b7bb5c19030.patch | 29 +++++++++++++++++++ pungi.spec | 8 ++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 e599eb06e2cb8fc3cc3f7a97378a7b7bb5c19030.patch diff --git a/e599eb06e2cb8fc3cc3f7a97378a7b7bb5c19030.patch b/e599eb06e2cb8fc3cc3f7a97378a7b7bb5c19030.patch new file mode 100644 index 00000000..d4b1fcdf --- /dev/null +++ b/e599eb06e2cb8fc3cc3f7a97378a7b7bb5c19030.patch @@ -0,0 +1,29 @@ +From e599eb06e2cb8fc3cc3f7a97378a7b7bb5c19030 Mon Sep 17 00:00:00 2001 +From: Patrick Uiterwijk +Date: Jan 18 2017 18:50:34 +0000 +Subject: Add some debugging about ref updating + + +Signed-off-by: Patrick Uiterwijk + +--- + +diff --git a/pungi/ostree/tree.py b/pungi/ostree/tree.py +index 1b616b2..68b6d70 100644 +--- a/pungi/ostree/tree.py ++++ b/pungi/ostree/tree.py +@@ -63,10 +63,13 @@ class Tree(OSTree): + if self.extra_config: + tag_ref = self.extra_config.get('tag_ref', True) + if not tag_ref: ++ print('Not updating ref as configured') + return + ref = get_ref_from_treefile(self.treefile) + commitid = get_commitid_from_commitid_file(self.commitid_file) ++ print('Ref: %r, Commit ID: %r' % (ref, commitid)) + if ref and commitid: ++ print('Updating ref') + # Let's write the tag out ourselves + heads_dir = os.path.join(self.repo, 'refs', 'heads') + if not os.path.exists(heads_dir): + diff --git a/pungi.spec b/pungi.spec index f2997d48..2da622f7 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,12 +1,14 @@ Name: pungi Version: 4.1.12 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distribution compose tool Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2 +# from https://pagure.io/fork/puiterwijk/pungi/c/e599eb06e2cb8fc3cc3f7a97378a7b7bb5c19030 +Patch0: e599eb06e2cb8fc3cc3f7a97378a7b7bb5c19030.patch BuildRequires: python-nose, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd >= 1.3 @@ -68,6 +70,7 @@ notification to Fedora Message Bus. %prep %setup -q +%patch0 -p1 %build %{__python} setup.py build @@ -109,6 +112,9 @@ cd tests && ./test_compose.sh %{_bindir}/%{name}-fedmsg-notification %changelog +* Tue Jan 17 2017 Dennis Gilmore - 4.1.12-2 +- add patch from Patrick to give us some ostree debuging + * Tue Jan 17 2017 Lubomír Sedlář - 4.1.12-1 - unified-iso: Fall back to default config (lsedlar) - osbs: optionally check GPG signatures (qwan) From 4e5b6f476b1af101bf11a806be2bd56cecd55ac9 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 18 Jan 2017 12:58:32 -0600 Subject: [PATCH 74/78] switch to updated patch Signed-off-by: Dennis Gilmore --- ...7db5aad4690b72898d01fa82270c1f503241.patch | 30 +++++++++++++++++-- pungi.spec | 4 +-- 2 files changed, 30 insertions(+), 4 deletions(-) rename e599eb06e2cb8fc3cc3f7a97378a7b7bb5c19030.patch => 63aa7db5aad4690b72898d01fa82270c1f503241.patch (50%) diff --git a/e599eb06e2cb8fc3cc3f7a97378a7b7bb5c19030.patch b/63aa7db5aad4690b72898d01fa82270c1f503241.patch similarity index 50% rename from e599eb06e2cb8fc3cc3f7a97378a7b7bb5c19030.patch rename to 63aa7db5aad4690b72898d01fa82270c1f503241.patch index d4b1fcdf..66216b00 100644 --- a/e599eb06e2cb8fc3cc3f7a97378a7b7bb5c19030.patch +++ b/63aa7db5aad4690b72898d01fa82270c1f503241.patch @@ -1,6 +1,6 @@ -From e599eb06e2cb8fc3cc3f7a97378a7b7bb5c19030 Mon Sep 17 00:00:00 2001 +From 63aa7db5aad4690b72898d01fa82270c1f503241 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk -Date: Jan 18 2017 18:50:34 +0000 +Date: Jan 18 2017 18:52:45 +0000 Subject: Add some debugging about ref updating @@ -26,4 +26,30 @@ index 1b616b2..68b6d70 100644 # Let's write the tag out ourselves heads_dir = os.path.join(self.repo, 'refs', 'heads') if not os.path.exists(heads_dir): +diff --git a/pungi/ostree/utils.py b/pungi/ostree/utils.py +index fb5e330..02540c9 100644 +--- a/pungi/ostree/utils.py ++++ b/pungi/ostree/utils.py +@@ -37,8 +37,10 @@ def get_ref_from_treefile(treefile): + try: + parsed = json.loads(f.read()) + ref = parsed['ref'] +- except Exception: +- pass ++ except Exception as e: ++ print('Unable to get ref from treefile: %s' % e) ++ else: ++ print('Unable to open treefile') + return ref + + +@@ -48,6 +50,8 @@ def get_commitid_from_commitid_file(commitid_file): + if os.path.isfile(commitid_file): + with open(commitid_file, 'r') as f: + commitid = f.read().replace('\n', '') ++ else: ++ print('Unable to find commitid file') + return commitid + + diff --git a/pungi.spec b/pungi.spec index 2da622f7..9cc4d81c 100644 --- a/pungi.spec +++ b/pungi.spec @@ -7,8 +7,8 @@ Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2 -# from https://pagure.io/fork/puiterwijk/pungi/c/e599eb06e2cb8fc3cc3f7a97378a7b7bb5c19030 -Patch0: e599eb06e2cb8fc3cc3f7a97378a7b7bb5c19030.patch +# from https://pagure.io/fork/puiterwijk/pungi/c/63aa7db5aad4690b72898d01fa82270c1f503241 +Patch0: 63aa7db5aad4690b72898d01fa82270c1f503241.patch BuildRequires: python-nose, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd >= 1.3 From 7fa76d01df55470ed2b80dcd28e3d77852d1544a Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 18 Jan 2017 14:29:23 -0600 Subject: [PATCH 75/78] add patch to replace ${basearch} in the ostree ref Signed-off-by: Dennis Gilmore --- ...place-basearch-when-updating-the-ref.patch | 37 +++++++++++++++++++ pungi.spec | 9 ++++- 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 0001-replace-basearch-when-updating-the-ref.patch diff --git a/0001-replace-basearch-when-updating-the-ref.patch b/0001-replace-basearch-when-updating-the-ref.patch new file mode 100644 index 00000000..758af040 --- /dev/null +++ b/0001-replace-basearch-when-updating-the-ref.patch @@ -0,0 +1,37 @@ +From 575fd872661f288c90d2fc8498e4db9ffddc4a9e Mon Sep 17 00:00:00 2001 +From: Dennis Gilmore +Date: Wed, 18 Jan 2017 14:22:43 -0600 +Subject: [PATCH] replace ${basearch} when updating the ref + +pungi-make-ostree has to run on the target arch so that rpm +scriptlets can be ran.as a reult we can ask rpm what the +basearch is for the running environment + +Signed-off-by: Dennis Gilmore +--- + pungi/ostree/tree.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/pungi/ostree/tree.py b/pungi/ostree/tree.py +index 68b6d70..2b97af4 100644 +--- a/pungi/ostree/tree.py ++++ b/pungi/ostree/tree.py +@@ -16,6 +16,7 @@ + + import os + import json ++import rpmUtils.arch + from kobo import shortcuts + + from pungi.util import makedirs +@@ -67,6 +68,7 @@ class Tree(OSTree): + return + ref = get_ref_from_treefile(self.treefile) + commitid = get_commitid_from_commitid_file(self.commitid_file) ++ ref = ref.replace('${basearch}', rpmUtils.arch.getBaseArch()) + print('Ref: %r, Commit ID: %r' % (ref, commitid)) + if ref and commitid: + print('Updating ref') +-- +2.11.0 + diff --git a/pungi.spec b/pungi.spec index 9cc4d81c..6562ae0c 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.1.12 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Distribution compose tool Group: Development/Tools @@ -9,11 +9,12 @@ URL: https://pagure.io/pungi Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2 # from https://pagure.io/fork/puiterwijk/pungi/c/63aa7db5aad4690b72898d01fa82270c1f503241 Patch0: 63aa7db5aad4690b72898d01fa82270c1f503241.patch +Patch1: 0001-replace-basearch-when-updating-the-ref.patch BuildRequires: python-nose, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd >= 1.3 BuildRequires: python-lockfile, kobo, kobo-rpmlib, python-kickstart, createrepo_c -BuildRequires: python-lxml, libselinux-python, yum-utils, lorax +BuildRequires: python-lxml, libselinux-python, yum-utils, lorax, python-rpm BuildRequires: yum => 3.4.3-28, createrepo >= 0.4.11 BuildRequires: gettext, git-core, cvs BuildRequires: python-jsonschema @@ -71,6 +72,7 @@ notification to Fedora Message Bus. %prep %setup -q %patch0 -p1 +%patch1 -p1 %build %{__python} setup.py build @@ -112,6 +114,9 @@ cd tests && ./test_compose.sh %{_bindir}/%{name}-fedmsg-notification %changelog +* Tue Jan 17 2017 Dennis Gilmore - 4.1.12-3 +- add patch to replace ${basearch} in the ostree ref + * Tue Jan 17 2017 Dennis Gilmore - 4.1.12-2 - add patch from Patrick to give us some ostree debuging From 358378864816e52c12187224135ef76b710c8a87 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 18 Jan 2017 15:38:15 -0600 Subject: [PATCH 76/78] update patch with fix for test suite failures Signed-off-by: Dennis Gilmore --- 0001-replace-basearch-when-updating-the-ref.patch | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/0001-replace-basearch-when-updating-the-ref.patch b/0001-replace-basearch-when-updating-the-ref.patch index 758af040..5e4a4ebb 100644 --- a/0001-replace-basearch-when-updating-the-ref.patch +++ b/0001-replace-basearch-when-updating-the-ref.patch @@ -1,4 +1,4 @@ -From 575fd872661f288c90d2fc8498e4db9ffddc4a9e Mon Sep 17 00:00:00 2001 +From 1e9962be27718171e9291c1b62983229ca49b907 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 18 Jan 2017 14:22:43 -0600 Subject: [PATCH] replace ${basearch} when updating the ref @@ -9,11 +9,11 @@ basearch is for the running environment Signed-off-by: Dennis Gilmore --- - pungi/ostree/tree.py | 2 ++ - 1 file changed, 2 insertions(+) + pungi/ostree/tree.py | 3 +++ + 1 file changed, 3 insertions(+) diff --git a/pungi/ostree/tree.py b/pungi/ostree/tree.py -index 68b6d70..2b97af4 100644 +index 68b6d70..94a0be2 100644 --- a/pungi/ostree/tree.py +++ b/pungi/ostree/tree.py @@ -16,6 +16,7 @@ @@ -24,11 +24,12 @@ index 68b6d70..2b97af4 100644 from kobo import shortcuts from pungi.util import makedirs -@@ -67,6 +68,7 @@ class Tree(OSTree): +@@ -67,6 +68,8 @@ class Tree(OSTree): return ref = get_ref_from_treefile(self.treefile) commitid = get_commitid_from_commitid_file(self.commitid_file) -+ ref = ref.replace('${basearch}', rpmUtils.arch.getBaseArch()) ++ if ref is not None: ++ ref = ref.replace('${basearch}', rpmUtils.arch.getBaseArch()) print('Ref: %r, Commit ID: %r' % (ref, commitid)) if ref and commitid: print('Updating ref') From 0a6966ac86458f321ba29c32b664cb569233dbe8 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 24 Jan 2017 02:23:23 -0600 Subject: [PATCH 77/78] add patches for pagure pr#517 Signed-off-by: Dennis Gilmore --- ...age-build-Expand-arches-for-can_fail.patch | 104 ++++++++ ...place-basearch-when-updating-the-ref.patch | 82 ++++-- ...e-build-Pass-arches-around-as-a-list.patch | 241 ++++++++++++++++++ pungi.spec | 9 +- 4 files changed, 408 insertions(+), 28 deletions(-) create mode 100644 0001-image-build-Expand-arches-for-can_fail.patch create mode 100644 0002-image-build-Pass-arches-around-as-a-list.patch diff --git a/0001-image-build-Expand-arches-for-can_fail.patch b/0001-image-build-Expand-arches-for-can_fail.patch new file mode 100644 index 00000000..3ac6ea91 --- /dev/null +++ b/0001-image-build-Expand-arches-for-can_fail.patch @@ -0,0 +1,104 @@ +From 6c708549c8f6632884bc55abed2f88afa1abe100 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Mon, 23 Jan 2017 16:52:57 +0100 +Subject: [PATCH 1/2] image-build: Expand arches for can_fail +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +We need to work with a list of strings, not a comma-delimited single +string. + +Signed-off-by: Lubomír Sedlář +--- + pungi/phases/image_build.py | 2 +- + tests/test_imagebuildphase.py | 60 +++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 61 insertions(+), 1 deletion(-) + +diff --git a/pungi/phases/image_build.py b/pungi/phases/image_build.py +index 5cfdbb0..b795125 100644 +--- a/pungi/phases/image_build.py ++++ b/pungi/phases/image_build.py +@@ -122,7 +122,7 @@ class ImageBuildPhase(base.PhaseLoggerMixin, base.ImageConfigMixin, base.ConfigG + + can_fail = image_conf['image-build'].pop('failable', []) + if can_fail == ['*']: +- can_fail = image_conf['image-build']['arches'] ++ can_fail = image_conf['image-build']['arches'].split(',') + if can_fail: + image_conf['image-build']['can_fail'] = ','.join(sorted(can_fail)) + +diff --git a/tests/test_imagebuildphase.py b/tests/test_imagebuildphase.py +index 86012ac..328b2b3 100644 +--- a/tests/test_imagebuildphase.py ++++ b/tests/test_imagebuildphase.py +@@ -619,6 +619,66 @@ class TestImageBuildPhase(PungiTestCase): + self.assertItemsEqual(phase.pool.queue_put.mock_calls, + [mock.call((compose, server_args))]) + ++ @mock.patch('pungi.phases.image_build.ThreadPool') ++ def test_failable_star(self, ThreadPool): ++ compose = DummyCompose(self.topdir, { ++ 'image_build': { ++ '^Server$': [ ++ { ++ 'image-build': { ++ 'format': [('docker', 'tar.xz')], ++ 'name': 'Fedora-Docker-Base', ++ 'target': 'f24', ++ 'version': 'Rawhide', ++ 'ksurl': 'git://git.fedorahosted.org/git/spin-kickstarts.git', ++ 'kickstart': "fedora-docker-base.ks", ++ 'distro': 'Fedora-20', ++ 'disk_size': 3, ++ 'failable': ['*'], ++ } ++ } ++ ] ++ }, ++ 'koji_profile': 'koji', ++ }) ++ compose.setup_optional() ++ ++ self.assertValidConfig(compose.conf) ++ ++ phase = ImageBuildPhase(compose) ++ ++ phase.run() ++ ++ # assert at least one thread was started ++ self.assertTrue(phase.pool.add.called) ++ server_args = { ++ "format": [('docker', 'tar.xz')], ++ "image_conf": { ++ 'image-build': { ++ 'install_tree': self.topdir + '/compose/Server/$arch/os', ++ 'kickstart': 'fedora-docker-base.ks', ++ 'format': 'docker', ++ 'repo': self.topdir + '/compose/Server/$arch/os', ++ 'variant': compose.all_variants['Server'], ++ 'target': 'f24', ++ 'disk_size': 3, ++ 'name': 'Fedora-Docker-Base', ++ 'arches': 'amd64,x86_64', ++ 'version': 'Rawhide', ++ 'ksurl': 'git://git.fedorahosted.org/git/spin-kickstarts.git', ++ 'distro': 'Fedora-20', ++ 'can_fail': 'amd64,x86_64', ++ } ++ }, ++ "conf_file": self.topdir + '/work/image-build/Server/docker_Fedora-Docker-Base.cfg', ++ "image_dir": self.topdir + '/compose/Server/%(arch)s/images', ++ "relative_image_dir": 'Server/%(arch)s/images', ++ "link_type": 'hardlink-or-copy', ++ "scratch": False, ++ } ++ self.assertItemsEqual(phase.pool.queue_put.mock_calls, ++ [mock.call((compose, server_args))]) ++ + + class TestCreateImageBuildThread(PungiTestCase): + +-- +2.11.0 + diff --git a/0001-replace-basearch-when-updating-the-ref.patch b/0001-replace-basearch-when-updating-the-ref.patch index 5e4a4ebb..4f44cae1 100644 --- a/0001-replace-basearch-when-updating-the-ref.patch +++ b/0001-replace-basearch-when-updating-the-ref.patch @@ -1,38 +1,66 @@ -From 1e9962be27718171e9291c1b62983229ca49b907 Mon Sep 17 00:00:00 2001 +From 59dd4dbcd84ce30faa6558ad0d052370077d3fe5 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore -Date: Wed, 18 Jan 2017 14:22:43 -0600 -Subject: [PATCH] replace ${basearch} when updating the ref +Date: Jan 19 2017 03:21:26 +0000 +Subject: replace ${basearch} when updating the ref + pungi-make-ostree has to run on the target arch so that rpm -scriptlets can be ran.as a reult we can ask rpm what the -basearch is for the running environment +scriptlets can be ran. as a reult we can ask rpm what the +basearch is for the running environment. For notifications +we have to pass in the arch we are running for. Signed-off-by: Dennis Gilmore ---- - pungi/ostree/tree.py | 3 +++ - 1 file changed, 3 insertions(+) -diff --git a/pungi/ostree/tree.py b/pungi/ostree/tree.py -index 68b6d70..94a0be2 100644 ---- a/pungi/ostree/tree.py -+++ b/pungi/ostree/tree.py -@@ -16,6 +16,7 @@ - - import os +--- + +diff --git a/pungi/ostree/utils.py b/pungi/ostree/utils.py +index 02540c9..d80fb9f 100644 +--- a/pungi/ostree/utils.py ++++ b/pungi/ostree/utils.py +@@ -17,6 +17,7 @@ + import datetime import json + import os +import rpmUtils.arch - from kobo import shortcuts from pungi.util import makedirs -@@ -67,6 +68,8 @@ class Tree(OSTree): - return - ref = get_ref_from_treefile(self.treefile) - commitid = get_commitid_from_commitid_file(self.commitid_file) -+ if ref is not None: -+ ref = ref.replace('${basearch}', rpmUtils.arch.getBaseArch()) - print('Ref: %r, Commit ID: %r' % (ref, commitid)) - if ref and commitid: - print('Updating ref') --- -2.11.0 + +@@ -29,14 +30,21 @@ def make_log_file(log_dir, filename): + return os.path.join(log_dir, '%s.log' % filename) + + +-def get_ref_from_treefile(treefile): +- """Return ref name by parsing the tree config file""" ++def get_ref_from_treefile(treefile, arch=None): ++ """ ++ Return ref name by parsing the tree config file. Replacing ${basearch} with ++ the basearch of the architecture we are running on or of the passed in arch. ++ """ + ref = None + if os.path.isfile(treefile): + with open(treefile, 'r') as f: + try: + parsed = json.loads(f.read()) +- ref = parsed['ref'] ++ if arch is None: ++ basearch = rpmUtils.arch.getBaseArch() ++ else: ++ basearch = rpmUtils.arch.getBaseArch(arch) ++ ref = parsed['ref'].replace('${basearch}', basearch) + except Exception as e: + print('Unable to get ref from treefile: %s' % e) + else: +diff --git a/pungi/phases/ostree.py b/pungi/phases/ostree.py +index ebe03d0..e61e969 100644 +--- a/pungi/phases/ostree.py ++++ b/pungi/phases/ostree.py +@@ -104,7 +104,7 @@ class OSTreeThread(WorkerThread): + extra_config_file=extra_config_file) + + if compose.notifier: +- ref = get_ref_from_treefile(os.path.join(repodir, config['treefile'])) ++ ref = get_ref_from_treefile(os.path.join(repodir, config['treefile']), arch) + # 'pungi-make-ostree tree' writes commitid to commitid.log in logdir + commitid = get_commitid_from_commitid_file(os.path.join(self.logdir, 'commitid.log')) + compose.notifier.send('ostree', diff --git a/0002-image-build-Pass-arches-around-as-a-list.patch b/0002-image-build-Pass-arches-around-as-a-list.patch new file mode 100644 index 00000000..b86429b9 --- /dev/null +++ b/0002-image-build-Pass-arches-around-as-a-list.patch @@ -0,0 +1,241 @@ +From 8418b68fb0e1253f688b97c91df9ace6a38ebd02 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Tue, 24 Jan 2017 08:36:33 +0100 +Subject: [PATCH 2/2] image-build: Pass arches around as a list +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Instead of joining the arches as a comma separated string and splitting +it again later. Ultimately we do need the original format to pass to +koji wrapper, but we can produce that value later. + +Signed-off-by: Lubomír Sedlář +--- + pungi/phases/image_build.py | 16 ++++++++++------ + tests/test_imagebuildphase.py | 41 +++++++++++++++++++++-------------------- + 2 files changed, 31 insertions(+), 26 deletions(-) + +diff --git a/pungi/phases/image_build.py b/pungi/phases/image_build.py +index b795125..bd18d3a 100644 +--- a/pungi/phases/image_build.py ++++ b/pungi/phases/image_build.py +@@ -75,7 +75,7 @@ class ImageBuildPhase(base.PhaseLoggerMixin, base.ImageConfigMixin, base.ConfigG + def _get_arches(self, image_conf, arches): + if 'arches' in image_conf['image-build']: + arches = set(image_conf['image-build'].get('arches', [])) & arches +- return ','.join(sorted(arches)) ++ return sorted(arches) + + def _set_release(self, image_conf): + """If release is set explicitly to None, replace it with date and respin.""" +@@ -122,9 +122,9 @@ class ImageBuildPhase(base.PhaseLoggerMixin, base.ImageConfigMixin, base.ConfigG + + can_fail = image_conf['image-build'].pop('failable', []) + if can_fail == ['*']: +- can_fail = image_conf['image-build']['arches'].split(',') ++ can_fail = image_conf['image-build']['arches'] + if can_fail: +- image_conf['image-build']['can_fail'] = ','.join(sorted(can_fail)) ++ image_conf['image-build']['can_fail'] = sorted(can_fail) + + cmd = { + "format": format, +@@ -162,8 +162,7 @@ class CreateImageBuildThread(WorkerThread): + self.worker(num, compose, variant, subvariant, cmd) + + def worker(self, num, compose, variant, subvariant, cmd): +- arches = cmd["image_conf"]["image-build"]['arches'].split(',') +- failable_arches = self.failable_arches.split(',') ++ arches = cmd["image_conf"]["image-build"]['arches'] + dash_arches = '-'.join(arches) + log_file = compose.paths.log.log_file( + dash_arches, +@@ -180,6 +179,11 @@ class CreateImageBuildThread(WorkerThread): + # writes conf file for koji image-build + self.pool.log_info("Writing image-build config for %s.%s into %s" % ( + variant, dash_arches, cmd["conf_file"])) ++ ++ # Join the arches into a single string. This is the value expected by ++ # koji config file. ++ cmd["image_conf"]["image-build"]['arches'] = ','.join(cmd["image_conf"]["image-build"]['arches']) ++ + koji_cmd = koji_wrapper.get_image_build_cmd(cmd["image_conf"], + conf_file_dest=cmd["conf_file"], + scratch=cmd['scratch']) +@@ -207,7 +211,7 @@ class CreateImageBuildThread(WorkerThread): + image_infos.append({'path': path, 'suffix': suffix, 'type': format, 'arch': arch}) + break + +- if len(image_infos) != len(cmd['format']) * (len(arches) - len(failable_arches)): ++ if len(image_infos) != len(cmd['format']) * (len(arches) - len(self.failable_arches)): + self.pool.log_error( + "Error in koji task %s. Expected to find same amount of images " + "as in suffixes attr in image-build (%s) for each arch (%s). Got '%s'." % +diff --git a/tests/test_imagebuildphase.py b/tests/test_imagebuildphase.py +index 328b2b3..d3185e2 100644 +--- a/tests/test_imagebuildphase.py ++++ b/tests/test_imagebuildphase.py +@@ -66,11 +66,11 @@ class TestImageBuildPhase(PungiTestCase): + 'target': 'f24', + 'disk_size': 3, + 'name': 'Fedora-Docker-Base', +- 'arches': 'amd64', ++ 'arches': ['amd64'], + 'version': 'Rawhide', + 'ksurl': 'git://git.fedorahosted.org/git/spin-kickstarts.git', + 'distro': 'Fedora-20', +- 'can_fail': 'x86_64', ++ 'can_fail': ['x86_64'], + } + }, + "conf_file": self.topdir + '/work/image-build/Client/docker_Fedora-Docker-Base.cfg', +@@ -91,11 +91,11 @@ class TestImageBuildPhase(PungiTestCase): + 'target': 'f24', + 'disk_size': 3, + 'name': 'Fedora-Docker-Base', +- 'arches': 'amd64,x86_64', ++ 'arches': ['amd64', 'x86_64'], + 'version': 'Rawhide', + 'ksurl': 'git://git.fedorahosted.org/git/spin-kickstarts.git', + 'distro': 'Fedora-20', +- 'can_fail': 'x86_64', ++ 'can_fail': ['x86_64'], + } + }, + "conf_file": self.topdir + '/work/image-build/Server/docker_Fedora-Docker-Base.cfg', +@@ -151,7 +151,7 @@ class TestImageBuildPhase(PungiTestCase): + 'target': 'f24', + 'disk_size': 3, + 'name': 'Fedora-Docker-Base', +- 'arches': 'amd64,x86_64', ++ 'arches': ['amd64', 'x86_64'], + 'version': 'Rawhide', + 'ksurl': 'git://git.fedorahosted.org/git/spin-kickstarts.git', + 'distro': 'Fedora-20', +@@ -207,7 +207,7 @@ class TestImageBuildPhase(PungiTestCase): + 'target': 'f24', + 'disk_size': 3, + 'name': 'Fedora-Docker-Base', +- 'arches': 'amd64,x86_64', ++ 'arches': ['amd64', 'x86_64'], + 'version': '25', + 'ksurl': 'git://git.fedorahosted.org/git/spin-kickstarts.git', + 'distro': 'Fedora-20', +@@ -305,7 +305,7 @@ class TestImageBuildPhase(PungiTestCase): + 'target': 'f24', + 'disk_size': 3, + 'name': 'Fedora-Docker-Base', +- 'arches': 'x86_64', ++ 'arches': ['x86_64'], + 'version': 'Rawhide', + 'ksurl': 'git://git.fedorahosted.org/git/spin-kickstarts.git', + 'distro': 'Fedora-20', +@@ -369,7 +369,7 @@ class TestImageBuildPhase(PungiTestCase): + 'target': 'f24', + 'disk_size': 3, + 'name': 'Fedora-Docker-Base', +- 'arches': 'x86_64', ++ 'arches': ['x86_64'], + 'version': 'Rawhide', + 'ksurl': 'git://git.fedorahosted.org/git/spin-kickstarts.git', + 'distro': 'Fedora-20', +@@ -430,7 +430,7 @@ class TestImageBuildPhase(PungiTestCase): + 'target': 'f24', + 'disk_size': 3, + 'name': 'Fedora-Docker-Base', +- 'arches': 'x86_64', ++ 'arches': ['x86_64'], + 'version': 'Rawhide', + 'ksurl': 'git://git.fedorahosted.org/git/spin-kickstarts.git', + 'distro': 'Fedora-20', +@@ -603,11 +603,11 @@ class TestImageBuildPhase(PungiTestCase): + 'target': 'f24', + 'disk_size': 3, + 'name': 'Fedora-Docker-Base', +- 'arches': 'x86_64', ++ 'arches': ['x86_64'], + 'version': 'Rawhide', + 'ksurl': 'git://git.fedorahosted.org/git/spin-kickstarts.git', + 'distro': 'Fedora-20', +- 'can_fail': 'x86_64', ++ 'can_fail': ['x86_64'], + } + }, + "conf_file": self.topdir + '/work/image-build/Server-optional/docker_Fedora-Docker-Base.cfg', +@@ -663,11 +663,11 @@ class TestImageBuildPhase(PungiTestCase): + 'target': 'f24', + 'disk_size': 3, + 'name': 'Fedora-Docker-Base', +- 'arches': 'amd64,x86_64', ++ 'arches': ['amd64', 'x86_64'], + 'version': 'Rawhide', + 'ksurl': 'git://git.fedorahosted.org/git/spin-kickstarts.git', + 'distro': 'Fedora-20', +- 'can_fail': 'amd64,x86_64', ++ 'can_fail': ['amd64', 'x86_64'], + } + }, + "conf_file": self.topdir + '/work/image-build/Server/docker_Fedora-Docker-Base.cfg', +@@ -703,7 +703,7 @@ class TestCreateImageBuildThread(PungiTestCase): + 'target': 'f24', + 'disk_size': 3, + 'name': 'Fedora-Docker-Base', +- 'arches': 'amd64,x86_64', ++ 'arches': ['amd64', 'x86_64'], + 'version': 'Rawhide', + 'ksurl': 'git://git.fedorahosted.org/git/spin-kickstarts.git', + 'distro': 'Fedora-20', +@@ -743,6 +743,7 @@ class TestCreateImageBuildThread(PungiTestCase): + with mock.patch('time.sleep'): + t.process((compose, cmd), 1) + ++ self.assertEqual(cmd['image_conf']['image-build']['arches'], 'amd64,x86_64') + self.assertItemsEqual( + koji_wrapper.get_image_build_cmd.call_args_list, + [mock.call(cmd['image_conf'], +@@ -832,11 +833,11 @@ class TestCreateImageBuildThread(PungiTestCase): + 'target': 'f24', + 'disk_size': 3, + 'name': 'Fedora-Docker-Base', +- 'arches': 'amd64,x86_64', ++ 'arches': ['amd64', 'x86_64'], + 'version': 'Rawhide', + 'ksurl': 'git://git.fedorahosted.org/git/spin-kickstarts.git', + 'distro': 'Fedora-20', +- "can_fail": 'amd64,x86_64', ++ "can_fail": ['amd64', 'x86_64'], + } + }, + "conf_file": 'amd64,x86_64-Client-Fedora-Docker-Base-docker', +@@ -880,11 +881,11 @@ class TestCreateImageBuildThread(PungiTestCase): + 'target': 'f24', + 'disk_size': 3, + 'name': 'Fedora-Docker-Base', +- 'arches': 'amd64,x86_64', ++ 'arches': ['amd64', 'x86_64'], + 'version': 'Rawhide', + 'ksurl': 'git://git.fedorahosted.org/git/spin-kickstarts.git', + 'distro': 'Fedora-20', +- 'can_fail': 'amd64,x86_64', ++ 'can_fail': ['amd64', 'x86_64'], + } + }, + "conf_file": 'amd64,x86_64-Client-Fedora-Docker-Base-docker', +@@ -923,11 +924,11 @@ class TestCreateImageBuildThread(PungiTestCase): + 'target': 'f24', + 'disk_size': 3, + 'name': 'Fedora-Docker-Base', +- 'arches': 'amd64,x86_64', ++ 'arches': ['amd64', 'x86_64'], + 'version': 'Rawhide', + 'ksurl': 'git://git.fedorahosted.org/git/spin-kickstarts.git', + 'distro': 'Fedora-20', +- 'can_fail': 'amd64', ++ 'can_fail': ['amd64'], + } + }, + "conf_file": 'amd64,x86_64-Client-Fedora-Docker-Base-docker', +-- +2.11.0 + diff --git a/pungi.spec b/pungi.spec index 6562ae0c..dfdb30f8 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.1.12 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Distribution compose tool Group: Development/Tools @@ -10,6 +10,8 @@ Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2 # from https://pagure.io/fork/puiterwijk/pungi/c/63aa7db5aad4690b72898d01fa82270c1f503241 Patch0: 63aa7db5aad4690b72898d01fa82270c1f503241.patch Patch1: 0001-replace-basearch-when-updating-the-ref.patch +Patch2: 0001-image-build-Expand-arches-for-can_fail.patch +Patch3: 0002-image-build-Pass-arches-around-as-a-list.patch BuildRequires: python-nose, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd >= 1.3 @@ -73,6 +75,8 @@ notification to Fedora Message Bus. %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build %{__python} setup.py build @@ -114,6 +118,9 @@ cd tests && ./test_compose.sh %{_bindir}/%{name}-fedmsg-notification %changelog +* Tue Jan 24 2017 Dennis Gilmore - 4.1.12-4 +- add patches for pagure pr#517 + * Tue Jan 17 2017 Dennis Gilmore - 4.1.12-3 - add patch to replace ${basearch} in the ostree ref From f17b7835b9b7904a90156defcc2430caa314ddf1 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 11 Feb 2017 07:58:18 +0000 Subject: [PATCH 78/78] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild --- pungi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pungi.spec b/pungi.spec index dfdb30f8..d8a51ded 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,6 +1,6 @@ Name: pungi Version: 4.1.12 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Distribution compose tool Group: Development/Tools @@ -118,6 +118,9 @@ cd tests && ./test_compose.sh %{_bindir}/%{name}-fedmsg-notification %changelog +* Sat Feb 11 2017 Fedora Release Engineering - 4.1.12-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + * Tue Jan 24 2017 Dennis Gilmore - 4.1.12-4 - add patches for pagure pr#517