1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-09 22:36:14 +01:00
Commit Graph

3766 Commits

Author SHA1 Message Date
24fb9732f0
Merge pull request #898 from adrianschroeter/shell_after_fail
implement osc build --shell-after-fail
2021-02-12 08:41:36 +01:00
c06b794ddf support osc build --shell-after-fail from build script 2021-02-12 08:20:51 +01:00
Marcus Huewe
6144b27470 Merge branch 'showlinked' of https://github.com/adrianschroeter/osc
Add "showlinked [<prj> <pkg>]" command that can be used to show which
packages link to the "<prj>/<pkg>" package.
2021-02-08 20:36:49 +01:00
bc25ac769e add showlinked command 2021-02-08 10:50:45 +01:00
Marcus Huewe
fc7d3d91fc Merge branch 'creq_slash_split' of https://github.com/marcus-h/osc
Support slash notation in "osc creq -a <action type> args".
2021-02-01 23:06:57 +01:00
Marcus Huewe
609990ba62 Open 0.173.0 development 2021-01-27 13:30:43 +01:00
Marcus Huewe
5df5465b1a Release 0.172.0
For the details see the NEWS file.
2021-01-27 13:21:32 +01:00
Marcus Huewe
2371a6c91b Support slash notation in "osc creq -a <action type> args"
Most osc commands support slash notation for the specification of
a project package pair. That is, "osc <cmd> prj/pkg" has the same
semantics as "osc <cmd> prj pkg" (in most cases).
For consistency reasons, "osc creq" should also support the slash
notation for the action type's arguments. That is, for instance,
"osc creq -a submit src_prj/src_pkg dst_prj/dst_pkg" should have the
same effect as "osc creq -a submit src_prj src_pkg dst_prj dst_pkg".

Proposed-by: darix
2021-01-25 21:16:17 +01:00
Ludwig Nussel
224ec6eef5
Merge pull request #847 from marcus-h/service_old_dir
Add .old dir support for source services
2021-01-20 15:08:27 +01:00
Marcus Huewe
0f5bdc9ad5 Merge branch 'lastsucceeded' of https://github.com/adrianschroeter/osc
Add --lastsucceeded/--last-succeeded option to "osc buildlog" (the latter
option is also added to "osc remotebuildlog").
Also take the --lastsucceeded option into account when computing the
file offset (for the corresponding *tail commands).
Moreover, improve the error message in case of an unknown build type (now,
it also includes flatpak* filenames).
2021-01-18 18:59:22 +01:00
ca080d2118 add --lastsucceeded option also for buildlog command
introduce --last-succeeded alias
2021-01-18 10:21:58 +01:00
9ad555ee24 mention flatpack as well 2021-01-18 10:21:50 +01:00
Marcus Huewe
a6012b92b3 Merge branch 'pypi_bugfix' of https://github.com/crazyscientist/osc
Workaround/fix for pypi deployment via travis.

Note: I cannot really "review" this change because I have no clue about
travis. Since the current pypi deployment via travis does not seem to
work, merging it does not seem to be a problem.

