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

3441 Commits

Author SHA1 Message Date
lethliel
2f0918b93e add brief results/prjresults with filtered code
in do_results:
  * add --brief option on prj level:
    [packagename] [repo] [arch] [buildstatus]
  * filter by --status-filter <long status name>
    works on prj and pkg level

in do_prjresults:
  * --brief
  * assume len(state)>1 as long state

core.py
  * filter packages by build status
  * long status handling in get_prj_results
  * brief output generation in get_prj_results
2020-07-07 08:23:02 +02:00
Marcus Huewe
ce291abac6 Merge branch 'fix_string_literal_in_commit_msg' of https://github.com/lethliel/osc
Interprete unicode escape characters in a "--message" option. In some
cases, this breaks the existing UI (but that's OK because it can be
fixed by properly escaping the escape character(s)).
Note: if we are going to do more advanced stuff in the future, we should
move the logic into a separate function.
2020-06-29 23:53:32 +02:00
lethliel
16fda3115c interpretation of string literals in messages
string literals are not interpreted correctly when using -m "my\ntwo line message"
2020-06-26 17:42:35 +02:00
Marcus Huewe
d85030b72d Fix python2 regression in util.helper.decode_it
In commit 276d6e2439 ("Do not use the
chardet module in util.helper.decode_it") util.helper.decode_it was
changed to always decode the passed object if it has a decode method.
Since a python2 str has a decode method, the new code tries to utf-8
decode the passed str. As a result, a unicode object is returned (if
the decoding worked). Since a unicode object is not an instance of
type str, all subsequent isinstance(decoded_obj, str) checks evaluate
to False, which break some codepaths.
In order to fix this, restore the old python2 behavior (that is, if
the passed object is a str, it is not decode it). This change does not
affect the python3 codepaths.

Fixes: #814 ("osc log | fails")
2020-06-25 15:38:14 +02:00
Marcus Huewe
050c94dcf3 Merge branch 'fix_issues_diff' of https://github.com/lethliel/osc
Improve "osc rdiff --issues-only ..." output: now, it shows the added,
deleted and changed issues. Also, add a new "osc rdiff --xml ..." option,
which only works in combination with the "--issues-only" option: it prints
the raw xml.

Note: server_diff_noex has no option for the "full" parameter. Hence,
with the addition of the "xml=False" parameter, the signatures of the
server_diff_noex and server_diff functions are going to differ "forever".
That's OK (IMHO) because it is probably more sane to simply specify the
additional args via the kwargs syntax.
2020-06-15 22:42:16 +02:00
lethliel
a1df48145b Add more infos to issues rdiff
Show the state of the issues (added, deleted, changed)
of the issues in a list.

Also --xml can now be given to get the raw xml output from the server.
2020-06-15 20:53:38 +02:00
Marcus Huewe
dd814054ee Merge branch 'remove_dead_code' of https://github.com/lethliel/osc
Remove dead code from the fetch module. Actually, it should have
been removed in commit 95ec7dee7b
('- fixed #590606 ("osc/fetch.py does not support authenticated URLs")').
2020-06-08 21:32:42 +02:00
lethliel
297b050f1e remove dead opener code
The opener is generated but never used.
Since commit 95ec7dee7b
2020-06-08 20:31:28 +02:00
Marcus Huewe
a87d2c1202 Document a potential decoding issue in print_buildlog
We should reconsider this in the future (in practice, it does not
seem to cause too much trouble (at least I'm not aware of any bug
reports)).
2020-06-04 15:09:03 +02:00
Marcus Huewe
276d6e2439 Do not use the chardet module in util.helper.decode_it
In general, decode_it is used to get a str from an arbitrary bytes
instance. For this, decode_it used the chardet module (if present)
to detect the underlying encoding (if the bytes instance corresponds
to a "supported" encoding). The drawback of this detection is that
it can take quite some time in case of a large bytes instance, which
represents no "supported" encoding (see #669 and #746).
Instead of doing a potentially "time consuming" detection, either
assume an utf-8 encoding or a latin-1 encoding. Rationale: it is just
not worth the effort to detect a _potential_ encoding because we have
no clue what the _correct_ encoding is. For instance, consider the
following bytes instance:

b'This character group is not supported: [abc\xc3\xbf]'

It represents a valid utf-8 and latin-1 encoding. What is the "correct"
one? We don't know... Even if you interpret the bytes instance as a
human you cannot give a definite answer (implicit assumption: there is
no additional context available).
That is, if we cannot give a definite answer in case of two potential
encodings, there is no point in bringing even more potential encodings
into play. Hence, do not use the chardet module.

Note: the rationale for trying utf-8 first is that utf-8 is pretty
much in vogue these days and, hence, the chances are "high" that we
guess the "correct" encoding.

Fixes: #669 ("check in huge shell archives is insanely slow")
Fixes: #746 ("Very slow local buildlog parsing")
2020-06-04 13:12:22 +02:00
Adam Williamson
13a13a87c4 Fix ElementTree imports for Python 3.9
Importing `cElementTree` has been deprecated since Python 3.3 -
importing `ElementTree` automatically uses the fastest
implementation available - and is finally removed in Python 3.9.
Importing cElementTree directly (not as part of xml) is an even
older relic, it's for Ye Time Before ElementTree Was Added To
Python and it was instead an external module...which was before
Python 2.5.

We still need to work with Python 2.7 for now, so we use a try/
except to handle both 2.7 and 3.9 cases. Also, let's not repeat
this import 12 times in one file for some reason.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-06-02 15:13:10 -07:00
lethliel
e99b2942ef increase version number in core.py 2020-05-29 20:35:00 +02:00
lethliel
0e70579113 release 0.169.1 2020-05-29 20:28:42 +02:00
Marcus Huewe
1d26cb3079 Merge branch 'ccache' of https://github.com/sjamgade/osc
Add "--ccache" option to "osc getbinaries".
2020-05-27 16:09:06 +02:00
lethliel
22ac336f8b open 0.170.0 development 2020-05-27 14:50:37 +02:00
lethliel
42b4992ecb release 0.169.0 2020-05-27 14:49:10 +02:00
lethliel
a79c54418b fix security issue (bsc#1122675) no / in filename
This checks if the filename of a downloaded file has
been modified (for example by a MITM attack) to contain
slashes. This could mean that the file is compromised
and that the attacker tries to overwrite system files.
2020-05-27 11:17:40 +02:00
Sumit Jamgade
5557a06e5b add and implement ccache option for getbinaries
If this option is used, the api is asked to list ccache archive if
present, osc will then download the archive.
2020-05-25 09:03:33 +02:00
Marco Strigl
3967133022
Merge pull request #793 from sjamgade/ccache_path
add option pkg-ccache to be passed to build-cmd
2020-05-22 15:55:48 +02:00
Fabian Vogt
f3d07eab3f Fix kiwi build with --prefer-pkgs
The buildinfo contains packages from the local dir, so it needs the list of
local packages to work correctly.
2020-05-20 11:34:27 +02:00
Sumit Jamgade
5dd853e302 add option pkg-ccache to be passed to build-cmd
this option is a /path/to/_ccache.tar. The patch just forwards that
option to the build script.
2020-05-19 16:15:49 +02:00
Marcus Huewe
6b5b0fd55d Merge branch 'fix_help_depends_on' of https://github.com/lethliel/osc
Split dependson and whatdependson into two commands. This way, both
commands are part of "osc --help".
2020-05-19 12:56:55 +02:00
lethliel
798e3e4f63 split dependson/whatdependon in two commands
split the code of do_dependson into two separate commands (just for
the osc help overview)

They are doing the opposite of each other.

Duplicate code was moved to _dependson()

do_whatdependson and do_dependson just call _dependson with an option
reverse set to None or 1.
2020-05-19 12:50:15 +02:00
Marcus Huewe
9b2cbfead0 Merge branch 'fix_osc_api_without_arguments' of https://github.com/lethliel/osc
Fix handling of incorrect CLI arguments (python3).
2020-05-18 20:05:25 +02:00
lethliel
69b1233316 add regex for python3 missing arguments err
add new regex and check for missing arguments.
The error message in python3 differs from the one in python2.

python3:
do_api() missing 1 required positional argument: 'url'

python2:
do_api() takes exactly 4 arguments (3 given)

To be compatible with python2 two checks are needed.
2020-05-18 19:46:22 +02:00
12e0b67117 complete --shell-cmd support parts to get it working 2020-05-12 13:16:29 +02:00
5d6351b1bd Support git@ (private github) or git:// URLs correctly 2020-05-05 10:54:43 +02:00
lethliel
9a3fda8471 quote prj, repository, arch and package
quote the arguments before creating the apiurl.
This prevents weird behaviour when any has an '#'
at the end.
2020-04-28 14:47:40 +02:00
William Brown
bdb0c8033c Add ccache argument for oscrc 2020-04-14 14:50:24 +10:00
lethliel
81acc39c9f e.reason is a string not a integer decimal 2020-04-01 12:48:12 +02:00
Marcus Huewe
894f1c281a Merge branch 'packagequery_bytes_fixes' of https://github.com/marcus-h/osc
bytes fixes/cleanups in the packagequery and repodata modules.
2020-03-25 19:39:11 +01:00
lethliel
b99c4486e8 update news and open new development milestone 2020-03-23 13:50:01 +01:00
Marcus Huewe
55aef1a014 Convert repodata.RepoDataQueryResult to a bytes API
The repodata.RepoDataQueryResult is supposed to be a bytes API and
that's what our users (see build module) expect.
Note that the repodata.RepoDataQueryResult.path method still returns
a str. That's what the rpmquery.RpmQuery, debquery.DebQuery, and
archquery.ArchQuery classes also do (if the "path" was initially
passed as a str).

Fixes: #760 ("osc build fails when called with --prefer-pkgs where the
       passed directory is a repodata repository or a subdirectory of one")
2020-03-15 18:30:28 +01:00
Marcus Huewe
cd51f47a77 Return bytes in packagequery.PackageQueryResult.evr() instead of a str
The packagequery.PackageQueryResult class is supposed to provide a
bytes API. Hence, packagequery.PackageQueryResult.evr() should return
bytes instead of a str. Also, adjust the single caller in the build
module.
2020-03-15 18:30:00 +01:00
lethliel
3914b8c5e8 release 0.168.2 2020-03-13 07:44:34 +01:00
Marcus Huewe
33bbc57b5f Fix the previously introduced escaping via the html module
This is a follow-up commit for commit
6dbf103e10 ("Use html.escape instead
removed cgi.escape"), which breaks the python2 backward compatibility
(since the "html" module is not available by default) and also breaks
the code in general (due to missing html imports).

The fix is based on the proposed fix in [1].

Fixes: boo#1166537 ("osc rq accept - forwarding request causes backtrace")

[1] https://github.com/openSUSE/osc/pull/764
2020-03-12 23:00:47 +01:00
6dbf103e10
Use html.escape instead removed cgi.escape
Fixes:

`Traceback (most recent call last):
  File "/usr/bin/osc", line 41, in <module>
    r = babysitter.run(osccli)
  File "/usr/lib/python3.8/site-packages/osc/babysitter.py", line 64, in run
    return prg.main(argv)
  File "/usr/lib/python3.8/site-packages/osc/cmdln.py", line 344, in main
    return self.cmd(args)
  File "/usr/lib/python3.8/site-packages/osc/cmdln.py", line 367, in cmd
    retval = self.onecmd(argv)
  File "/usr/lib/python3.8/site-packages/osc/cmdln.py", line 501, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/usr/lib/python3.8/site-packages/osc/cmdln.py", line 1232, in _dispatch_cmd
    return handler(argv[0], opts, *args)
  File "/usr/lib/python3.8/site-packages/osc/commandline.py", line 1458, in do_submitrequest
    result = create_submit_request(apiurl,
  File "/usr/lib/python3.8/site-packages/osc/core.py", line 4244, in create_submit_request
    cgi.escape(message))
AttributeError: module 'cgi' has no attribute 'escape'
`
`cgi.escape` was deprecated in python 3.2
2020-03-11 16:58:04 +01:00
lethliel
a8641a47c8 release 0.168.0 2020-03-04 10:21:17 +01:00
Jan Chren
fa205be798
Suggest correct python-keyring package version
On Tumbleweed, `zypper in python-keyring` installs python2 version, while `osc` runs on python3.
After this change, user will be pointed to the correct version.
2020-02-29 00:28:20 +00:00
Marcus Huewe
c3e7428631 Merge branch 'master' of https://github.com/matthewdva/osc
Fix "osc importsrcpkg --name <name>". Do not try to decode a str.
2020-02-26 21:46:42 +01:00
Marcus Huewe
4e8e0492e8 Fix arch zst magic in util.packagequery
The correct zst magic is b'(\xb5/\xfd' (4 bytes) (that's what obs-build
is also using).

Kudos to Tobias Ellinghaus for spotting this.

Fixes: #756 ("zst detection fails")
2020-02-26 20:04:26 +01:00
Matthew D
9ba0d8adcd Fix -n / --name flag on importsrcpkg command.
osc importsrcpkg -n <pacname> does not work.  If the option is supplied, osc
mistakenly trys to "decode" the pac object.  This patch limit the decode
call when pac is not a string.

Refactored fix based on suggestions from marcus-h
2020-02-24 00:23:14 -05:00
175bcb4613
Remove compat code for Python < 2.6 2020-02-21 15:09:58 +01:00
Marcus Huewe
20f2f40614 Merge branch 'fix_748' of https://github.com/lethliel/osc
Add missing oscerr import in util.helper. Oops.
2020-02-20 09:10:57 +01:00
lethliel
95c68dc3f0 import oscerr in helper.py 2020-02-20 08:45:02 +01:00
Nicholas Brown
75ba922eb2 custom exception if importing m2crypto fails
fixes #743
2020-02-18 17:35:29 +00:00
Marcus Huewe
5185026084 Merge branch 'fix_name_display' of https://github.com/lethliel/osc
Old keyring versions of the KeyringBackend class have no name method (the
name method was added in 2016). In this case, the class name is used as the
backend name.
2020-02-14 09:52:20 +01:00
lethliel
6a20fd8bf5 fix list of backends for old python-keyring
old python-keyring classes have no name method.
This is used instead:

return self._keyring_backend.__class__.__name__
2020-02-14 09:35:07 +01:00
Marcus Huewe
9b0dcf3535 Merge branch 'master' of https://github.com/sbahling/osc
Use configparser.ConfigParser instead of configparser.SafeConfigParser,
since the latter will be removed in future python versions. No functional
changes because SafeConfigParser is a ConfigParser except that its __init__
prints a DeprecationWarning.
2020-02-09 15:57:49 +01:00
Scott Bahling
b9adde96b6 Rename SafeConfigParser to ConfigParser
configparser.SafeConfigParser has been changed to configparser.ConfigParser
upstream in Python 3.2. Warnings are saying that the alias will be
removed in future versions.

Signed-off-by: Scott Bahling <sbahling@suse.com>
2020-02-07 12:04:49 +01:00
Marcus Huewe
32859d6803 Merge branch 'handle-string-conversion' of https://github.com/krig/osc
Add core.parse_meta_to_string helper to work around the insane
implementation of core.meta_exists. Since core.meta_exists may return
a list of bytes, a str, a list of str etc., we ultimately convert the
data to str before passing it ET.fromstring(...).

In case of bytes, the explicit decoding is OK because it is assumed to
be a valid utf-8 encoding (the data represents an xml).

Note: at the moment core.parse_meta_to_string is also called even if it
is not necessary (it is only necessary if the "create" parameter of a
corresponding core.meta_exists call is True).

Note 2: this is just a temporary workaround and, eventually, we will make
the implementation of core.meta_exists more reasonable. When doing so,
we will also remove "public" function core.parse_meta_to_string again.
(Yes, this breaks API but the core.meta_exists change will also break the
API in some sense - so that's OK.)
2020-02-07 10:27:10 +01:00
Marcus Huewe
fb9e64c2f1 Merge branch 'handle_empty_releas_in_rpmquery' of https://github.com/lethliel/osc
Do not pass None as a release to RpmQuery.filename. The release might
be None in case of a kiwi build (the returned canonname is not used in
case of kiwi build).
2020-02-07 10:23:35 +01:00
Kristoffer Grönlund
16a3fcfabf Handle bytes vs. str error when parsing meta (#683)
In all the cases where meta_exists returns either
string data, bytes data or a list, the output needs
to be parsed correctly.

Signed-off-by: Kristoffer Grönlund <kgronlund@suse.com>
2020-02-07 10:02:27 +01:00
lethliel
f5aa389e38 handle empty release in build.py
This is very unlikely but in very rare cases this
can happen.

Builing kiwi images containing debian is one case.
In this case we do not know what is inside the kiwi
file and osc build assumes buildtype 'rpm' to generate
a package list which get's thrown away anyway.

Now we just check for release
2020-02-07 09:41:23 +01:00
Marco Strigl
9449745b5e
Merge pull request #673 from lethliel/fix_non_colon_checkout_on_prj_level
fix checkout_no_colon on project level
2020-02-07 09:27:00 +01:00
lethliel
cf6939e68a fix checkout_no_colon on project level
prj_dir was not altered when issuing osc co on
project level.

Solution: Replace ":" with "/" on project level when
no output_dir is given
2020-02-07 09:21:36 +01:00
Marcus Huewe
4d0c9f2dc6 Merge branch 'print_additional_APIURL_links' of https://github.com/lethliel/osc
Add a "print_web_links" option. If enabled, a webui url is printed after
certain operations. For now, it is only used in "do_submitrequest" in order
to print the webui url that can be used to view the newly created request
(note: the print_web_links option is not considered in the "cd prj; osc sr"
case).
2020-02-06 21:26:20 +01:00
lethliel
f079be17c2 print web url links for creating requests
This will print the direct url to show the created request.
New general bool option 'print_web_links' must be set to enable
this.

Right now this is only for creating requests. More to follow.
2020-02-06 13:57:38 +01:00
Marco Strigl
d279dfbedb
Merge pull request #723 from lethliel/improve_error_message_on_ssl_version_mismatch
improve SSLError message
2020-02-06 13:31:54 +01:00
Marco Strigl
ff7b64d5eb
Merge pull request #727 from lethliel/version_in_osc_maintained
print verion in osc maintained if --version is given
2020-02-06 11:05:23 +01:00
lethliel
90dd172af0 print verion in osc maintained if -v is given
Determine the version of the package for maintained project
and print version or 'unknown' if version unknown.
2020-02-06 10:55:51 +01:00
lethliel
1ee7b638cc improve SSLError message
Improve the SSLError message if a version mismatch (TLSv1) is
detected and give the user a hint what is wrong.
(Basically the API does not supprt TLS <= 1.2 and the python
version does not support TLS >= 1.2)
2020-02-06 10:50:22 +01:00
Marcus Huewe
73d880e138 Fix bogus None check in core.vc_export_env
In case of an error, core.get_user_data returns an empty list.
None is never returned. Hence, only pop data from the returned list,
if it is non-empty.
2020-02-06 10:09:52 +01:00
Marcus Huewe
d22ca55975 Merge branch 'vertical' of https://github.com/adrianschroeter/osc
Add a "--vertical" option to "osc results <project>" to list the
packages vertically instead of horizontally.
2020-02-04 20:24:06 +01:00
Marcus Huewe
55dcfa72c6 Merge branch 'add_release_project_to_print_if_exists' of https://github.com/lethliel/osc
Print out the release project (if known) when creating a maintenance
request (just to be a bit more verbose).
2020-02-04 19:50:27 +01:00
Marcus Huewe
d94e457632 Merge branch 'fix_build_user_determination' of https://github.com/lethliel/osc
By default, pass --norootforbuild to the build script when running osc
shell/chroot (unless --userootforbuild is passed to osc).
2020-02-04 19:43:24 +01:00
8716dcc24a use signdummy for product builds
avoids build failure, but leads to unsigned media
2020-02-04 17:26:24 +01:00
37f19f7de9 fix counter handling for obsrepositories:/ in products
all entries had the same name, so repos got ignored.
2020-02-04 17:25:14 +01:00
2978b37fa7 - allow "osc r --vertical" for projects
dunno about others, but the default horizontal listing is not really
usable. This is at least true if you have more packages then
repostories.
2020-01-30 14:41:01 +01:00
lethliel
0b7b515f11 fix decoding in interactive request mode
In interactive review mode:

If a diff is issued and the request is accepted with 'a -m ok'
the tmpfile with the diff will be read. This tmpfile.read() call
is now decoded properly.
2020-01-24 09:23:24 +01:00
lethliel
82ca311eb3 print release_project on maintenancerequests
When creating maintenance requests print out the relese_project
if already known at this point.
2020-01-23 13:28:40 +01:00
lethliel
9849112278 append --norootforbuild as default
pass opts to run_build and check if norootforbuild
needs to be appended to cmd. (if opts.userootforbuild is not set)
2020-01-22 14:24:58 +01:00
Marcus Huewe
efbc60f147 Merge branch 'fix_deletereq_for_repo' of https://github.com/lethliel/osc
Support "osc deletereq <project> -r <REPO>" (previously, the -r option
could only be used if a <package> was specified as well).
2020-01-16 22:26:43 +01:00
lethliel
897c23c0ab Fix deletereq for repository
Do not require --all if --repository is given. There
are no packages touched when removing a repository for
a home project.
2020-01-16 09:01:43 +01:00
Marcus Huewe
a0514d299f Merge branch 'honor_rev_for_mr' of https://github.com/lethliel/osc
Do not ignore rev when creating a maintenance request (if the SR creation
fails).
2020-01-10 19:00:45 +01:00
Marco Strigl
3d2f1a4ffb
Merge pull request #718 from adrianschroeter/arch_zst
- support zstd arch linux files in local build
2020-01-10 14:06:56 +01:00
5f2721d8f6 - support zstd arch linux files in local build
Note: This requires a tar executable supporting zstd
2020-01-09 15:49:54 +01:00
lethliel
3a863a309c honor rev when creating maintenance incident
When creating a submit reqeust against a project that does not
accept SR anymore a maintenance request via create_maintenance_request
is generated. With this commit the orev will be honored and the
appropriate revision will be submitted.
2020-01-09 09:59:03 +01:00
Marcus Huewe
a6e49494c1 Merge branch 'drop_dead_code' of https://github.com/dcermak/osc
Get rid of unused core.dgst_from_string. Actually, this breaks the API
but that's IMHO ok (users of this, if at all, should be very rare)...
2020-01-08 18:18:55 +01:00
Quang Tran
86fcb7aecf
Fix typo in help message 2020-01-08 17:18:54 +01:00
136678ec21
Remove unused function dgst_from_string 2020-01-07 16:32:52 +01:00
lethliel
88abf11bd3 release 0.167.2 2020-01-07 11:29:52 +01:00
Marco Strigl
f0583c22c0
Merge pull request #713 from M0ses/fix_importsrcpkg
fix broken importsrcpkg for python3
2019-12-28 21:05:10 +01:00
lethliel
76793cc0ac fix regression in osc chroot
This fixes some regressions with osc chroot:

- osc chroot --wipe --root=/dir/ can now be called outside
  a working copy
- osc chroot --noinit --root=/dir/ can now be called outside
  a working copy and behaves like the old code (Just entering
  the chroot without any modifications)
- The confirmation of the deletion is implemented again and thus
  the --force option was implemented too.
2019-12-20 20:43:01 +01:00
Frank Schreiner
ae0b55de3b
fix broken importsrcpkg for python3
without this patch, `importsrcpkg` breaks with the following output:

```
  File "/usr/lib/python3.7/site-packages/osc/commandline.py", line 7868, in do_importsrcpkg
    createPackageDir(os.path.join(project.dir, pac), project)
  File "/usr/lib64/python3.7/posixpath.py", line 94, in join
    genericpath._check_arg_types('join', a, *p)
  File "/usr/lib64/python3.7/genericpath.py", line 151, in _check_arg_types
    raise TypeError("Can't mix strings and bytes in path components") from None
TypeError: Can't mix strings and bytes in path components
```

Fixes #712
2019-12-20 08:36:08 +01:00
lethliel
32ec356bad release 0.167.1 2019-12-10 13:39:55 +01:00
Marco Strigl
40abc51657
Merge pull request #698 from adrianschroeter/fix_api
fix Fetch api to become compatible again.
2019-12-10 11:43:59 +01:00
Marco Strigl
a5014eaa92
Merge pull request #704 from lethliel/remove_decoding_of_hdr_filename
remove decoding of hdr.filename
2019-12-10 11:38:16 +01:00
lethliel
67358c9746 remove decoding of hdr.filename
It is wrong in this case.
2019-12-10 11:24:17 +01:00
ef4e0411e9 fix Fetch api to become compatible again.
Broke in db795c8121 as reported by Marcus
2019-12-10 07:54:01 +01:00
lethliel
ade9baba52 fix lastbuildroot on builds not in WC
fix the lastbuildroot handling if the package is being build oustide of
a package directory and thus no .osc/ dir can be found.

We then just skip the store_write_last_buildroot and store_read_last_buildroot
calls.
2019-12-09 14:07:48 +01:00
Marcus Huewe
7621e79ddf Merge branch 'linux-platform-detection' of https://github.com/tomaskrizek/osc
Use the distro module (if available) for guessing the linux distribution.
In case of python < 3.8, use the platform.linux_distribution() fallback if
no distro module is available.
Rationale: platform.linux_distribution() was dropped in python3.8
2019-12-05 21:25:03 +01:00
db795c8121 support local building using RedHat rpm-md modules 2019-12-05 13:06:30 +01:00
lethliel
41158412f8 fix decoding in fetch_cpio 2019-12-05 13:02:24 +01:00
lethliel
d0de4c383d open 0.168.0 development 2019-12-05 10:46:17 +01:00
lethliel
2a2ea5c27d release 0.167.0 2019-12-05 10:44:46 +01:00
Tomas Krizek
eb894eff72
core: support distro module for platform detection
Python 3.8 no longer supports platform.linux_distribution().

Compatibility with Python 2.6+ is kept. The
platform.linux_distribution() function is available since 2.6:
https://docs.python.org/2.6/library/platform.html?platform.linux_distribution#platform.linux_distribution
2019-12-05 10:39:55 +01:00
Marco Strigl
8ec18e99a3
Merge pull request #694 from adrianschroeter/vm_build_fixes
VM build fixes
2019-12-05 10:26:40 +01:00
b08bd8a437 support building for kiwi products using obsrepositories:/ 2019-12-04 15:16:58 +01:00
b329b74816 build environement parameter caching
repository, architecture and vm_type from last build is automatically
reused if not specified otherwise.
2019-12-04 15:16:54 +01:00
47e346dde8 avoid source service run for "osc shell"
this also drops the warning line if service disabled. It seems not
to be important enough to me.
2019-12-04 14:50:15 +01:00
f4bdd3c876 avoid implicit --noinit if extra packages are specified 2019-12-04 14:50:15 +01:00
eb7aab1cf7 osc build --vm-disk-size= switch support 2019-12-04 14:50:15 +01:00
a628ea8cca read debug packages from server side project configuration
=> avoids unresolvable errors when distro is not providing the
    extra/debug package
2019-12-04 08:41:46 +01:00
Marco Strigl
8bebc13675
Merge pull request #678 from adrianschroeter/lastsucceeded
add --lastsucceeded option for logfile display
2019-12-04 08:36:30 +01:00
19168f4bb1
Merge pull request #690 from andreas-schwab/master
Doc fix
2019-12-03 17:30:24 +01:00
1f89b5a538 add --lastsucceeded option for logfile display
no single option since it is really a special usecase IMHO
jsc#OBS-40
2019-12-03 17:29:59 +01:00
33747d12a2 do not running local source service with "osc shell" 2019-12-02 14:33:17 +01:00
f480799522 Use --noinit and --offline on "osc shell" when environment exists 2019-12-02 14:23:41 +01:00
e5788030bf add --login-as-root alias of old "osc chroot".
is doing the same as --userootforbuild now
2019-12-02 14:23:41 +01:00
Andreas Schwab
5dfb80299c Doc fix 2019-12-02 13:12:59 +01:00
d46e93fb03 disable hostarch check for emulator builds entirely 2019-12-02 08:35:50 +01:00
2286f042ef improve help text for for build/shell/wipe 2019-11-28 10:21:05 +01:00
4bcb78e322 osc build --vm-type=qemu support for cross architecture builds 2019-11-28 10:07:36 +01:00
b78a0b3896 osc shell/chroot/wipe is now handled via build script (working for chroot and KVM only atm) 2019-11-28 10:07:11 +01:00
Andreas Schwab
7be5838e4e fix decoding for osc aggregatepac 2019-11-13 15:50:49 +01:00
lethliel
e16bd07e25 release 0.166.2 2019-11-13 13:02:57 +01:00
Marco Strigl
2bd921ee7c
Merge pull request #676 from lethliel/fix_http_debug_for_pub_key
fix output in http_debug mode for pubkey not found
2019-11-13 11:47:24 +01:00
lethliel
50891392ce fix output in http_debug mode for pubkey not found
Variable e is not known at the time of the call and
e.strerror is None nevertheless. So just ommit e.strerror.
2019-11-13 11:40:22 +01:00
lethliel
c32ec4bc1c appent opts.file to args not cmd_list
prepend to args instead to cmd_list. Otherwise the
changes file will be written into the given --file

osc vc --file=proposed.changes package.changes
2019-11-13 09:50:05 +01:00
Marco Strigl
f78057e2d5
Merge pull request #641 from mcepl/337_check_for_request_on_action_1
Make check_for_request_on_action on per default.
2019-11-05 16:03:59 +01:00
Marcus Huewe
8bb96776a8 Merge branch 'fix_decoding_linkpac' of https://github.com/lethliel/osc
Fix link_pac (meta_exists returns a list of bytes (if create_new is False)).
2019-11-04 15:11:57 +01:00
lethliel
02207d719c fix decoding for osc linkpac
in def link_pac dst_meta is a list of bytes-like objects.
so b''.join(dst_meta) is needed
2019-11-04 15:00:59 +01:00
Marcus Huewe
f9b1fa18ad Move passx handling into ObfuscatedConfigFileCredentialsManager
Minor cleanup for commit c5231d61dd
("fix credentials with passx entries").
2019-11-04 14:25:48 +01:00
Andreas Schwab
5227e357bc Don't enforce password reuse 2019-11-03 13:43:22 +01:00
lethliel
992255b0df release 0.166.1 2019-10-29 11:15:35 +01:00
lethliel
c5231d61dd fix credentials with passx entries
Existing passx enries resulted in a stacktrace because
the cp.get() call for the passx entries was missing.

Also added a delete_password function for ObfuscatedPasswordManager
to delete passx entries
2019-10-29 11:04:22 +01:00
lethliel
64a5969ca8 release 0.166.0 2019-10-24 11:48:35 +02:00
lethliel
2f02db1621 Merge branch 'master' of github.com:openSUSE/osc 2019-10-24 11:44:42 +02:00
Marco Strigl
aa50dca4eb
Merge pull request #650 from lethliel/fallback_if_keyring_not_present
catch configured keyring without module installed
2019-10-24 11:29:26 +02:00
lethliel
5fa1e73db6 catch configured keyring without module installed
If a python-keyring based backend is configured, but
python-keyring is not installed osc fails without giving
the user the opportunity to continue.

This introduces a new class method `create` for the AbstractCredentialsManager.
The CredentialsManagers for the backends that use a 3rd party software can
now check if the software is present in its own create method.
2019-10-24 11:21:23 +02:00
lethliel
af6d0bc652 osc ci improve error message on fail
The error message if the call of _commit is just:
"ERROR: service run failed"

One option why this can fail is that the user Editor in env('EDITOR')
is not present.

We check now if e.msg gives a hint about "not found file" and then
error out with a better error message
2019-10-23 14:12:03 +02:00
lethliel
d59141e3fe fix build with alternative prj and multibuild
building with alternative project (pac='_repository')
and multibuild did not work correctly, because the buildflavor
was not submitted to the src server.

With commit 2390823d649a3b0b6bf3b7bd07713c4426932bed in open-build-service
it is now possible to submit the build flavor like this: _repository:<flavor>

The obs commit also enables osc buildinfo --alternative-prject -M <flavor>
to show the correct buildinfo for the flavor.
2019-10-23 11:46:38 +02:00
Marco Strigl
6f34f2b8d8
Merge pull request #651 from lethliel/implement_incoming_option_for_rq
implement incoming option for osc rq
2019-10-22 13:15:17 +02:00
lethliel
b556095502 implement incoming option for osc rq
There is a config option 'include_request_from_project' which
can be set to 0 to exclude all requests originating from the
project in osc [rq|review] list.

To force this behaviour just once (without always editing oscrc
the '--incoming' option can be used.
2019-10-22 10:20:15 +02:00
Ludwig Nussel
e53d16f5d8 New browse command to quickly open web browser 2019-10-22 09:16:57 +02:00
Marcus Huewe
5611c55bde Merge branch 'fix_buildinfo_with_alternative_project' of https://github.com/lethliel/osc
Make "osc buildinfo --alternative-project <project> ..." consistent with
"osc build --alternative-project <project> ...". This change breaks some
invocations where a build_descr is omitted (but in this case, simply
use "osc buildinfo <project> <package> <repo> <arch>).
2019-10-21 16:16:55 +02:00
Marcus Huewe
3025dbf954 Merge branch 'support_appimage_yml' of https://github.com/adrianschroeter/osc
Support "appimage.yml" in parse_repoarchdescr.
2019-10-21 16:06:29 +02:00
lethliel
333028401e use _repository if alt prj is used
Use _repository as package name if alternative_project is used
2019-10-21 13:29:37 +02:00
e43d0641c6 find appimage.yml files as build description 2019-10-17 08:07:38 +02:00
lethliel
aaa51bcab1 improve help text for osc maintained
The help text does not indicate that only osc mbranch
really creates a branch.

osc maintained and osc sm are just aliases for osc mbranch --dryrun
2019-10-16 14:41:22 +02:00
ea5f8d40aa
Make check_for_request_on_action on per default.
Fixes #337
2019-10-10 18:02:20 +02:00
Marcus Huewe
95d49a0af6 Merge branch 'fix' of https://github.com/adrianschroeter/osc
Only a 404 implies a "meta_change" in link_pac and aggregate_pac.
2019-10-09 14:38:50 +02:00
e2c50fb8c1 be sure that destination is not existing before overwriting content
we used to crash on utf encoding errors, be sure not to replace meta
data in that case
2019-10-09 07:34:20 +02:00
Marcus Huewe
dc60cc2a09 Merge branch 'fix_#637_osc_vc_escape_chars' of https://github.com/lethliel/osc
Pass the filename to the vc script instead of passing its content via
the "-m" parameter. If "osc vc --file <fname>" is issued, it might be
possible that $EDITOR is still opened (if the "vc" script is too old),
which contradicts the --file option's help text. This "break" is acceptable
(just update osc in tandem with the vc script).
2019-09-27 22:35:25 +02:00
lethliel
edc2bde460 Transfer the name of the input file to vc
instead of the content and let vc do the rest.
This prevents calling echo -e and interpreting
escape characters.
2019-09-25 11:36:25 +02:00
Marco Strigl
99d305e969
Merge pull request #643 from lethliel/fix_quoted_output
unquote prj on osc co error message
2019-09-23 11:55:52 +02:00
40c480e9ef
Resurrect merge_cmd variable after it got removed in the past
In case diff3 returns something except 0 or 1, osc errors out because the
variable merge_cmd is not defined. It used to exist, but got removed in the
past and is reintroduced via this commit.
2019-09-20 21:56:35 +02:00
lethliel
e89c7dd12d unquote prj on osc co error message 2019-09-20 09:28:19 +02:00
Marco Strigl
e7e91709ef
Merge pull request #621 from lethliel/fix_#617_regression_in_deleterequest
make now() UTC aware for accept-in-hours
2019-09-18 16:57:56 +02:00
lethliel
ced4ac6506 append '+00:00' to now.isoformat() to satify api
just append '+00:00' so that the api calculates the correct accept time
based on UTC
2019-09-18 16:55:10 +02:00
Marcus Huewe
5756e90b90 Merge branch 'fix_decoding_in_osc_cat' of https://github.com/lethliel/osc
Do not perform any decoding in do_cat.
2019-09-18 16:36:00 +02:00
lethliel
6f674a6289 do not decode diff before passing it to run_pager
run_pager will take care of the bytes-like object and
will directly write it to sys.stdout.buffer.write() or
NamedTemporaryFile.
2019-09-18 11:26:16 +02:00
lethliel
d1d45f4618 fix decoding for osc cat
use sys.stdout.buffer.write() to print encoded data
correctly
2019-09-18 10:49:39 +02:00
Marco Strigl
1e4e7edad5
Merge pull request #446 from lethliel/add_error_for_issue_445
print error and exit if p.apiurl != -A <apiurl> using osc sr
2019-09-17 14:11:20 +02:00
lethliel
4b1e2343d8 fix TypeError with python3.7 configparser
configparser.py in python3.7 does not take None Type.
We override the _validate_value_types method in
OscConfigParser class to disable this check.
2019-09-17 13:35:30 +02:00
5f1109072f fix checkout of meta files
typo leaded to wrong parameter
2019-09-16 14:01:35 +02:00
Marco Strigl
035457cc26
Merge pull request #630 from lethliel/fix_decoding_on_lbl
decode data on osc lbl
2019-09-12 12:27:42 +02:00
lethliel
ee64437521 decode data on osc lbl 2019-09-12 10:41:26 +02:00
Mike Gorse
ef1c605a32 Initialize diff as bytes
Otherwise, python 3 will throw a traceback if the fallback code is
triggered, since it appends bytes.
2019-09-11 10:05:32 -05:00
lethliel
406918469d [python3] decode tmpfile content on edit_message 2019-08-30 11:57:31 +02:00
Marcus Huewe
749f994465 Merge branch 'simplify_sr_on_prj_level' of https://github.com/lethliel/osc
Simplify the project sr handling in do_submitrequest a bit. It also fixes
a bug in case a target project and --separate-request is specified.
Other bugs are retained for now (for instance, --update-link is ignored).
2019-08-30 10:52:52 +02:00
lethliel
3da7b9b3d8 simplify osc sr code in submitting prj
Most of the stuff is now done in the API.
For just submitting all in one request the following is sufficient:

<action type="submit"> <source project="%s" /> %s </action>

If a target project is given it looks like this:

<action type="submit"> <source project="%s" /> <target project="%s"> %s </action>

We don't need package name or source package and targets anymore.
This is all handled by the API now.

For the --seperate-requests case the check for the entries in the linkinfo
is not working on most cases. So we handle this in the do_submitrequest
and skip the package if X-Opensuse-Errorcode is missing_action which means
basically nothing to do for this package

redesign target_project handling
2019-08-30 10:42:08 +02:00
lethliel
74c70620b7 Add project parameter to print_repos
This is needed if the project differs from the current
working copy.

Fixes https://github.com/openSUSE/osc/issues/623
2019-08-30 10:32:02 +02:00
Marcus Huewe
e7397221b3 Add --change-password example to the help text of do_config
This should have been part of commit
cba4b58bbe ("Improve password
handling").
2019-08-29 16:42:09 +02:00
lethliel
3ba02b9cec Refactor user extraction
Implement _extract_user_compat() for gnomekeyring special case.
2019-08-29 16:11:29 +02:00
lethliel
cba4b58bbe Improve password handling
* Adapt do_config to use the new credentials manager implementation
  and add a --change-password option which can be used to change the
  password.
* Adapt config_set_option to follow the change in do_config.
* Split selection of the credentials manager descriptor to reuse it
  in do_config and interactive_config_setup.
* Introduce new ConfigMissingCredentialsError which is raised in case
  of missing credentials (user or password). In this case the user will
  be asked to enter the new credentials.
2019-08-29 16:11:17 +02:00
lethliel
36ec0c48d4 Remove passx encode/decode functions from conf.py
They are no longer needed with the new CredentialsManagers
2019-08-29 15:06:48 +02:00
lethliel
629ab25a0e Remove check for GNOME_DESKTOP_SESSION_ID
It was removed from GNOME with this commit:
6bf47ad8c6
2019-08-29 15:06:48 +02:00
lethliel
abf206fa0d New credentials backend (Transient store)
New backend to not store the password and ask for
it every time.
2019-08-29 15:06:45 +02:00
lethliel
eb3a3ef0ec Introduction of new credential management
* new module credentials.py which contains classes
  and methods to set and get passwords for different
  backends:
      - python-keyring
      - gnomekeyring
      - ConfigFile based storage

The new code should be backward compatible except a minor
change in add_section (pass and passx are not removed from
the config parser). This affects only callers that do not pass
a creds_mgr_descriptor.

On initial osc call or initial osc call on new API Url
the user now can decide where to store the password (based
on the backends available on his system)
2019-08-29 15:04:36 +02:00
lethliel
c9d85ac248 move raw_input function to helper module 2019-08-27 15:17:53 +02:00
Marcus Huewe
7c01399a4a Deprecate the "plaintext_passwd" config option
The upcoming credentials manager abstraction supersedes the old
plaintext_passwd behavior. This commits "breaks" the old behavior:
Passwords are not rewritten anymore (plaintext <-> obfuscated)
2019-08-27 15:15:59 +02:00
Jimmy Berry
6a3976dc22 osc/core: parseRevisionOption(): cleanup and make logic consistent.
Handle multiple revisions the same as a single revision in terms of what
is allowed (digit, or 32 character string [md5]). Additionally, support
either blank or "latest" to mean latest revision (None).

This allows for new revision to be specified without old revision like the
following example:

osc rdiff ... -r :17
2019-08-26 16:08:04 -05:00
lethliel
428a81e451 Refactor config setup dialog
Move logic to conf module in new function interactive_config_setup
for new config file and missing apiurl section.

Dropped keyring code, because it was never used in write_initial_config()
2019-08-26 17:25:56 +02:00
lethliel
dbed74a13f reopen 0.166 development 2019-08-05 08:47:46 +02:00
lethliel
5994326451 release 0.165.4 2019-08-05 08:45:32 +02:00
Marcus Huewe
63c103770a Merge branch 'fix_600_osc-h_not_working_with_plugins' of https://github.com/lethliel/osc
python3 "workaround" for the quite fragile code in
RawCmdln._help_preprocess: It depends on the "non-deterministic" order
of preprocessor.items(). Hence, the results may differ on python2 and
python3. The real fix is probably to enforce a fixed iteration order.
See also the discussion in [1].

[1] https://github.com/openSUSE/osc/pull/604
2019-08-03 16:20:01 +02:00
lethliel
c78c8178e6 prevent plugins to break help
prevent call of preprocessor if ${cmd_name} marker is accidentaly set,
but cmdname is None.

Also for cmd_option_list and cmd_usage
overwrite _help_preprocess_* functions in Osc class
2019-08-02 20:02:14 +02:00
Marcus Huewe
6e95f8019d Merge branch 'fix_#607' of https://github.com/lethliel/osc
Do not apply the --target-package-filter pattern if there is no target
package.
2019-08-02 13:31:53 +02:00
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
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
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
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
lethliel
0c0dca0b27 Fix package filtering for osc rq
Check if action.tgt_package is None.
2019-07-23 15:51:41 +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
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
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
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
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
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
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
Marcus Huewe
c4dd37936f Merge branch 'fix_offline_mode_for_build' of https://github.com/lethliel/osc
Do not make a http request if noinit is True in parse_repoarchdescr.
2019-05-25 23:10:49 +02:00
Bernhard M. Wiedemann
13a174bdcc Fix encode method call
This broke with
--define="%_buildhost foo"
2019-05-25 13:36:10 +02:00
Stefan Knorr
b14c9cfd92 Add "prioritize" as (preferred) alias for "priorize" command
"priorize" is not an English word, "prioritize" is the correct
version:
* https://www.merriam-webster.com/dictionary/priorize
* https://www.merriam-webster.com/dictionary/prioritize

The "priorize" command will continue to exist after this commit, but the
documented  version will be "prioritize".
2019-05-24 13:22:30 +02:00
Andreas Schwab
7ed9ff32ad osc token: decode data from trigger url 2019-05-23 09:53:05 +02:00
lethliel
178dfd16c3 fix offline build mode
The offline mode does not really work offline since
parse_repoarchdescr() uses get_buildconfig to store the
buildconfig in a temporary file.

Solution:

Use the same logic as in build.py. If in offline mode(noinit = True)
try to use the local _buildconfig file. If not in offline mode just
download the buildconfig from the server via get_buildconfig
2019-05-22 13:58:46 +02:00
Marco Strigl
c4979dcde2
Merge pull request #562 from lethliel/fix_status_outupt_of_attribute_deletion
[python3] fix outupt of status on attribute deletion
2019-05-22 13:08:43 +02:00
lethliel
1ab68d3bfb open 0.165.2 development 2019-05-22 13:00:55 +02:00
lethliel
260d5f585a fix outupt of status on attribute deletion
On osc meta attribute --attribue <name> --delete the returned
data is encoded. Therefore the sys.stdout.write(data) call fails.

Solution: Decode data

--> sys.stdout.write(decode_it(data))
2019-05-22 12:57:02 +02:00
lethliel
8b56405d10 release 0.165.1 2019-05-20 08:35:27 +02:00
lethliel
860548bc30 fix getbinaries in commandline (progress_meter)
change progress_meter = opts.quiet to
progress_meter = not opts.quiet
2019-05-16 15:21:16 +02:00
lethliel
5bd5fdb22c Revert "fix getbinaries quiet logic"
This reverts commit 82ac5f6f06.
2019-05-16 09:31:38 +02:00
Marco Strigl
8c14208ad0
Merge pull request #555 from lethliel/fix_get_binaries_quiet_logic
fix getbinaries quiet logic
2019-05-15 17:29:16 +02:00
lethliel
82ac5f6f06 fix getbinaries quiet logic
opts.quiet is passed to get_binary_file which is False by default.
So the following if progress_meter is always False unless -q is given.

So it needs to be if not progress_meter.
2019-05-15 17:22:51 +02:00
lethliel
877d5e50b6 fix triggerreason on empty packages.
When running osc triggerreason on newly created (empty) packages
the command failes with AttributeError: 'NoneType' object has no attribute 'text'
because root.find('explain') is NoneType.

Solution:

Check if root.find('explain') is None and print "No triggerreaseon found".
In this case also do not try to get the triggertime. It will result in the same error.
2019-05-15 11:45:20 +02:00
Stefan Knorr
84c8019383 Improve grammar of request supersede message 2019-05-14 20:05:38 +02:00
lethliel
597eadf2f4 fix adding dirs as compressed archive
The content in the todo dict are strings. In python3 the communicate
method expects a bytes-like object not a string.

Solution: Encode every element in todo to a new dict (enc_todo) and
pass this instead of todo
2019-05-14 10:24:17 +02:00
lethliel
03777b7e4d fix get_commitlog to decode correct.
get_commitlog mixes bytes and strings when the output is
xml or csv.

This is fixed by decoding the commit message before replacing chars.
2019-05-14 10:01:02 +02:00
Marco Strigl
c5139fdff8
Merge pull request #538 from lethliel/fix_unimported_urldefrag
Import urldefrag function
2019-04-26 12:14:15 +02:00
lethliel
9aba391a11 Import urldefrag function
The function was not imported and so osc crashed when executed behind a proxy
2019-04-26 10:49:03 +02:00
3886b95ae4 [python3] release command: fix exception on missing bytearray/str decode 2019-04-25 22:28:19 +02:00
Marcus Huewe
a3de1bdad1 Merge branch 'master' of https://github.com/lnussel/osc
Remove group elements during copy_pac, link_pac, aggregate_pac.
2019-04-24 20:11:50 +02:00
lethliel
1dc836f48c open 0.166 development 2019-04-18 14:30:14 +02:00
lethliel
baf80268b7 release 0.165.0 2019-04-18 14:27:42 +02:00
Ludwig Nussel
9d4f584aeb Also remove groups on copypac 2019-04-17 11:42:29 +02:00
lethliel
0d55ddc1b3 [python3] fix decoding in addGitSource
open the file with mode 'w' instead of 'wb'. The 'b' is not needed.
Neither in python2 nor in python3.

Fixes github issue https://github.com/openSUSE/osc/issues/507
2019-04-16 16:55:06 +02:00
Marco Strigl
393290bfe5
Merge pull request #528 from lethliel/python3_fix_bsc1129889
[python3] add exception if encoding fails and try ISO-8859-1
2019-04-16 15:49:29 +02:00
Marco Strigl
fc8e6f8695
Merge pull request #529 from lethliel/python3_fix_bsc1131512
[python3] return value when adding attrs is bytes
2019-04-16 15:41:10 +02:00
lethliel
d10c9b4cea [python3] fix sorting when using osc se
osc se did not sort the output anymore. The logic
in the existing results.sort(key=...) was wrong. Now it is using
key=itemgetter(0,1) has two columns and key=itemgetter(0) if there
is only one column.
2019-04-16 15:18:04 +02:00
lethliel
b7dea9ddcd [python3] return value when adding attrs is bytes
When adding attribute with osc meta attribute <prj> -a <attr> -s '<val>'
the api call gets executed successfull but the return value needs to be
decoded to print it correctly.
2019-04-16 14:57:19 +02:00
lethliel
5841bf759f add exception if encoding fails and try ISO-8859-1
In some rare cases the chardet encoding detection detects
a wrong encoding standard. Then we switch to latin-1 which
covers most if utf-8 does not work.
2019-04-16 14:40:13 +02:00
Marco Strigl
71770555ac
Merge pull request #526 from lethliel/python3_fix_debquery_decoding
[python3] fix decoding issue in debquery.py
2019-04-15 15:10:21 +02:00
Marco Strigl
6c074fce20
Merge pull request #524 from lethliel/python3_packagequery_fix_decoding
[python3] fix decoding for packageqeury.py
2019-04-15 15:09:59 +02:00
Marco Strigl
2693d24a0a
Merge branch 'master' into python3_fetch_module 2019-04-15 15:09:31 +02:00
Marco Strigl
41ced89fcc
Merge pull request #522 from lethliel/python3_repodata_module
[python3] fix epoch encoding in repodata.py
2019-04-15 15:07:50 +02:00
Marco Strigl
19965b7a15
Merge pull request #513 from lethliel/python3_compatible_fetch_module
[python3] cpio.py is now a bytes only api.
2019-04-15 15:07:37 +02:00
Marco Strigl
32a28ae460
Merge pull request #493 from lethliel/python3_commandline_module
[python3] python3 support for commandline module
2019-04-15 15:07:24 +02:00
Marco Strigl
498bc9d44d
Merge pull request #492 from lethliel/python3_core_module
[python3] python3 support for core library
2019-04-15 15:07:02 +02:00
Marco Strigl
ec7945a07e
Merge pull request #491 from lethliel/python3_build_module
[python3] build.py with python3 (mostly bytestring)
2019-04-15 15:05:28 +02:00
Marco Strigl
05d90f9e96
Merge pull request #490 from lethliel/python3_oscssl_module
[python3] make oscssl.py python3 ready.
2019-04-15 15:05:04 +02:00
Marco Strigl
3ec9a57ab5
Merge pull request #485 from lethliel/python3_babysitter_module
[python3] babysitter.py msg and body are byte strings
2019-04-15 15:04:32 +02:00
Marco Strigl
0086bcfa64
Merge pull request #483 from lethliel/python3_rpmquery_module
[python3] rpmquery.py now python3 ready
2019-04-15 15:02:59 +02:00
Marco Strigl
5e6bcf5610
Merge pull request #479 from lethliel/python3_cmdln_module
[python3] enable full python3 support for man page building
2019-04-15 15:02:19 +02:00
Marco Strigl
d5108c7536
Merge pull request #464 from lethliel/python3_utils_helper
[python3] add helper functions for python3 support
2019-04-15 15:00:58 +02:00
lethliel
fe642db042 [python3] python3 support for commandline module
* use cmp_to_key from functools for python 2.7 and higer
* use self written cmp_to_key for python 2.6
* a lot of bytestring handling and decoding
2019-04-12 09:58:23 -05:00
lethliel
60c6ec2b52 [python3] fix decoding issue in debquery.py
name, version, release and arch are strings, not bytes
2019-04-07 14:44:25 -05:00
lethliel
ee694b54f2 [python3] python3 support for core library
* use cmp_to_key from functools for python 2.7 and higer
* use self written cmp_to_key for python 2.6
* new functions compare und cmp (used in python2 and python3)
* a lot of bytestring handling and decoding
* fix slow rbl based on f.readline(bufsize)
2019-04-07 11:14:49 -05:00
Marco Strigl
030cd69771
Merge branch 'master' into python3_build_module 2019-04-07 11:09:15 -05:00
lethliel
c235148180 [python3] now python3 ready:
* new function cmp (not available in python3)
  * fix decoding in canonname function
2019-04-07 11:05:13 -05:00
lethliel
6c001fa64c [python3] build with python3 (mostly bytestring)
* return of get_buildinfo is bytestring with python3
* other variables contain bytestrings as well now
2019-04-07 10:42:00 -05:00
lethliel
c6d3870942 [python3] fix decoding for packageqeury.py
name, arch, version and release need to be decoded
2019-04-07 10:31:23 -05:00
Marco Strigl
b71deaa537
Merge branch 'master' into python3_fetch_module 2019-04-07 10:25:50 -05:00
lethliel
87628a4150 [python3] fix epoch encoding in repodata.py
other.epoch() needs to be encoded to work with the vercmp callers.
2019-04-07 10:19:47 -05:00
lethliel
96ce14221b [python3] fetch.py python3 ready
* the result of a division is a float
  but we need int to continue.
* use decode_it to decode hdr.filename
2019-04-07 10:06:24 -05:00
Michael Schroeder
8b4dae21f7 Fix kiwi builds where the project does not define a path
In that case, the packages to setup the build environment are
taken from the repositories defined in the kiwi file. Osc did
not take into account that the build config must match this
path. So it cannot just get the build config like with normal
builds, but must use a different path.

This led to build errors on some projects like CentOS 7 which
rely on 'Order' statements from the project config.

The OBS backend already had support for this: the 'path' parameter
can be used to overwrite the project path in the _buildconfig
query. We now use this to provide the correct path if we
detect this case. (The detection is currently a heuristic
because OBS does not provide us with a clear indicator.)
2019-03-11 16:39:04 +01:00
Marcus Huewe
c39c3b8cae Cleanup the source services execution code in do_build
Always error out if the source services execution failed (the old
code only errored out if the local_service_run config option was
set (this behavior was probably unintentionally introduced in commit
d3dd8539d9 ('- fallback to "build
--local-package" if it does not exist instead of complaining'))).
Also, do not suppress all exceptions (if something failed in the
services execution code path, the user should be informed).

The bug was reported by darix.
2019-02-22 15:42:23 +01:00
lethliel
442a2731be cpio.py is now a bytes only api.
The decoding of the header needs to be done in fetch.py
2019-02-12 14:04:42 +01:00
lethliel
93ea66b922 reopen 0.165 development 2019-02-12 09:17:05 +01:00
lethliel
4a7248562f release 0.164.2 2019-02-12 09:11:43 +01:00
lethliel
0ab8661a8b reworked deleterequest commit (add --all)
* removed superfluous parenthesis
* switched package == None to package is None
2019-02-04 14:56:20 +01:00
Marco Strigl
4b4774872e
Merge pull request #509 from adrianschroeter/deletereq
deleterequest for entire projects needs the --recursive option as add…
2019-02-04 14:52:25 +01:00
a760e2bd39 Return exitcode when "osc results" is falling through prjresults
Otherwise a failure from osc prjresults does not propagate
up.
2019-02-04 13:07:59 +01:00
Marcus Huewe
555efc845f Avoid a potential http request if there are no services
The vc_export_env call was introduced in commit
37ca5535ce ("Export vc env vars when
running a source service") and broke the testsuite. The potential
http request is useless if there are no services. Hence, avoid it.

Thanks to Marco Strigl for catching the testsuite error!
2019-02-04 12:19:57 +01:00
677c741189 deleterequest for entire projects needs the --all option as additional protection
We had it two times this week that people dropped entire projects
(important ones)
2019-02-04 11:54:03 +01:00
Marcus Huewe
37ca5535ce Export vc env vars when running a source service
Some services (like the obs_scm) will use them. Note: if realname
or email is not set in the oscrc, an additional http request will
be performed.

This change was requested by darix.
2019-01-29 14:30:52 +01:00
Marcus Huewe
fefd7c1dea Move vc env exporting code into core.vc_export_env
This allows for reuse. In the future, these variables should also
be exported when executing source services.
2019-01-29 14:20:12 +01:00
Marcus Huewe
c534d7e990 Fix logic error in DebQuery.vercmp
res is never None, because DebQuery.rpmvercmp always returns -1, 0,
or 1.
2019-01-27 19:43:38 +01:00
Marcus Huewe
cd5f46984d Port debquery module to python3
No functional changes. Note that we cannot simply decode the control's
fields as ascii/utf-8 because a field is not necessarily a valid
ascii/utf-8 encoding (it is possible to register _arbitrary_ custom
fields via a 'register-custom-fields' hook when building a deb
package).

Note: DebQuery.debvercmp really deserves a cleanup:/
2019-01-27 19:31:47 +01:00
Marcus Huewe
bb9f9a7fde Refactor DebQuery.__parse_control a bit
No functional changes. This just simplifies the upcoming python3
port a bit.
2019-01-27 17:35:47 +01:00
Marcus Huewe
f63a0957af Remove superfluous try-except block in the archquery module
ArchQuery.query never raises an ArchError exception.
2019-01-27 16:51:58 +01:00
Marcus Huewe
2074a1c01d Make ArchQuery.canonname more robust against None values
Use ArchQuery.filename to construct the filename and raise an
ArchError exception if we are unable to construct a filename.
2019-01-27 16:46:52 +01:00
Marcus Huewe
8c1cb190bd Port the missing pieces of the archquery module to python3
This is a follow-up commit for commit
21eca9e3f1 ("[python3] switch
ArchQuery to bytestrings").
2019-01-27 16:27:30 +01:00
Marcus Huewe
2d0c974296 Add cmp function to packagequery module
cmp(a, b) returns
-1 if a < b
 0 if a == 0
 1 if a > b

This is needed since python3 has no cmp function anymore.

All credits for this go to Marco Strigl <mstrigl@suse.com> (see
PR#483 [1]).

[1] https://github.com/openSUSE/osc/pull/483
2019-01-27 16:12:57 +01:00
Marcus Huewe
a3720c5286 Fix ArchQuery.rpmvercmp if one of its arguments is None
The None argument is always <= than the other argument. We need this
in case of a broken/pathological package where version() or release()
return None (see vercmp (which calls rpmvercmp)).
2019-01-27 15:50:35 +01:00
Marcus Huewe
5c639db805 ArchQuery.epoch should never return None
Returning None breaks ArchQuery.vercmp. Returning b'0' is ok because
an epoch, if present, is always supposed to be an integer (at least
in a "valid" arch package (see scripts/libmakepkg/lint_pkgbuild/epoch.sh.in
in the pacman sources)). Hence, if we compare the epoch of a package,
which has no explicit epoch set, with the epoch of a package, which
has an explicit epoch set, we always have a <= relation.
2019-01-27 15:39:07 +01:00
Marcus Huewe
deee8ef6cb Fix logic error in ArchQuery.vercmp
res is never None, because ArchQuery.rpmvercmp always returns -1, 0,
or 1.
2019-01-27 15:00:36 +01:00
Marcus Huewe
562374f045 Simplify ArchQuery.read a bit
No functional changes - just to improve readability.
2019-01-27 14:57:47 +01:00
Marcus Huewe
e580769757 Merge branch 'python3_archquery_module' of https://github.com/lethliel/osc
Initial port of the archquery module to python3 (ArchQuery.__init__,
ArchQuery.read, and ArchQuery.canonname are ported - the rest is missing).
2019-01-27 14:55:01 +01:00
Marco Strigl
fb6605f475
Merge pull request #481 from lethliel/python3_oscerr_module
[python3] self[i] is now self.args[i]
2019-01-23 23:37:49 +01:00
lethliel
21eca9e3f1 [python3] switch ArchQuery to bytestrings
decode explicit (ascii)
2019-01-23 22:59:55 +01:00
Marcus Huewe
60f9290d02 Fix ZeroDivisionException in meter.PBTextMeter
If size is 0, using pb.Percentage will result in a
ZeroDivisionException. Note: the output in case of
size == 0 looks a bit "strange" - for a consistent
output we should probably subclass pb.Percentage.
2019-01-23 15:37:01 +01:00
Marco Strigl
f233066448
Merge pull request #482 from lethliel/python3_packagequery_module
[python3] magic is now a bytestring in python3
2019-01-18 14:34:43 +01:00
lethliel
623f33daa4 reopen 0.165.0 development 2019-01-16 14:04:04 +01:00
lethliel
8cf5e7bfd3 release 0.164.1 2019-01-16 14:02:23 +01:00
Marcus Huewe
218e77aadc Merge branch 'rework_meter_py' of https://github.com/lethliel/osc
Simplify code that uses meter.TextMeter (for the details, see the
discussion in https://github.com/openSUSE/osc/pull/502).
2019-01-16 12:59:50 +01:00
lethliel
93d15fc83b reworked meter.py based on discussion
* new function create_text_meter with fallback selection
* NoPBTextMeter.start() will print the basename (if not stated otherise with
  basename = None)
* The callers that should use an alternare TextMeter class now call create_text_meter()
* The callers that should not use and alternate TextMeter (because of different handling,
  like build.py) call create_text_meter(use_pb_fallback=False)
* the warning 'Please install the progressbar module' is now only shown once

improvements
2019-01-16 11:39:40 +01:00
Marcus Huewe
e60af6f120 Use with statement in CpioRead._copyin_file
This makes sure that the file is closed in case of an exception.
2019-01-15 20:49:26 +01:00
Marcus Huewe
5387744d36 Port CpioWrite to python3
Now, CpioWrite provides a bytes-only API. It would be also possible
that the API accepts bytes and str (we would need to explicitly
encode the latter) but this would be a bit inconsistent wrt.
cpio.CpioRead (which is bytes-only).
Also, by using a bytesarray instead of a [] we avoid several
intermediate ''.join(...)s.
2019-01-15 20:48:42 +01:00
Marcus Huewe
3e326b1bb4 Port CpioRead and CpioHdr to python3
This is a bytes only API because a filename in a cpio archive can
contain, for instance, illegal utf-8 sequences. A user can decode
the filename/content as she wishes.
2019-01-15 20:05:47 +01:00
Marcus Huewe
54ac438eb0 Do not mmap a cpio archive
There is simply no need for a mmap.
2019-01-15 19:47:27 +01:00
Marcus Huewe
1c4385a579 Run a small demo when the cpio module is invoked as a script
It just reads in a cpio archive and print the headers.
2019-01-15 19:46:00 +01:00
Marcus Huewe
245df33444 Merge branch 'samefile' of https://github.com/maltek/osc
Just catch an AttributeError in os_path_samefile instead of using a
general "except".
2019-01-15 17:49:07 +01:00
Malte
3fc3dfb802 improve os_path_samefile 2019-01-15 17:22:27 +01:00
Marcus Huewe
5c19425c9b Use with statement in ArFile.saveTo
This makes sure that the file is closed in case of an exception.
2019-01-15 17:18:50 +01:00
Marcus Huewe
b26a4a967d Raise a ValueError if neither fn nor fh is passed to Ar.__init__
A ValueError is more appropriate because there is no issue with the
ar archive itself. Also, the old codepath never worked because the
fn parameter was missing.
2019-01-15 17:18:50 +01:00
Marcus Huewe
6fdce86fc9 Port the ar module to python3
Since an ar archive can contain arbitary filenames (that is a
filename can be an invalid utf-8 encoding (for instance,
"foo\xff\xffbar")), the ar module provides a bytes only API. A
user can decode filenames as she wishes.
Note: if a "fn" parameter is passed to Ar.__init__ it should be a
bytes (a str is also ok, but then be aware that an ArError's file
attribute might be a str or a bytes).
2019-01-15 17:18:37 +01:00
Marcus Huewe
68cf974c78 Do not mmap the ar archive
There is really no need for a mmap here. Also, the comment in the
docstr does not apply/is nonsense (there is no performance gain).
2019-01-15 17:18:19 +01:00
Marcus Huewe
e12181b11d An ext fn header in an ar file has no mode
Use a dummy mode of 0 in this case (internally, the mode is never
used).
2019-01-15 17:18:19 +01:00
Marcus Huewe
2e45edbe16 Remove superfluous StopIteration exception from the ar module
There is no need to raise a StopIteration exception.
2019-01-15 17:18:19 +01:00
Marcus Huewe
470b187374 Run a small demo when the ar module is invoked as a script
It just prints the ar headers.
2019-01-15 17:18:10 +01:00
Marcus Huewe
35a909bee5 Merge branch 'python3_fetch_module' of https://github.com/lethliel/osc
Explicitly "cast" the division result to an int. This is needed for the
python3 port (in python3 a division of two ints yields a float).
2019-01-14 17:11:16 +01:00
Marcus Huewe
28eeff8683 Simplify rpmquery.unpack_string
There is no need to unpack a single byte because it is not
affected by (byte) endianness (and that's what struct.unpack is
about). Moreover, rpmquery.unpack_string now supports an optional
encoding parameter, which could be used by the python3 port to
decode a string. Note: in general we cannot assume that all strings
in a rpm are utf-8 encoded (it is possible to build a rpm that
contains illegal utf-8 sequences).
2019-01-14 16:40:09 +01:00
Marcus Huewe
e608200414 Remove yet another superfluous try-except from meter import
Follow-up fix for commit be94132298
("Remove superfluous try-except from meter import").
2019-01-14 00:41:09 +01:00
lethliel
8b3c2bd61a improve handling of missing progressbar module
With the NoPBTextMeter class the build view gets broken.
Old view:
1/11 (repo) filename

new view:
Please install the progressbar module...
Please install the progressbar module...
Please install the progressbar module...

With this commit the old behavior is restored.

The getbinaries call now lists the file he downloads instead of just
stating "Please install the progressbar module..." several times.
(but only if not called with the option quiet)
2019-01-11 10:16:02 +01:00
lethliel
a3ab245893 open 0.165 development 2019-01-09 12:02:02 +01:00
lethliel
6800582512 release 0.164 2019-01-09 11:57:37 +01:00
Marcus Huewe
be94132298 Remove superfluous try-except from meter import
Since commit 8a6abe3a6c ("warn user
if python-progressbar is not installed") it is always safe to import
the meter module (even if the progressbar module is not installed).
2019-01-08 18:03:23 +01:00
Marco Strigl
8a6abe3a6c warn user if python-progressbar is not installed
On ImportError have_pb_module is false and the class NoPBTextMeter gets
returned which prints "Please install progressbar module..." on TextMeter.start()
2019-01-08 17:39:13 +01:00
Andreas Schwab
51812b7e93 Don't crash if can_also_build does not contain hostarch 2019-01-04 19:39:18 +01:00
lethliel
6ddf771c9f [python3] make oscssl.py python3 ready.
* works also with python2
2018-12-13 14:53:34 +01:00
lethliel
4269426b28 [python3] msg and body are byte strings 2018-12-13 14:32:38 +01:00
lethliel
67560887db [python3] enable full python3 support for man 2018-12-13 13:33:51 +01:00
lethliel
017c74ba21 [python3] the result of a division is a float
but we need int to continue.
2018-12-13 13:29:14 +01:00
lethliel
40caf1ce0a [python3] self[i] is now self.args[i] 2018-12-13 13:27:22 +01:00
lethliel
2d5a3aeb3b [python3] magic is now a bytestring in python3 2018-12-13 13:23:26 +01:00
b4b1ec7b64 don't fail on request processing, where the object has not yet a state
element.

Happens only before submitting to api
2018-12-13 13:14:19 +01:00
Fridrich Štrba
89cef1f8c1 Do not choke on operators < and > in spec files 2018-11-28 10:55:17 +01:00
74ed6a5b9a report status as outdated if the scheduler can not re-evaluated the
repository because it needs to wait for other repos first
2018-11-26 16:42:17 +01:00
lethliel
2c905ad94f do not add key to buildinfo if not existent
fixes issue: https://github.com/openSUSE/osc/issues/471

Add the key_path only to buildinfo(bi) if it exists (not try_parent)
2018-11-20 20:41:03 +01:00
lethliel
4b29e1c543 add helper functions for python3 support
This functions are used in the whole code and are
mandatory for the python3 support to work. In python2
case nothing is touched.

* cmp_to_key:
  converts a cmp= into a key= function

* decode_list:
  decodes each element of a list. This is needed if
  we have a mixed list with strings and bytes.

* decode_it:
  Takes the input and checks if it is not a string.
  Then it uses chardet to get the encoding.
2018-11-08 09:55:07 +01:00
Marcus Huewe
aa88b6b795 Merge branch 'prjresults-watch' of https://github.com/JanZerebecki/osc
Add "--watch" option to "osc prjresults" ("--watch" can only be used
in combination with "--xml").
2018-11-06 16:44:50 +01:00
5e03ffcec9
Add --watch for osc prjresults --xml
Like: osc results --watch
2018-11-06 15:13:08 +01:00
Marcus Huewe
07b6b41154 Merge branch 'fix_OscMirrorGroup_bug_with_network_not_reachable' of https://github.com/lethliel/osc
Catch URLError and remove superfluous counter in OscMirrorGroup.urlgrab.
2018-11-06 15:05:25 +01:00
lethliel
a65606cbfe fix broken URLError handling in OscMirrorGroup.urlgrab()
If urlgrab returns a URLError (for example if the Network is unreachable)
the for loop did not continue and the osc build aborts.

Now we also catch the URLError and try the next mirror and return False
correctly if no mirror could be reached. And then try to download it from
api
2018-11-06 13:29:17 +01:00
Luca Weiss
f5938348db Fix Python 3.7 support
See PEP 479
2018-11-06 10:35:38 +01:00
Marcus Huewe
e5478e2ff6 Merge branch 'release-no-delay' of https://github.com/JanZerebecki/osc
Add --no-delay option to the "osc release" command.
2018-11-01 20:07:57 +01:00
Marcus Huewe
d5dd5708d5 Merge branch 'add_alternative_project_to_buildinfo' of https://github.com/lethliel/osc
Add --alternative-project option to the "osc buildinfo" command.
2018-11-01 20:04:04 +01:00
Marcus Huewe
ad1450a1f7 Remove superfluous error message
Printing something like "Error 404" might be a bit confusing for
the users.
2018-11-01 19:55:52 +01:00
Marcus Huewe
bec52a7917 Merge branch 'python3_prep' of https://github.com/lethliel/osc
Get rid of the urlgrabber dependency. The current implementation of the
progress bar is quite "noisy" if the line length exceeds the size of
the terminal window, but that's something we could fix later. (The
superfluous error message will be fixed in a subsequent commit.)
2018-11-01 19:55:07 +01:00
63e2ac20ed
Remove reference to non existing documentation
The release management chapter in the OBS book is no where to be found.

Resolves: https://github.com/openSUSE/osc/issues/458
2018-10-31 14:22:11 +01:00
fb80026651
Add --no-delay for osc release
This is useful so one can wait with a following osc prjresult until
everything done. Without this one can not know if a release job hasn't
started yet or is already finished.
2018-10-31 03:45:17 +01:00
Andreas Schwab
1fab61c875 Fix help for osc token 2018-10-25 10:20:16 +02:00
Marco Strigl
92d15b2d95 add --alternative-project option to buildinfo
to be consistent with osc build
2018-10-23 20:27:43 +02:00
lethliel
65b053abb3 replace urlgrabber to enable python3 compatibility
- new module grabber.py
  * OscMirrorGroup to keep urlgrabber.mirrorgroup behavior
  * OscFileGrabber moved here

- meter.py
  * reworked to use progressbar module instead of progressbar
    of urlgrabber and simplified the module.

- babysitter.py
  * removed URLGrabErrorr

- build.py
  * removed adding of url_local to urllist. (not needed anymore)
  * removed URLGrabError

- commandline.py
  * switched from urlgrabber.urlgrab to OscFileGrabber().urlgrab

- core.py
  * reworked progressbar behavior

- fetch.py
  * removed join_url (not needed anymore)
  * moved OscFileGrabber to grabber.py
  * removed failureReport (not needed anymore)
2018-10-19 09:31:37 +02:00