[Bug 412157] New: Add some guessing to "osc build"
https://bugzilla.novell.com/show_bug.cgi?id=412157 Summary: Add some guessing to "osc build" Product: openSUSE.org Version: unspecified Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: BuildService AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: vuntz@novell.com QAContact: adrian@novell.com Found By: --- Like many people, I'm lazy. So having to type "osc build openSUSE_Factory i586 something.spec" is too long, and I'd love to just type "osc build" and have it work. Here's a first attempt to implement this. It works, but it might be considered a bit hacky. What it does: + if needed, it tries to guess the platform to build on. If there's more than one possible platform, it doesn't do anything. + if needed, it tries to guess the spec file to build. If there's more than one spec file, it doesn't do anything. It could be improved (eg, list the various spec files that I can use instead of saying "missing argument"), but I'd like to get feedback first. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=412157 User vuntz@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=412157#c1 --- Comment #1 from Vincent Untz <vuntz@novell.com> 2008-07-25 04:57:06 MDT --- Created an attachment (id=229993) --> (https://bugzilla.novell.com/attachment.cgi?id=229993) Patch implementing the guessing in osc build -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=412157 User vuntz@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=412157#c2 --- Comment #2 from Vincent Untz <vuntz@novell.com> 2008-07-25 04:58:28 MDT --- Also note that it might be worth reworking this a bit more so that the guessing is more generic and can easily be used in other osc commands. Another approach, at least for the platform, would be to make it possible to specify the preferred platform in ~/.oscrc. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=412157 Cyril Hrubis <chrubis@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team-screening@forge.provo.novell.com |poeml@novell.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=412157 User dmueller@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=412157#c3 --- Comment #3 from Dirk Mueller <dmueller@novell.com> 2008-07-25 06:06:17 MDT --- Created an attachment (id=230012) --> (https://bugzilla.novell.com/attachment.cgi?id=230012) alternative patch I've also desired this feature and asked Peter about it but we didn't get to an agreement so far. I'm using the attached patch in my osc, which makes all paramenters optional and they can appear in any order. I guess its a bit too sophisticated, but at least I don't have to start 5 attempts at getting the order right. it also prints a message on what it actually tries to build. Another idea I had was to guess/read the settings from the already set up build root, so that you only have to specify the full information once (or whenever you want to change it). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=412157 Dirk Mueller <dmueller@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|Normal |Enhancement Status|NEW |ASSIGNED Priority|P5 - None |P3 - Medium -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=412157 Dirk Mueller <dmueller@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Found By|--- |Development -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=412157 User suse-tux@gmx.de added comment https://bugzilla.novell.com/show_bug.cgi?id=412157#c4 --- Comment #4 from Marcus Hüwe <suse-tux@gmx.de> 2008-07-25 06:27:56 MDT --- (In reply to comment #2 from Vincent Untz)
Also note that it might be worth reworking this a bit more so that the guessing is more generic and can easily be used in other osc commands.
Another approach, at least for the platform, would be to make it possible to specify the preferred platform in ~/.oscrc.
Hmm I think this approach is more appropriate than guessing the platform and arch. As you already said your current implementation of the platform guessing only works if there's only one target in the project which is quite unusual IMHO. But I like the idea of guessing the build description:) Btw. your patch wouldn't work if "osc build <platform> <arch> <specfile>" is used. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=412157 User suse-tux@gmx.de added comment https://bugzilla.novell.com/show_bug.cgi?id=412157#c5 --- Comment #5 from Marcus Hüwe <suse-tux@gmx.de> 2008-07-25 06:51:59 MDT --- (In reply to comment #3 from Dirk Mueller)
I guess its a bit too sophisticated, but at least I don't have to start 5 attempts at getting the order right. it also prints a message on what it actually tries to build.
Hmm I don't know if it's really needed to accept the arguments in a random order. IMHO it shouldn't be too hard to keep "platform arch build_descr" in mind:)
Another idea I had was to guess/read the settings from the already set up build root, so that you only have to specify the full information once (or whenever you want to change it).
This only works as long as the build-root option is a plain string (for example: build-root: /var/tmp/build-root) but you can also use something like "build-root: /var/tmp/build-root-%(repo)s-%(arch)s". If it's set to the latter it won't work anymore. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=412157 User dmueller@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=412157#c6 --- Comment #6 from Dirk Mueller <dmueller@novell.com> 2008-07-25 08:27:09 MDT ---
Hmm I don't know if it's really needed to accept the arguments in a random order
I did that because I want: osc build i586 as well as osc build foo-subspec.spec to be valid invocations. of course you can require the command line to be in the form of: osc build [platform] [arch] [builddescr] but code wise it doesn't make it easier, and it is inconvenient for those packagers that have multiple spec files (or specs and .dsc's): they would have to always specify platform and arch, even though they just always want to build for one predefined architecture (their own), but particular spec file flavors. Peter's concern was that my patch makes it always query the list of available repos (which it needs for matching if an argument is either the repo or the architecture). My proposal would be to allow the repo default to be chosen via ~/.oscrc, the arch' be the machine's native architecture by default, and the builddescr be autoguessed if only one file matches "{*.spec,*.dsc}" -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=412157 User dmueller@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=412157#c7 --- Comment #7 from Dirk Mueller <dmueller@novell.com> 2008-07-25 08:27:30 MDT --- this proposal would then avoid the extra roundtrip and still allow arbitrary matching -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=412157 User suse-tux@gmx.de added comment https://bugzilla.novell.com/show_bug.cgi?id=412157#c8 --- Comment #8 from Marcus Hüwe <suse-tux@gmx.de> 2008-07-26 07:31:12 MDT --- Created an attachment (id=230172) --> (https://bugzilla.novell.com/attachment.cgi?id=230172) yet another patch (In reply to comment #6 from Dirk Mueller)
My proposal would be to allow the repo default to be chosen via ~/.oscrc, the arch' be the machine's native architecture by default, and the builddescr be autoguessed if only one file matches "{*.spec,*.dsc}"
I like this idea. The attached patch adds this functionality to osc (or at least it should:) ). Is there anything missing? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=412157 User dmueller@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=412157#c9 --- Comment #9 from Dirk Mueller <dmueller@novell.com> 2008-07-30 02:22:09 MDT --- I like that patch. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=412157 User suse-tux@gmx.de added comment https://bugzilla.novell.com/show_bug.cgi?id=412157#c10 Marcus Hüwe <suse-tux@gmx.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED --- Comment #10 from Marcus Hüwe <suse-tux@gmx.de> 2008-07-30 11:19:58 MDT --- (In reply to comment #9 from Dirk Mueller)
I like that patch.
Ok - I just committed this patch (r4577). I think we can close this bug (if not please reopen). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=412157 User poeml@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=412157#c11 --- Comment #11 from Peter Poeml <poeml@novell.com> 2008-08-06 04:41:22 MDT --- I had the occasion to try the new behaviour yesterday -- and I like it! -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com