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

3214 Commits

Author SHA1 Message Date
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
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