Home Home > 2009
Sign up | Login

Deprecation notice: openSUSE Lizards user blog platform is deprecated, and will remain read only for the time being. Learn more...

Archive for 2009

Smarter osc commit

August 3rd, 2009 by

Some hours ago I have worked on fix of eclipse build. But two parallel builds of eclipse (there are eclipse.spec and eclipse-archdep.spec) eats almost all resources of my computer, which was unusable. Fortunately vim needs a little of CPU time, so I decided to improve smarter osc commit, I implemented on Friday.

If you work with osc and packaging, you probably forgot to add a new patch, or source and commits sources with missing file, so build in OBS fails. Our internal script, which we used before BuildService has a check, which warns about files not specified in Patch or Source in a spec file, so it was a great feature for forgetful developers (as myself, for example). The problem is how to get a list of sources and patches for a current spec file? The internal script uses some “magic” shell code which calls a rpmbuild, because it’s rather impossible to parse a specfile correctly. Fortunately there is a simplest approach.

In build service package directory each file has a state – added, modified, removed, …. So my idea is simple – check state of all files in the directory and if there is any file with ‘?’ (file exists, but not in metadata) or ‘!’ (file is in metadata, but not in directory) state, ask user what to do. The initial implementation allows to continue or abort and was not user friendly as it could be. So during rebuild of (two) eclipse I wrote a better implementation.

Lets have a package (for example called xdoclet) and we want commit our changes to OBS. So

$ osc status
?    xdoclet-modules-objectweb-4.6.tar.bz2
?    xdoclet-src-1.2.3.tar.bz2
!    xdoclet-modules-objectweb-4.6.tgz
!    xdoclet-src-1.2.3.tgz
M    xdoclet.changes
M    xdoclet.spec

You see, that we used bznew to repack tgz files to tar.bz2, which is recommended in openSUSE. Then we commit our changes