Probably fixes: #884 ("osc pypi artifact is not up to date")
2020-12-28 13:40:07 +01:00
Andreas Hasenkopf
dba77a315b CI pipeline: Skip cleanup prior to deployment
Deployment via Travis CI failed due an error during
cleanup (#884):

`Could not restore untracked files from stash entry`

Disabling the cleanup fixes this problem.
2020-12-28 10:25:37 +01:00
Marcus Huewe
6104560050 Merge branch 'creq_no_supersede_dups' of https://github.com/marcus-h/osc
Do not supersede the same requests several times in osc creq.
2020-12-22 16:07:43 +01:00
Marcus Huewe
e06c633798 Merge branch 'fix__submit_request_id_return' of https://github.com/marcus-h/osc
Only return request ids in Osc._submit_request in order to avoid a
TypeError in the caller when processing the results.
2020-12-22 16:06:37 +01:00
Marcus Huewe
0926e37f1e Do not return Request instances in Osc._submit_request
If there are existing requests that should be superseded, the old
code stores the Request instances in the myreqs list, which is
returned to the caller. However, the caller expects only request
ids instead of instances of class Request. Eventually, this results
in a type error - excerpt:

...
  File "/usr/lib/python3.8/site-packages/osc/commandline.py", line 1892, in do_createrequest
    change_request_state(apiurl, srid, 'superseded',
  File "/usr/lib/python3.8/site-packages/osc/core.py", line 4322, in change_request_state
    u = makeurl(apiurl,
  File "/usr/lib/python3.8/site-packages/osc/core.py", line 3326, in makeurl
    return urlunsplit((scheme, netloc, '/'.join([path] + list(l)), query, ''))
TypeError: sequence item 2: expected str instance, Request found

Hence, simply return the request ids instead of the Request instances.

Note: this changes the API of the Osc._submit_request method but
this is OK because it is not part of the public API.
2020-12-22 16:04:13 +01:00
Marcus Huewe
1aab0a8ed9 Do not supersede the same requests several times in osc creq
When calling "osc creq -a prj1 foo prj2 bar -a submit prj1 bar prj2 bar",
the requests that could be superseded are calculated two times for the
prj2/bar package. Hence, they could end up two times in the "supersede"
list (see do_createrequest) In order to avoid duplicates, use a set
instead of a list.

Kudos to darix for pointing this out!

Note: it is a bit questionable if osc's current semantics makes sense
in the above example.
2020-12-09 21:41:37 +01:00
Marcus Huewe
745dc1180d Merge branch 'fix__html_escape_usage' of https://github.com/marcus-h/osc
Avoid superfluous/excessive usage of _html_escape.
2020-12-05 19:26:59 +01:00
Marcus Huewe
5428c09cd7 Merge branch 'use_getcwdb' of https://github.com/marcus-h/osc
os.getcwd() fixes:
- Fix a potential TypeERror in util.ArFile.saveTo.
- Avoid error prone use of os.getcwd().encode() in util.cpio.CpioRead.
2020-12-01 13:20:12 +01:00
Marcus Huewe
fbea0ea729 Avoid superfluous/excessive usage of _html_escape
When creating a new request via the core.Request.create method, there is
no need to escape the data that is assigned to the "description" attribute
of a core.Request instance. Internally, core.Request.create ensures that
the data, which is POSTed to the api, is correctly escaped (the escaping
is implicitly done by ET (see core.Request.to_str)). Manually escaping the
description results in a double escaping (the escaped description is
escaped by ET again) - this is not the desired behavior.
Analogously, there is no need to escape the data that is passed to the
message parameter of the core.create_submit_request function because
core.create_submit_request takes care of escaping it.

Fixes: #869 ("Silly encoding of htmlencodable entities")
2020-11-28 18:03:24 +01:00
Marcus Huewe
1933da5bcc Use os.getcwdb() instead of os.getcwd().encode() in util.cpio.CpioRead
Using os.getcwd() in combination with a subsequent .encode() is error
prone:

marcus@linux:~> mkdir illegal_utf-8_encoding_$'\xff'_dir
marcus@linux:~> cd illegal_utf-8_encoding_$'\xff'_dir/
marcus@linux:~/illegal_utf-8_encoding_ÿ_dir> python3
Python 3.8.6 (default, Nov 09 2020, 12:09:06) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.getcwd().encode()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcff' in position 36: surrogates not allowed
>>>

Hence, use os.getcwdb(), which returns a bytes, instead of
os.getcwd().encode().

Fixes: commit 36f7b8ffe9 ("Fix a
potential TypeError in CpioRead.copyin and CpioRead.copyin_file")
2020-11-22 17:39:54 +01:00
Marcus Huewe
674ea78815 Avoid a potential TypeError in util.ArFile.saveTo
If no dir is passed to util.ArFile.saveTo, dir is set to os.getcwd(),
which returns a str. Since self.name is a bytes, the subsequent
os.path.join(dir, self.name) results in a TypeError.
To fix this, use os.getcwdb(), which returns a bytes instead of a
str.
2020-11-22 17:36:17 +01:00
Marcus Huewe
926c2eb422 Merge branch 'support-nspawn' of https://github.com/OlegGirko/osc
Support "osc build --vm-type=nspawn". Without this change build_root
is changed to "build_root/.mount", which results in an invalid name
for systemd-nspawn (see build-vm-nspawn in the obs-build codebase).
Now, --vm-type=nspawn behaves the same as --vm-type=lxc wrt. option
passing to the build script and package signature checking.
2020-11-22 17:09:47 +01:00
Oleg Girko
74846ea83b Add support for nspawn VM type.
This allows to utilise support for systemd-nspawn backend in build engine.
Like LXC, systemd-nspawn creates isolated lightweight container.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
2020-11-22 14:34:37 +00:00
Marco Strigl
5e313ed485
Merge pull request #866 from marcus-h/cpio_bytes_fix
Fix a potential TypeError in CpioRead.copyin and CpioRead.copyin_file
2020-11-20 11:43:11 +01:00
Marcus Huewe
36f7b8ffe9 Fix a potential TypeError in CpioRead.copyin and CpioRead.copyin_file
If no "dest" argument is specified when calling CpioRead.copyin or
CpioRead.copyin_file, a TypeError occurs in CpioRead._copyin_file
because os.getcwd(), which returns a str, is used as dest and, hence,
the subsequent os.path.join(...) fails (because it tries to join a
str and a bytes).
In order to avoid this, encode the result of os.getcwd().

Note that the existing

archive.copyin_file(hdr.filename,
                    os.path.dirname(tmpfile),
                    os.path.basename(tmpfile))

was OK because CpioRead._copyin_file os.path.join()s "dest" and
"new_fn", which are both str. It is just changed to stress that
CpioRead is a bytes-only API.

Fixes: #865 ("Traceback in osc/util/cpio.py line 128: TypeError:
Can't mix strings and bytes in path components")
2020-11-20 09:55:09 +01:00
Marcus Huewe
d7594ddeda Merge branch 'do_init_non_existent_prj' of https://github.com/marcus-h/osc into master
Fix "osc init" in case of a non-existent project.
2020-11-12 22:41:51 +01:00
Marcus Huewe
558efce0fd Merge branch 'master' of https://github.com/mlschroe/osc into master
Initial support for flatpak. Note that this requires a recent obs-build
version.
2020-11-12 19:52:36 +01:00
Michael Schroeder
5d2542522d Support flatpak building 2020-11-12 14:08:10 +01:00
lethliel
a47a0a5f3c open 0.172.0 development 2020-11-10 14:31:25 +01:00
lethliel
528991829f release 0.171.0 2020-11-10 14:25:02 +01:00
Marcus Huewe
0d78560e5d Do not retrieve the package list when initializing a project via osc init
Currently, when trying to initialize a non existent (server-side)
project via "osc init <prj>", osc errors out (after creating the wc)
because it fails to retrieve the package list. However, there is no
need to retrieve the package list in the "osc init <prj>" case. Hence,
skip the package list retrieval. As a result, osc does not error out.

For the background, see the discussion in #858 ("osc fails to check
out an empty project as project") [1].

[1] https://github.com/openSUSE/osc/issues/858#issuecomment-722330024
2020-11-05 13:13:07 +01:00
Marcus Huewe
699827d091 Merge branch 'checkRevision_meta_mode' of https://github.com/marcus-h/osc into master
Fix show_upstream_rev call in checkRevision in the meta=True
case.
2020-10-27 01:08:23 +01:00
Marcus Huewe
4ee9c1ad38 Merge branch 'fix_readme' of https://github.com/dcermak/osc into master
Fix bugzilla URL. Alternatively, we could also directly point to
https://github.com/openSUSE/osc/issues/new.
2020-10-14 21:05:11 +02:00
3956abbd3c
Replace link to novell Bugzilla with openSUSE's Bugzilla 2020-10-14 17:02:34 +02:00
Marcus Huewe
b573f02eb4 Fix show_upstream_rev call in checkRevision
If meta=True is passed to checkRevision, the meta parameter is used
as a revision in the show_upstream_rev call. Instead, it should be
bound to show_upstream_rev's meta parameter.
2020-10-13 19:35:08 +02:00
Marcus Huewe
89bb15d3b6 Add .old dir support for source services
Some services expect "old" service files (that is, files from a
previous service run) to be present in an ".old" dir. Hence, osc
should support that.
Instead of removing all files from a previous service run, move them
to the ".old" dir, run the services, and, finally, remove the ".old"
dir.
Unfortunately, the location of the ".old" dir is hardcoded in the
specific services. That is, we have to be careful if an ".old" dir
exists (in this case, we error out).

Based on [1].

[1] https://github.com/openSUSE/osc/pull/846
2020-10-01 14:03:10 +02:00
Marco Strigl
7b5d105523
Merge pull request #841 from lethliel/add_proper_repourls
add proper reporuls
2020-09-22 11:55:33 +02:00
lethliel
eaf50dd13d add proper reporuls
for use in Arch, Debian and Ubuntu
2020-09-22 08:52:57 +02:00
3cb40c51b1
Merge pull request #836 from marcus-h/preinstallimage_offline
Support a preinstallimage in combination with the --offline option
2020-09-08 09:06:46 +02:00
Marcus Huewe
e58abf1527 Support a preinstallimage in combination with the --offline option
Currently, if the --offline option is passed to "osc build ...", a
preinstallimage is not used (even if it exists). Instead, a
preinstallimage should be used (if it exists) even if the --offline
option is specified.
2020-09-07 18:54:59 +02:00
Marco Strigl
1649fe47df
Merge pull request #834 from adrianschroeter/github_hack
catch URLs to github.com and gitlab.com as git repos
2020-09-01 14:10:16 +02:00
9b245db224 catch URLs to github.com and gitlab.com as git repos
yes, ugly, but I am tired to explain people to add a .git suffix
to get the right mode for "osc add"
2020-09-01 13:50:18 +02:00
Marco Strigl
5bf40aa9a4
Merge pull request #830 from adrianschroeter/owner
maintainer search: lookup via package name by default and binary as fallback
2020-09-01 13:25:21 +02:00
36fc925ee0 maintainer search: lookup via package name by default and binary as fallback
This is faster in best case since the binary search does not need
to be executed on the server.

It also finds package names where no binary with that name exists.
(as for some multibuild cases)
2020-08-31 13:53:41 +02:00
Marco Strigl
d3acec44e3
Merge pull request #833 from mcepl/ignore_SIGNWINCH
Ignore signal.SIGWINCH.
2020-08-31 10:38:07 +02:00
bf7899da83
Ignore signal.SIGWINCH.
Fixes #584
2020-08-27 16:56:36 +02:00
Marcus Huewe
a57b8a60b2 Merge branch 'help-rdiff-p-in-archives' of https://github.com/JanZerebecki/osc
Improve the documentation of the "rdiff" command + its "--plain" option.
2020-08-25 18:44:56 +02:00
294aaa0dd7
help rdiff: -p shows diff of files in archives
This was undocumented.

Also remove the part that incorrectly says this is the default.
2020-08-25 18:14:02 +02:00