Hi,
here's a small summary of the 11th (coding) week. Last week I worked on
implementing the new commandline interface. While doing so I faced several
"issues":
* How to combine argparse and our oscargs url-like syntax?
Basically we have to run our oscargs parser on the result which is
returned by argparse.ArgumentParser's parse_args method. The problem is
that both parsers have a different "syntax" that is using a naive approach
will lead to some redundancies (we specify the ui twice: one time for
argparse and one time for oscargs). In order to avoid this we need some
"interface" to which the oscargs syntax is passed and which configures
the argparse parser accordingly.
* How to support custom commands?
We also have to provide an "easy" way to specify custom commands.
Additionally it might be handy if existing commands can be enhanced
(either by adding additional options etc. or by adding a new subcommand
etc.). The best would be if the user simply drop his/her plugins in a
specific directory and osc will scan this directory and use the new
plugins/commands.
* Specifying the ui programmatically is somehow confusing/cluttered. It would
be much better if the ui can be specified in a more "declarative" way
without the syntactic "overhead" (well that's a bit exaggerated) which
is needed to configure the parser. Additionally it would be nice to have
a convenient way to specify a multi line description for a command
(hardcoding the str into the source makes the code "harder" to read).
Finally I ended up with a small DSL which can be used to specify the
ui in a "declarative" way (the initial idea + syntax is taken from the
django framework (see [1])).
Example:
Assume we want to implement a request command which consists (for the
sake of simplicity) of 2 subcommands "list" and "accept". This can be
specified like the following:
# file: osc/cli/request/ui.py
class Request(CommandDescription, OscCommand):
"""Show and modify requests."""
cmd = 'request'
class RequestList(CommandDescription, Request):
"""List requests.
By default open requests for a specific project or package will be
listed.
Examples:
osc request list api://
osc request list api://project
osc request list api://project/package
"""
cmd = 'list'
args = 'api://project?/package?'
opt_user = Option('U', 'user', 'list only requests for USER')
opt_group = Option('G', 'group', 'list only requests for GROUP')
opt_state = Option('s', 'state', 'list only requests with state STATE',
choices=['new', 'review', 'accepted', 'revoked',
'declined', 'superseded'], action='append')
func = request_list
class RequestAccept(CommandDescription, Request):
"""Accept a specific request.
...
"""
cmd = 'accept'
args = 'api://reqid'
func = request_accept
In order to add the request command it is sufficient to add an
import osc.cli.request.ui
statement to the main cli module. This produces the following output:
marcus@linux:~/osc2/osc/cli> python cli.py request -h
usage: cli.py request [-h] {list,accept} ...
Show and modify requests.
positional arguments:
{list,accept}
list List requests.
accept Accept a specific request.
optional arguments:
-h, --help show this help message and exit
marcus@linux:~/osc2/osc/cli>
and
marcus@linux:~/osc2/osc/cli> python cli.py request list -h
usage: cli.py request list [-h]
[-s {new,review,accepted,revoked,declined,superseded}]
[-G GROUP] [-U USER]
api://project?/package?
List requests.
By default open requests for a specific project or package will be
listed.
Examples:
osc request list api://
osc request list api://project
osc request list api://project/package
positional arguments:
api://project?/package?
optional arguments:
-h, --help show this help message and exit
-s {new,review,accepted,revoked,declined,superseded}, --state {new,review,accepted,revoked,declined,superseded}
list only requests with state STATE
-G GROUP, --group GROUP
list only requests for GROUP
-U USER, --user USER list only requests for USER
marcus@linux:~/osc2/osc/cli>
How does it work?
First of all each class which defines a command or subcommand has to inherit
from class "CommandDescription". If a subcommand is to be defined it also
has to inherit from the "parent" command (that is in our example "RequestList"
and "RequestAccept" inherit from class "Request" (which in turn inherits from
class "OscCommand" (from this class all toplevel commands have to inherit))).
In short: with the help of the inheritance hierarchy it is possible to define
a command <- subcommand hierarchy.
Note: actually the classes "RequestList" and "RequestAccept" only inherit
from "CommandDescription". The "parent" command base class is only needed
for a "marking" purpose (it is filtered out with the help of a metaclass
when the concrete class is "constructed" - I'll leave out the details for
now and may write a dedicated blogpost about it).
Now the remaining task is to define and implement the commands (note: we will
definitely not finish the project on the "suggested pencils down" date and
use the week until the "firm pencils down" date for coding...).
Marcus
[1] https://docs.djangoproject.com/en/1.4/topics/db/models
Here's a small example how to modify an existing command:
# plugins/myrequestaccept.py
from osc.cli.description import Option
import osc.cli.request.ui
class MyRequestAccept(osc.cli.request.ui.RequestAccept):
# add a new option
opt_foo = Option('f', 'foo', help='foo option')
This leads to
marcus@linux:~/osc2/osc/cli> python cli.py request accept -h
usage: cli.py request accept [-h] [-f FOO] api://reqid
positional arguments:
api://reqid
optional arguments:
-h, --help show this help message and exit
-f FOO, --foo FOO foo option
marcus@linux:~/osc2/osc/cli>
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe(a)opensuse.org
To contact the owner, e-mail: opensuse-buildservice+owner(a)opensuse.org
On Mon, 25 Jun 2012 19:16:17 +0200
Boris Manojlovic <boris(a)steki.net> wrote:
> as stated in paste did you run command from debug log? (missing
> initrd)
>
> On Mon, Jun 25, 2012 at 5:53 PM, Malcolm
> <malcolm_lewis(a)bellsouth.net> wrote:
> > Hi
> > I've enabled qemu-kvm and it's working fine for running an iso
> > image as my user.
> >
> > I've configured my ~/.oscrc for the three options: build-device,
> > build-swap and build-memory, however when testing I get the
> > following;
> >
> > http://paste.opensuse.org/72274785
> >
> > I'm on SLED 11 SP2, with osc version 0.134.1.
> >
> > Is there something I'm missing?
> >
Ahh running the env command was it many thanks :)
--
Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 3.0.31-0.9-default
up 3:17, 4 users, load average: 0.51, 0.52, 0.49
CPU Intel i5 CPU M520(a)2.40GHz | Intel Arrandale GPU
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe(a)opensuse.org
To contact the owner, e-mail: opensuse-buildservice+owner(a)opensuse.org
Package: Build
Hi,
I'm working on the project OBS Light and I am currently developing a
feature to build with fakeobs
(http://en.opensuse.org/openSUSE:OBS_Light_Fakeobs).
Everything works fine but I noticed a problem.
With a package:
-"A" which BuildRequires: Foo > 1.0.
and in my repository two packages:
- "B" Provides: Foo = 0.5
- "C" Provides: Foo = 1.5
expanddeps fails:
have choice for Foo needed by "A": "B" "C"
In the script "expanddeps", the function Build::addproviders is called
(to check Provides rules on Build.pm Line 582).
We need to keep the Requires and Provides rules (< <= = >= >) for the
dependency.
so in the script expanddeps (Line 173,190), we need to add:
if (@s && $s[0] =~ /^[<=>]/){
push @re, "$s $s[0] $s[1]";
}else{
push @re, $s;
}
instead of:
push @re, $s;
Does this patch have consequences on other scripts?
Could someone confirm this, please?
submit request 130302 to openSUSE:Tools
The Branch project on https://build.opensuse.org:
https://build.opensuse.org/project/show?project=home%3Aronan22%3Abranches%3…
Ronan
--
Ronan Le Martret
Intel Open Source Technology Center
I guess this is not good ;-)
[ 2541s] [ 2508.276069] BUG: soft lockup - CPU#2 stuck for 23s! [sh:24754]
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe(a)opensuse.org
To contact the owner, e-mail: opensuse-buildservice+owner(a)opensuse.org
Hi all,
How can I add Fedora Updates/Update-testing/Rawhide repo to OBS?
Thanks in advance,
Damian
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe(a)opensuse.org
To contact the owner, e-mail: opensuse-buildservice+owner(a)opensuse.org
Hi all,
How can I add Fedora Updates/Update-testing/Rawhide repo to OBS?
Thanks in advance,
Damian
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe(a)opensuse.org
To contact the owner, e-mail: opensuse-buildservice+owner(a)opensuse.org
I guess because of
http://en.opensuse.org/openSUSE:Build_Service_Tips_and_Tricks#Using_differe…
when you have a package with two spec files (e.g. binutils.spec and
cross-x86_64-binutils.spec) nothing will build for a repository like
"openSUSE_12.2", staying in status excluded.
There is any way to avoid the excluded state other than removing the
extra .spec files?
Something like
<build>
<spec repository="openSUSE_12.2" file="binutils.spec"/>
</build>
?
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe(a)opensuse.org
To contact the owner, e-mail: opensuse-buildservice+owner(a)opensuse.org
On Thu, Aug 02, 2012 at 02:02:02PM +0200, Martin Weber wrote:
> Am 02.08.2012 13:54, schrieb Michael Schroeder:
>> On Thu, Aug 02, 2012 at 01:23:45PM +0200, Martin Weber wrote:
>>> when I enable the Debuginfo flag, rpmbuild seems to skip the %prep phase
>>> and then fails.
>>> What's going on there?
>>
>> Dunno, can you send me the specfile?
>
> Ok, but how can the specfile affect rpmbuild's behaviour?
It's your
%global debug_package %{nil}
line that exposes a bug (actually some spaces) in build's way
of enabling debug packages. What happens is that
%prep
gets translated to
%debug_package%prep
(note the speces at the start of the line). That works ok with the
normal debug_package macro, but with debug_package set to %{nil},
it'll expand to
%prep
That renders %prep useless as it must start at the first column.
I'll delete the extra spaces from the build script.
Cheers,
Michael.
--
Michael Schroeder mls(a)suse.de
SUSE LINUX Products GmbH, GF Jeff Hawn, HRB 16746 AG Nuernberg
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe(a)opensuse.org
To contact the owner, e-mail: opensuse-buildservice+owner(a)opensuse.org
Hi all,
when I enable the Debuginfo flag, rpmbuild seems to skip the %prep phase
and then fails.
What's going on there?
### With debuginfo on
[ 76s] + exec rpmbuild -ba --define '_srcdefattr (-,root,root)'
--nosignature --define '_build_create_debug 1' --define 'disturl
obs://buildservice.ats-berlin.de/Razorcat:testing/openSUSE_11.4/2c501607724113ed307095bc41ddc1b4-ccursim_usable_headers'
/usr/src/packages/SOURCES/ccursim_usable.spec
[ 76s] Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.6Ww6YH
### With debuginfo off
[ 87s] + exec rpmbuild -ba --define '_srcdefattr (-,root,root)'
--nosignature --define 'disturl
obs://buildservice.ats-berlin.de/Razorcat:testing/openSUSE_11.4/2c501607724113ed307095bc41ddc1b4-ccursim_usable_headers'
/usr/src/packages/SOURCES/ccursim_usable.spec
[ 87s] Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.d9J4OI
Any help appreciated,
Martin
--
E-Mails sollten Text sein, Text und nur Text.
Wenn Gott gewollt hätte, dass E-Mails in HTML geschrieben würden,
endeten Gebete traditionell mit </amen>.
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe(a)opensuse.org
To contact the owner, e-mail: opensuse-buildservice+owner(a)opensuse.org