osc commit
File `xdoclet-modules-objectweb-4.6.tar.bz2' is not in package meta. Would you like skip/remove/edit file lists/commit/abort? (s/r/e/c/A)

I suppose that all options are clear – skip will skip check for this file, remove will remove it, commit forced commit and abort breaks it. But I don’t like this message, so if you have some better proposal, please contact me.

The most important command is edit file list. I thought how to easily add and remove files using this smarter commit. The final implementation has been inspired by one of the coolest git feature – interactive rebase.

So after selecting e, the list of files is opened in your EDITOR

  1 leave   xdoclet-AbstractProgramElementTagsHandler.patch
  2 leave   xdoclet-WebLogicSubTask.patch
  3 leave   xdoclet-XDocletModulesEjbMessages.patch
  4 leave   xdoclet-ant.not-required.patch
  5 leave   xdoclet-build_docs_xml.patch
  6 leave   xdoclet-build_xml.patch
  7 leave   xdoclet-component-info.xml
  8 leave   xdoclet-maven-plugin-project.patch
  9 leave   xdoclet-maven-plugin-template.patch
 10 leave ? xdoclet-modules-objectweb-4.6.tar.bz2
 11 remove ! xdoclet-modules-objectweb-4.6.tgz
 12 leave   xdoclet-project_xml.patch
 13 leave ? xdoclet-src-1.2.3.tar.bz2
 14 remove ! xdoclet-src-1.2.3.tgz
 15 leave M xdoclet.changes
 16 leave M xdoclet.spec
 17
 18 # Edit a filelist for package %s
 19 # Commands:
 20 # l, leave = leave a file as is
 21 # r, remove = remove a file
 22 # a, add   = add a file
 23 #
 24 # If you remove file from a list, it will be unchanged
 25 # If you remove all, commit will be aborted

and a manipulation is obvious. Just replace a command listed in a first column by another one, then save a file and instructions will be processed and package will be commited.

BTW: Of course this feature can be suppressed by new -f/–force option.

Source Services 0.0.1, no more writing SPEC files ?

August 3rd, 2009 by

Okay, my first example of the build service source services did something usefull on my notebook. I submitted a very short file and I got installable packages in return. The file is actually that simple that it can easy get created by any IDE, website or desktop shortcut.

So the final goal is to get a 1-Click package build, but there is even more !

(more…)

Li-f-e and KIWI-LTSP updates

August 3rd, 2009 by

Nat Friedman's tip, put image on top of the blog to make visitors stay longer than 26 seconds ;)
openSUSE Li-f-e: Linux for Education DVD and the KIWI-LTSP has been updated.

The changes from the last release:

Lif-e:

– All openSUSE updates including the latest stable kernel 2.6.27.25
– Nvu is replaced by Kompozer
– New KIWI-LTSP images
(more…)

Small openSUSE Build Service Tips

July 31st, 2009 by

I talked yesterday with Coolo about the openSUSE Build Service and mentioned that I have now a lot of branched projects in my home project since I looked at many different packages that have different devel packages.  He showed me his script and also gave another hint that I wanted to share (thanks Coolo for sharing this with me!).

(more…)

openFATE feature 306967, KDE default

July 31st, 2009 by

There are pretty many pros and cons and even more people with their opinion about the feature. I’d like to summarize what has been said in the discussion in the feature itself and during yesterday’s openSUSE project meeting. Unfortunately the only sure thing is whatever decision is taken – it will be wrong for some. This is why, at this time, we have no default – because openSUSE has strong GNOME and KDE implementations, we offer them side-by-side as equals.  And we made 2 years ago on opensuse-project the decision that we stay with “no default” desktop.

So what do we have so far?

  • a feature request from one of the KDE e.V. board members
  • the feature asks to make KDE default. Reason for that, is to make openSUSE more simple for newbies and to make openSUSE the best KDE distribution around
  • Through the discussion in the feature I’d translate that feature into put the radio button as default to KDE on the desktop selection screen during installation instead of today’s status where everybody needs to make a choice between
  • the highest rated feature in openFATE until today
  • a majority of people supporting this feature (currently approx. 90% pro, 1% neutral, 9% against)

(more…)

New Package: Association Subscribers Manager 3.0

July 30th, 2009 by

I’m happy to announce, that i imported the Assuma Manager to openSUSE. Special Thanks goes to David Haller. The Package can recieved in KDE:KDE4:Community.

More Infos there: http://www.opendesktop.org/content/show.php?content=109313

Testing Packages and Their Dependencies

July 30th, 2009 by

With many packages, it’s easy to test that the package itself builds after a major change, e.g. a version update.  But once you add the package to your devel project or to factory, you notice that other packages do not build anymore due to your new package.

So, what can you do? You can create your own project in the openSUSE Build Service that contains your package and create links for those packages that need your package during build. That way you can find out which packages fail and fix them – instead of submitting your package to the devel project or factory and get lots of failures.

Do you have other tips about the Build Service?  Please post them!

Improved mirror selection for India

July 29th, 2009 by

Recently, it became evident that users in India don’t get good mirrors. This was solved by configuring a few German and US mirrors to serve users from India.

Courtesy of Adrian Reber from Esslingen University of Applied Sciences, there is an illustrative screenshot that visualizes the efficacy of this. The world map shows accesses to their openSUSE mirror by country (live view). In openSUSE’s MirrorBrain configuration, this mirror is set up to receive German, Danish, Polish, and Indian requests.

The background is that India has bad connectivity to neighbouring countries, but good connection to German and US mirrors. Therefore, now a few German and US mirrors are configured to serve India. The screenshot below demonstrates this for the mirror of the Esslingen University of Applied Sciences:

world map showing client distribution of accesses to an openSUSE mirror in Germany

world map showing client distribution of accesses to an openSUSE mirror in Germany

The world map clearly shows how the mirror gets nearly exclusively German requests, as well as those from India. The same happens for some other German and some US mirrors.

Note that if a mirror in India should become available (would be nice!), it would automatically be preferred, and the other mirrors become fallback mirrors.

While it is not new that we do this, the screenshot of Adrian’s analysis illustrates the issue very nicely. We have similar configuration for a number of countries, where a mirror selection purely based on countries and regions wouldn’t work. For this kind of tuning, we depend on user input.

Hints about how to improve serving our downloads are always appreciated. Please write to admin at opensuse dot org with input in this regard. Thanks!

Hackweek IV: Novell Bugzilla access from command line

July 29th, 2009 by

During a last Hackweek I decided to work on some tool which will helps users with submitting a new bug. My idea is to create something like reportbug from Debian, but targeted to SUSE. So the first step was find the way how to communicate with a bugzilla (especially to bugzilla.novell.com – bnc). Fortunately I found several libraries, which should be used for it:

perl-SUSE-BugzillaClient is written by Thomas Schmidt especially for bnc, so it is able to login using iChain. It also provides few functions for bugzilla communication, but unfortunately only for querying. Pybugz is written by Alastair Tse for Gentoo development in Python. But it is not able to login through iChain and I did not extended it for bnc, because it uses a plain GET/POST communication with parsing of HTML using regexes.

The reason why I have used the python-bugzilla written by Will Woods from RedHat is simple. It uses XMLRPC API, which bugzilla provides. And it’s also written with a flexibility in mind, so writing of another type of Bugzilla was easy. Just some subclassing and reimplementing of few methods and voila, the NovellBugzilla type is here. Because it uses iChain, it was necessary to reimplement login/logout methods – I spend a lot of time to understand how it works. Osc uses a HTTP authentication, which should be supported too, but even if it works with api.opensuse.org, it did not work with bnc. So I used a Firefox and LiveHTTP headers extension to track a communication and implemented the login according it.

The useful advantage of Novell bugzilla is that I extended a method readconfig, which reads a config file. Novell Bugzilla can read the username/password from ~/.oscrc, so you don’t need to have a same password in another config file, if you use osc.

So on the end those few lines of Python code

import bugzilla

bnc = bugzilla.NovellBugzilla(url="https://bugzilla.novell.com", user="mvyskocil", password="XXXXX")
kwargs = {
    'product': 'openSUSE 11.2',
    'severity': 'Normal',
    'cc': [],
    'rep_platform': 'x86-64',
    'component': 'Java',
    'summary': '[Java:packages/ant]: Cannot find a Java virtual machine',
    'version': 'unspecified',
    'assigned_to': 'mvyskocil@novell.com',
    'op_sys': 'Linux',
    'description': 'This is a testing bug report\n'
    }
bug = bnc.createbug(**kwargs)
print bug.bug_id

Have created this bug#525549. Even if Python is readable for regular programmers, the **kwargs should be expressed. It maps the dictionary to named function arguments (called keyword arguments – kwargs – in a Python world), so both calls in following snippet are equivalent.

d = {'name' : 'value')
call(**d)
call(name='value')

The python-bugzilla comes also with a simple command line tool called bugzilla, so this tool should be used also from shell scripts. It is sometimes little bit raw. For example listing of all products returns an output as a Python dictionary

bugzilla --bztype NovellBugzilla --user mvyskocil --password xxxxxx info -p
...
{'description': 'openSUSE 11.1', 'internals': {'disallownew': 0, 'classification_id': 7340, 'name': 'openSUSE 11.1', 
'votestoconfirm': 0, 'milestone_required': 0, 'id': 651, 'votesperuser': 20, 'maxvotesperbug': 5, 'defaultmilestone': '---',
'milestoneurl': '', 'description': 'openSUSE 11.1'}, 'name': 'openSUSE 11.1', 'id': 651} 
{'description': 'openSUSE 11.2', 'internals': {'disallownew': 0, 'classification_id': 7340, 'name': 'openSUSE 11.2',
'votestoconfirm': 0, 'milestone_required': 0, 'id': 755, 'votesperuser': 20, 'maxvotesperbug': 5, 'defaultmilestone': '---',
'milestoneurl': '', 'description': 'openSUSE 11.2'}, 'name': 'openSUSE 11.2', 'id': 755}
...

which might be hard to parse in other language. But it provides a lot of functionality, so for other informations about usage, please use man bugzilla.

SUSE Studio Launch – and openSUSE

July 28th, 2009 by

Today the SUSE Appliance program was launched by Novell. The interesting part for openSUSE is the launch of  SUSE Studio.  SUSE Studio is a web-based tool to build complete software appliances based on SUSE Linux Enterprise and also openSUSE. A software appliance is a ready-to run image that you can copy on your harddisk and start directly – or it comes packaged as a virtual image that you can boot using e.g. Xen. Normally software appliances are custom made for a specific purpose, e.g. a database server.

I just build on top of openSUSE 11.1 a git server appliance. The interface is very intuitive so that most of the time used was waiting for the image to be created – and building the images is extremely fast  (the LiveDVD image took 4:21min to build, the hard disk image only 2:35mins)! The SUSE Studio folks have created a great product – congratulations!

(more…)