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

1527 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
Quang Tran
86fcb7aecf
Fix typo in help message 2020-01-08 17:18:54 +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
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
Marco Strigl
8ec18e99a3
Merge pull request #694 from adrianschroeter/vm_build_fixes
VM build fixes
2019-12-05 10:26:40 +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
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
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
2286f042ef improve help text for for build/shell/wipe 2019-11-28 10:21:05 +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
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
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
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
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
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