Various fixes to finish import from pkgsys-ostree

This commit is contained in:
Colin Walters 2013-12-21 22:15:57 -05:00
parent 958dfa435e
commit 8ecc47ac87
4 changed files with 22 additions and 6 deletions

View File

@ -17,7 +17,7 @@
bin_SCRIPTS += rpm-ostree
rpm-ostree: fedora/rpm-ostree.in Makefile
rpm-ostree: src/rpm-ostree.in Makefile
$(AM_V_GEN) sed -e s,@PYTHON\@,$(PYTHON), -e s,@pkglibdir\@,$(pkglibdir), $< > $@.tmp && mv $@.tmp $@
@chmod a+x $@

View File

@ -35,6 +35,8 @@ PKG_CHECK_MODULES(PKGDEP_GIO_UNIX, [gio-unix-2.0])
PKG_CHECK_MODULES(PKGDEP_OSTREE, [ostree-1])
AC_PATH_PROG([XSLTPROC], [xsltproc])
AM_PATH_PYTHON(2.7)
AC_CONFIG_FILES([
Makefile
])

View File

@ -26,6 +26,6 @@ __builtin__.__dict__['PKGLIBDIR'] = "@pkglibdir@"
path = os.path.join('@pkglibdir@', 'rpm-ostree')
sys.path.insert(0, path)
import rpmrpmrpmostree
import rpmostree
sys.exit(rpmostree.main())

View File

@ -217,11 +217,10 @@ def _create_rootfs_from_yumroot_content(targetroot, yumroot):
ensuredir(target_tmpfilesd)
shutil.copy(os.path.join(PKGLIBDIR, 'tmpfiles-gnome-ostree.conf'), target_tmpfilesd)
def yuminstall(yumroot, packages):
def runyum(argv, yumroot):
yumargs = ['yum', '-y', '--releasever=%s' % (opts.os_version, ), '--nogpg', '--setopt=keepcache=1', '--installroot=' + yumroot, '--disablerepo=*']
yumargs.extend(map(lambda x: '--enablerepo=' + x, opts.enablerepo))
yumargs.append('install')
yumargs.extend(packages)
yumargs.extend(argv)
print "Running: %s" % (subprocess.list2cmdline(yumargs), )
yum_env = dict(os.environ)
yum_env['KERNEL_INSTALL_NOOP'] = 'yes'
@ -230,6 +229,14 @@ def yuminstall(yumroot, packages):
if rcode != 0:
raise ValueError("Yum exited with code %d" % (rcode, ))
def yuminstall(yumroot, packages):
argv = list(['install'])
argv.extend(packages)
runyum(argv, yumroot)
def yumgroupinstall(yumroot, group):
runyum(['group', 'install', group], yumroot)
def main():
parser = optparse.OptionParser('%prog ACTION PACKAGE1 [PACKAGE2...]')
parser.add_option('', "--repo",
@ -337,7 +344,14 @@ def main():
open(os.path.join(yumroot, 'usr/lib', n), 'w').close()
replace_nsswitch(os.path.join(yumroot, 'etc'))
yuminstall(yumroot, packages)
plain_packages = []
for package in packages:
if package[0] == '@':
yumgroupinstall(package)
else:
plain_packages.append(package)
yuminstall(yumroot, plain_packages)
if opts.breakpoint == 'post-yum-phase2':
return