Giter Club home page Giter Club logo

osc's Introduction

unit tests docs 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

Unstable RPM packages are available in the OBS:Server:Unstable repository.

zypper addrepo --repo http://download.opensuse.org/repositories/OBS:/Server:/Unstable/openSUSE_Factory/OBS:Server:Unstable.repo
zypper install osc

To install from git, do

./setup.py build
./setup.py install

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

osc's People

Contributors

abitrolly avatar adrianschroeter avatar andreas-schwab avatar aplanas avatar aspiers avatar bitstreamout avatar bmwiedemann avatar coolo avatar dalgaaf avatar dcermak avatar dirkmueller avatar dmach avatar firstyear avatar janzerebecki avatar lethliel avatar lnussel avatar marcus-h avatar mcepl avatar michal42 avatar mlschroe avatar mmohring avatar mvyskocil avatar nijel avatar prusnak avatar raimue avatar rudimeier avatar saschpe avatar schoolguy avatar thaodan avatar vogtinator avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

osc's Issues

osc 0.139.2: SSL Server Name Indication does not work

Heya,

i am in the process of creating a public OBS instance for fun and proft (learning experience).

As i have only one public ip available i set up the different vhosts for my obs in nginx with ssl and am using sni.

The sites are working fine from a modern browser (chromium). I am using StartSSL as a CA which is in my local cert store.

When i am trying to connect to the api through osc i get a general ssl validation error.

I tried it with a patched version of m2crypto -> http://stackoverflow.com/questions/7961547/does-m2crypto-have-client-side-server-name-indication-sni-support but the error prevails.

It seems that the ssl code of osc is overloading some functions of m2crypto, but i am not sure where to begin to troubleshoot the problem.

update of project - osc hangs after 2nd change

I've done some mass changes to many packages within a project, and want to check it in all in one run. Latest at the 2nd change osc hangs with 'Transmitting file data ':

docb@T520:~/home:DocB:Tryton:3.0> osc ci
nothing to do for package trytond
nothing to do for package tryton
nothing to do for package neso
nothing to do for package trytond_country
nothing to do for package trytond_crm_activities
Sending trytond_currency/trytond_currency.spec
Transmitting file data .
Committed revision 2.
Waiting for server side source service run
....
At revision 2.
Sending trytond_party/trytond_party.spec
Transmitting file data .

only CRTL-C helps, and restart of the check in.

osc is osc-0.139.1-1.1.1.noarch

osc ci: headless commit hacky

Headless committing needs:

yes "c" | EDITOR=/bin/true osc commit

Not sure if that is really what we want. First of all there's no headless flag, i.e. always fires up $EDITOR. Then there's the stupid asking back "do you really want to commit what you just changed"....

osc build --clean standard i586 <specfile> causes traceback in git master

With the current osc git master, a call of local build causes the following traceback on openSUSE 12.1:

$ osc build --clean standard i586 osp-shell.spec
Building osp-shell.spec for standard/i586
Getting buildinfo from server and store to /var/lib/tooladmin/obs-update/co/testobs.5eecosystems.com/Tizen:2.1:Main:rebuild/osp-shell/.osc/_buildinfo-standard-i586.xml
Getting buildconfig from server and store to /var/lib/tooladmin/obs-update/co/testobs.5eecosystems.com/Tizen:2.1:Main:rebuild/osp-shell/.osc/_buildconfig-standard-i586
Updating cache of required packages
Traceback (most recent call last):
File "/usr/bin/osc", line 26, in
r = babysitter.run(osccli)
File "/usr/lib/python2.7/site-packages/osc/babysitter.py", line 60, in run
return prg.main()
File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 345, in main
return self.cmd(args)
File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 368, in cmd
retval = self.onecmd(argv)
File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 488, in onecmd
return self._dispatch_cmd(handler, argv)
File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 1209, in _dispatch_cmd
return handler(argv[0], opts, *args)
File "/usr/lib/python2.7/site-packages/osc/commandline.py", line 5404, in do_build
return osc.build.main(self.get_api_url(), opts, args)
File "/usr/lib/python2.7/site-packages/osc/build.py", line 705, in main
cookiejar=cookiejar)
File "/usr/lib/python2.7/site-packages/osc/fetch.py", line 89, in init
self.gr = OscFileGrabber(progress_obj=self.progress_obj)
File "/usr/lib/python2.7/site-packages/osc/fetch.py", line 40, in init
super(OscFileGrabber, self).init()
TypeError: must be type, not classobj

This is not depending on any options like --clean, same result in any case.

osc clean doesn't remove directory from source service

Everything is in the title.

My example: I've a package which only contains a _service file. Source services are checking out from github, extracting spec file, then obs build.
I made a checkout, run "osc service r", got some files, run "osc clean", still got more than what I started with. See the dir listing below.

