1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-23 18:52:10 +01:00

Merge pull request #1425 from dmach/fix-1.4.0

Fix 1.4.0
This commit is contained in:
Daniel Mach 2023-10-10 19:56:50 +02:00 committed by GitHub
commit 8f80e1c647
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 11 deletions

2
NEWS
View File

@ -27,7 +27,7 @@
- Fix handling empty vm_type in Store.last_buildroot
- Spec:
- Install zsh completion
- Bulild and install oscrc man page
- Build and install oscrc man page
- 1.3.1
- Command-line:

View File

@ -15,10 +15,6 @@
# need to override python_sitelib because it is not set as we would expect on many distros
%define python_sitelib %(RPM_BUILD_ROOT= %{use_python} -Ic "import sysconfig; print(sysconfig.get_path('purelib'))")
%if 0%{?is_opensuse}
%define completion_dir_bash %{_sysconfdir}/bash_completion.d
%endif
# generate manpages on distros where argparse-manpage >= 3 is available
%if 0%{?suse_version} > 1500 || 0%{?fedora} >= 37
%bcond_without man
@ -26,6 +22,13 @@
%bcond_with man
%endif
# whether to use fdupes to deduplicate python bytecode
%if 0%{?suse_version} || 0%{?fedora}
%bcond_without fdupes
%else
%bcond_with fdupes
%endif
%define argparse_manpage_pkg %{use_python_pkg}-argparse-manpage
%define sphinx_pkg %{use_python_pkg}-Sphinx
@ -62,6 +65,9 @@ BuildRequires: %{use_python_pkg}-rpm
BuildRequires: %{use_python_pkg}-setuptools
BuildRequires: %{use_python_pkg}-urllib3
BuildRequires: diffstat
%if %{with fdupes}
BuildRequires: fdupes
%endif
# needed for git scm tests
BuildRequires: git-core
@ -168,6 +174,10 @@ install -Dm0644 osc.1 %{buildroot}%{_mandir}/man1/osc.1
install -Dm0644 oscrc.5 %{buildroot}%{_mandir}/man5/oscrc.5
%endif
%if %{with fdupes}
%fdupes %buildroot
%endif
%check
%{use_python} setup.py test
@ -185,7 +195,8 @@ install -Dm0644 oscrc.5 %{buildroot}%{_mandir}/man5/oscrc.5
%{_bindir}/*
# python modules
%{python_sitelib}/*
%{python_sitelib}/osc
%{python_sitelib}/osc-*-info
# rpm macros
%{_rpmmacrodir}/*
@ -198,8 +209,11 @@ install -Dm0644 oscrc.5 %{buildroot}%{_mandir}/man5/oscrc.5
%dir %{_datadir}/osc
%{_datadir}/osc/complete
%{completion_dir_bash}/*
%{completion_dir_csh}/*
%config %{completion_dir_csh}/*
%{completion_dir_fish}/*
%dir %{_datadir}/zsh
%dir %{_datadir}/zsh/functions
%dir %{_datadir}/zsh/functions/Completion
%{completion_dir_zsh}/*
# osc owns the dirs to avoid the "directories not owned by a package" build error

View File

@ -1833,7 +1833,9 @@ def get_config(override_conffile=None,
urls = [i for i in cp.sections() if i != "general"]
for url in urls:
apiurl = sanitize_apiurl(url)
username = cp[url]["user"]
username = cp[url].get("user", None)
if username is None:
raise oscerr.ConfigMissingCredentialsError(f"No user found in section {url}", conffile, url)
host_options = HostOptions(apiurl=apiurl, username=username, _parent=config)
for name, field in host_options.__fields__.items():
@ -1941,7 +1943,7 @@ def interactive_config_setup(conffile, apiurl, initial=True):
raise oscerr.UserAbort()
print()
apiurl_no_scheme = urlsplit(apiurl)[1]
apiurl_no_scheme = urlsplit(apiurl)[1] or apiurl
user_prompt = f"Username [{apiurl_no_scheme}]: "
user = raw_input(user_prompt)
pass_prompt = f"Password [{user}@{apiurl_no_scheme}]: "

View File

@ -4753,7 +4753,7 @@ def change_request_state_template(req, newstate):
return ''
action = req.actions[0]
tmpl_name = '%srequest_%s_template' % (action.type, newstate)
tmpl = conf.config.get(tmpl_name, '')
tmpl = conf.config.get(tmpl_name, "") or ""
tmpl = tmpl.replace('\\t', '\t').replace('\\n', '\n')
data = {'reqid': req.reqid, 'type': action.type, 'who': req.creator}
if req.actions[0].type == 'submit':

View File

@ -11,7 +11,9 @@ class TestGitStore(unittest.TestCase):
def setUp(self):
self.tmpdir = tempfile.mkdtemp(prefix="osc_test")
os.chdir(self.tmpdir)
subprocess.check_output(["git", "init", "-b", "factory"])
# 'git init -b <initial-branch>' is not supported on older distros
subprocess.check_output(["git", "init", "-q"])
subprocess.check_output(["git", "checkout", "-b", "factory", "-q"])
subprocess.check_output(["git", "remote", "add", "origin", "https://example.com/packages/my-package.git"])
def tearDown(self):