1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-21 09:46:19 +02:00
Commit Graph

3360 Commits

Author SHA1 Message Date
Andreas Schwab
c9d320bf92 Use correct appname for trusted-certs store 2019-07-28 14:59:14 +02:00
Marcus Huewe
e5c4a10673 Merge branch 'dont_decode_None' of https://github.com/lethliel/osc
Do not try to decode None in decode_it (in this case None is returned).
2019-07-26 14:35:03 +02:00
lethliel
a802df15ad return the obj if None type is passed to decode_it
If a obj of type None is passed to decode_it just
return it and do not try to decode it as this will fail
2019-07-26 14:22:26 +02:00
Marcus Huewe
1b6149fc75 Merge branch 'fix_local_package_cache_for_all_formats' of https://github.com/lethliel/osc
Make osc.util.{debquery,rpmquery} a bytes only api again.
2019-07-26 14:01:59 +02:00
lethliel
2aa6e998d2 fix and unify building of local package cache
* all filename functions now return bytes-like objects
* the caller does the decoding
* the caller in build.py passes encoded arguments
2019-07-26 13:38:45 +02:00
Marco Strigl
5c75566d22
Merge pull request #606 from adrianschroeter/maint_enforce_branch
allow implicit branch on maintenance request creation
2019-07-25 13:46:58 +02:00
Marco Strigl
d2de7ccc97
Merge branch 'master' into maint_enforce_branch 2019-07-25 13:46:18 +02:00
f465717668 allow implicit branch on maintenance request creation
via --enforce-branching option

This may be default by server side settings
2019-07-25 13:43:45 +02:00
Marcus Huewe
a98943cfc3 Merge branch 'rpmerror_fix' of https://github.com/mgerstner/osc
Make sure that RPMError is always a real "exception".
2019-07-25 12:40:30 +02:00
Matthias Gerstner
0a99f35126
babysitter: fix RPMError fallback when running in Python3
After (successfully) running an 'osc vc' the following exception trace
comes up, when no rpm python module is available:

```
no changes made
Traceback (most recent call last):
  File "/home/mgerstner/.local/lib64/python3.6/site-packages/osc/babysitter.py", line 62, in run
    return prg.main(argv)
  File "/home/mgerstner/.local/lib64/python3.6/site-packages/osc/cmdln.py", line 344, in main
    return self.cmd(args)
  File "/home/mgerstner/.local/lib64/python3.6/site-packages/osc/cmdln.py", line 367, in cmd
    retval = self.onecmd(argv)
  File "/home/mgerstner/.local/lib64/python3.6/site-packages/osc/cmdln.py", line 501, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/home/mgerstner/.local/lib64/python3.6/site-packages/osc/cmdln.py", line 1232, in _dispatch_cmd
    return handler(argv[0], opts, *args)
  File "/home/mgerstner/.local/lib64/python3.6/site-packages/osc/commandline.py", line 8924, in do_vc
    sys.exit(vc.returncode)
SystemExit: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mgerstner/bin/osc", line 41, in <module>
    r = babysitter.run(osccli)
  File "/home/mgerstner/.local/lib64/python3.6/site-packages/osc/babysitter.py", line 172, in run
    except RPMError as e:
TypeError: catching classes that do not inherit from BaseException is not allowed
```

To fix this change the fallback RPMError from None to an actual
Exception-derived type.
2019-07-25 10:58:56 +02:00
lethliel
5e39cdf683 open 0.166 development 2019-07-24 15:15:45 +02:00
lethliel
26214f7dcd release 0.165.3 2019-07-24 15:13:39 +02:00
Marcus Huewe
71ae93b35a Merge branch 'switch_diffs_to_bytes' of https://github.com/lethliel/osc
Since we do not know the files' encoding, the diff functions/methods
have to return bytes. Note: decoding the diff result is wrong in
general (see the discussion in [1]).

[1] https://github.com/openSUSE/osc/pull/554
2019-07-24 14:45:23 +02:00
lethliel
2b47be6b1e switch to difflib.diff_bytes in python3 case.
The files are now opened as rb for diffing. In python2 nothing changes.
In python3 the returned diff is bytes now.