[root@localhost ansible-devel]# ll
total 16
drwxr-xr-x 3 root root 4096 Dec 27 13:21 .
drwxr-xr-x 4 root root 4096 Dec 27 09:03 ..
drwxr-xr-x 2 root root 4096 Dec 27 11:16 .osc
-rw-r--r-- 1 root root  584 Dec 27 11:14 _service
[root@localhost ansible-devel]# osc service r
Fetching from git://github.com/rgarrigue/ansible-1.git ...
[...snip.......]
[root@localhost ansible-devel]# ll
total 1268
drwxr-xr-x 4 root root    4096 Dec 27 13:22 .
drwxr-xr-x 4 root root    4096 Dec 27 09:03 ..
drwxr-xr-x 2 root root    4096 Dec 27 11:16 .osc
-rw-r--r-- 1 root root     584 Dec 27 11:14 _service
drwxr-xr-x 3 root root    4096 Dec 27 13:22 _service:extract_file:ansible-1.5
-rw-r--r-- 1 root root    4194 Dec 27 13:22 _service:extract_file:ansible.spec
-rw-r--r-- 1 root root 1266200 Dec 27 13:22 _service:recompress:tar_scm:ansible-1.5.tar.gz
[root@localhost ansible-devel]# osc clean
Removing: _service:extract_file:ansible.spec
Removing: _service:recompress:tar_scm:ansible-1.5.tar.gz
[root@localhost ansible-devel]# ll
total 20
drwxr-xr-x 4 root root 4096 Dec 27 13:23 .
drwxr-xr-x 4 root root 4096 Dec 27 09:03 ..
drwxr-xr-x 2 root root 4096 Dec 27 11:16 .osc
-rw-r--r-- 1 root root  584 Dec 27 11:14 _service
drwxr-xr-x 3 root root 4096 Dec 27 13:22 _service:extract_file:ansible-1.5

By the way, this leftover dir is problematic now and then. If I just add a "osc service r" behind that:

[root@localhost ansible-devel]# osc service r
Traceback (most recent call last):
  File "/usr/bin/osc", line 26, in <module>
    r = babysitter.run(osccli)
  File "/usr/lib/python2.6/site-packages/osc/babysitter.py", line 60, in run
    return prg.main(argv)
  File "/usr/lib/python2.6/site-packages/osc/cmdln.py", line 343, in main
    return self.cmd(args)
  File "/usr/lib/python2.6/site-packages/osc/cmdln.py", line 366, in cmd
    retval = self.onecmd(argv)
  File "/usr/lib/python2.6/site-packages/osc/cmdln.py", line 484, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/usr/lib/python2.6/site-packages/osc/cmdln.py", line 1214, in _dispatch_cmd
    return handler(argv[0], opts, *args)
  File "/usr/lib/python2.6/site-packages/osc/commandline.py", line 6008, in do_service
    p.run_source_services(mode, singleservice)
  File "/usr/lib/python2.6/site-packages/osc/core.py", line 2153, in run_source_services
    r = si.execute(self.absdir, mode, singleservice, verbose)
  File "/usr/lib/python2.6/site-packages/osc/core.py", line 360, in execute
    os.unlink(os.path.join(dir, filename))
OSError: [Errno 21] Is a directory: '/root/home:rgarrigue/ansible-devel/_service:extract_file:ansible-1.5'

Thus I have to remove it manually each time I rebuild.

osc sr in project checkout drips over not source-linked packages

Having a checkout of a project (e.g GNOME:Factory) and issuing
osc sr
in there fails / aborts at the first occurence of a non-linked package:

osc/GNOME/Factory> osc sr
Submitting package ModemManager
Submitting package NetworkManager
Submitting package NetworkManager-gnome
Package NetworkManager-iodine is not a source link and no target specified.
This is currently not supported.

osc commit fails

