[PATCH] Allow pungi to gather for arch != host

Josh Boyer jwboyer at gmail.com
Wed Dec 12 15:40:29 UTC 2007


There might be really good reasons not to do this, but it seems the
Gather step of pungi could be useful for gathering packages for other
architectures.  The patch below allows users to set --arch, but only
for the gather step.  Perhaps eventually some of the other steps could
also allow this, like createrepo.  IIRC, the buildinstall and iso steps
are the only ones that are arch specific.

Feel free to flame away.

josh

diff -r d0417d60748e pungi
--- a/pungi     Tue Dec 11 10:35:59 2007 -0500
+++ b/pungi     Wed Dec 12 09:35:40 2007 -0600
@@ -130,6 +130,9 @@ if __name__ == '__main__':
         parser.add_option("--name", dest="name", type="string",
           action="callback", callback=set_config, callback_args=(config, ),
           help='the name for your distribution (defaults to "Fedora")')
+        parser.add_option("--arch", dest="arch", type="string",
+          action="callback", callback=set_config, callback_args=(config, ),
+          help='the architecture to do gather for')
         parser.add_option("--ver", dest="version", type="string",
           action="callback", callback=set_config, callback_args=(config, ),
           help='the version of your distribution (defaults to datestamp)')
@@ -181,6 +184,14 @@ if __name__ == '__main__':
             print >> sys.stderr, "Flavor must be alphanumeric."
             sys.exit(1)
 
+        if config.get('default', 'arch') != os.uname()[4]:
+            if not opts.do_gather:
+                print >> sys.stderr, "Arch must be used with gather."
+                sys.exit(1)
+            elif opts.do_all or opts.do_createrepo or opts.do_install or opts.createiso:
+                print >> sys.stderr, "Arch can only be used with gather."
+                sys.exit(1)
+
         if opts.do_gather or opts.do_createrepo or opts.do_buildinstall or opts.do_createiso:
             opts.do_all = False
         return (opts, args)




More information about the Fedora-buildsys-list mailing list