Show Menu
Cheatography

OSC - Open Build Service Command Line Client Cheat Sheet by

Workflows for the Command Line Interface of the Build Service

Create or edit a package

osc co home:you
Check out you(r) home project.
cd home:you
Change into the new directory.
osc mkpac ctris
Create new package named ctris.
cd ctris
Change into the new package directory.
vi ctris.s­pec
Start writing the new spec file.
Download the sources into the directory. (Note: checks­um/­sig­nature validation should also be done as next step, if any of them are provided.)
osc addremove
Mark files to be added and/or removed from your package directory.
osc ci -m "­First checkin of the ctris packag­e"
Submit your files/­changes back to the remote build instance.
Editing or creating a (new) package (meta data) in project $PRJ with the name $PKG can also be done via the command:
osc meta pkg $PRJ $PKG -e
everywhere in the filesy­stem.

To work with the sources locally, a checkout via
osc co $PRJ $PKG
is needed.

Branch a package

osc branch home:lrupp ctris
Creates a branch of the package below your home project.
osc co home:y­ou:­bra­nch­es:­hom­e:l­rup­p/c­tris
Check out the branched package.
cd home:y­ou:­bra­nch­es:­hom­e:l­rup­p/c­tris
Change into the new directory.
vi ctris.s­pec
Do changes in spec file (or other files).
Download newer source tarballs (as example).
osc build ctris.s­pec
Do a test build of the package.
rm ctris-­0.4­1.t­ar.bz2
Cleanup before submit­ting, please. ;-)
osc vc
Add a new package changelog entry.
osc ci -m "­updated package to latest upstream versio­n"
Submit your files/­changes to the remote build instance.
osc results
Check the build results of your changes.
osc sr -m "Hi! I updated your package to the latest version. Have fun!"
Create a submit request against the original project.
osc request -M
Check the current status of your own requests.
You might also check tools like quilt for fixing packages, but this is not the topic of this cheat sheet.

Mainte­nance updates for openSUSE follow a slightly different workflow. Please check https:­//e­n.o­pen­sus­e.o­rg/­Por­tal­:Ma­int­enance for details.
 

Building a package

osc meta prj -e
Either use the WebUI or edit the project config­uration manually and add a build target reposi­tory.
osc build
Builds a package with the default values (for distri­bution and archit­ecture) from the file ~/.os­crc.
osc build Fedora_22 x86_64
Builds a package with given repository and archit­ecture.
osc lbl | less
Shows the build log of a local build (pipe into pager to allow scrolling and search­ing).
osc chroot
Jump into the chroot enviro­nment of the current local build. Might be useful for debugging and/or fixing a package.
osc ci -m "­fixed package build for Fedora­"
Submit your files/­changes to the remote build instance.
osc results
Shows the build results of a package or project.
osc prjres­ults
Shows projec­t-wide build results.
Building a package locally saves time, as the public instances need to find a free schedule for building, while the local machine can start the build immedi­ately. As the build is done in a chroot enviro­nment, the OS instal­lation on the local machine will not be affected.

Please remember that the public build instances do neither allow network access nor root permis­sions during build.

Collab­orating on packages

osc request list home:l­rupp
Check for (open) submit requests against a reposi­tory.
osc request show -d $ID
Deeply inspect submit request with id $ID (show diff).
osc request accept $ID -m "­Thank you for your contri­bution :-)"
Accept a pending request.
osc request decline $ID -m "­Sorry, but you forgot to add missing files"
Decline a pending request.
osc request supersede -m "He did it better than me - use his submit request please­" $ID $SUPER­SED­ING_ID
Superseede a pending submit request with another one.
osc branch -N -M openSU­SE:­Bac­kpo­rts­:SL­E-1­2:U­pda­te/­glibc7
Create a branch pointing to a not yet existing package for a project and package in mainte­nance mode like the package hub project.

Working with meta inform­atoin

osc meta prj $PRJ
Show meta inform­atoin about a project.
osc meta pkg $PRJ $PKG
Show meta inform­ation about a package.
osc meta user $USER
Show inform­ation about a user.
osc meta prjconf $PRJ
Show meta inform­ation about a project.
osc update­pac­met­afr­omspec
Update package meta data with metadata taken from spec file.
osc comes with a very useful --help option and man page. Please refer to this material if you want to get more inform­ation.

https:­//e­n.o­pen­sus­e.o­rg/­ope­nSU­SE:OSC
https:­//g­ith­ub.c­om­/op­enS­USE/osc
                   

Help Us Go Positive!

We offset our carbon usage with Ecologi. Click the link below to help us!

We offset our carbon footprint via Ecologi
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Linux Command Line Cheat Sheet
          mod_rewrite Cheat Sheet
          RPM Build Basics Cheat Sheet