1 osc -- opensuse-commander with svn like handling
4 Please send patches to poeml@suse.de, or work directly on
5 https://forgesvn1.novell.com/svn/opensuse/trunk/buildservice/src/clientlib/python/osc/
10 RPM packages are here (yum repository):
11 http://download.opensuse.org/repositories/openSUSE:/Tools/
13 To install from svn, do
15 python setup.py install
16 # create a symlink 'osc' in your path pointing to osc.py.
17 ln -s osc-wrapper.py /usr/bin/osc
19 Alternatively, you can directly use osc-wrapper.py from the source dir
20 (which is easier if you develop on osc).
23 The program needs the cElementTree python module installed. On SUSE, the
24 respective package is called python-elementtree (before 10.2: python-xml).
25 For local building, you will need python-urlgrabber in addition. Those are
26 standard package on SUSE Linux since a while. If your version is too old, you
27 can find python-elementtree and python-urlgrabber here:
28 http://download.opensuse.org/repositories/devel:/languages:/python/
34 When you use it for the first time, it will ask you for your username and
35 password, and store it in ~/.oscrc.
38 CONFIGURATION MIGRATION (only affects versions >= 0.114):
40 Version 0.114 got some cleanups for the configfile handling and therefore some
41 options are now deprecated, namely:
45 One new option was added:
46 * apiurl = <protocol>://<somehost> # use this as the default apiurl. If this
47 option isn't specified the default (https://api.opensuse.org) is used.
49 So far osc still has some backward compatibility for these options but it might
50 get removed in the future that's why it issues a deprecation warning in case
51 one of those options is still in use.
53 The new configuration scheme looks like the following:
55 [<protocol>://<apiurl>]
60 '''Before starting the migration please save your ~/.oscrc file!'''
62 If the migration doesn't work for whatever reason feel free to send me an email
63 or ask on the opensuse-buildservice mailinglist or in the #opensuse-buildservice
66 === Migration case I (apisrv only) ===
67 The apisrv option is used to specify the default apihost. If apisrv isn't
68 specified at all the default ("api.opensuse.org") is used.
69 The current [general] section looks like this:
74 apisrv = <protocol>://<somehost>
76 apisrv got superseded by the new apiurl option which looks like this:
79 apiurl = <protocol>://<somehost>
81 If apisrv has no "<protocol>" https is used. Make sure all apiurl sections have
82 the new format which is described above. Afterwards apisrv can be removed.
84 === Migration case II (scheme only) ===
85 The current [general] section looks like this:
90 This means every apiurl section which don't have the new format which is
91 described above for instance
97 has to be converted to
98 [<protocol>://<somehost>]
100 password = <password>
103 Afterwards the scheme option can be removed from the [general] section (it
104 might be the case that some sections already have the correct format).
106 === Migration case III (apisrv and scheme) ===
107 The current [general] section looks like this:
113 Both options can be removed if all apiurl sections have the new format which is
114 described above. So basically just adjust all apiurl sections (it might be the
115 case that some sections already have the correct format).
120 (online at http://en.opensuse.org/Build_Service/CLI )
122 To list existing content on the server
123 osc ls # list projects
124 osc ls Apache # list packages in a project
125 osc ls Apache subversion # list files of package of a project
128 osc co Apache # entire project
129 osc co Apache subversion # a package
130 osc co Apache subversion foo # single file
132 Update a working copy
134 osc up [pac_dir] # update a single package by its path
135 osc up * # from within a project dir, update all packages
136 osc up # from within a project dir, update all packages
137 AND check out all newly added packages
139 If an update can't be merged automatically, a file is in 'C' (conflict)
140 state, and conflicts are marked with special <<<<<<< and >>>>>>> lines.
141 After manually resolving the problem, use
144 Upload change content
147 osc ci file1 file2 ...
149 Show the status (which files have been changed locally)
152 osc st file1 file2 ...
154 Mark files to be added or removed on the next 'checkin'
155 osc add file1 file2 ...
156 osc rm file1 file2 ...
158 Adds all new files in local copy and removes all disappeared files.
161 Generates a diff, to view the changes
162 osc diff # current dir
163 osc diff file1 file2 ...
165 Shows the build results of the package
167 osc results [platform]
169 Shows the log file of a package (you need to be inside a package directory)
170 osc log <platform> <arch>
172 Shows the URLs of .repo files which are packages sources for Yum/YaST/smart
175 Triggers a package rebuild for all repositories/architectures of a package
178 Shows available platforms/build targets
181 Shows the configured platforms/build targets of a project
182 osc platforms <project>
184 Shows meta information
186 osc meta Apache subversion
189 Edit meta information
190 (Creates new package/project if it doesn't exist)
192 osc editmeta Apache subversion
194 Update package meta data with metadata taken from spec file
195 osc updatepacmetafromspec <dir>
198 There are other commands, which you may not need (they may be useful in scripts):
204 Locally build a package (see 'osc help build' for more info):
205 osc build <repo> <arch> specfile [--clean|--noinit]
208 Update a package to a different sources (directory foo_package_source):
209 cp -a foo_package_source foo; cd foo; osc init <prj> <pac>; osc addremove; osc ci; cd $OLDPWD; rm -r foo
215 Putting the following in the file ~/.w3m/passwd will make
216 w3m know the credentials for the buildservice servers:
219 host api.opensuse.org
221 realm Authentication required
225 host build.opensuse.org
227 realm openSUSE Build Service
232 chmod 0600 ~/.w3m/passwd
235 NOTES about the testsuite
237 It requires editing tests.py, for a user account / project to work with.
238 I use my own project (home:poeml) for testing.
239 Tests can be run as ./tests.py
240 or, more powerful, with nosetests:
242 To run a single test, you can use:
243 nosetests --exe tests:TestOsc.testCmdOptVersion