The following changes were made:
  * commandline.py: The returned diff is now bytes
  * get_diff now returs the diff as a bytes-like object
  * run_pager writes with sys.stdout.buffer.write if message
    is not a string
  * for the commit message the returned diff needs to be decoded
    now. Otherwise it will just producce garbage. For the commit
    message the diff on decoded bytes-objects is ok. (nothing harmfull
    can happen here)
  * fixed submit_action_diff
  * fixed request_interactive_review
2019-07-24 13:48:39 +02:00
Marco Strigl
714dca0c92
Merge pull request #610 from lethliel/master
updated NEWS
2019-07-24 08:46:22 +02:00
lethliel
837a63e9d6 updated NEWS 2019-07-24 08:25:44 +02:00
Marcus Huewe
9daa15de8e Merge branch 'fix_CVE-2013-3685' of https://github.com/lethliel/osc
Use custom https connection classes. Follow-up fix for commit
6ddf771c9f ("[python3] make oscssl.py
python3 ready.").
2019-07-23 20:53:37 +02:00
lethliel
1d866351b9 fix oscssl.py not verifying TLS cert verification
use own implementation of HTTPSConnection (myHTTPSConnection)
instead the one provided by M2Crypto (httpslib.HTTPConnection)
And in proxy case use myProxyHTTPSConnection.

all credits go to wfrisch
2019-07-23 19:42:51 +02:00
Marcus Huewe
23c8f19868 Merge branch 'fix_issue_602_osc_api' of https://github.com/lethliel/osc
Do not decode the api result in do_api.
2019-07-19 12:56:44 +02:00
lethliel
cc44dded85 Do not decode output from osc api calls
Do not guess the decoding of the returned output on osc api calls.
This could lead to unexptected behavior. Just use sys.stdout.buffer.write()
to print the bytes-like object in python3.
2019-07-19 08:44:57 +02:00
Marcus Huewe
107976e8f8 Merge branch 'remove_old_version_from_travis' of https://github.com/lethliel/osc
Old python3 versions do not support %-interpolation with bytes.
2019-07-17 14:26:36 +02:00
lethliel
43274ae06a remove python 3.3 and 3.4 from testing
Those versions are not supported anymore and thus testing
is not needed anymore.
2019-07-17 11:35:10 +02:00
Marcus Huewe
ba0f07db6a Merge branch 'fix_osc_ls_l_empty_size_but_not_empyt_mtime' of https://github.com/lethliel/osc
Do not fail in do_list if f.size or f.mtime is None.
2019-07-13 16:45:27 +02:00
lethliel
49b0325ab0 fix error when f.size is None but f.mtime is not
The if statement just catches the case when both (f.size
and f.mtime) are None.

Added two elifs to catch the cases that just one of them is None.
2019-07-11 13:43:22 +02:00
lethliel
9a1b2d980a open 0.165.3 development 2019-07-08 11:30:42 +02:00
lethliel
d17b46c948 release 0.165.2 2019-07-08 11:28:50 +02:00
Marco Strigl
9dfc6c211e
Merge pull request #592 from lethliel/fix_empty_prjconf_meta
fix handling of empty prjconfig meta
2019-07-02 13:53:51 +02:00
lethliel
ef4b0ce023 fix handling of empty prjconfig meta
if prjconfig meta is empty the class metafile init
fails with

if isinstance(input[0], str):
IndexError: list index out of range

This is because input is an empty list and has no
[0] index.

This can be fixed by changing this line to:

if input and isinstance(input[0], str):
2019-07-02 09:36:05 +02:00
Marco Strigl
d516560d47
Merge pull request #591 from adrianschroeter/simpleimage
fix typo in last commit fixing simpleimage support
2019-06-27 16:47:14 +02:00
72b96b7d39 fix typo in last commit fixing simpleimage support 2019-06-27 16:34:41 +02:00
Marco Strigl
704c495dca
Merge pull request #590 from adrianschroeter/simpleimage
fix local build using simpleimage
2019-06-27 16:20:43 +02:00
024759bee0 fix local build using simpleimage 2019-06-27 16:14:17 +02:00
Marco Strigl
fe50d08df7
Merge pull request #587 from lethliel/fix_lbl_with_non_utf8_encoding
[python3] fix osc lbl non utf8 encoding
2019-06-21 10:47:57 +02:00
lethliel
682452d914 [python3] fix osc lbl non utf8 encoding
data can contain non-utf8 chars. So passing data to
the decode_it function will solve this problem.
2019-06-21 10:13:31 +02:00
Marco Strigl
7df178b50b
Merge pull request #552 from lethliel/fix_unhandled_exception_on_empty_package
fix triggerreason on empty packages.
2019-06-12 13:07:16 +02:00
Marcus Huewe
6362887977 Merge branch 'fix_osc_lock' of https://github.com/lethliel/osc
The "input" parameter of the metafile's __init__ method can be a bytes
now. (Also, fixes one bug + introduces a new one (old code could break
on an empty bytes b'' and the new code could break on an empty list
(however, the current osc code shouldn't pass such arguments)).)
2019-06-12 11:16:44 +02:00
lethliel
2568f88438 simplified class metafile __init__ method
simplified and fixed the __init__ method of the metafile class.
input can be string, bytes-like object, list of strings or list
of bytes-like objects now.

Based on the input now always a list is generated and joined to
a string for writing in the fd. (This is ugly but needed for
compat reasons)
2019-06-11 15:08:52 +02:00
Marco Strigl
9a098c4af8
Merge pull request #578 from lethliel/python3_fix_set_bugowner
[python3] osc maintainer -s now works with python3
2019-06-11 12:53:20 +02:00
lethliel
d85c901f88 osc maintainer -s now works with python3
data is a bytes-like object now and needs to be joined into a
bytes-like object.
2019-06-11 12:00:42 +02:00
Marcus Huewe
ee34429d75 Merge branch 'master' of https://github.com/andreas-schwab/osc
Use ET to parse the error xml in metafile.edit.
2019-06-02 20:07:43 +02:00
Marcus Huewe
a72d90a7af Merge branch 'priorize-command-typo' of https://github.com/sknorr/osc
Spelling and grammar fixes.
2019-05-29 23:13:27 +02:00
Andreas Schwab
ce63cd3e18 Properly parse error message in metafile.edit 2019-05-29 12:27:40 +02:00
Marco Strigl
d5c91d6a73
Merge pull request #568 from MaximilianMeister/fetch
cast bytes object to string during os.path.join
2019-05-28 13:36:06 +02:00
Maximilian Meister
1c825ec8b6
cast bytes object to string during os.path.join
this makes sure not to mix objects to prevent a TypeError

TypeError: Can't mix strings and bytes in path components

Fixes#567

Signed-off-by: Maximilian Meister <mmeister@suse.de>
2019-05-28 13:29:12 +02:00
Marco Strigl
497cb3af60
Merge pull request #512 from adrianschroeter/triggers
support different token operations (runservice, release and rebuild) …
2019-05-28 13:05:13 +02:00
6eac27ec1c support different token operations (runservice, release and rebuild) (requires OBS 2.10) 2019-05-27 14:50:34 +02:00
Stefan Knorr
4c16177ada Random drive-by typo fixes for osc command-line messages 2019-05-27 11:54:42 +02:00
Marcus Huewe
cf96f85590 Merge branch 'master' of https://github.com/sknorr/osc
Improve grammar in check_existing_requests and
check_existing_maintenance_requests.
2019-05-25 23:44:44 +02:00
Marcus Huewe
f1100d2a45 Merge branch 'master' of https://github.com/bmwiedemann/osc
Fix opts.define codepath in the build module (missing encode).
2019-05-25 23:36:31 +02:00
Marcus Huewe
0c9c616bd8 Merge branch 'master' of https://github.com/andreas-schwab/osc
Decode data in do_token before printing it.
2019-05-25 23:14:41 +02:00