Initial changes for Pungi 4.0.

This commit is contained in:
Daniel Mach 2015-02-05 10:56:24 -05:00
parent 274236a3f3
commit f5c6d44000
19 changed files with 90 additions and 198 deletions

View File

@ -1,11 +0,0 @@
syntax: glob
*.pyc
*~
pungi.pidaproject
.project
.pydevproject
.settings/org.eclipse.mylyn.tasks.ui.prefs
MANIFEST
build/*
dist/*
noarch/*

70
.hgtags
View File

@ -1,70 +0,0 @@
e80b96291cfe23c4c21b2e668d8d80a8998c7cfc pungi--
f755487fdd539c3a68296c0dc7b6c6dc49dccb98 pungi-0.1.0-1%{?dist}
d9bda840074f8f5e7b8844007e9951cd55ad9c1d pungi--
baa55b9774642535467104c3f6b268671cc35e08 pungi-0.1.0-1
902402e675943d6c3186b924a9cff89d539b06f9 pungi-0.1.0-1
14a5e625d91034b7dcb1f2b26486827929e87e24 pungi-0.1.0-1
b13071d9363851d2766e9efaf80e9e13feec7a0c pungi-0.1.0-1
00326e01cc7dd77f527d1a70e97fa907f35ce669 pungi-0.1.0-1
591cf30beec90deb8b01aaef07e042d8878f4f09 pungi-0.1.1-1
9f954716abd9c8db453b9f1b56f64e0defd8fa1d FC-6
f0cbd4fbc9e7915fa94588237827e0a1379ec823 pungi--
c5e81c8e1adc642b15e5aac713ae2e58a386c9b9 pungi-0.2.0-1
f90b645121cb2f794ceda3c4be050c53d36a7bec pungi-0.2.0-1
ebfe0e963db6d7b652f63f99aaec121e7ff19074 pungi-0.2.1-1
769a8e08d77a2234295449282b16ca38ff4d846e pungi-0.2.2-1
ba049c3454d5dae9326d8050bb0d7d8116982ca4 f7-test1
780520383876b76dd06fa013e1a41ddd6bf0901e pungi-0.2.3-1
158bd9a170892b43645caed12bddc3602ef3be4d pungi-0.2.3-1
6659955ccfdf29ecd6027bd3770f80d815720af0 pungi-0.2.3-1
9f7b5877c32c533d00ea6baa67057ce424a40a61 pungi-0.2.3-1
7ea08753383766ce36bb49fef6d4fcf44158ad26 pungi-0.2.3-1
65596b024b8380bd72c6faec00d37820ada1444d pungi-0.2.4-1
5e3332cfa2bb723f438507313836c299fcc99cff pungi-0.2.5-1
61146ab008d70cb4ce294d14a8465c05613e91e5 pungi-0.2.6-1
6de1d8a07c7b75fc069c72eaa9b3cb4ecaa5ad5a pungi-0.2.7-1
c150a9d7a125e6c25384fbbf8080d7532191b587 f7-test2
9c5cdf9e045ab0c804d85a50b24107b108aa2da5 pungi-0.2.8-1
f1ee949b238b004ee53c6b30915e69352274f583 pungi-0.3.0-1
8cd10e139537882e6620ff7a834550372d661765 pungi-0.3.2-1.fc7
cadce5054b15ae68cab1ab4535051413502f6f06 pungi-0.3.3-1.fc7
ab966576cf34faf07ef340f2bf35a845e50b2e60 pungi-0.3.4-1.fc7
be92c798eb08d91cd95769473a89201fea2deee7 pungi-0.3.4-1.fc7
14cc0c736f005298e55857b6f8d4e96811d391f0 pungi-0.3.5-1.fc7
d71cd934642d7e57875bec2cf1fae94143a32e3d pungi-0.3.6-1.fc7
c307e8c643a7b3bc7d79aed21e1992c3dadd930b pungi-0.3.7-1.fc7
49ffb6153da14ce66ef8f95e356f7b268caba907 f7
a18b9e205575a209423b22ebb55987f46c4f0994 pungi-0.3.8-1.fc8
9b1619bddf881c65bcba1ae6c6a0f516915f2973 pungi-0.3.9-1.fc8
2ece0fc1e1f5a519f10b514e35a44f575b6926b7 pungi-0.4.0-1.fc8
57308147c0f4a6d4fc6ba8d35f3225b83ecd245a pungi-0.4.1-1.fc8
b6b730ec37d887efaa175718780486f2f2217626 pungi-0.5.0-1.fc8
904b3b5d799fcfc01d57075f8a9cfaf57c4b9e96 pungi-0.5.0-1.fc8
0d1678fab953bf8049feba79435d536720875c35 pungi-1.0.0-1.fc8
0f9756371e0bf46172f414f6568522f7d69531a7 pungi-1.0.0-2.fc8
6a80d436e84bf782164b3613c52e8155793d33ad pungi-1.0.1-1.fc8.1
812ca4b56f453adb7cf9632ebaf7fd05b9e317b0 pungi-1.0.2-1.fc8
21fdf978d6b3b0e6b1f9470994261b5c2dd03dc4 pungi-1.0.2-1.fc8
daafaa357e4b59316e7f89f94f7d85de1dd214e3 pungi-1.1.0-1.fc8
a4f98216a6de2caa3aa3d25a05ca2df69f84ad27 pungi-1.1.1-1.fc8
fe6ef87b3d0224c60f4a20510e2c9cf7eded5bbb pungi-1.1.2-1.fc8
bbbfaaf1cbfa2329d7fc5932ad9eabb8ea92fa3d pungi-1.1.4-1.fc8
25d1219ba97e777cd34d596475eb14b505e2c431 pungi-1.1.5-1.fc8
4edd3626781cbb562d467c30eb905a3670a29920 pungi-1.1.6-1.fc8
ffa18895b6d9c3069a4eceb93ab3cbb2775f6958 pungi-1.1.7-1.fc8
74c78bd267b31410f45240f68b47f2197d629a01 pungi-1.1.8-1.fc8
214e56769a8a36964d297366f9ee6d1e9e13734e pungi-1.1.9-1.fc8
251b9f7c28a64ad79d24998e8f1329ef593918e6 pungi-1.1.9-1.fc8
fd109d29c502c7117ec171aad24bae0149d14f82 pungi-1.1.10-1.fc8
0a52fdb4ca6463835128c0c6b9a8705ac1973c0b pungi-1.2.0-1.fc8
738b45957b10d06bdb6be6d63266b559d62ab647 pungi-1.2.1-1.fc8
0a6ed4246de368c4f80f2de98d0b1e40fe36ee6f pungi-1.2.2-1.fc8
daab9b65ae2df4cc8e74bb01f354b90a5d8e351c pungi-1.2.3-1.fc8
eda1c2fb02e4427a860146aa8aebcb1bb12c5eda pungi-1.2.4-1.fc8
df20ca17d16dda8d85bec12e0f94cf7525779a2b pungi-1.2.6-1.fc8
edceabcc3a0dc2b28679dbef2c734e7d7c55c9a4 pungi-1.2.7-1.fc8
5c8f4d20fe3022ca21b3d064a484571efe02c821 pungi-1.2.8-1.fc8
77e9034ef654d9ce17575fb6c6216a561eaba6ec pungi-1.2.9-1.fc9
b96d2030c9d572852ba4d45c49647b665e020bfa pungi-1.2.10-1.fc9
337fa20a0e1e04dc03842b9a354dc0f086b9fa4d pungi-1.2.11-1.fc9
3cb7b1a58df7e3cb8f6e6b90f5dbd9922a4fcaa8 pungi-1.2.12-1.fc9

View File

View File

@ -1,5 +1,5 @@
Pungi - a Fedora release compose tool
Copyright (C) 2006 Jesse Keating
Pungi - Distribution compose tool
Copyright (C) 2006-2015 Red Hat, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -13,4 +13,3 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

View File

@ -50,9 +50,12 @@ install:
@python setup.py install
clean:
@python setup.py clean
@rm -vf *.rpm
@rm -vrf noarch
@rm -vf *.tar.gz
@rm -vrf dist
@rm -vf MANIFEST
@rm -vf Changelog
find . -\( -name "*.pyc" -o -name '*.pyo' -o -name "*~" -o -name "__pycache__" -\) -delete
find . -depth -type d -a -name '*.egg-info' -exec rm -rf {} \;

62
ToDo
View File

@ -1,62 +0,0 @@
Working with Kickstart
* Remove config options for:
osdir
sourcedir
debugdir
isodir
iso_basename
cachedir
arch
relnotefilere
relnotedirre
relnotepkgs
DONE ^^
* Move to CLI only:
name
version
destdir
flavor (optional)
bugurl (optional)
discs (optional)
nosource (optional/debug)
DONE ^^
* Make the following transitions
product_name -> name *DONE*
product path == 'Packages/" *DONE*
cachedir == /var/cache/pungi *DONE*
DONE ^^
* Get comps data from repos
Use ayum.comps.<whatever> to get comps information *DONE*
Snag each available comps file, cat them together, use xslt to make clean *DONE*
Use this mutant comps for creating repodata in the destdirs. *DONE*
DONE ^^
* From pykickstart
manifest -> %packages *DONE*
yum-repos -> repo *DONE*
isosize -> part iso size <size> (optional) *DONE*
DONE ^^
* Release notes stuff
Drop all stuff but GPL, README, GPG keys, potentially README-BURNING-ISOS ?
* From livecd-creator
Steal root check *DONE*
Use same cli syntax if possible (conf -> config, etc..) *DONE*
DONE ^^
* Figure out how to allow use of $releasever and $basearch *DONE*
DONE ^^
* Profit!

View File

@ -13,14 +13,14 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import os
import pypungi
import pypungi.config
import pypungi.ks
import pungi.gather
import pungi.config
import pungi.ks
import subprocess
def main():
config = pypungi.config.Config()
config = pungi.config.Config()
(opts, args) = get_arguments(config)
@ -41,7 +41,7 @@ def main():
pass
# Set up the kickstart parser and pass in the kickstart file we were handed
ksparser = pypungi.ks.get_ksparser(ks_path=opts.config)
ksparser = pungi.ks.get_ksparser(ks_path=opts.config)
if opts.sourceisos:
config.set('pungi', 'arch', 'source')
@ -121,7 +121,7 @@ def main():
config.set("lorax", "installpkgs", " ".join(opts.installpkgs))
# Actually do work.
mypungi = pypungi.Pungi(config, ksparser)
mypungi = pungi.gather.Pungi(config, ksparser)
with mypungi.yumlock:
if not opts.sourceisos:

View File

@ -1,8 +1,8 @@
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Name: pungi
Version: 3.13
Release: 1%{?dist}
Version: 4.0
Release: 0.1%{?dist}
Summary: Distribution compose tool
Group: Development/Tools
@ -46,7 +46,7 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root,-)
%doc Authors Changelog COPYING GPL ToDo doc/README
# For noarch packages: sitelib
%{python_sitelib}/pypungi
%{python_sitelib}/pungi
%if 0%{?fedora} >= 9 || 0%{?rhel} >= 6
%{python_sitelib}/%{name}-%{version}-py?.?.egg-info
%endif
@ -289,7 +289,7 @@ rm -rf $RPM_BUILD_ROOT
- Add support for yum repo costs
- Adjust manifest for Fedora 9 (kernels, languages, flash)
* Mon Apr 08 2008 Jesse Keating <jkeating@redhat.com> - 1.2.14-1
* Mon Apr 07 2008 Jesse Keating <jkeating@redhat.com> - 1.2.14-1
- Create repodata for source.
- Fix SRPM splittree making
- Bump anaconda require up for fixed splittree

1
pungi/__init__.py Normal file
View File

@ -0,0 +1 @@
__version__ = "4.0"

View File

@ -21,7 +21,7 @@ import re
import shutil
import sys
import gzip
import pypungi.util
import pungi.util
import pprint
import lockfile
import logging
@ -135,7 +135,7 @@ class PungiBase(object):
logdir = os.path.join(self.config.get('pungi', 'destdir'), 'logs')
pypungi.util._ensuredir(logdir, None, force=True) # Always allow logs to be written out
pungi.util._ensuredir(logdir, None, force=True) # Always allow logs to be written out
if self.config.get('pungi', 'flavor'):
logfile = os.path.join(logdir, '%s.%s.log' % (self.config.get('pungi', 'flavor'),
@ -194,9 +194,9 @@ class PungiYum(yum.YumBase):
result[0:1] = result[0:1:-1]
return result
class Pungi(pypungi.PungiBase):
class Pungi(PungiBase):
def __init__(self, config, ksparser):
pypungi.PungiBase.__init__(self, config)
PungiBase.__init__(self, config)
# Set our own logging name space
self.logger = logging.getLogger('Pungi')
@ -222,7 +222,7 @@ class Pungi(pypungi.PungiBase):
self.topdir = os.path.join(self.archdir, 'os')
self.isodir = os.path.join(self.archdir, self.config.get('pungi','isodir'))
pypungi.util._ensuredir(self.workdir, self.logger, force=True)
pungi.util._ensuredir(self.workdir, self.logger, force=True)
self.common_files = []
self.infofile = os.path.join(self.config.get('pungi', 'destdir'),
@ -1074,9 +1074,9 @@ class Pungi(pypungi.PungiBase):
# Ensure the pkgdir exists, force if requested, and make sure we clean it out
if relpkgdir.endswith('SRPMS'):
# Since we share source dirs with other arches don't clean, but do allow us to use it
pypungi.util._ensuredir(pkgdir, self.logger, force=True, clean=False)
pungi.util._ensuredir(pkgdir, self.logger, force=True, clean=False)
else:
pypungi.util._ensuredir(pkgdir, self.logger, force=self.config.getboolean('pungi', 'force'), clean=True)
pungi.util._ensuredir(pkgdir, self.logger, force=self.config.getboolean('pungi', 'force'), clean=True)
probs = self.ayum.downloadPkgs(polist)
@ -1098,11 +1098,11 @@ class Pungi(pypungi.PungiBase):
target = os.path.join(pkgdir, po.name[0].lower(), basename)
# Make sure we have the hashed dir available to link into we only want dirs there to corrospond to packages
# that we are including so we can not just do A-Z 0-9
pypungi.util._ensuredir(os.path.join(pkgdir, po.name[0].lower()), self.logger, force=True, clean=False)
pungi.util._ensuredir(os.path.join(pkgdir, po.name[0].lower()), self.logger, force=True, clean=False)
# Link downloaded package in (or link package from file repo)
try:
pypungi.util._link(local, target, self.logger, force=True)
pungi.util._link(local, target, self.logger, force=True)
continue
except:
self.logger.error("Unable to link %s from the yum cache." % po.name)
@ -1157,7 +1157,7 @@ class Pungi(pypungi.PungiBase):
#compsfilter.append('/usr/share/pungi/comps-cleanup.xsl')
#compsfilter.append(ourcompspath)
#pypungi.util._doRunCommand(compsfilter, self.logger)
#pungi.util._doRunCommand(compsfilter, self.logger)
@yumlocked
def downloadSRPMs(self):
@ -1306,7 +1306,7 @@ class Pungi(pypungi.PungiBase):
repoview.append(path)
# run the command
pypungi.util._doRunCommand(repoview, self.logger)
pungi.util._doRunCommand(repoview, self.logger)
def doCreaterepo(self, comps=True):
"""Run createrepo to generate repodata in the tree."""
@ -1318,7 +1318,7 @@ class Pungi(pypungi.PungiBase):
# setup the cache dirs
for target in ['createrepocache', 'repoviewcache']:
pypungi.util._ensuredir(os.path.join(self.config.get('pungi', 'cachedir'),
pungi.util._ensuredir(os.path.join(self.config.get('pungi', 'cachedir'),
target),
self.logger,
force=True)
@ -1454,7 +1454,7 @@ class Pungi(pypungi.PungiBase):
# don't bother summing directories. Won't work.
if os.path.isdir(path):
continue
sum = pypungi.util._doCheckSum(path, 'sha256', self.logger)
sum = pungi.util._doCheckSum(path, 'sha256', self.logger)
outpath = path.replace(basepath, '')
sums.append((outpath, sum))
@ -1467,7 +1467,7 @@ class Pungi(pypungi.PungiBase):
# Get a checksum of repomd.xml since it has within it sums for other files
repomd = os.path.join(self.topdir, 'repodata', 'repomd.xml')
sum = pypungi.util._doCheckSum(repomd, 'sha256', self.logger)
sum = pungi.util._doCheckSum(repomd, 'sha256', self.logger)
sums.append((os.path.join('repodata', 'repomd.xml'), sum))
# Now add the sums, and write the config out
@ -1499,7 +1499,7 @@ class Pungi(pypungi.PungiBase):
for pattern in self.config.get('pungi', 'relnotedirre').split():
dirres.append(re.compile(pattern))
pypungi.util._ensuredir(docsdir, self.logger, force=self.config.getboolean('pungi', 'force'), clean=True)
pungi.util._ensuredir(docsdir, self.logger, force=self.config.getboolean('pungi', 'force'), clean=True)
# Expload the packages we list as relnote packages
pkgs = os.listdir(os.path.join(self.topdir, self.config.get('pungi', 'product_path')))
@ -1530,7 +1530,7 @@ class Pungi(pypungi.PungiBase):
for regex in fileres:
if regex.match(filename) and not os.path.exists(os.path.join(self.topdir, filename)):
self.logger.info("Linking release note file %s" % filename)
pypungi.util._link(os.path.join(dirpath, filename),
pungi.util._link(os.path.join(dirpath, filename),
os.path.join(self.topdir, filename),
self.logger,
force=self.config.getboolean('pungi',
@ -1554,7 +1554,7 @@ class Pungi(pypungi.PungiBase):
self.logger.error("Could not open checksum file: %s" % csumfile)
self.logger.info("Generating checksum of %s" % path)
checksum = pypungi.util._doCheckSum(path, 'sha256', self.logger)
checksum = pungi.util._doCheckSum(path, 'sha256', self.logger)
if checksum:
checkfile.write("%s *%s\n" % (checksum.replace('sha256:', ''), os.path.basename(path)))
else:
@ -1572,7 +1572,7 @@ class Pungi(pypungi.PungiBase):
isolist = []
ppcbootinfo = '/usr/share/lorax/config_files/ppc'
pypungi.util._ensuredir(self.isodir, self.logger,
pungi.util._ensuredir(self.isodir, self.logger,
force=self.config.getboolean('pungi', 'force'),
clean=True) # This is risky...
@ -1656,15 +1656,15 @@ class Pungi(pypungi.PungiBase):
if self.config.get('pungi', 'no_dvd') == "False":
# run the command
pypungi.util._doRunCommand(mkisofs + extraargs, self.logger)
pungi.util._doRunCommand(mkisofs + extraargs, self.logger)
# Run isohybrid on the iso as long as its not the source iso
if os.path.exists("/usr/bin/isohybrid") and not self.tree_arch == 'source':
pypungi.util._doRunCommand(isohybrid, self.logger)
pungi.util._doRunCommand(isohybrid, self.logger)
# implant md5 for mediacheck on all but source arches
if not self.tree_arch == 'source':
pypungi.util._doRunCommand(['/usr/bin/implantisomd5', isofile], self.logger)
pungi.util._doRunCommand(['/usr/bin/implantisomd5', isofile], self.logger)
# shove the checksum into a file
csumfile = os.path.join(self.isodir, '%s-%s-%s-CHECKSUM' % (
@ -1690,7 +1690,7 @@ class Pungi(pypungi.PungiBase):
isofile = os.path.join(self.isodir, isoname)
# link the boot iso to the iso dir
pypungi.util._link(os.path.join(self.topdir, 'images', 'boot.iso'), isofile, self.logger)
pungi.util._link(os.path.join(self.topdir, 'images', 'boot.iso'), isofile, self.logger)
# shove the checksum into a file
self._doIsoChecksum(isofile, csumfile)

View File

@ -20,7 +20,7 @@ import re
import fnmatch
import pathmatch
import pypungi
import pungi.gather
@ -96,7 +96,7 @@ class MultilibMethodBase(object):
raise NotImplementedError
def skip(self, po):
if pypungi.is_noarch(po) or pypungi.is_source(po) or pypungi.is_debug(po):
if pungi.gather.is_noarch(po) or pungi.gather.is_source(po) or pungi.gather.is_debug(po):
return True
return False

52
setup.py Normal file → Executable file
View File

@ -1,20 +1,44 @@
from distutils.core import setup
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import glob
setup(name='pungi',
version='3.13', # make sure src/bin/pungi.py is updated to match
description='Distribution compose tool',
author='Dennis Gilmore',
author_email='dgilmore@fedoraproject.org',
url='http://fedorahosted.org/pungi',
license='GPLv2',
package_dir = {'': 'src'},
packages = ['pypungi'],
scripts = ['src/bin/pungi.py'],
data_files=[
import distutils.command.sdist
from setuptools import setup
# override default tarball format with bzip2
distutils.command.sdist.sdist.default_format = {"posix": "bztar"}
# recursively scan for python modules to be included
package_root_dirs = ["pungi"]
packages = set()
for package_root_dir in package_root_dirs:
for root, dirs, files in os.walk(package_root_dir):
if "__init__.py" in files:
packages.add(root.replace("/", "."))
packages = sorted(packages)
setup(
name = "pungi",
version = "4.0", # make sure it matches with pungi.__version__
description = "Distribution compose tool",
url = "http://fedorahosted.org/pungi",
author = "Dennis Gilmore",
author_email = "dgilmore@fedoraproject.org",
license = "GPLv2",
packages = packages,
scripts = [
'bin/pungi-gather',
],
data_files = [
('/usr/share/pungi', glob.glob('share/*.xsl')),
('/usr/share/pungi', glob.glob('share/*.ks')),
('/usr/share/pungi/multilib', glob.glob('share/multilib/*')),
]
]
)

View File

@ -8,9 +8,13 @@ import os
import sys
import tempfile
import shutil
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src", "pypungi")))
from arch import *
here = sys.path[0]
if here != '/usr/bin':
# Git checkout
sys.path[0] = os.path.dirname(here)
from pungi.arch import *
class TestArch(unittest.TestCase):

View File

@ -5,9 +5,13 @@
import unittest
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src", "pypungi")))
from pathmatch import PathMatch, head_tail_split
here = sys.path[0]
if here != '/usr/bin':
# Git checkout
sys.path[0] = os.path.dirname(here)
from pungi.pathmatch import PathMatch, head_tail_split
class TestHeadTailSplit(unittest.TestCase):