osc commit -m '..'
Traceback (most recent call last):
  File "/usr/bin/osc", line 26, in 
    r = babysitter.run(osccli)
  File "/usr/lib/python2.7/site-packages/osc/babysitter.py", line 60, in run
    return prg.main(argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 343, in main
    return self.cmd(args)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 366, in cmd
    retval = self.onecmd(argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 484, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 1214, in _dispatch_cmd
    return handler(argv[0], opts, *args)
  File "/usr/lib/python2.7/site-packages/osc/commandline.py", line 4386, in do_commit
    prj = Project(prj_path)
  File "/usr/lib/python2.7/site-packages/osc/core.py", line 591, in __init__
    self.pac_root = self.read_packages().getroot()
  File "/usr/lib/python2.7/site-packages/osc/core.py", line 714, in read_packages
    return ET.parse(packages_file)
  File "", line 62, in parse
  File "", line 38, in parse
cElementTree.ParseError: not well-formed (invalid token): line 1, column 0

I tried version 0.144, 0.146 and the current git version.

Traceback of an error in an exception handler

I hope this output is sufficient.

osc mv /tmp/rear-1.14/rear.spec /tmp/rear-1.14/rear-1.14.spec
Traceback (most recent call last):
  File "/usr/bin/osc", line 22, in <module>
    r = babysitter.run(osccli)
  File "/usr/lib/python2.6/site-packages/osc/babysitter.py", line 53, in run
    return prg.main()
  File "/usr/lib/python2.6/site-packages/osc/cmdln.py", line 310, in main
    return self.cmd(args)
  File "/usr/lib/python2.6/site-packages/osc/cmdln.py", line 333, in cmd
    retval = self.onecmd(argv)
  File "/usr/lib/python2.6/site-packages/osc/cmdln.py", line 449, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/usr/lib/python2.6/site-packages/osc/cmdln.py", line 1179, in _dispatch_cmd
    return handler(argv[0], opts, *args)
  File "/usr/lib/python2.6/site-packages/osc/commandline.py", line 7130, in do_mv
    raise oscerr.NoWorkingCopy("Error: \"%s\" is not an osc working copy." % os.path.abspath(dir))
  File "/usr/lib64/python2.6/posixpath.py", line 342, in abspath
    if not isabs(path):
  File "/usr/lib64/python2.6/posixpath.py", line 52, in isabs
    return s.startswith('/')
AttributeError: 'builtin_function_or_method' object has no attribute 'startswith'

osc rq show --interactive edit for maintenancerequests

Would it be possible to add the edit-option to osc request show --interactive for maintenancerequests? Currenty it's just possible for regular submitrequests and it would be very useful for maintenancerequests to add small changes like adding new patchnames to the changelog entry.

HTTP Error 400: Bad Request service validation error: Invalid attribute mode for element service

When I tried to make _service mode=localrun.

matthias@mPad-X230:~/Projekte/OBS/home:Mailaender:branches:games/stuntrally> osc ci
Sending    _service
Sending    stuntrally.changes
Sending    stuntrally.spec
Sending    tracks-2.4.tar.xz
Sending    stuntrally-2.4.tar.xz
Transmitting file data .Server returned an error: HTTP Error 400: Bad Request
service validation error: Invalid attribute mode for element service

osr sr -d in a project directory directly creates submit requests

I created a branch project with two packages, based on packages in the same source project, using "osc bco" each.

I modified each package and committed. I went ahead and created a submit request on one package to the parent project.

I issues "osc sr -d" in the directory containing the branch project. I expected a) the project diff or b) the message that this was not yet supported. Instead, submit requests for both packages were issued. This violated the rule of least surprise.

In addition, a submit request was issued when the same one already existed.

complete.sh breaks systems's TAB completion

In 08a9505 the line
COMP_WORDBREAKS="${COMP_WORDBREAKS//:}"
was added to complete.sh. This may override and break well choosen system settings.

Please remove this line again or make sure that packagers don't install it into /etc/profile.d or bashrc.
The real bug is that colon was choosen for OBS subproject separator. This should not be "fixed" by making things even worse.

See also,
https://bugzilla.novell.com/show_bug.cgi?id=851908#c12
(comments 12 - 15)

osc with uses USERID and ignores .oscrc

Dear OSC guys.

I am running OSC with an .oscrc config file that is ignored by osc and my user ID is used rather than what is configured in the oscrc file.

as unix user ID oms101 I can checkout

isc co home:osynge:branches:Devel:Storage:Ceph ceph

but on committing I get the error:

Server returned an error: HTTP Error 403: Forbidden
no permission to modify package ceph in project home:osynge:branches:Devel:Storage:Ceph
Transmitting file data

If I make a new unix user and change userID I can successfully do this task with the same config file.

My config file is shown below:

grep -v '#' .oscrc | sed 's/pass = .*/pass = password/g'

[general]
apiurl = https://api.opensuse.org
su-wrapper = sudo
build-root = /usr/local/share/build-root/%(repo)s-%(arch)s

