diff --git a/Makefile-rpm-ostree.am b/Makefile-rpm-ostree.am index a68f2d2f..8ff33945 100644 --- a/Makefile-rpm-ostree.am +++ b/Makefile-rpm-ostree.am @@ -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 $@ diff --git a/configure.ac b/configure.ac index b929d9fc..5c07ab6d 100644 --- a/configure.ac +++ b/configure.ac @@ -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 ]) diff --git a/src/rpm-ostree.in b/src/rpm-ostree.in index 84937f64..e3aeb822 100644 --- a/src/rpm-ostree.in +++ b/src/rpm-ostree.in @@ -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()) diff --git a/src/rpm-ostree.py b/src/rpmostree.py similarity index 97% rename from src/rpm-ostree.py rename to src/rpmostree.py index 3aa907f1..6b13cb10 100755 --- a/src/rpm-ostree.py +++ b/src/rpmostree.py @@ -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