1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-28 10:46:15 +01:00
Commit Graph

3990 Commits

Author SHA1 Message Date
Daniel Mach
a0388fc6e7
Merge pull request #1004 from dmach/osc-localbuild-hdrmd5
Fix "Error: hdrmd5 mismatch" during local build
2022-02-28 16:34:54 +01:00
Daniel Mach
345d0c8d26
Merge pull request #1007 from glaubitz/submitreq
Add -F option to osc submitreq
2022-02-28 16:28:17 +01:00
e37e144099 Fix getbinaries -M/--multibuild-package option usage 2022-02-28 13:31:51 +01:00
08a70952c0 Skip fetching metadata and logs in the getbinaries command
They have identical names for all downloaded packages
and get overwritten by the last downloaded file.
Unless we dowload them into subdirs or prefix them with package name,
it makes no sense to download them.
2022-02-28 13:09:37 +01:00
fd6634e320 Re-download file from API when hdrmd5 doesn't match 2022-02-28 09:28:32 +01:00
John Paul Adrian Glaubitz
483e07042a Add -F option to osc submitreq
Fixes #1001
2022-02-25 12:01:10 +01:00
d222a38d03 Fix getbinaries command to fetch also multibuild packages 2022-02-23 14:56:02 +01:00
Marco Strigl
fe6a50ffb7
Merge pull request #995 from dmach/setup-py-fixes
Drop Windows from supported operating systems
2022-02-21 08:12:15 +01:00
d76ec31ef4 Honor --download-api-only option
Used Marcus Huewe's patch from:
https://github.com/openSUSE/open-build-service/issues/12034#issuecomment-1003051674
2022-02-18 12:00:53 +01:00
171b546379 Remove Windows from the supported operating systems
The ':' character is used as a separator in Open Build Service
and constantly appears in directory names after running osc commands.
Windows do not support ':' as a valid character on file system.
This breaks not only osc but also basic commands such
as 'git clone' on a project that contains colons in paths.

That's why we decided to make osc unsupported on Windows.
2022-02-17 13:34:03 +01:00
Marco Strigl
28dee6603b
Merge pull request #996 from dmach/fix-copying
COPYING: Use the latest version from gnu.org
2022-01-27 10:20:47 +01:00
2c89a1143e COPYING: Use the latest version from gnu.org
https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
2022-01-27 10:06:03 +01:00
3b0c660359 setup.py: Add py3.10 and py3.11 to the classifiers 2022-01-26 15:04:24 +01:00
6ed59860f0 setup.py: Fix license 2022-01-26 15:03:23 +01:00
Marcus Huewe
5c2e1b039a Merge commit 'refs/pull/990/head' of github.com:openSUSE/osc
Add a --verbose <mode> option to the "osc build" command (it is just
passed to the build script).
2022-01-13 19:00:22 +01:00
dc253ed212
add build --verbose option for build script
shows kernel messages (only) atm
2022-01-13 11:57:54 +01:00
Marcus Huewe
dd3908c56f Merge commit 'refs/pull/987/head' of github.com:openSUSE/osc
Handle SIGWINCH more gracefully. This is also needed to work
around an issue in m2crypto (see the discussion [1]).

[1] https://github.com/openSUSE/osc/pull/987
2022-01-07 16:20:11 +01:00
8d082fae6b No need to ignore SIGWINCH anymore
In normal mode, SIGWINCH is handled by ProgressBar.
In quiet mode, there's no SIGWINCH handler at all.
2022-01-07 13:51:48 +01:00
74671532a7 Fix crash on terminal resize during download 2022-01-03 11:47:33 +01:00
Marcus Huewe
c91e2d5c67 Merge commit 'refs/pull/986/head' of github.com:openSUSE/osc
Do not fail with a traceback in case of a config error.
2021-12-25 23:51:23 +01:00
Marcus Huewe
cf8aadc886 Do not fail with a traceback in case of a config error
Do not fail with a traceback if the config file parsing fails.
Hence, catch the configparser.Error exception and print its
"message" attribute to the user.