[https://api.suse.de]
user = osynge
pass = password
trusted_prj=SUSE:Factory:Head Devel:Storage:Ceph

[https://api.opensuse.org]
user = oms101
pass = password
trusted_prj=CentOS:CentOS-5 CentOS:CentOS-6 openSUSE:Factory filesystems

Problems with osc and gnome-keyring

I was asked to open an issue for the following stack trace:

osc co -c Archiving:Backup:Rear:Snapshot rear -o /tmp/rear-1.13.0-git201206261113
Traceback (most recent call last):
  File "/usr/bin/osc", line 22, in <module>
    r = babysitter.run(osccli)
  File "/usr/lib/python2.6/site-packages/osc/babysitter.py", line 53, in run
    return prg.main()
  File "/usr/lib/python2.6/site-packages/osc/cmdln.py", line 302, in main
    self.postoptparse()
  File "/usr/lib/python2.6/site-packages/osc/commandline.py", line 121, in postoptparse
    override_verbose = self.options.verbose)
  File "/usr/lib/python2.6/site-packages/osc/conf.py", line 799, in get_config
    password = gk_data[0]['password']
KeyError: 'password'

I verified my gnome-keyring and the password in the interface is empty. In fact, it is greyed out so I am unable to change the password. I don't know why that happened. Yesterday I had a similar issue where the password in gnome-keyring did not (no longer?) match the password of the service. I had to modify the password in gnome-keyring to get the service working again. (osc was bailing out with http auth issues because of this). After changing the password everything worked again without any problem until today I issued a new build getting the above stack trace.

osc commit fails with do_package_tracking = 0

osc 0.145 with do_package_tracking = 0

curl -SsX PUT -T - /source/$prj/$pkg/_meta <<<$XML
osc co $prj/$pkg
touch $pkg/file
osc add $pkg/file
osc ci -m ... $pkg
Traceback (most recent call last):
  File "/usr/bin/osc", line 26, in <module>
    r = babysitter.run(osccli)
  File "/usr/lib/python2.7/site-packages/osc/babysitter.py", line 60, in run
    return prg.main(argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 343, in main
    return self.cmd(args)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 366, in cmd
    retval = self.onecmd(argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 484, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 1214, in _dispatch_cmd
    return handler(argv[0], opts, *args)
  File "/usr/lib/python2.7/site-packages/osc/commandline.py", line 4402, in do_commit
    p = Package(pac)
UnboundLocalError: local variable 'pac' referenced before assignment

do_package_tracking = 0

When this options is enable in .oscrc the home project indicates : inconsistent state
run : osc repairwc home:Florian

Running osc repairwc home:Florian do nothing
The result of osc status home:Florian say always inconsistent state.

disable : do_package_tracking fix the problem

AttributeError: 'str' object has no attribute 'read' when doing 'osc copypac'

osc version 0.141 installed from openSUSE:Tools, I get the following error when trying to run osc copypac X11:windowmanagers awesome home:KGronlund:

Sending meta data...
Copying files...
Traceback (most recent call last):
  File "/usr/bin/osc", line 26, in <module>
    r = babysitter.run(osccli)
  File "/usr/lib/python2.7/site-packages/osc/babysitter.py", line 60, in run
    return prg.main(argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 343, in main
    return self.cmd(args)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 366, in cmd
    retval = self.onecmd(argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 484, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 1214, in _dispatch_cmd
    return handler(argv[0], opts, *args)
  File "/usr/lib/python2.7/site-packages/osc/commandline.py", line 2624, in do_copypac
    print(r.read())
AttributeError: 'str' object has no attribute 'read'

osc uses wrong build log for gcc check

While building clewarecontrol it did build fine locally but didn't after submitting to the build service because of [unacceptable] compiler warnings.
The compiler warnings were the same but locally the gcc check didn't work.

osc chroot like command for VM based builds

It would be cool to have an ability to start a VM with buildroot used previously for build. In case of ppc64le we always build packages in a VM on ppc64, so chroot is not an option here.

Maybe chroot option needs to be renamed to osc debug or something like that. So later it can be extended with VM start capabilities.

osc sr --seperate-requests in prj checkout fails on packages without diff

Trying to do osc sr --seperate-requests on a prj fails / aborts on first occurrence of a package without a diff against the parent:

osc/GNOME/Factory> osc sr --seperate-requests
Submitting package ModemManager
Server returned an error: HTTP Error 400: Bad Request
The request contains no actions. Submit requests without source changes may have skipped!

osc dumps on ci

Not sure if this is a user or a system problem :-)
I checked out a package:

docb@T520:~> osc co home:DocB:python_packages trytond_stock_lot
A home:DocB:python_packages/trytond_stock_lot
A home:DocB:python_packages/trytond_stock_lot/_service
A home:DocB:python_packages/trytond_stock_lot/trytond_stock_lot.spec
At revision 3.

...created a new file
touch home:DocB:python_packages/trytond_stock_lot/trytond_stock_lot.changes

..added it to version control:
docb@T520:~/home:DocB:python_packages/trytond_stock_lot> osc ar
A trytond_stock_lot.changes

(actually not sure if this was sufficient, so I did a
osc ar trytond_stock_lot.changes
extra)

...and then tried to check in:
docb@T520:~> osc ci home:DocB:python_packages/trytond_stock_lot
Traceback (most recent call last):
File "/usr/bin/osc", line 22, in
r = babysitter.run(osccli)
File "/usr/lib/python2.7/site-packages/osc/babysitter.py", line 53, in run
return prg.main()
File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 310, in main
return self.cmd(args)
File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 333, in cmd
retval = self.onecmd(argv)
File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 449, in onecmd
return self._dispatch_cmd(handler, argv)
File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 1179, in _dispatch_cmd
return handler(argv[0], opts, *args)
File "/usr/lib/python2.7/site-packages/osc/commandline.py", line 4136, in do_commit
msg = get_commit_msg(prj.absdir, pac_objs[prj_path])
File "/usr/lib/python2.7/site-packages/osc/core.py", line 6231, in get_commit_msg
lines.extend(get_commit_message_template(p))
File "/usr/lib/python2.7/site-packages/osc/core.py", line 6189, in get_commit_message_template
f = open(filename, 'r')
IOError: [Errno 2] Datei oder Verzeichnis nicht gefunden: 'trytond_stock_lot.changes'

osc fails with TypeError: must be type, not classobj

osc build openSUSE_12.3 mono-core.spec
Run source service: /usr/lib/obs/service/download_files --outdir /tmp/tmpcGuS6p
Run source service: /usr/lib/obs/service/format_spec_file --outdir /tmp/tmpK9AcjY
Run source service: /usr/lib/obs/service/source_validator --outdir /tmp/tmpXO0TKW
(E) mono-3.0.10.tar.bz2 mentioned in spec file is not tracked.
Building mono-core.spec for openSUSE_12.3/i586
Getting buildinfo from server and store to /home/matthias/Projekte/OBS/home:Mailaender:branches:Mono:Factory/mono-core/.osc/_buildinfo-openSUSE_12.3-i586.xml
Getting buildconfig from server and store to /home/matthias/Projekte/OBS/home:Mailaender:branches:Mono:Factory/mono-core/.osc/_buildconfig-openSUSE_12.3-i586
Updating cache of required packages
Traceback (most recent call last):
  File "/usr/bin/osc", line 26, in <module>
    r = babysitter.run(osccli)
  File "/usr/lib/python2.7/site-packages/osc/babysitter.py", line 60, in run
    return prg.main()
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 345, in main
    return self.cmd(args)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 368, in cmd
    retval = self.onecmd(argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 488, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 1209, in _dispatch_cmd
    return handler(argv[0], opts, *args)
  File "/usr/lib/python2.7/site-packages/osc/commandline.py", line 5404, in do_build
    return osc.build.main(self.get_api_url(), opts, args)
  File "/usr/lib/python2.7/site-packages/osc/build.py", line 703, in main
    cookiejar=cookiejar)
  File "/usr/lib/python2.7/site-packages/osc/fetch.py", line 89, in __init__
    self.gr = OscFileGrabber(progress_obj=self.progress_obj)
  File "/usr/lib/python2.7/site-packages/osc/fetch.py", line 40, in __init__
    super(OscFileGrabber, self).__init__()
TypeError: must be type, not classobj

osc --debug status outputs no debugging information

% time osc --debug st
M    haskell-hslogger/PKGBUILD
M    ttf-hanazono/PKGBUILD
M    vim-project/PKGBUILD
M    vim-workspace/PKGBUILD
osc --debug st  140.87s user 26.18s system 49% cpu 5:36.52 total

i would expect something to look at while it's going through the project.

osc dr is inconsistent versus osc sr

if i enter a local package directory, i can

osc sr -m "message"

which will submit request for the current local package inti

On the other hand, if, in the same directory i issue

osc dr -m "message"

and the request is accepted, the whole project will be deleted!

The documentation for osc dr says:

deleterequest (deletereq, dr, dropreq, droprequest)
Request to delete (or 'drop') a package or project

usage: osc deletereq [-m TEXT] # works in checked out project/package
osc deletereq [-m TEXT] PROJECT [PACKAGE]
Options: -h, --help show this help message and exit
-m TEXT, --message=TEXT
specify message TEXT

It"s not very clear how "optional" is the [PACKAGE] in

osc deletereq [-m TEXT] PROJECT [PACKAGE]

I propose the following improvements:

Add a warning for the osc dr when an entire project is a target
Add a warning (and a double check) for the accept request operation when an entire project is a target.

Separate in man page the delete project line from the delete package line, and add comments to each of them describing what they do.

Thank you,
Cornel

ps
this was previously reported here:

openSUSE/open-build-service#285

feature: osc rq list prj --incoming

A feature that could be helpful would be an extension to osc rq list, showing only 'incoming' requests.

Example:
osc rq list GNOME:Factory --incoming
would show me only SRs with GNOME:Factory as target.

Currently, one can work around this missing feature by 'excluding known targets' (--exclude-target-project openSUSE:Factory).

Would just be a small 'help' in daily review jobs.

osc proxy problem

When I use osc 0.139 + python 2.7,
the following problem is met.


hj44.park@S3 17:39:46 (2008) ~/ [] > osc list

-- GET https://168.219.241.168:444/source
WARNING: SSL certificate checks disabled. Connection is insecure!

GET https://168.219.241.168:444/source
Failed to reach a server:

[Errno 8] _ssl.c:504: EOF occurred in violation of protocol

I executed the followings :
hj44.park@S3 17:39:49 (2009) ~/ [] > export no_proxy="168.219.241.168"

But currently, this error comes out.

hj44.park@S3 17:40:05 (2010) ~/ [] > osc list

-- GET https://168.219.241.168:444/source
WARNING: SSL certificate checks disabled. Connection is insecure!

GET https://168.219.241.168:444/source
Traceback (most recent call last):
File "/usr/bin/osc", line 22, in
r = babysitter.run(osccli)
File "/usr/lib/python2.7/dist-packages/osc/babysitter.py", line 53, in run
return prg.main()
File "/usr/lib/python2.7/dist-packages/osc/cmdln.py", line 310, in main
return self.cmd(args)
File "/usr/lib/python2.7/dist-packages/osc/cmdln.py", line 333, in cmd
retval = self.onecmd(argv)
File "/usr/lib/python2.7/dist-packages/osc/cmdln.py", line 449, in onecmd
return self._dispatch_cmd(handler, argv)
File "/usr/lib/python2.7/dist-packages/osc/cmdln.py", line 1179, in _dispatch_cmd
return handler(argv[0], opts, _args)
File "/usr/lib/python2.7/dist-packages/osc/commandline.py", line 376, in do_list
for prj in meta_get_project_list(apiurl, opts.deleted):
File "/usr/lib/python2.7/dist-packages/osc/core.py", line 3024, in meta_get_project_list
f = http_GET(u)
File "/usr/lib/python2.7/dist-packages/osc/core.py", line 2937, in http_GET
def http_GET(_args, *_kwargs): return http_request('GET', *args, *_kwargs)
File "/usr/lib/python2.7/dist-packages/osc/core.py", line 2925, in http_request
fd = urllib2.urlopen(req, data=data)
File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 400, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 418, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
result = func(_args)
File "/usr/lib/python2.7/urllib2.py", line 1215, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1174, in do_open
h.request(req.get_method(), req.get_selector(), req.data, headers)
File "/usr/lib/python2.7/httplib.py", line 958, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 992, in _send_request
self.endheaders(body)
File "/usr/lib/python2.7/httplib.py", line 954, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 814, in _send_output
self.send(msg)
File "/usr/lib/python2.7/dist-packages/osc/conf.py", line 522, in new_method
meth(_args, **kwargs)
File "/usr/lib/python2.7/httplib.py", line 790, in send
self.sock.sendall(data)

AttributeError: 'NoneType' object has no attribute 'sendall'

I cannot find out what is the problem.
I tried to understand with python 2.7 source, but I could not.

What's the problem and What can I do to solve?

TypeError: exec() arg 1 must be a string, bytes or code object

I installed version 0.139.50.git.1366120650 from https://build.opensuse.org/package/show?project=devel%3Atools%3Ascm&package=osc on openSUSE 12.3 and it crashes on startup for every command.

Traceback (most recent call last):
  File "/usr/bin/osc", line 9, in <module>
    from osc import commandline, babysitter
  File "/usr/lib/python3.3/site-packages/osc/commandline.py", line 54, in <module>
    class Osc(cmdln.Cmdln):
  File "/usr/lib/python3.3/site-packages/osc/commandline.py", line 7858, in Osc
    exec(open(os.path.join(plugin_dir, extfile)))
TypeError: exec() arg 1 must be a string, bytes or code object

devel project push feature

In order to support active devel projects in staging and submitting towards factory, a new feature for osc would be helpful; something like

osc push GNOME:Factory

What should it do

  • Check every package in GNOME:Factory if it's 'parent' (the package it was branched off) is different. In case there are differences, a submitreq should be created for this package
  • If the package is not a branch / link, no action to be taken
  • Bonus points for an extra switch to 'auto supersede' existing SRs
  • Bonus points for a switch to ignore packages with a pending SR (like if you run osc push twice, only 'new' packages should be SRed).

Remember buildroot location

We need a mechanism to remember location specified buildroot locaton specified by --root option. Without that it is hard to teach osc chroot to use last used buildroot.
(chroot option always defaults to /var/tmp/build-root)

osc meta pkg -e broken

$ rpm -q osc
osc-0.144.0-125.1.noarch
$ osc meta pkg -e
The package is linked from a different project.
If you want to edit the meta of the package create first a branch.
osc branch home:Andreas_Schwab:Factory libqt5-qtbase home:Andreas_Schwab:Factory
osc meta pkg home:Andreas_Schwab:Factory libqt5-qtbase -e

But home:Andreas_Schwab:Factory/libqt5-qtbase is a branch.

Push a new release

osc on 13.1 dumps on some projects but the latest git code works:

"/tmp/osc-commitmsgLZHpeI.diff" 183L, 6984C written
Log message not specified
a)bort, c)ontinue, e)dit: c
Traceback (most recent call last):
  File "/usr/bin/osc", line 26, in <module>
    r = babysitter.run(osccli)
  File "/usr/lib/python2.7/site-packages/osc/babysitter.py", line 60, in run
    return prg.main(argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 343, in main
    return self.cmd(args)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 366, in cmd
    retval = self.onecmd(argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 484, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 1214, in _dispatch_cmd
    return handler(argv[0], opts, *args)
  File "/usr/lib/python2.7/site-packages/osc/commandline.py", line 4382, in do_commit
    if any(pac.is_link_to_different_project() for pac in pacs):
  File "/usr/lib/python2.7/site-packages/osc/commandline.py", line 4382, in <genexpr>
    if any(pac.is_link_to_different_project() for pac in pacs):
  File "/usr/lib/python2.7/site-packages/osc/core.py", line 1568, in is_link_to_different_project
    orgprj = self.get_local_origin_project()
  File "/usr/lib/python2.7/site-packages/osc/core.py", line 1563, in get_local_origin_project
    root = ET.fromstring(self.get_local_meta())
  File "<string>", line 124, in XML
TypeError: must be string or read-only buffer, not None

linkpac -c and setlinkrev behave strange

the current sources are defined by a srcmd5 not by a revision. Right now if you linkpac -c to a package that is a link itself, you keep the _link content but not the actual sources.

Which makes me believe that this is a bug is that setlinkrev has a -R option, which is supposed to enable the current default behaviour. There is no switch to enable srcmd5.

Beside that it would be good if both add the current vrev into the _link too - this makes sure the rebuild counters are correct. @mlschroe dislikes _links without vrev ;)

FR: quickly summarize link types across multiple packages

I just wrote an osc-classify-link script - just a quick hack shell script but it would be better rewritten as an OSC plugin.

Sample output:

$ cd /home/adam/SUSE/OBS/systemsmanagement/crowbar/2.0
$ osc-classify-link
[... snipped ...]
rubygem-tilt               linkpac -> devel:languages:ruby:extensions/rubygem-tilt
rubygem-treetop            linkpac -> systemsmanagement:chef:10/rubygem-treetop
rubygem-tzinfo             linkpac expanded -> devel:languages:ruby:extensions/rubygem-tzinfo
rubygem-unicorn            normal or copypac
rubygem-uuidtools          linkpac -> systemsmanagement:chef:10/rubygem-uuidtools
rubygem-wsman              normal or copypac
rubygem-xml-simple         normal or copypac
rubygem-yajl-ruby          linkpac -> systemsmanagement:chef:10/rubygem-yajl-ruby
sleshammer                 normal or copypac

osc branch should warn about pending request

When branching (branch, mbranch) a package that has a pending request, there is a high risk of future conflicts on future submit. It would be good to warn about pending requests (or even error without proposed --force or --pending command line arguments) on both osc command line and web interface.

Mac OS X support

As tiitle said, does osc support Mac OS X indeed? if not, please remove 'Mac OSX' in platforms in setup.py.

and also, I installed it in my Max OSX, I can use some base commands, such as ls, diff, ci is bad.

osc package tracking moves files into old project

Problem...I have a project home:DocB:python_packages which I wanted to branch (completely) into home:DocB:Tryton:3.0. Ideally in one step (see http://forums.opensuse.org/english/other-forums/development/open-build-service-obs/491382-osc-copy-all-packages-one-project-another-project.html )

As this did not work, and I detected the package tracking functionality http://en.opensuse.org/openSUSE:OSC#Package_tracking
I created a local copy accordingly.

As the attempt with
osc add home:DocB:python_packages
did not work out, I copied the local files from the source to the target directory.

Made changes to one package, added the changed files to the version control, and checked in:
docb@T520:/home:DocB:Tryton:3.0/trytond> osc ar
A trytond.changes
docb@T520:
/home:DocB:Tryton:3.0/trytond> osc ci
Sending trytond.spec
Sending trytond.changes
Transmitting file data ..
Committed revision 50.
Waiting for server side source service run
...
At revision 50.

As a result, the files were changed in home:DocB:python_packages/trytond/ instead of /home:DocB:Tryton:3.0/trytond/.

Tried detaching:
docb@T520:~/home:DocB:Tryton:3.0> osc detachbranch
Error: '/home/docb/home:DocB:Tryton:3.0' is not an osc package working copy

..whats wrong? Is there a way to clone a whole project?

request: make osc branch|detachbranch|copypac work on project level

I have a project with some 30+ packages in it.
Now I want to create a branch for a new major release for that project, while keeping the original project, as this release is still maintained.
Unfortunately I have to call 'osc branch' for each package...which is a PITA.

Please make osc branch|detachbranch|copypac work on project-level as well.
Thanks

calling with -H option causes traceback

on openSUSE 12.1, current git master of osc

osc -H -A https://api.opensuse.org ls
Traceback (most recent call last):
File "/usr/bin/osc", line 26, in
r = babysitter.run(osccli)
File "/usr/lib/python2.7/site-packages/osc/babysitter.py", line 60, in run
return prg.main()
File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 337, in main
self.postoptparse()
File "/usr/lib/python2.7/site-packages/osc/commandline.py", line 131, in postoptparse
override_verbose = self.options.verbose)
File "/usr/lib/python2.7/site-packages/osc/conf.py", line 971, in get_config
init_basicauth(config)
File "/usr/lib/python2.7/site-packages/osc/conf.py", line 563, in init_basicauth
AbstractHTTPHandler.init = urllib2_debug_init
NameError: global name 'AbstractHTTPHandler' is not defined

osc commit updates .osc file copy even if commit was unsuccesful

When doing "osc commit", I got the following error:
Sending SLED_DVD_PACKAGES.group
Transmitting file data .Server returned an error: HTTP Error 400: Bad Request
element 'packagelist' contains content

However, after this failed commit, running "osc diff" didn't show any diff for the file. I had to remove .osc/SLED_DVD_PACKAGES.group, run osc repairwc . to get diff to work properly

This is with osc-0.142.2

osc asks for forwarding of request after error 403

osc rejected accepting of request, but then asked me for forwarning to Factory. I was thinking that it will make a direct request from my branch to Factory, but it created an empty request instead.

Example from opensuse.org OSC:

Base:System/time> osc rq accept 234801

HTTP Error 403: Forbidden
post_request_no_permission
openSUSE:Factory
Forward this submit to it? ([y]/n)y

  • remove time.1 [bnc#878057](forwarded request 234801 from pgajdos)
    New request # 234912
    Base:System/time> osc rq show --diff 234912
    Request: #234912

    submit: Base:System/time@4 -> openSUSE:Factory

Message:

  • remove time.1 [bnc#878057](forwarded request 234801 from pgajdos)

State: review 2014-05-20T21:44:15 sbrabec
Comment:

Review: new Group: factory-auto
new Group: legal-auto
new Package: Base:System/time

Some osc services are executed too early

Problem is if we have openSUSE dependant checks in the services like the format_verification it might fail, because on the host machine it is not guaranteed to be openSUSE.

For example the source_validator calls rpm to validate the spec file but VANILLA rpm does not parse some stuff we put into spec files resulting in impossible build.

Workaround for now is to use the --noservice option to get it building and commited.

I think we should have way to determine which services are safe to run on host and which needs suse setup and then run them in approperiate stage (eg verify the quality of the spec in the chroot bit later and not right away).

I am not exactly sure if this is bug of osc or build itself so please take your pick :-)

maintained command should not be aliased to mbranch

maintained documented as an alias to mbranch implies one could do

echo ${osc_command} | sed 's/maintained/mbranch/g'

However, maintained really is mbranch --dryrun and is poorly documented in the man page.

osc service localrun fails when cloning from git

This will only fail locally, not on http://build.opensuse.org

osc service localrun
Fetching from https://github.com/OpenRA/OpenRA.git ...
Klone nach 'OpenRA'...
remote: Counting objects: 77904, done.
remote: Compressing objects: 100% (18430/18430), done.
remote: Total 77904 (delta 61930), reused 74271 (delta 58662)
Empfange Objekte: 100% (77904/77904), 38.31 MiB | 947 KiB/s, done.
Löse Unterschiede auf: 100% (61930/61930), done.
Note: checking out 'playtest-20130413'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

Zweigspitze (HEAD) ist jetzt bei f7f4170... Merge pull request #3052 from chrisforbes/husk-render-order
You are not currently on a branch. Please specify which
branch you want to merge with. See git-pull(1) for details.

    git pull <remote> <branch>

ERROR: git pull failed; aborting!
Aborting: service call failed: /usr/lib/obs/service/tar_scm --scm 'git' --url 'https://github.com/OpenRA/OpenRA.git' --revision 'playtest-20130413' --versionprefix 'playtest-' --version '20130413' --outdir /tmp/tmpzCuvXH
Traceback (most recent call last):
  File "/usr/bin/osc", line 22, in <module>
    r = babysitter.run(osccli)
  File "/usr/lib/python2.7/site-packages/osc/babysitter.py", line 53, in run
    return prg.main()
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 310, in main
    return self.cmd(args)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 333, in cmd
    retval = self.onecmd(argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 449, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 1179, in _dispatch_cmd
    return handler(argv[0], opts, *args)
  File "/usr/lib/python2.7/site-packages/osc/commandline.py", line 5782, in do_service
    p.run_source_services(mode, singleservice)
  File "/usr/lib/python2.7/site-packages/osc/core.py", line 2124, in run_source_services
    r = si.execute(self.absdir, mode, singleservice, verbose)
  File "/usr/lib/python2.7/site-packages/osc/core.py", line 374, in execute
    os.unlink(os.path.join(temp_dir, filename))
OSError: [Errno 21] Ist ein Verzeichnis: '/tmp/tmpzCuvXH/OpenRA'

This is how the _service file looks like:

<services>
  <service name="tar_scm">
    <param name="scm">git</param>
    <param name="url">https://github.com/OpenRA/OpenRA.git</param>
    <param name="revision">playtest-20130413</param>
    <param name="versionprefix">playtest-</param>
    <param name="version">20130413</param>
  </service>
  <service name="recompress">
    <param name="compression">bz2</param>
    <param name="file">*.tar</param>
  </service>
  <service name="set_version"/>
</services>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.