Home Home
Sign up | Login

Author Archive

Hackweek V: osc bash completion

June 15th, 2010 by

During last week , I was working on my Hackweek V project: bash completion for osc. It’s still far from being complete, but IMHO it is usable already, so here we go.


The project is hosted on gitorious.org. To get the sources, use git:

git clone git://gitorious.org/opensuse/osc-bash-completion.git


You need working and configured osc. I have tested the completion with osc-0.126git, but it should more or less work with older/newer versions too. Naturally, your shell has to be bash (I used bash-4.x). The easiest way how to try the completion is simply to do
~> source osc.shThis will enable the completion for the given shell only – see README for more “persistent” ways how to enable the osc completion.


The script provides support for completing:

  • osc subcommand names (checkout, commit, …)
  • global long osc options (e.g. –quiet, –debug, …)
  • long subcommand options
  • project names
  • package names (in given project)
  • file names (in given project/package)
  • repository names (openSUSE_Factory, …)
  • architectures (i586, x86_64, …)

Some examples:
osc com<tab><tab> => osc commit
osc --ht<tab><tab> => osc --http-debug
osc build --a<tab><tab> => osc build --alternative-project
osc ls Ar<tab><tab> => osc ls Archiving
osc ls Base:System pa<tab><tab> => osc ls Base:System parted
osc cat Base:System parted ba<tab><tab> => osc cat Base:System parted baselibs.conf
osc buildlog openSUSE_<tab><tab> => osc buildlog openSUSE_
openSUSE_Factory openSUSE_11.0 openSUSE_11.1 openSUSE_11.2

osc buildlog openSUSE_Factory x<tab><tab> => osc buildlog openSUSE_Factory x86_64
osc createrequest -a<tab><tab> => osc createrequest -a
add_role delete change_devel set_bugowner submit

osc ? d<tab><tab> => osc ?
delete deleterequest dependson dif

osc meta a<tab><tab> => osc meta attribute
osc my <tab><tab> => osc my
pkg prj rq sr

osc request <tab><tab> => osc request
accept approvenew co decline checkout
list log revoke show wipe

osc getpac for<tab><tab> => osc gepac fortune

At the moment, the script DOES NOT provide support for completing

  • short options
  • arguments for most of the options
  • some complex combinations of arguments


To avoid long delays and spamming OBS server too much, the script caches several information:

  • list of projects in OBS
  • list of packages in individual projects (only in those that have been accessed by osc)
  • output of “osc repos prj” (dtto)

Please see the README file for more information about how the caching works and how to customize it (to make the completion significantly faster).

Known issues, TODO

  • The script does not work correctly if there is a long option with argument and there is ‘=’ between the option and argument (–long-option=arg). Please use the ‘–long-option arg’ form instead.
  • For the time being, the script does not recognize alternative apiurl (-A|–apiurl) and thus it works only with default (https://api.opensuse.org) api.
  • Sourcing the script removes the colon from COMP_WORDBREAKS variable to make completion of Build Service projects easier. This was known to break e.g. git completion in the past (however, I didn’t notice any issues). In the future, the script should be fixed so that modifying of COMP_WORDBREAKS is not necessary.
  • The script should dynamically create list of osc subcommands and lists of their options by parsing osc help output (or something similar). Now the lists and logic are hardcoded in the script, which will make it maintenance nightmare when osc changes.
  • Completing of “osc {chroot,build}” is not yet implemented.
  • See TODO file

Testing and feedback

The completion script is very new, tested only by me and mvyskocil for a while, so it definitely has a lot of bugs. Before releasing it as a separate package, I’d like to collect some feedback first (and fix the already known problems and TODOs), so, if you are interested, please give it a try and report any bugs, suggestions or patches directly to me (petr.uzel@suse.cz). Also, feel free to ping me on IRC: ptr_uzl @ freenode.net.

I hope at least somebody (except me :) ) will find the completion useful. Thanks and happy completing.

openSUSE @ Chemnitzer Linux Tage 2010

March 18th, 2010 by

Last weekend, I was boosting at Chemnitzer Linux Tage where we ran openSUSE booth with Jan Weber, Kai-Uwe Behrmann and Sirko Kemter. Jan and Sirko already wrote reports at their blogs, so I’ll add just some personal thoughts and remarks.
It all started on Friday at the Greek restaurant. There was about ten of us, including all the guys mentioned above, invis-server people and others (sorry, I suck at remembering names). We had nice evening with some greek food (surprisingly), German beer and free ouzo refill. Yes free. Caused me troubles later…

On Saturday morning, we went to the TU where the event took place and finished the booth with table clothes I brought from Prague. I have to thank my girlfriend’s brother, who work in a restaurant, for providing these (I will rather not thank the restaurant – I doubt they are aware of their contribution). Both touchscreens were ready, running 11.2, one GNOME and the second one KDE 4.4.1 IIRC. We had also bunch of DVDs to hand out, some stickers and similar stuff.

