1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 01:46:13 +01:00
The Command Line Interface to work with an Open Build Service
Go to file
Daniel Mach 93bc0e4731 Switch http_request() to urllib3
Use connection pools for better performance.
Replace M2Crypto with cryptography and urllib3's ssl context.
2022-07-27 11:15:21 +02:00
.github Switch http_request() to urllib3 2022-07-27 11:15:21 +02:00
dist Add missing space to copypac completion 2022-05-05 11:14:30 +02:00
doc Fix several issues in HTML doc rendering, improve output 2022-03-16 15:19:24 +01:00
fuse allow loading module from working copy if osc is not installed 2009-10-20 21:02:21 +00:00
osc Switch http_request() to urllib3 2022-07-27 11:15:21 +02:00
tests Switch http_request() to urllib3 2022-07-27 11:15:21 +02:00
.gitattributes Auto-generate git versions compatible with PEP 440 2022-06-08 08:48:50 +02:00
.gitignore Ignore *junit-xml-results 2013-11-18 13:48:09 +01:00
.travis.yml CI pipeline: Skip cleanup prior to deployment 2020-12-28 10:25:37 +01:00
AUTHORS It's all for the fame, isn't it? 2011-08-18 16:02:34 +02:00
COPYING COPYING: Use the latest version from gnu.org 2022-01-27 10:06:03 +01:00
MANIFEST.in Automatic package publication via Travis CI 2020-04-06 09:32:01 +02:00
NEWS release 0.181.0 2022-07-26 21:34:07 +02:00
osc_expand_link.pl - added 'osc bugowner' as a more intelligent version of 'osc maintainer -B' 2009-10-22 09:43:58 +00:00
osc-wrapper.py Whitespace fixes as expected by pycodestyle/pep8 2022-04-27 14:13:18 +02:00
osc.fish fish shell completion: help arguments 2014-09-05 19:59:18 +04:00
osc.ico optional support for py2exe 2009-05-14 15:49:54 +00:00
osc.png optional support for py2exe 2009-05-14 15:49:54 +00:00
PROJ_PACK.txt fix whitespace 2010-02-28 02:30:13 +01:00
README.md Improve README, rename it to README.md 2022-06-21 13:40:13 +02:00
run_bandit.sh added a simple way to verify osc code base with the python security scanner bandit 2015-04-08 10:02:10 +02:00
setup.cfg Move test runner from pytest back to standard unittest 2022-06-24 13:06:01 +02:00
setup.py Switch http_request() to urllib3 2022-07-27 11:15:21 +02:00
TODO fix links that point into the wiki 2010-07-27 17:24:05 +02:00

unit tests codecov code climate contributors

openSUSE Commander

OpenSUSE Commander (osc) is a command-line interface to the Open Build Service (OBS).

Installation

RPM packages are available in the openSUSE:Tools repository.

zypper addrepo --repo http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_Tumbleweed/openSUSE:Tools.repo
zypper install osc

To install from git, do

./setup.py build
./setup.py install
# create a symlink `osc` in your path pointing to osc-wrapper.py.
ln -s osc-wrapper.py /usr/local/bin/osc

Alternatively, you can directly use ./osc-wrapper.py from the source directory, which is easier if you develop on osc.

Configuration

When you use osc for the first time, it will ask you for your username and password, and store it in ~/.config/osc/oscrc.

Keyrings

Osc can store passwords in keyrings instead of ~/.config/osc/oscrc. To use them, you need python3-keyring with a backend of your choice installed:

  • kwalletd5 (A pasword manager for KDE)
  • secrets (A password manager for GNOME)
  • python3-keyring-keyutils (A python-keyring backend for the kernel keyring)

If you want to switch to using a keyring you need to delete apiurl section from ~/.config/osc/oscrc and you will be asked for credentials again, which will be then stored in the keyring application.

Usage

For more details please check the openSUSE wiki.

To list existing content on the server

osc ls                              # list projects
osc ls Apache                       # list packages in a project
osc ls Apache subversion            # list files of package of a project

Check out content

osc co Apache                       # entire project
osc co Apache subversion            # a package
osc co Apache subversion foo        # single file

Update a working copy

 osc up
 osc up [pac_dir]                   # update a single package by its path
 osc up *                           # from within a project dir, update all packages
 osc up                             # from within a project dir, update all packages
                                    #   AND check out all newly added packages

If an update can't be merged automatically, a file is in C (conflict) state, and conflicts are marked with special <<<<<<< and >>>>>>> lines. After manually resolving the problem, use

osc resolved foo

Upload change content

osc ci                              # current dir
osc ci <dir>
osc ci file1 file2 ...

Show the status (which files have been changed locally)

osc st
osc st <directory>
osc st file1 file2 ...

Mark files to be added or removed on the next 'checkin'

osc add file1 file2 ...
osc rm file1 file2 ...

Adds all new files in local copy and removes all disappeared files

osc addremove

Generates a diff, to view the changes

osc diff                            # current dir
osc diff file1 file2 ...

Shows the build results of the package

osc results
osc results [repository]

Shows the log file of a package (you need to be inside a package directory)

osc log <repository> <arch>

Shows the URLs of .repo files which are packages sources for Yum/YaST/smart

osc repourls [dir]

Triggers a package rebuild for all repositories/architectures of a package

osc rebuildpac [dir]

Shows available repository/build targets

osc repository

Shows the configured repository/build targets of a project

osc repository <project>

Shows meta information

osc meta Apache
osc meta Apache subversion
osc id username

Edit meta information (Creates new package/project if it doesn't exist)

osc editmeta Apache
osc editmeta Apache subversion

Update package meta data with metadata taken from spec file

osc updatepacmetafromspec <dir>

There are other commands, which you may not need (they may be useful in scripts)

osc repos
osc buildconfig
osc buildinfo

Locally build a package (see 'osc help build' for more info)

osc build <repo> <arch> specfile [--clean|--noinit]

Update a package to a different sources (directory foo_package_source)

cp -a foo_package_source foo
cd foo
osc init <prj> <pac>
osc addremove
osc ci
cd $OLDPWD
rm -r foo

Contributing

Report issues or submit pull-requests to the osc project on GitHub.

Testing

Unit tests can be run from a git checkout by executing

./setup.py test