Fixes: #985 ("Type error on any osc call")
2021-12-19 17:38:22 +01:00
Marcus Huewe
c1134d2f4d Merge commit 'refs/pull/981/head' of github.com:openSUSE/osc
Do not download a bdep with a hdrmd5 from the api by default.
2021-12-15 00:04:41 +01:00
Marco Strigl
6c89e4eb5c
Merge pull request #980 from marcus-h/escape_binary_download_urls
Escape % character in binary download URLs
2021-12-08 11:42:03 +01:00
Marcus Huewe
7da451c87d Do not download a bdep with a hdrmd5 from the api by default
Since a recent backend change, a bdep has a hdrmd5 by default. That
is, osc always downloads these bdeps from the API (unless they are
cached) instead of a mirror. This is not intended.
Using a mirror is no problem because the hdrmd5s are verified in
the build module.
Note: If this causes a problem, one could also use "osc build
--download-api-only" to mimic the old behavior.
2021-12-08 10:41:04 +01:00
Marcus Huewe
824ca083f2 Merge branch 'flake8-config' of https://github.com/dmach/osc
Initial flake8 configuration (this is probably subject to
changes/experiments:) ).
2021-12-08 10:28:45 +01:00
Marcus Huewe
c45373faaa Merge branch 'oscrc-symlink' of https://github.com/dmach/osc
If the oscrc is a symlink, follow the symlink when writing the
configuration file. The old code replaced the symlink with a
regular file (see #390 ("symlinked $HOME/.oscrc gets replaced
with a ordinary file")).

Implementation note: if the directory, which contains the resolved
config file, has a <config file>.new file, the file is overwritten.
2021-12-08 10:24:01 +01:00
5ba6bbe0c2 conf: Preserve oscrc symlink
When a user creates a symlink pointing from ~/.config/osc/oscrc
to a different location, don't overwrite the symlink but follow
it when writing configuration on disk.
2021-12-08 08:48:59 +01:00
Marcus Huewe
d549f27ec5 Escape % character in binary download URLs
Without escaping the % character, the download URL could be subject
to string formatting (depending on the subsequent characters). For
instance, if the url attribute's value of a buildinfo's path element
contains the substring "c_c%2B%2B", the "%2B" is interpreted as a
format string (see issue #965), which is wrong ("B" is not a valid
format character at all). In order to avoid this, escape all
% characters in the download urls.
Note: escaping the % characters in the download url itself is OK
because we only intend to "format" the path.

Note: we do not escape the % characters for urls from the config
file (implicit assumption: the user already correctly escaped the
urls (whether this assumption is sensible or not is debatable, of
course)).

Fixes: #965 ("unsupported format character 'B' (0x42) at index 66")
2021-12-07 20:44:48 +01:00
Marcus Huewe
686175d072 Merge branch 'get_built_files-deb' of https://github.com/dmach/osc
Correctly print the built packages in case of a debbuild.
2021-12-07 18:53:44 +01:00
f3a9ef6446 build: Fix printing paths to built debian packages 2021-12-07 09:17:55 +01:00
a0ea1eeaf7 flake8: Initial configuration
Set max line length to 120.
Keep the all the other settings on their default values.
2021-12-06 12:57:38 +01:00
lethliel
2e80671523 open 0.176.0 development 2021-12-02 08:51:26 +01:00
lethliel
52e89604b3 release 0.175.0 2021-12-02 08:48:19 +01:00
Marcus Huewe
bf9e046f2f Merge branch 'always_parse_config' of https://github.com/marcus-h/osc
Osc.postoptparse only returns if the get_config call succeeds.
2021-12-01 19:59:09 +01:00
Marcus Huewe
b8482bfab3 Osc.postoptparse only returns if the get_config call succeeds
The old code passes try_again=False to the recursive postoptparse
call when calling it from one of the exception handlers. This is
wrong because it can result in an incomplete conf.config dict (for
instance, if two apiurl sections have no user and no password and
no credentials_mgr_class option - see #761 ("Traceback config with
two backends and no username")).
Hence, Osc.postoptparse should only return if the conf.get_config
call succeeds. For this, unconditionally call Osc.postoptparse from
within the exception handlers. Note: this could potentially (although
quite unlikely) result in an endless recursion but in each recursive
call "user" interaction is required (that is, the user could simply
press CTRL+c) - so this should not be a problem.

Implementation note: this change breaks the API. Rationale: the
semantics of Osc.postoptparse changed. Hence, "pretending" to
honor the try_again parameter could result in unexpected behavior
(from the API consumer's POV). Hence, a traceback might be more
sensible.

Fixes: #761 ("Traceback config with two backends and no username")
2021-11-23 15:34:48 +01:00
Marco Strigl
8da29dc766
Merge pull request #971 from jayvdb/i970
OscTestCase: Always reset CWD
2021-11-08 21:39:11 +01:00
John Vandenberg
090bd0316c OscTestCase: Always reset CWD
Fixes #970
2021-11-07 16:39:39 +08:00
Marcus Huewe
d3e9ff739a Merge branch 'zstddeb' of https://github.com/adrianschroeter/osc
Support a zst compressed control.tar in debquery.DebQuery. A zst compressed
control tar is used, for instance, in Ubuntu 21.10.
Note: this requires the 3rd-party python-zstandard module.
2021-10-26 21:10:29 +02:00
fe311c7ae5
support zst compressed control files in deb archives
eg. some packages Ubuntu 21.10
2021-10-26 07:29:43 +02:00
Marcus Huewe
3ba867cf94 Merge branch 'improve-mode-handling' of https://github.com/Firstyear/osc
Only change the mode of a config file if it is different from 0o600 (instead
of unconditionally calling os.chmod). The advantage of the new behavior is
that it also works with a read-only filesystem. Additionally, if the mode
is not 0o600 and the config file resides on a read-only filesystem, we
print a warning and continue (actually, this change is debatable but it is
also not too bad because the config file does not necessarily have to
contain the passwords anymore... (let's keep our fingers crossed that no
3rd party application relied on the "implicit" os.chmod API, though)).
2021-10-25 15:54:32 +02:00
William Brown
d56a46b669 Improve logic for conffile mode handling 2021-10-25 09:34:16 +10:00
Marcus Huewe
16ec3ff9f9 Merge branch 'fix_queryhdrmd5' of https://github.com/adrianschroeter/osc
Only verify the hdrmd5 for containers and rpms. Currently, the other formats
(deb and arch) lack a hdrmd5 implementation. For now, we skip the hdrmd5
verification for these formats. The downside is that the build could be
carried out with a "wrong" package (this could happen, for instance, if
a package is replaced with a different package and both packages have the
_same_ canonname).
The old code would abort the build if the buildinfo contains an arch/a deb
bdep with a hdrmd5 attribute - this is also not desirable from a user's
POV...
Eventually, we will implement the hdrmd5 computations for these formats,
too.
2021-10-19 16:20:52 +02:00
4d7dd3d46c
fix hdmrd5 check of local cached files
Current OBS is delivering hdrmd5 in buildinfo. It turns out
that osc has already code for validating cached files, but it
invalidates all local files atm with python 3.x
2021-10-19 16:01:24 +02:00
Marcus Huewe
42e46ccaec Merge branch 'fix_querymd5hdr' of https://github.com/adrianschroeter/osc
Fix rpm magic check in PackageQuery.queryhdrmd5 (str vs bytes).
Note: if a buildinfo's bdep element contains a hdrmd5, osc will refuse
the build in a non-rpm case.
2021-10-13 13:15:59 +02:00
b5d337d037
fix hdmrd5 check of local cached files
Current OBS is delivering hdrmd5 in buildinfo. It turns out
that osc has already code for validating cached files, but it
invalidates all local files atm with python 3.x
2021-10-12 10:54:20 +02:00
Marcus Huewe
b6f69180e2 Merge branch 'fix_mr' of https://github.com/adrianschroeter/osc
Do not create an MR for the entire project if "osc mr" is invoked in
a package wc (only create an MR for the specific package instead).
Strictly speaking, the "breaks" the existing UI - but this rather seems
to be a "fix" than a "break";)
2021-10-11 16:05:06 +02:00
Marcus Huewe
26aea786da Merge branch 'improve_URLError_msg' of https://github.com/marcus-h/osc
Improve error message in case of an URLError.
2021-10-11 16:03:26 +02:00
2b278e7226
avoid sending entire projects on "osc mr"
We may have a package working directory, so we should only put this into
request and not entire project.
2021-10-08 17:13:53 +02:00
2b1c04757b
Merge pull request #952 from adrianschroeter/fix_download
fix downloading from mirrors
2021-10-06 13:22:48 +02:00
3b90480dfc
fix downloading from mirrors
Some of our repositories have specific download urls. osc is ignoring
this so far and just tries to use the generic downloadurl

This code prefers definitions for individual path elements if they exist.
We could IMHO remove the old code, since old OBS instances would still
work via the api download fallback.

Real life examples for repo specific configs are on openSUSE all
repositories outside of the /repositories/ directory. eg.

  <path project="openSUSE:Tumbleweed" repository="dod" url="http://download.opensuse.org/tumbleweed/repo/oss/"/>

Co-Author: Marcus Hüwe <suse-tux@gmx.de>
2021-10-06 13:16:40 +02:00