The event officialy started at 9 o’clock. I was surprised that so many people showed up.  Many of them came to the our booth, either just to take the DVD or to ask for help with their openSUSE installation. It was a bit funny when somebody started to talk to me in German (which I have completely forgot since the secondary school), so I always had to ask for switching to English – about 95% of cases this was no problem, and in the rest of cases I simply Fwd:ed the people to Jan or Kai-Uwe.

I have talked to several people doing server solutions based on openSUSE and asked what’s their biggest issue with using openSUSE and what can we do better. There seemed to be a consensus that it’s packages dropped from the distribution without communicating it enough to the community. Perhaps we could think about some centralized place (mailinglist) where packages that are due to be dropped were communicated to the community, so interested people could step in and take over of their maintenance?

Late in the afternoon, I attended Frederic Weisbecker’s talk called Instrumentation with perf events and ftrace, which was AFAIK the only lecture held in English. Frederic gave an overview about recently included tracing subsystem in linux kernel and how can it be used to gather various information from the running system.

On Sunday, things were more quiet as not so many people as on Saturday came. It was quite funny when I talked with some guy from Fedora at our booth when internet connection at the touchscreens broke up. I suspect it was some problem at AP’s side, but he seemed to be quite amused by openSUSE’s “instability” nevertheless. Hmm…

I left at about 15:30 and headed back to Prague.

In general, I think it was nice event and our booth was quite successful, because we handed out about 800 DVDs and also managed to solve most of the problems people asked us to help them with (KDE 4.4 desktop appereance, non working internet connection and VirtualBox installation are just few of them). I was happy to meet new people as well as those I know from IRC or changelog entries.

I took few photos, which can be found at picasaweb.

Tip: transparent editing of gpg encrypted files with vim

January 29th, 2010 by

If you are vim user and also use gpg to encrypt stuff, you might appreciate that you can teach vim to transparently open gpg encrypted files with vim gnupg plugin. Just install vim-plugin-gnupg from Contrib repository:

# zypper install vim-plugin-gnupg

Also, you should add following two lines to your .bashrc to make the plugin work properly:
export GPG_TTY

Then, if you tell vim to open gpg encrypted file, it will ask for passphrase, transparently decrypts it and after you make changes, it will encrypt the file again.

Report from openSUSE 11.2 Release Party in Prague

November 24th, 2009 by

On November 20th, the Czech members of the openSUSE Boosters Team organized openSUSE 11.2 Release Party. The party took place in the nice building of Faculty of Mathematics and Physics.


We have prepared installation DVDs, which we’ve burnt with Pavol the day before the party – about 20 32bit and the same amount of 64bit DVDs together with some promo DVDs. It was interesting that the 32bit DVDs were taken before the 64bit ones – we expected it to be the other way round. We had also some promotional stuff like T-shirts, caps, stickers etc. Everything disappeared in several minutes, so it seems that people enjoy wearing T-shirts with that little green creatures. ;)


It was hard to estimate how many people will come – we have expected something around 20 participants. However, to our pleasant surprise, about 40 people showed up. Moreover, not only students and young people were present, but also two or three colleagues born a bit earlier.


After Pavol’s quick introduction of members of Czech openSUSE Boosters Team, Michal Hrusecky started his talk about new features in openSUSE 11.2 and new look and feel. Finally, Michal noted opening of Factory, new development model with devel projects, the Contrib repository and Junior Jobs.


After a short snack break, Lubos talked about new KDE in openSUSE 11.2. It seems that the rotating cube effect never bores, so Lubos was asked to rotate his desktop. After having some troubles with figuring out how to switch the cube on, he of course succeeded and the cube worked – WOW! Next, Lubos exhumed his about two years old presentation named ‘What will be new in KDE 4.0′ (or something like that) and retroactively evaluated what the KDE developers achieved or not.


The rest of the party was rather interactive. Boosters and other participants helped with installation of 11.2, solving problems, answered questions and helped with creating bugzilla accounts and reporting bugs in case we had no clue. ;)



Our thanks belong to Faculty of Mathematics and Physics for allowing us to use classroom, SUSE CZ for sponsoring the promotional stuff and snacks and last but not least, to everybody who showed up at the party. Thanks!

For more photos from the party, please visit picasaweb.

Branching Contrib for 11.2

October 21st, 2009 by

As you might know, Contrib is a universal repository for third-party packages. Branching of this repository to openSUSE:11.2:Contrib is going to happen on October, 30, so if you want to have your favorite application or tool included in openSUSE:11.2:Contrib, please submit your request as soon as possible.

If you already maintain some package(s) in Contrib, please spend a few minutes by checking that the package builds fine, has properly set metadata (maintainer, bugowner) etc.