openSUSE Commits
Threads by month
- ----- 2025 -----
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
January 2021
- 1 participants
- 1538 discussions
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package git for openSUSE:Factory checked in at 2021-01-15 19:43:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/git (Old)
and /work/SRC/openSUSE:Factory/.git.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "git"
Fri Jan 15 19:43:14 2021 rev:257 rq:859290 version:2.30.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/git/git.changes 2020-11-26 23:12:52.396951653 +0100
+++ /work/SRC/openSUSE:Factory/.git.new.28504/git.changes 2021-01-15 19:43:16.577745577 +0100
@@ -1,0 +2,12 @@
+Tue Dec 29 19:30:29 UTC 2020 - Andreas Stieger <andreas.stieger(a)gmx.de>
+
+- git 2.30.0:
+ * Userdiff updates for PHP, Rust, CSS
+ * New features and options to multiple subcommands and workflows
+ * Avoid administrator error leading to data loss with
+ "git push --force-with-lease[=<ref>]" by introducing
+ "--force-if-includes"
+ * Updates to shell autocompletion
+ * Bug fixes and internal improvements
+
+-------------------------------------------------------------------
Old:
----
git-2.29.2.tar.sign
git-2.29.2.tar.xz
New:
----
git-2.30.0.tar.sign
git-2.30.0.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ git.spec ++++++
--- /var/tmp/diff_new_pack.vZJona/_old 2021-01-15 19:43:17.461747026 +0100
+++ /var/tmp/diff_new_pack.vZJona/_new 2021-01-15 19:43:17.465747033 +0100
@@ -39,7 +39,7 @@
%endif
Name: git
-Version: 2.29.2
+Version: 2.30.0
Release: 0
Summary: Fast, scalable, distributed revision control system
License: GPL-2.0-only
@@ -91,8 +91,8 @@
BuildRequires: sgml-skel
BuildRequires: xmlto
%if %{with asciidoctor}
-BuildRequires: docbook5-xsl-stylesheets
BuildRequires: %{rubygem asciidoctor}
+BuildRequires: docbook5-xsl-stylesheets
%else
BuildRequires: asciidoc
%endif
++++++ git-2.29.2.tar.xz -> git-2.30.0.tar.xz ++++++
/work/SRC/openSUSE:Factory/git/git-2.29.2.tar.xz /work/SRC/openSUSE:Factory/.git.new.28504/git-2.30.0.tar.xz differ: char 15, line 1
++++++ git-zsh-completion-fixes.diff ++++++
--- /var/tmp/diff_new_pack.vZJona/_old 2021-01-15 19:43:17.561747190 +0100
+++ /var/tmp/diff_new_pack.vZJona/_new 2021-01-15 19:43:17.561747190 +0100
@@ -2,15 +2,15 @@
contrib/completion/git-completion.zsh | 1 +
1 file changed, 1 insertion(+)
-Index: git-2.11.0/contrib/completion/git-completion.zsh
+Index: git-2.30.0/contrib/completion/git-completion.zsh
===================================================================
---- git-2.11.0.orig/contrib/completion/git-completion.zsh
-+++ git-2.11.0/contrib/completion/git-completion.zsh
-@@ -31,6 +31,7 @@ if [ -z "$script" ]; then
- local e
- locations=(
- $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
+--- git-2.30.0.orig/contrib/completion/git-completion.zsh
++++ git-2.30.0/contrib/completion/git-completion.zsh
+@@ -36,6 +36,7 @@ if [ -z "$script" ]; then
+ "$(dirname ${funcsourcetrace[1]%:*})"/git-completion.bash
+ "$HOME/.local/share/bash-completion/completions/git"
+ "$bash_completion/git"
+ '/etc/bash_completion.d/git.sh' # suse
- '/etc/bash_completion.d/git' # fedora, old debian
- '/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian
- '/usr/share/bash-completion/git' # gentoo
+ '/etc/bash_completion.d/git' # old debian
+ )
+ for e in $locations; do
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-pysmbc for openSUSE:Factory checked in at 2021-01-15 19:43:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pysmbc (Old)
and /work/SRC/openSUSE:Factory/.python-pysmbc.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pysmbc"
Fri Jan 15 19:43:02 2021 rev:6 rq:863124 version:1.0.23
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pysmbc/python-pysmbc.changes 2020-08-13 10:12:03.046562082 +0200
+++ /work/SRC/openSUSE:Factory/.python-pysmbc.new.28504/python-pysmbc.changes 2021-01-15 19:43:03.701724478 +0100
@@ -1,0 +2,12 @@
+Thu Jan 14 12:05:43 UTC 2021 - Benjamin Greiner <code(a)bnavigator.de>
+
+- Update to 1.0.23
+ No changelog provided. From the git log:
+ * Python 3 API changes
+ * Rework Context.getxattr() To Only Allocate Needed Buffer Space
+- Remove evil ifpython3. Let the macros figure out the correct
+ provides/obsoletes tags. gh#openSUSE/python-rpm-macros#66
+- Upstream is moving to pytest, but the tests still need a running
+ samba server.
+
+-------------------------------------------------------------------
Old:
----
pysmbc-1.0.22.tar.gz
New:
----
pysmbc-1.0.23.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pysmbc.spec ++++++
--- /var/tmp/diff_new_pack.OLnKhg/_old 2021-01-15 19:43:04.201725298 +0100
+++ /var/tmp/diff_new_pack.OLnKhg/_new 2021-01-15 19:43:04.205725304 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-pysmbc
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,15 +18,15 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define oldpython python
-# Tests don't work in rpmbuild sandbox
+# Tests need a running samba server
%bcond_with test
Name: python-pysmbc
-Version: 1.0.22
+Version: 1.0.23
Release: 0
Summary: Python bindings for samba clients (libsmbclient)
License: GPL-2.0-or-later
Group: Development/Languages/Python
-URL: http://cyberelk.net/tim/software/pysmbc/
+URL: https://github.com/hamano/pysmbc
Source: https://files.pythonhosted.org/packages/source/p/pysmbc/pysmbc-%{version}.t…
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
@@ -35,16 +35,14 @@
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
%if %{with test}
-BuildRequires: %{python_module nose}
+BuildRequires: %{python_module pytest}
%endif
%ifpython2
Obsoletes: %{oldpython}-smbc < %{version}
Provides: %{oldpython}-smbc = %{version}
%endif
-%ifpython3
-Obsoletes: python3-smbc < %{version}
-Provides: python3-smbc = %{version}
-%endif
+Obsoletes: python-smbc < %{version}-%{release}
+Provides: python-smbc = %{version}-%{release}
%python_subpackages
%description
@@ -53,6 +51,7 @@
%prep
%setup -q -n pysmbc-%{version}
+sed -i '1{/^#!.*/ d}' smbc/xattr.py
%build
export CFLAGS="%{optflags}"
@@ -60,25 +59,18 @@
%install
%python_install
-
-%{python_expand chmod a+x %{buildroot}%{$python_sitearch}/smbc/xattr.py
-sed -i "s|^#!%{_bindir}/python$|#!%__$python|" %{buildroot}%{$python_sitearch}/smbc/xattr.py
-$python -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/smbc/
-$python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitearch}/smbc/
-%fdupes %{buildroot}%{$python_sitearch}
-}
+%python_expand %fdupes %{buildroot}%{$python_sitearch}
%if %{with test}
%check
-pushd tests
-%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitearch}
-$python -B -m nose .
-}
+%pytest_arch
%endif
%files %{python_files}
%license COPYING
%doc NEWS
-%{python_sitearch}/*
+%{python_sitearch}/smbc
+%{python_sitearch}/_smbc*
+%{python_sitearch}/pysmbc-%{version}*-info
%changelog
++++++ pysmbc-1.0.22.tar.gz -> pysmbc-1.0.23.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.22/Makefile new/pysmbc-1.0.23/Makefile
--- old/pysmbc-1.0.22/Makefile 2020-05-19 18:17:24.000000000 +0200
+++ new/pysmbc-1.0.23/Makefile 2020-05-19 18:17:55.000000000 +0200
@@ -1,7 +1,6 @@
PYTHON=python
NAME=pysmbc
VERSION:=$(shell $(PYTHON) setup.py --version)
-#SDIST_ARGS=--formats=bztar -d.
_smbc.so: force
$(PYTHON) setup.py build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.22/PKG-INFO new/pysmbc-1.0.23/PKG-INFO
--- old/pysmbc-1.0.22/PKG-INFO 2020-05-19 18:17:40.000000000 +0200
+++ new/pysmbc-1.0.23/PKG-INFO 2020-10-26 03:36:16.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pysmbc
-Version: 1.0.22
+Version: 1.0.23
Summary: Python bindings for libsmbclient
Home-page: https://github.com/hamano/pysmbc
Author: ['Tim Waugh <twaugh(a)redhat.com>', 'Tsukasa Hamano <hamano(a)osstech.co.jp>', 'Roberto Polli <rpolli(a)babel.it>']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.22/pysmbc.egg-info/PKG-INFO new/pysmbc-1.0.23/pysmbc.egg-info/PKG-INFO
--- old/pysmbc-1.0.22/pysmbc.egg-info/PKG-INFO 2020-05-19 18:17:40.000000000 +0200
+++ new/pysmbc-1.0.23/pysmbc.egg-info/PKG-INFO 2020-10-26 03:36:16.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pysmbc
-Version: 1.0.22
+Version: 1.0.23
Summary: Python bindings for libsmbclient
Home-page: https://github.com/hamano/pysmbc
Author: ['Tim Waugh <twaugh(a)redhat.com>', 'Tsukasa Hamano <hamano(a)osstech.co.jp>', 'Roberto Polli <rpolli(a)babel.it>']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.22/pysmbc.egg-info/SOURCES.txt new/pysmbc-1.0.23/pysmbc.egg-info/SOURCES.txt
--- old/pysmbc-1.0.22/pysmbc.egg-info/SOURCES.txt 2020-05-19 18:17:40.000000000 +0200
+++ new/pysmbc-1.0.23/pysmbc.egg-info/SOURCES.txt 2020-10-26 03:36:16.000000000 +0100
@@ -4,6 +4,7 @@
NEWS
README.md
setup.py
+test.py
pysmbc.egg-info/PKG-INFO
pysmbc.egg-info/SOURCES.txt
pysmbc.egg-info/dependency_links.txt
@@ -20,9 +21,6 @@
smbc/smbcmodule.c
smbc/smbcmodule.h
smbc/xattr.py
-tests/settings.py
-tests/test_acl.py
-tests/test_auth.py
-tests/test_context.py
-tests/test_dir.py
-tests/test_file.py
\ No newline at end of file
+tests/__init__.py
+tests/conftest.py
+tests/test_auth.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.22/setup.py new/pysmbc-1.0.23/setup.py
--- old/pysmbc-1.0.22/setup.py 2020-05-19 13:38:32.000000000 +0200
+++ new/pysmbc-1.0.23/setup.py 2020-10-26 03:35:07.000000000 +0100
@@ -79,12 +79,15 @@
stdout=subprocess.PIPE)
(stdout, stderr) = c.communicate()
vers = stdout.decode('ascii').rstrip().split('.')
- ver = str(int(vers[0]) * 10000 + int(vers[1]) * 100 + int(vers[2]))
+ if len(vers) == 3:
+ ver = str(int(vers[0]) * 10000 + int(vers[1]) * 100 + int(vers[2]))
+ else:
+ ver = str(int(vers[0]))
return [(prefix + 'VERSION', ver)]
setup(
name="pysmbc",
- version="1.0.22",
+ version="1.0.23",
description="Python bindings for libsmbclient",
long_description=__doc__,
author=[
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.22/smbc/context.c new/pysmbc-1.0.23/smbc/context.c
--- old/pysmbc-1.0.22/smbc/context.c 2020-05-19 13:33:50.000000000 +0200
+++ new/pysmbc-1.0.23/smbc/context.c 2020-10-22 17:19:20.000000000 +0200
@@ -25,8 +25,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <Python.h>
-#include <string.h>
#include "smbcmodule.h"
#include "context.h"
#include "dir.h"
@@ -143,16 +141,6 @@
self->auth_fn = auth;
}
-#if SMBCLIENT_VERSION < 500 /* Older than 0.5.0 */
- if(proto)
- {
- debugprintf ("-> Setting client max protocol to %s\n", proto);
- lp_set_cmdline("client max protocol", proto);
- debugprintf ("-> Setting client min protocol to %s\n", proto);
- lp_set_cmdline("client min protocol", proto);
- }
-#endif
-
debugprintf ("-> Context_init ()\n");
errno = 0;
@@ -170,13 +158,17 @@
smbc_setOptionUserData (ctx, self);
if (auth)
smbc_setFunctionAuthDataWithContext (ctx, auth_fn);
-#if SMBCLIENT_VERSION >= 500 /* 0.5.0 or newer */
if(proto)
{
- debugprintf ("-> Setting client min/max protocol to %s\n", proto);
- smbc_setOptionProtocols (ctx, proto, proto);
- }
+#if SMBCLIENT_VERSION >= 500 /* 0.5.0 or newer */
+ debugprintf("-> Setting client min/max protocol to %s by smbc_setOptionProtocols\n", proto);
+ smbc_setOptionProtocols(ctx, proto, proto);
+#else
+ debugprintf("-> Setting client min/max protocol to %s by smbc_option_set\n", proto);
+ smbc_option_set(ctx, "client max protocol", proto);
+ smbc_option_set(ctx, "client min protocol", proto);
#endif
+ }
if (smbc_init_context (ctx) == NULL)
{
@@ -586,64 +578,43 @@
*/
static PyObject *
Context_getxattr (Context *self, PyObject *args)
-{
- int ret;
- char *uri = NULL;
- char *name = NULL;
- char *buffer = NULL;
- static smbc_getxattr_fn fn;
-
- // smbc_getxattr takes two string parameters
- if (!PyArg_ParseTuple (args, "ss", &uri, &name))
- {
- return NULL;
- }
-
- /* The security descriptor string returned by this call will vary depending on the requested attribute
- * A call with system.nt_sec_desc.* will return the longest string which would be in the following format:
- *
- * REVISION:<revision number>,OWNER:<sid>,GROUP:<sid>,ACL:<sid>:<type>/<flags>/<mask>
- *
- * There could be multiple ACL entries up to a reasonable maximum of 1820.
- *
- * <revision number> : 3 chars
- * <sid> : 184 chars
- * <type>: 1 char
- * <flags>: 3 chars
- * <mask>: 10 chars
- *
- * The maximum size of the security descriptor string returned can be
- * derived as follows (includes space for terminating null):
- * Sec Desc = 13 + 2 x (7 + <sid>) + 1820 * (5 + <acl>) = 375315
- *
- * References: https://msdn.microsoft.com/en-us/library/cc246018.aspx
- * https://technet.microsoft.com/en-us/library/cc961995.aspx
- * https://technet.microsoft.com/en-us/library/cc961986.aspx
- */
-
- size_t size = 375315;
- buffer = (char *)malloc (size);
- if(!buffer)
- return PyErr_NoMemory ();
-
- bzero(buffer, size);
-
- errno = 0;
- fn = smbc_getFunctionGetxattr(self->context);
- ret = (*fn)(self->context, uri, name, buffer, size);
-
- if (ret < 0)
- {
- pysmbc_SetFromErrno ();
- free(buffer);
- return NULL;
- }
-
- PyObject *value = PyUnicode_FromString(buffer);
- free(buffer);
-
- return value;
-}
+ {
+ PyObject * result = NULL;
+ char *uri = NULL;
+ char *name = NULL;
+ char *buffer = NULL;
+ int ret;
+ do /*once*/
+ {
+ if (!PyArg_ParseTuple(args, "ss", &uri, &name))
+ break;
+ const smbc_getxattr_fn fn = smbc_getFunctionGetxattr(self->context);
+ errno = 0;
+ ret = fn(self->context, uri, name, NULL, 0);
+ if (ret < 0)
+ {
+ pysmbc_SetFromErrno();
+ break;
+ }
+ const int bufsize = ret + 1;
+ buffer = (char *)malloc(bufsize);
+ if (buffer == NULL)
+ {
+ PyErr_NoMemory();
+ break;
+ } /*if*/
+ ret = fn(self->context, uri, name, buffer, bufsize);
+ if (ret < 0)
+ {
+ pysmbc_SetFromErrno();
+ break;
+ } /*if*/
+ result = PyUnicode_FromString(buffer);
+ }
+ while (false);
+ free(buffer);
+ return result;
+ } /*Context_getxattr*/
/**
@@ -805,7 +776,12 @@
return -1;
}
- chars = PyUnicode_GetSize (value); /* not including NUL */
+#if PY_MAJOR_VERSION > 3
+ chars = PyUnicode_GET_LENGTH(value);
+#else
+ chars = PyUnicode_GET_SIZE(value); /* not including NUL */
+#endif
+
w_name = malloc ((chars + 1) * sizeof (wchar_t));
if (!w_name)
{
@@ -874,7 +850,12 @@
return -1;
}
- chars = PyUnicode_GetSize (value); /* not including NUL */
+#if PY_MAJOR_VERSION > 3
+ chars = PyUnicode_GET_LENGTH(value);
+#else
+ chars = PyUnicode_GET_SIZE(value); /* not including NUL */
+#endif
+
w_workgroup = malloc ((chars + 1) * sizeof (wchar_t));
if (!w_workgroup)
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.22/smbc/dir.c new/pysmbc-1.0.23/smbc/dir.c
--- old/pysmbc-1.0.22/smbc/dir.c 2020-05-19 13:33:50.000000000 +0200
+++ new/pysmbc-1.0.23/smbc/dir.c 2020-10-22 17:17:16.000000000 +0200
@@ -18,7 +18,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <Python.h>
#include "smbcmodule.h"
#include "context.h"
#include "dir.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.22/smbc/file.c new/pysmbc-1.0.23/smbc/file.c
--- old/pysmbc-1.0.22/smbc/file.c 2020-05-19 13:33:50.000000000 +0200
+++ new/pysmbc-1.0.23/smbc/file.c 2020-10-22 17:17:30.000000000 +0200
@@ -23,7 +23,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <Python.h>
#include "smbcmodule.h"
#include "context.h"
#include "file.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.22/smbc/smbcdirent.c new/pysmbc-1.0.23/smbc/smbcdirent.c
--- old/pysmbc-1.0.22/smbc/smbcdirent.c 2019-09-27 10:36:50.000000000 +0200
+++ new/pysmbc-1.0.23/smbc/smbcdirent.c 2020-10-22 17:23:16.000000000 +0200
@@ -18,7 +18,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <Python.h>
#include "smbcmodule.h"
#include "smbcdirent.h"
@@ -55,9 +54,9 @@
Dirent_init (Dirent *self, PyObject *args, PyObject *kwds)
{
const char *name;
- int name_len;
+ Py_ssize_t name_len;
const char *comment;
- int comment_len;
+ Py_ssize_t comment_len;
unsigned int smbc_type;
static char *kwlist[] =
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.22/smbc/smbcmodule.c new/pysmbc-1.0.23/smbc/smbcmodule.c
--- old/pysmbc-1.0.22/smbc/smbcmodule.c 2019-09-27 10:36:50.000000000 +0200
+++ new/pysmbc-1.0.23/smbc/smbcmodule.c 2020-10-22 17:16:37.000000000 +0200
@@ -26,7 +26,6 @@
*/
#include <stdarg.h>
-#include <Python.h>
#include "smbcmodule.h"
#include "context.h"
#include "dir.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.22/smbc/smbcmodule.h new/pysmbc-1.0.23/smbc/smbcmodule.h
--- old/pysmbc-1.0.22/smbc/smbcmodule.h 2020-05-19 13:33:50.000000000 +0200
+++ new/pysmbc-1.0.23/smbc/smbcmodule.h 2020-10-22 17:20:18.000000000 +0200
@@ -23,7 +23,8 @@
#ifndef HAVE_SMBCMODULE_H
#define HAVE_SMBCMODULE_H
-
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
#include <stdbool.h>
#include <libsmbclient.h>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.22/test.py new/pysmbc-1.0.23/test.py
--- old/pysmbc-1.0.22/test.py 1970-01-01 01:00:00.000000000 +0100
+++ new/pysmbc-1.0.23/test.py 2020-10-14 18:03:53.000000000 +0200
@@ -0,0 +1,15 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import sys
+import smbc
+
+def main():
+ ctx = smbc.Context()
+ uri = 'smb://localhost'
+ entries = ctx.opendir(uri).getdents()
+ for d in entries:
+ print(d)
+
+if __name__ == '__main__':
+ main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.22/tests/conftest.py new/pysmbc-1.0.23/tests/conftest.py
--- old/pysmbc-1.0.22/tests/conftest.py 1970-01-01 01:00:00.000000000 +0100
+++ new/pysmbc-1.0.23/tests/conftest.py 2020-10-16 03:43:28.000000000 +0200
@@ -0,0 +1,22 @@
+import pytest
+
+def pytest_addoption(parser):
+ parser.addoption('--server', action='store', default='localhost')
+ parser.addoption('--share', action='store', default='share')
+ parser.addoption('--username', action='store', default='user1')
+ parser.addoption('--password', action='store', default='password1')
+
+(a)pytest.fixture(autouse=True, scope='session')
+def config(pytestconfig):
+ server = pytestconfig.getoption('server')
+ share = pytestconfig.getoption('share')
+ username = pytestconfig.getoption('username')
+ password = pytestconfig.getoption('password')
+ uri = 'smb://{}/{}/'.format(server, share)
+ yield {
+ 'server': server,
+ 'share': share,
+ 'username': username,
+ 'password': password,
+ 'uri': uri,
+ }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.22/tests/settings.py new/pysmbc-1.0.23/tests/settings.py
--- old/pysmbc-1.0.22/tests/settings.py 2019-09-27 10:36:50.000000000 +0200
+++ new/pysmbc-1.0.23/tests/settings.py 1970-01-01 01:00:00.000000000 +0100
@@ -1,13 +0,0 @@
-# This is setting template.
-# You must change these parameter if you perform test.
-# The following configration will create \\server\share\testdir
-# directory, so user should have write permission.
-
-WORKGROUP = "WORKGROUP"
-SERVER = "server"
-SHARE = "share"
-USERNAME = "username"
-PASSWORD = "password"
-TESTDIR = "testdir"
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.22/tests/test_acl.py new/pysmbc-1.0.23/tests/test_acl.py
--- old/pysmbc-1.0.22/tests/test_acl.py 2019-09-27 10:36:50.000000000 +0200
+++ new/pysmbc-1.0.23/tests/test_acl.py 1970-01-01 01:00:00.000000000 +0100
@@ -1,68 +0,0 @@
-import os
-import smbc
-import settings
-import nose
-from nose.plugins.skip import SkipTest
-
-
-""" Test acl parser
-
-
-"""
-
-class SmbAcl():
- revision = None
- owner = None
- group = None
- acl = []
-
- def __init__(self, xattr_s=None):
- """ parse an acl into a SmbAcl object """
- if xattr_s:
- xattr_l = [ s[s.index(":")+1:] for s in xattr_s.split(",")]
- (self.revision, self.owner, self.group) = xattr_l[0:3]
- self.acl = xattr_l[3:]
-
-
- def __str__(self):
- ret = "REVISION:%s,OWNER:%s,GROUP:%s" % (self.revision,self.owner,self.group)
- for a in self.acl:
- ret = ret + ",ACL:%s" % a
- return ret
-
- @staticmethod
- def get_target(acl_s):
- return acl_s[0:acl_s.index(":")]
-
- @staticmethod
- def get_perm(acl_s):
- return acl_s[acl_s.index(":")+1:]
-
-
-"""SmbAcl parser To be implemented"""
-def test_acl_parser():
- raise SkipTest("SmbAcl to be implemented")
-
- xattr_l = ["REVISION:1,OWNER:S-1-5-21-833659924-920326847-3160110649-3002,GROUP:S-1-22-2-1002,ACL:S-1-5-21-833659924-920326847-3160110649-3002:0/0/0x001e01ff,ACL:S-1-22-2-1002:0/0/0x00120089,ACL:S-1-1-0:0/0/0x00120089",
- #attrs(system.nt_sec_desc.*+):
- 'REVISION:1,OWNER:RPOLLI\\babel,GROUP:Unix Group\\babel,ACL:RPOLLI\\babel:0/0/0x001e01ff,ACL:Unix Group\\babel:0/0/0x00120089,ACL:\Everyone:0/0/0x00120089']
-
- for xattr_s in xattr_l:
- xattr = SmbAcl(xattr_s)
- print("xattr: %s" % xattr)
-
- assert xattr.revision
- assert xattr.owner
- assert xattr.group
- assert xattr.acl and len(xattr.acl)>1
-
-def test_acl_get_target():
- acl_l = ["S-1-5-21-833659924-920326847-3160110649-3002:0/0/0x001e01ff",
- "Unix Group\\babel:0/0/0x00120089"]
- for acl_s in acl_l:
- perm = SmbAcl.get_perm(acl_s)
- target = SmbAcl.get_target(acl_s)
-
- assert target
- assert perm
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.22/tests/test_auth.py new/pysmbc-1.0.23/tests/test_auth.py
--- old/pysmbc-1.0.22/tests/test_auth.py 2019-09-27 10:36:50.000000000 +0200
+++ new/pysmbc-1.0.23/tests/test_auth.py 2020-10-25 15:25:07.000000000 +0100
@@ -1,72 +1,43 @@
-#!/usr/bin/env python
-
import smbc
-import settings
-import sys
-
-def setUp():
- pass
-
-def tearDown():
- pass
-def test_AuthSuccess():
+def test_auth_succes(config):
ctx = smbc.Context()
ctx.optionNoAutoAnonymousLogin = True
- cb = lambda se, sh, w, u, p: (w, settings.USERNAME, settings.PASSWORD)
+ cb = lambda se, sh, w, u, p: (w, config['username'], config['password'])
ctx.functionAuthData = cb
- uri = 'smb://' + settings.SERVER + '/' + settings.SHARE
- try:
- dir = ctx.opendir(uri)
- print("ok: connection to ", uri)
- except:
- print("fail: connection to ", uri)
- assert False
+ d = ctx.opendir(config['uri'])
+ assert d != None
-def test_AuthFailNoauth():
+def test_auth_failed_noauth(config):
ctx = smbc.Context()
ctx.optionNoAutoAnonymousLogin = True
- uri = 'smb://' + settings.SERVER + '/' + settings.SHARE
try:
- dir = ctx.opendir(uri)
+ ctx.opendir(config['uri'])
except smbc.PermissionError:
- print("ok: permission error to ", uri)
- pass
- except:
- print("fail: error connecting to", uri)
- assert False
+ assert True
else:
- print("fail: error connecting to", uri)
assert False
-def test_AuthFailNopass():
+def test_auth_failed_nopass(config):
ctx = smbc.Context()
ctx.optionNoAutoAnonymousLogin = True
- cb = lambda se, sh, w, u, p: (w, settings.USERNAME, "")
+ cb = lambda se, sh, w, u, p: (w, config['username'], "")
ctx.functionAuthData = cb
- uri = 'smb://' + settings.SERVER + '/' + settings.SHARE
try:
- dir = ctx.opendir(uri)
+ ctx.opendir(config['uri'])
except smbc.PermissionError:
- pass
- except:
- assert False
+ assert True
else:
assert False
-def test_AuthFailNoname():
+def test_auth_failed_nouser(config):
ctx = smbc.Context()
ctx.optionNoAutoAnonymousLogin = True
- cb = lambda se, sh, w, u, p: (w, "", "")
+ cb = lambda se, sh, w, u, p: (w, "", config['password'])
ctx.functionAuthData = cb
- uri = 'smb://' + settings.SERVER + '/' + settings.SHARE
try:
- dir = ctx.opendir(uri)
+ ctx.opendir(config['uri'])
except smbc.PermissionError:
- pass
- except:
- assert False
+ assert True
else:
assert False
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.22/tests/test_context.py new/pysmbc-1.0.23/tests/test_context.py
--- old/pysmbc-1.0.22/tests/test_context.py 2019-09-27 10:36:50.000000000 +0200
+++ new/pysmbc-1.0.23/tests/test_context.py 1970-01-01 01:00:00.000000000 +0100
@@ -1,195 +0,0 @@
-#!/usr/bin/env python
-import os
-import smbc
-import settings
-import nose
-from nose.plugins.skip import SkipTest
-
-
-baseurl = 'smb://' + settings.SERVER + "/" + settings.SHARE +"/"
-
-
-# a nice map from/to smbc constants
-smbcType = {
- 'WORKGROUP' : smbc.WORKGROUP,
- 'SERVER' : smbc.SERVER,
- 'FILE_SHARE' : smbc.FILE_SHARE,
- 'PRINTER_SHARE' : smbc.PRINTER_SHARE,
- 'IPC_SHARE' : smbc.IPC_SHARE,
-
- smbc.WORKGROUP : 'WORKGROUP',
- smbc.SERVER : 'SERVER',
- smbc.FILE_SHARE : 'FILE_SHARE',
- smbc.PRINTER_SHARE : 'PRINTER_SHARE',
- smbc.IPC_SHARE : 'IPC_SHARE'
-}
-
-# another map for system errors TODO can you find them in another module?
-EINVAL = 22
-
-def setUp():
- global ctx
- ctx = smbc.Context()
- cb = lambda se, sh, w, u, p: (w, settings.USERNAME, settings.PASSWORD)
- ctx.functionAuthData = cb
-
-
-def tearDown():
- global ctx
- del ctx
-
-def touch_file(name):
- """
- create a file containing "sample test file" in the test baseurl
- """
- tmpfile_name = baseurl + name
- dfile = ctx.open(tmpfile_name, os.O_CREAT | os.O_TRUNC | os.O_WRONLY)
- dfile.write("sample test file")
- dfile.close
- return tmpfile_name
-
-
-def test_xattr_constants():
- assert smbc.XATTR_ACL
- assert smbc.XATTR_OWNER
- assert smbc.XATTR_GROUP
-
-
-def test_xattr_get():
- """
- system.nt_sec_desc.<attribute name>
- * system.nt_sec_desc.*
- * system.nt_sec_desc.*+
- *
- * where <attribute name> is one of:
- *
- * revision
- * owner
- * owner+
- * group
- * group+
- * acl:<name or sid>
- * acl+:<name or sid
- """
- print("test_xattr")
- furl = touch_file("tmpfile.out")
-
- # create all combinations of attribute strings
- plus_xattrs = ["%s%s" % (i,j) for i in ["owner", "group", "*"] for j in ["","+"]]
- plus_xattrs.append("revision")
- valid_xatts = ["system.nt_sec_desc." +i for i in plus_xattrs]
-
- # check their existence
- for xattr in valid_xatts:
- print("\ttesting %s with %s" % (furl, xattr))
- assert(ctx.getxattr(furl, xattr))
- ctx.open(furl)
-
-def test_xattr_get_error():
- """ Verify that a RuntimeError is raised when passing bad arguments to getxattr()
-
- Bad arguments include malformed xattrs and unexistent file
- """
- print("test_xattr")
- furl = touch_file("tmpfile.out")
-
- # create all combinations of attribute strings
- plus_xattrs = ["%s%s" % (i,j) for i in ["owner", "pluto", "*"] for j in ["x","-"]]
- plus_xattrs.append("revisionX")
- invalid_xatts = ["system.nt_sec_desc." +i for i in plus_xattrs]
-
- try:
- ctx.getxattr("UNEXISTENT", smbc.XATTR_OWNER)
- assert False, "getxattr should fail with an unexistent file"
- except ValueError as e:
- (errno,strerror) = e.args
- assert errno == EINVAL # TODO is it possible to trap an unexistent entity error from smbclient?
- pass
-
- # check their existence
- for xattr in invalid_xatts:
- print("\ttesting %s with %s" % (furl, xattr))
- try:
- ctx.getxattr(furl, xattr)
- assert False, "getxattr should fail with %s" % xattr
- except ValueError as e:
- (errno,strerror) = e.args
- assert errno == EINVAL # invalid arguments
-
- ctx.open(furl)
-
-def test_xattr_set():
- #raise SkipTest("xattr_set to be implemented")
- print("test_xattr_put")
- furl = touch_file("tmpfile_set.out")
- attr_name = smbc.XATTR_ALL
- attrs = ctx.getxattr(furl, attr_name)
- print("attrs(%s): %s" % (attr_name, attrs))
- ctx.setxattr(furl, attr_name, attrs, smbc.XATTR_FLAG_REPLACE)
- attrs1 = ctx.getxattr(furl, attr_name)
- print("attrs1(%s): %s" % (attr_name, attrs1))
- assert attrs1 == attrs
-
-@SkipTest
-def test_xattr_set_2():
- furl = touch_file("tmpfile_set.out")
- attrs_new = u'REVISION:1,OWNER:RPOLLI\\babel" \
- + ",GROUP:Unix Group\\babel" \
- + ",ACL:RPOLLI\\babel:0/0/0x001e01ff" \
- + ",ACL:Unix Group\\babel:0/0/0x00120089" \
- + ",ACL:Unix Group\\games:0/0/0x001e01ff" \
- + ",ACL:\\Everyone:0/0/0x00120089'
- attr_name = smbc.XATTR_ALL_SID
- attrs_0 = ctx.getxattr(furl, attr_name)
- print("original attrs(%s)" % attrs_0)
-
- assert attrs_0 != attrs_new, "Old and new attributes are the same:\n%s\n%s\n" % (attrs_0, attrs_new)
-
- ctx.setxattr(furl, attr_name, attrs_new, smbc.XATTR_FLAG_REPLACE)
- attrs_1 = ctx.getxattr(furl, attr_name)
-
- print("attrs_1(%s): %s" % (attr_name, attrs_1))
- assert attrs_1 == attrs_new
-
-def test_xattr_set_error():
- #raise SkipTest("xattr_set to be implemented")
- print("test_xattr_set_error")
- furl = touch_file("tmpfile_set.out")
- attr_name = smbc.XATTR_ALL_SID
- attrs_ok = ctx.getxattr(furl, attr_name)
- attrs = "BAD_VALUE" # causes segfault
- for xa in ["BAD_VALUE", u'REVISION:1,OWNER:RPOLLI\\babel,GROUP:', 0, None]:
- try:
- ctx.setxattr(furl, attr_name, xa, smbc.XATTR_FLAG_REPLACE)
- except ValueError as e:
- (errno,strerror) = e.args
- assert errno == EINVAL # invalid arguments
- print("setxattr(%s) raises %s" % (xa, e))
- pass
- except TypeError as e:
- print("setxattr(%s) raises %s" % (xa, e))
- pass
-
-
-
-def test_Workgroup():
- l_entries = ctx.opendir('smb://').getdents()
- assert(len(l_entries) > 0)
- for entry in l_entries:
- assert(entry.smbc_type == smbc.WORKGROUP), "Entry %s of type %s, expected %s" % (entry.name, smbcType[entry.smbc_type], smbcType[smbc.WORKGROUP])
-
-def test_Server():
- uri = 'smb://' + settings.WORKGROUP
- l_entries = ctx.opendir(uri).getdents()
- assert(len(l_entries) > 0)
- for entry in l_entries:
- assert(entry.smbc_type == smbc.SERVER), "Entry %s of type %s, expected %s" % (entry.name, smbcType[entry.smbc_type], smbcType[smbc.SERVER])
-
-def test_Share():
- uri = 'smb://' + settings.SERVER
- l_entries = ctx.opendir(uri).getdents()
-
- allowed_shares = [smbc.FILE_SHARE, smbc.PRINTER_SHARE, smbc.IPC_SHARE, smbc.COMMS_SHARE]
- assert(len(l_entries) > 0)
- for entry in l_entries:
- assert (entry.smbc_type in allowed_shares), "Entry was %s (%d), expected values: %s" % (smbcType[entry.smbc_type], entry.smbc_type, allowed_shares)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.22/tests/test_dir.py new/pysmbc-1.0.23/tests/test_dir.py
--- old/pysmbc-1.0.22/tests/test_dir.py 2019-09-27 10:36:50.000000000 +0200
+++ new/pysmbc-1.0.23/tests/test_dir.py 1970-01-01 01:00:00.000000000 +0100
@@ -1,73 +0,0 @@
-#!/usr/bin/env python
-
-import smbc
-import settings
-import stat
-
-basedir = 'smb://' + settings.SERVER + '/' + settings.SHARE + '/'
-testdir = basedir + '/' + settings.TESTDIR
-
-def auth_fn(server, share, workgroup, username, password):
- return (workgroup, settings.USERNAME, settings.PASSWORD)
-
-def setUp():
- global ctx
- ctx = smbc.Context()
- ctx.optionNoAutoAnonymousLogin = True
- ctx.functionAuthData = auth_fn
-
-def tearDown():
- global ctx
- del ctx
-
-def test_Mkdir():
- ret = ctx.mkdir(testdir, 0)
- assert(ret == 0)
-
-def test_MkdirFail():
- try:
- ret = ctx.mkdir(testdir)
- except smbc.ExistsError:
- pass
- except:
- assert False
- else:
- assert False
- assert True
-
-def test_ListDir():
- list = ctx.opendir(testdir).getdents()
- assert(len(list) == 2)
-
-def test_Stat():
- st = ctx.stat(testdir)
- mode = st[stat.ST_MODE]
- assert(stat.S_ISDIR(mode))
- assert(stat.S_ISREG(mode) == False)
-
-def test_Rename():
- src = testdir + '/dir1'
- dst = testdir + '/dir2'
- ret = ctx.mkdir(src)
- assert(ret == 0)
- ret = ctx.rename(src, dst)
- assert(ret == 0)
-
-def test_StatFail():
- uri = testdir + '/dir1'
- try:
- ctx.stat(uri)
- except smbc.NoEntryError:
- pass
- except:
- assert False
-
-def test_Rmdir():
- uri = testdir + '/dir2'
- ret = ctx.rmdir(uri)
- assert(ret == 0)
-
-def test_Cleanup():
- ret = ctx.rmdir(testdir)
- assert(ret == 0)
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.22/tests/test_file.py new/pysmbc-1.0.23/tests/test_file.py
--- old/pysmbc-1.0.22/tests/test_file.py 2019-09-27 10:36:50.000000000 +0200
+++ new/pysmbc-1.0.23/tests/test_file.py 1970-01-01 01:00:00.000000000 +0100
@@ -1,167 +0,0 @@
-#!/usr/bin/env python
-
-import smbc
-import settings
-import hashlib
-import os
-
-basedir = 'smb://' + settings.SERVER + '/' + settings.SHARE + '/'
-testdir = basedir + '/' + settings.TESTDIR
-
-def auth_fn(server, share, workgroup, username, password):
- return (workgroup, settings.USERNAME, settings.PASSWORD)
-
-def creat_randfile(path, size):
- rand = open('/dev/urandom', 'rb')
- file = open(path, 'wb')
- buf = rand.read(size)
- file.write(buf)
- file.close()
- rand.close()
-
-def md(path):
- m = hashlib.md5()
- file = open(path, 'rb')
- m.update(file.read())
- file.close()
- return m.hexdigest()
-
-def upload_simple(spath, ctx, duri):
- sfile = open(spath, 'rb')
- dfile = ctx.open(duri, os.O_CREAT | os.O_TRUNC | os.O_WRONLY)
- ret = dfile.write(sfile.read())
- if ret < 0:
- raise IOError("smbc write error")
- sfile.close()
- dfile.close()
- return True
-
-def download_simple(ctx, suri, dpath):
- sfile = ctx.open(suri, os.O_RDONLY)
- dfile = open(dpath, 'wb')
- dfile.write(sfile.read())
- dfile.flush()
- sfile.close()
- dfile.close()
- return True
-
-def upload_buffer(spath, ctx, duri):
- sfile = open(spath, 'rb')
- dfile = ctx.open(duri, os.O_CREAT | os.O_TRUNC | os.O_WRONLY)
- while True:
- buf = sfile.read(8192)
- if not buf:
- break
- ret = dfile.write(buf)
- if ret < 0:
- raise IOError("smbc write error")
- sfile.close()
- dfile.close()
- return True
-
-def download_buffer(ctx, suri, dpath):
- sfile = ctx.open(suri, os.O_RDONLY)
- dfile = open(dpath, 'wb')
- while True:
- buf = sfile.read(8192)
- if not buf:
- break
- dfile.write(buf)
- dfile.flush()
- sfile.close()
- dfile.close()
- return True
-
-def upload_iter(spath, ctx, duri):
- sfile = open(spath, 'rb')
- dfile = ctx.open(duri, os.O_CREAT | os.O_TRUNC | os.O_WRONLY)
- for buf in sfile:
- ret = dfile.write(buf)
- if ret < 0:
- raise IOError("smbc write error")
- sfile.close()
- dfile.close()
- return True
-
-def download_iter(ctx, suri, dpath):
- sfile = ctx.open(suri, os.O_RDONLY)
- dfile = open(dpath, 'wb')
- for buf in sfile:
- dfile.write(buf)
- dfile.flush()
- sfile.close()
- dfile.close()
- return True
-
-def setUp():
- global ctx
- ctx = smbc.Context()
- ctx.optionNoAutoAnonymousLogin = True
- ctx.functionAuthData = auth_fn
-
-def tearDown():
- global ctx
- del ctx
-
-def test_copy_simple_1k():
- creat_randfile('test1.dat', 1000)
- testfile = basedir + '/' + 'test1.dat'
- upload_simple('test1.dat', ctx, testfile)
- download_simple(ctx, testfile, 'test2.dat')
- assert(md('test1.dat') == md('test2.dat'))
-
-def test_copy_simple_100k():
- creat_randfile('test1.dat', 10000)
- testfile = basedir + '/' + 'test1.dat'
- upload_simple('test1.dat', ctx, testfile)
- download_simple(ctx, testfile, 'test2.dat')
- assert(md('test1.dat') == md('test2.dat'))
-
-def test_copy_simple_1M():
- creat_randfile('test1.dat', 1000000)
- testfile = basedir + '/' + 'test1.dat'
- upload_simple('test1.dat', ctx, testfile)
- download_simple(ctx, testfile, 'test2.dat')
- assert(md('test1.dat') == md('test2.dat'))
-
-def test_copy_buffer_1k():
- creat_randfile('test1.dat', 1000)
- testfile = basedir + '/' + 'test1.dat'
- upload_buffer('test1.dat', ctx, testfile)
- download_buffer(ctx, testfile, 'test2.dat')
- assert(md('test1.dat') == md('test2.dat'))
-
-def test_copy_buffer_100k():
- creat_randfile('test1.dat', 10000)
- testfile = basedir + '/' + 'test1.dat'
- upload_buffer('test1.dat', ctx, testfile)
- download_buffer(ctx, testfile, 'test2.dat')
- assert(md('test1.dat') == md('test2.dat'))
-
-def test_copy_buffer_1M():
- creat_randfile('test1.dat', 1000000)
- testfile = basedir + '/' + 'test1.dat'
- upload_buffer('test1.dat', ctx, testfile)
- download_buffer(ctx, testfile, 'test2.dat')
- assert(md('test1.dat') == md('test2.dat'))
-
-def test_copy_iter_1k():
- creat_randfile('test1.dat', 1000)
- testfile = basedir + '/' + 'test1.dat'
- upload_iter('test1.dat', ctx, testfile)
- download_iter(ctx, testfile, 'test2.dat')
- assert(md('test1.dat') == md('test2.dat'))
-
-def test_copy_iter_100k():
- creat_randfile('test1.dat', 10000)
- testfile = basedir + '/' + 'test1.dat'
- upload_iter('test1.dat', ctx, testfile)
- download_iter(ctx, testfile, 'test2.dat')
- assert(md('test1.dat') == md('test2.dat'))
-
-def test_copy_iter_1M():
- creat_randfile('test1.dat', 1000000)
- testfile = basedir + '/' + 'test1.dat'
- upload_iter('test1.dat', ctx, testfile)
- download_iter(ctx, testfile, 'test2.dat')
- assert(md('test1.dat') == md('test2.dat'))
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-gobject for openSUSE:Factory checked in at 2021-01-15 19:43:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-gobject (Old)
and /work/SRC/openSUSE:Factory/.python-gobject.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-gobject"
Fri Jan 15 19:43:01 2021 rev:84 rq:863093 version:3.38.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-gobject/python-gobject.changes 2020-11-23 10:44:10.398223903 +0100
+++ /work/SRC/openSUSE:Factory/.python-gobject.new.28504/python-gobject.changes 2021-01-15 19:43:02.557722604 +0100
@@ -1,0 +2,8 @@
+Wed Jan 13 08:28:34 UTC 2021 - Dominique Leuenberger <dimstar(a)opensuse.org>
+
+- Simplify the dependency exclusion from __init__.py to also match
+ with multiple python3-flavors.
+- Remove exec bit from all *.py files in examples, also
+ subdirectories.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-gobject.spec ++++++
--- /var/tmp/diff_new_pack.8Fzyh5/_old 2021-01-15 19:43:03.081723462 +0100
+++ /var/tmp/diff_new_pack.8Fzyh5/_new 2021-01-15 19:43:03.085723469 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-gobject
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
# This figures in an error message
%global __requires_exclude typelib\\(%%namespaces\\)
-%global __requires_exclude_from ^%{python2_sitearch}/gi/__init__.py|%{python3_sitearch}/gi/__init__.py$
+%global __requires_exclude_from ^%{_libdir}/python.*/site-packages/gi/__init__.py$
%define _name pygobject
Name: python-gobject
Version: 3.38.0
@@ -107,7 +107,7 @@
%prep
%setup -q -n %{_name}-%{version}
# Remove the executable bits from example scripts:
-chmod -R -x examples/*.py
+find examples -name '*.py' -exec chmod -R -x {} +
%build
export CFLAGS="%{optflags}"
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package qpid-proton for openSUSE:Factory checked in at 2021-01-15 19:43:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/qpid-proton (Old)
and /work/SRC/openSUSE:Factory/.qpid-proton.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "qpid-proton"
Fri Jan 15 19:43:00 2021 rev:19 rq:863025 version:0.31.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/qpid-proton/qpid-proton.changes 2020-12-03 18:38:18.725707892 +0100
+++ /work/SRC/openSUSE:Factory/.qpid-proton.new.28504/qpid-proton.changes 2021-01-15 19:43:01.245720454 +0100
@@ -1,0 +2,5 @@
+Wed Jan 13 18:52:43 UTC 2021 - Benjamin Greiner <code(a)bnavigator.de>
+
+- Remove explicit python runtime requirements on full standard lib
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ qpid-proton.spec ++++++
--- /var/tmp/diff_new_pack.h22NMK/_old 2021-01-15 19:43:01.857721457 +0100
+++ /var/tmp/diff_new_pack.h22NMK/_new 2021-01-15 19:43:01.861721463 +0100
@@ -132,7 +132,6 @@
Summary: Python language bindings for the Qpid Proton messaging framework
Group: Development/Libraries/Python
Requires: libqpid-proton%{qpid_proton_soversion} = %{version}-%{release}
-Requires: python = %{python_version}
# These will automatically be rewritten for the python flavors
# including additional python- for python2 and python3- for the primary provider
# flavor
@@ -152,7 +151,6 @@
Summary: Python language bindings for the Qpid Proton messaging framework
Group: Development/Libraries/Python
Requires: libqpid-proton%{qpid_proton_soversion} = %{version}-%{release}
-Requires: python = %{python2_version}
Provides: python-qpid-proton = %{version}
Obsoletes: python-qpid-proton < %{version}
# as long as python2 is the default, provide also the non-versioned python pkg
@@ -168,7 +166,6 @@
Summary: Python language bindings for the Qpid Proton messaging framework
Group: Development/Libraries/Python
Requires: libqpid-proton%{qpid_proton_soversion} = %{version}-%{release}
-Requires: python = %{python_version}
Provides: python3-qpid-proton = %{version}
Obsoletes: python3-qpid-proton < %{version}
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-typing_extensions for openSUSE:Factory checked in at 2021-01-15 19:42:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-typing_extensions (Old)
and /work/SRC/openSUSE:Factory/.python-typing_extensions.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-typing_extensions"
Fri Jan 15 19:42:58 2021 rev:11 rq:862675 version:3.7.4.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-typing_extensions/python-typing_extensions.changes 2020-12-30 17:11:06.989274069 +0100
+++ /work/SRC/openSUSE:Factory/.python-typing_extensions.new.28504/python-typing_extensions.changes 2021-01-15 19:42:59.381717399 +0100
@@ -1,0 +2,11 @@
+Tue Jan 12 16:06:44 UTC 2021 - Benjamin Greiner <code(a)bnavigator.de>
+
+- Test in separate multibuild flavor to break depcycles with full
+ python stdlib
+
+-------------------------------------------------------------------
+Tue Jan 12 14:44:39 UTC 2021 - Benjamin Greiner <code(a)bnavigator.de>
+
+- clean requirements specifications for python flavors
+
+-------------------------------------------------------------------
New:
----
_multibuild
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-typing_extensions.spec ++++++
--- /var/tmp/diff_new_pack.Yp8BXf/_old 2021-01-15 19:42:59.889718232 +0100
+++ /var/tmp/diff_new_pack.Yp8BXf/_new 2021-01-15 19:42:59.889718232 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-typing_extensions
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,15 @@
%define modname typing_extensions
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without python2
-Name: python-typing_extensions
+%global flavor @BUILD_FLAVOR@%{nil}
+%if "%{flavor}" == "test"
+%define psuffix -test
+%bcond_without test
+%else
+%define psuffix %{nil}
+%bcond_with test
+%endif
+Name: python-typing_extensions%{psuffix}
Version: 3.7.4.3
Release: 0
Summary: Backported and Experimental Type Hints for Python 35+
@@ -31,19 +39,14 @@
BuildRequires: python-rpm-macros
BuildArch: noarch
Provides: python-typing-extensions = %{version}
-%if %{with python2}
-BuildRequires: python-typing >= 3.7.4
-%endif
-%if 0%{?suse_version} < 1500
-BuildRequires: python3-typing >= 3.7.4
-%endif
-%if 0%{?suse_version} > 1320
+%if 0%{?suse_version} > 1320 && %{with test}
BuildRequires: %{python_module testsuite}
%endif
-%if %{python3_version_nodots} < 35
-Requires: python-typing >= 3.7.4
+%if %{with python2}
+BuildRequires: python-typing >= 3.7.4
%endif
-%ifpython2
+BuildRequires: (python3-typing >= 3.7.4 if python3-base < 3.5)
+%if %{python_version_nodots} < 35
Requires: python-typing >= 3.7.4
%endif
%python_subpackages
@@ -71,19 +74,27 @@
%build
%python_build
+%if ! %{with test}
%install
%python_install
-%fdupes %{buildroot}%{python3_sitelib}
+%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%endif
+%if %{with test}
%check
# X.Y -> X
%{python_expand current_bin_suffix=%{$python_bin_suffix}
$python src_py${current_bin_suffix:0:1}/test_typing_extensions.py
}
+%endif
+%if ! %{with test}
%files %{python_files}
%license LICENSE
%doc README.rst
-%{python_sitelib}/*
+%{python_sitelib}/typing_extensions.py*
+%pycache_only %{python_sitelib}/__pycache__/typing_extensions*
+%{python_sitelib}/typing_extensions-%{version}*-info
+%endif
%changelog
++++++ _multibuild ++++++
<multibuild>
<package>test</package>
</multibuild>
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-rpm-macros for openSUSE:Factory checked in at 2021-01-15 19:42:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-rpm-macros (Old)
and /work/SRC/openSUSE:Factory/.python-rpm-macros.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-rpm-macros"
Fri Jan 15 19:42:56 2021 rev:33 rq:862532 version:20210112.86f4d9d
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-rpm-macros/python-rpm-macros.changes 2020-08-28 21:17:58.968225809 +0200
+++ /work/SRC/openSUSE:Factory/.python-rpm-macros.new.28504/python-rpm-macros.changes 2021-01-15 19:42:57.349714070 +0100
@@ -1,0 +2,128 @@
+Tue Jan 12 07:18:43 UTC 2021 - mcepl(a)cepl.eu
+
+- Update to version 20210112.86f4d9d:
+ * fix gh#openSUSE/python-rpm-macros#84: python_sysconfig_ macros
+
+-------------------------------------------------------------------
+Mon Dec 07 17:09:23 UTC 2020 - mcepl(a)cepl.eu
+
+- Update to version 20201207.2177fcf:
+ * README update after merge
+
+-------------------------------------------------------------------
+Mon Dec 07 16:31:52 UTC 2020 - mcepl(a)cepl.eu
+
+- Update to version 20201207.259cdda:
+ * Update python_expand description in README
+ * python_expand to basename only
+
+-------------------------------------------------------------------
+Fri Dec 04 09:47:39 UTC 2020 - mcepl(a)cepl.eu
+
+- Update to version 20201204.32a910e:
+ * fix print_provided_flavor again
+
+-------------------------------------------------------------------
+Thu Dec 03 07:08:14 UTC 2020 - mcepl(a)cepl.eu
+
+- Update to version 20201203.5331183:
+ * fix print_provided_flavor
+
+-------------------------------------------------------------------
+Sat Nov 28 22:11:52 UTC 2020 - mcepl(a)cepl.eu
+
+- Update to version 20201128.669edb3:
+ * fix provides (for python-numpy f2py, in gh#openSUSE/python-rpm-macros#66)
+
+-------------------------------------------------------------------
+Mon Nov 23 14:41:05 UTC 2020 - mcepl(a)cepl.eu
+
+- Update to version 20201123.6978323:
+ * also rewrite subpackage_only default providers
+ * pytest: ignore _build dirs for all flavors
+
+-------------------------------------------------------------------
+Thu Nov 19 07:53:17 UTC 2020 - mcepl(a)cepl.eu
+
+- Update to version 20201119.6bb5f69:
+ * add default provider properties
+ * don't replace %name, for subpackage_only
+ * expand parameters for subpackage_only packages
+
+-------------------------------------------------------------------
+Thu Nov 12 18:19:15 UTC 2020 - mcepl(a)cepl.eu
+
+- Update to version 20201112.a4c80dc:
+ * handle python_subpackage_only, fixes gh#openSUSE/python-rpm-macros#73
+ * define default providers for pythonX from pythonXY flavors: fixes #69
+
+-------------------------------------------------------------------
+Tue Nov 03 20:59:11 UTC 2020 - mcepl(a)cepl.eu
+
+- Update to version 20201103.cec67c2:
+ * document python_find_lang
+ * add python_find_lang and allow to specify in %python_files. Fixes #5
+
+-------------------------------------------------------------------
+Mon Nov 02 18:34:58 UTC 2020 - mcepl(a)cepl.eu
+
+- Update to version 20201102.31ccfc2:
+ * fix python_clone shebang replacement
+ * one less expansion for python_exec
+ * expand default %python_ macros earlier
+ * update README for multiple flavors
+ * more command delimiters for %python_expand
+
+-------------------------------------------------------------------
+Thu Oct 22 18:47:52 UTC 2020 - mcepl(a)cepl.eu
+
+- Update to version 20201022.7f87908:
+ * Add python36 and python38 flavours.
+
+-------------------------------------------------------------------
+Wed Oct 21 11:22:16 UTC 2020 - mcepl(a)cepl.eu
+
+- Update to version 20201021.adb6953:
+ * Prepare for multiple python3 flavors
+- Remove multiple_flavors.patch as it is included in the upstream
+ tarball.
+
+-------------------------------------------------------------------
+Fri Oct 16 20:05:52 UTC 2020 - mcepl(a)cepl.eu
+
+- Update to version 20201016.5d22545:
+ * fix whitespace after escape in compileall macro
+
+-------------------------------------------------------------------
+Fri Oct 16 14:31:59 UTC 2020 - mcepl(a)cepl.eu
+
+- Update to version 20201016.db09189:
+ * Delete pycache files before compilealll
+ * Update macros/010-common-defs
+ * Reword compileall
+ * mention pyproject.toml and link to PEP517 and PEP518
+ * add description for pyunittest macro
+ * add description for python_compileall macro
+ * add description for pyproject macros
+ * add python_compileall macro and use it in pyproject_install
+ * disable pip version check: no connection to pypi.org
+
+-------------------------------------------------------------------
+Tue Sep 22 19:29:03 UTC 2020 - Matej Cepl <mcepl(a)suse.com>
+
+- Update multiple_flavors.patch to generate correct names of the
+ python binary.
+
+-------------------------------------------------------------------
+Wed Sep 9 18:00:03 UTC 2020 - Matej Cepl <mcepl(a)suse.com>
+
+- %__#FLAVOR# should be defined as
+ /usr/bin/python%{#FLAVOR#_version} not just /usr/bin/#FLAVOR#
+
+-------------------------------------------------------------------
+Wed Sep 2 11:44:33 UTC 2020 - Matej Cepl <mcepl(a)suse.com>
+
+- Add patch multiple_flavors.patch which makes compile_macros.sh
+ generate alternative flavours as well.
+
+-------------------------------------------------------------------
Old:
----
python-rpm-macros-20200824.8fa42a7.tar.xz
New:
----
python-rpm-macros-20210112.86f4d9d.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-rpm-macros.spec ++++++
--- /var/tmp/diff_new_pack.b2ilpi/_old 2021-01-15 19:42:57.961715072 +0100
+++ /var/tmp/diff_new_pack.b2ilpi/_new 2021-01-15 19:42:57.965715079 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-rpm-macros
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,17 +17,17 @@
Name: python-rpm-macros
-Version: 20200824.8fa42a7
+Version: 20210112.86f4d9d
Release: 0
Summary: RPM macros for building of Python modules
License: WTFPL
URL: https://github.com/opensuse/python-rpm-macros
Source: python-rpm-macros-%{version}.tar.xz
+# To keep user expectations reasonably sane
+Recommends: python-rpm-generators
# Fedora compatibility
Provides: python2-rpm-macros
Provides: python3-rpm-macros
-# To keep user expectations reasonably sane
-Recommends: python-rpm-generators
BuildArch: noarch
%description
@@ -38,18 +38,17 @@
%package -n python-rpm-generators
Summary: Dependency generator dependencies for Python RPMs
Requires: %{name} = %{version}-%{release}
-# Fedora compatibility
-Provides: python3-rpm-generators
# For the dep generator macros
Requires: python3-setuptools
+# Fedora compatibility
+Provides: python3-rpm-generators
%description -n python-rpm-generators
This package contains the dependencies for Python RPMs to generate
dependencies automatically.
%prep
-%setup -q
-%autopatch -p1
+%autosetup
%if 0%{?suse_version} < 1330
mv macros-default-pythons macros/035-default-pythons
++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.b2ilpi/_old 2021-01-15 19:42:58.033715190 +0100
+++ /var/tmp/diff_new_pack.b2ilpi/_new 2021-01-15 19:42:58.033715190 +0100
@@ -1,4 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">git://github.com/openSUSE/python-rpm-macros.git</param>
- <param name="changesrevision">13628e66c3f31b07ef4a4227a1b45e766350f94c</param></service></servicedata>
\ No newline at end of file
+ <param name="changesrevision">16d3497aadc60ea99a1e28894b8d9bd073ac3e29</param></service></servicedata>
\ No newline at end of file
++++++ python-rpm-macros-20200824.8fa42a7.tar.xz -> python-rpm-macros-20210112.86f4d9d.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-rpm-macros-20200824.8fa42a7/README.md new/python-rpm-macros-20210112.86f4d9d/README.md
--- old/python-rpm-macros-20200824.8fa42a7/README.md 2020-08-24 10:07:22.000000000 +0200
+++ new/python-rpm-macros-20210112.86f4d9d/README.md 2021-01-12 08:17:34.000000000 +0100
@@ -9,36 +9,48 @@
### Terminology
-__flavor__ is a kind of python interpreter. At this point, we recognize the following flavors:
-`python2`, `python3` and `pypy3`.
+__``<flavor>``__ is a kind of python interpreter. At this point, we recognize the following flavors:
+`python2`, `python3`, `python36`, `python38` and `pypy3`. `python3` points to the default of
+coinstallable flavors `python3<M>` where `<M>` is the minor version number.
+
+The flavor is used as a prefix for all flavor-specific macros.
+Some macros are redefined with "short" flavor for compatibility
+reasons, such as `py3` for `python3`. All of them have a "long" form too.
For compatibility reasons you see sometimes `python`. In most places,
using `python` is either a redefinition of `python2`, or an alternative for
"flavor-agnostic". Conditionals are in place to switch `python` to mean `python3` in the future.
-The name of the flavor is the name of the binary in `/usr/bin`. It is also used as a prefix
-for all flavor-specific macros. Some macros are redefined with "short" flavor for compatibility
-reasons, such as `py2` for `python2`. All of them have a "long" form too.
+The name of the binary in `%_bindir` (`/usr/bin`) is the name of the flavor with an addtional `.`
+between the major and minor version number, in case the latter is part of the flavor name:
+
+- `/usr/bin/python2`
+- `/usr/bin/python3`
+- `/usr/bin/python3.8`
+- ...
__modname__ is the PyPI name, or, if the package in question is not on PyPI, the moniker that we
chose to stand in for it.
-Packages adhering to the SUSE Python module naming policy are usually called `%{flavor}-%{modname}`.
-In some cases, it is only `%{modname}` though.
+Packages adhering to the SUSE Python module naming policy are usually called `<flavor>-modname`.
+In some cases, it is only `modname` though.
-__pkgname__, or __subpackage name__, is internal to a spec file, and is that thing you put after the
-`%package` macro. Pkgname of the package itself is an empty string. Pkgname of a `%package -n
-something` is at this point `-n something`, and denotes that this subpackage should not be handled
-by the generator.
-That means, if you want a subpackage to be skipped, rename it from `%package foo` to
-`%package -n %{name}-foo`.
+__pkgname__, or __subpackage name__, is internal to a spec file, and is that thing you put after
+the `%package` macro. Pkgname of the package itself is an empty string. Pkgname of a
+`%package -n something` is at this point `-n something`, and denotes that this subpackage should
+not be handled by the generator. That means, if you want a subpackage to be skipped, rename it
+from `%package foo` to `%package -n %{name}-foo`.
-The purpose of the singlespec system is to take a package called `%{flavor}-%{modname}` for a
+The purpose of the singlespec system is to take a package called `<flavor>-modname` for a
particular flavor, and autogenerate subpackages for all the other flavors.
-Alternately, it is to take package `python-%{modname}` and generate subpackages for all flavors,
+Alternately, it is to take package `python-modname` and generate subpackages for all flavors,
leaving the top-level package empty.
+Additionally it is possible for non-Python packages which define a subpackage
+`%package -n python-modname` and corresponding `%description -n python-modname` etc.,
+to autogenerate all desired flavor subpackages `<flavor>-modname`.
+
### Build Set
The default build set is listed in the __`%pythons`__ macro. Every entry in `%pythons` generates a
@@ -47,7 +59,7 @@
and `_expand`.
To control the build set, you can either completely redefine `%pythons`, or exclude
-particular flavor(s) by defining __`%skip_$flavor`__. For example, if you `%define skip_python2 1`,
+particular flavor(s) by defining __`%skip_<flavor>`__. For example, if you `%define skip_python2 1`,
then Python 2 will be excluded from the default build set.
Skip-macros are intended __for per-package use only__. Never define a skip-macro in prjconf or
@@ -65,16 +77,20 @@
* __`%pythons`__ - the build set. See above for details.
-* __`%have_python2`, `%have_python3`, `%have_pypy3`__. Defined as 1 if the flavor is present in the
-build environment. Undefined otherwise.
-_Note:_ "present in build environment" does not mean "part of build set". Under some circumstances,
-you can get a Python flavor pulled in through dependencies, even if you exclude it from the build
-set. In such case, `%have_$flavor` will be defined but packages will not be generated for it.
+* __`%have_<flavor`__. Defined as 1 if the flavor is present in the build environment.
+ Undefined otherwise.
+
+ _Note:_ "present in build environment" does not mean "part of build set". Under some
+ circumstances, you can get a Python flavor pulled in through dependencies, even if you exclude it
+ from the build set. In such case, `%have_<flavor>` will be defined but packages will not be
+ generated for it.
-* __`%skip_python2`, `%skip_python3`, `%skip_pypy3`__. Undefined by default. Define in order to exclude
-a flavor from build set.
+* __`%skip_<flavor>`__. Undefined by default. Define in order to exclude a flavor from build set.
-* __`%{python_module modname [= version]}`__ expands to `$flavor-modname [= version]` for every
+ _Note:_ You do not need to define `%skip_python2` for Tumbleweed. Only define, if you need to skip it
+ for older distributions.
+
+* __`%{python_module modname [= version]}`__ expands to `<flavor>-modname [= version]` for every
flavor. Intended as: `BuildRequires: %{python_module foo}`.
* __`%{python_dist_name modname}`__. Given a standardized name (i.e. dist name, name on PyPI) of `modname`,
@@ -89,45 +105,108 @@
when listing dependencies. Intended as `(Build)Requires: %{python3_dist foo}`.
* __`%python_flavor`__ expands to the `%pythons` entry that is currently being processed.
-Does not apply in `%prep`, `%build`, `%install` and `%check` sections, except when evaluated
-as `%{$python_flavor}` in `%python_expand`.
+Does not apply in `%prep`, `%build`, `%install` and `%check` sections. For those, check for the
+expansion of `$python_` inside the `%python_expand` macro (see below).
-* __`%ifpython2`, `%ifpython3`, `%ifpypy3`__: applies the following section only to subpackages of
-that particular flavor.
-__`%ifpycache`__: applies the following section only to subpackages of flavors that generate a
-`__pycache__` directory.
-_Note:_ These are shortcuts for `%if "%python_flavor" == "$flavor"`. Due to how RPM evaluates the
+* __`%python_subpackages`__ expands to the autogenerated subpackages. This should go at the end of the
+main headers section.
+
+* __`%python_subpackage_only`__. Undefined by default. If you want to generate `<flavor>-modname`
+subpackages for a non-python main package, make sure to `%define python_subpackage_only 1` before
+`%python_subpackages` and use `-n python-modname` for section headers (except for `%files`, see below).
+
+* __`%python_enable_dependency_generator`__ expands to a define to enable automatic requires generation
+of Python module dependencies using egg-info/dist-info metadata. This should go above the
+`%python_subpackages` macro, preferably closer to the top of the spec. Intended usage:
+`%{?python_enable_dependency_generator}`. This macro will eventually be removed when the generator
+is configured to automatically run, hence the `?` at the beginning of the macro invocation.
+
+
+#### Conditionals
+
+These are shortcuts for `%if "%python_flavor" == "<flavor>"`. Due to how RPM evaluates the
shortcuts, they will fail when nested with other `%if` conditions. If you need to nest your
-conditions, use the full `%if %python_flavor` spelling.
+conditions, use the full `%if "%python_flavor"` spelling.
+
+* __`%if<flavor>`__: applies the following section only to subpackages of that particular flavor.
+
+* __`%ifpycache`__: applies the following section only to subpackages of flavors that generate a
+`__pycache__` directory.
+
+* __`%<flavor>_only`__: applies the contents of the line only to subpackages of that particular flavor.
-* __`%python2_only`, `%python3_only`, `%pypy3_only`__: applies the contents of the line only to
-subpackages of that particular flavor.
* __`%pycache_only`__: applies the contents of the line only to subpackages of flavors that generate
`__pycache__` directories. Useful in filelists: `%pycache_only %{python_sitelib}/__pycache__/*`
-* __`%python_build`__ expands to build instructions for all flavors.
-* __`%python_install`__ expands to install instructions for all flavors.
+#### Flavor expansion
-* __`%python_exec something.py`__ expands to `$flavor something.py` for all flavors, and moves around
-the distutils-generated `build` directory so that you are never running `python2` script with a
-python3-generated `build`. This is only useful for distutils/setuptools.
-
-* __`%python_expand something`__ is a more general form of the above. Performs the moving-around for
-distutils' `build` directory, and performs rpm macro expansion of its argument for every flavor.
-Importantly, `$python` is replaced by current flavor name, even in macros. So:
-`%{python_expand $python generatefile.py %$python_bin_suffix}`
-expands to:
-`python2 generatefile.py %python2_bin_suffix`
-`python3 generatefile.py %python3_bin_suffix`
-etc.
+The following macros expand to command lists for all flavors and move around the distutils-generated
+`build` directory so that you are never running a `python2` command with a python3-generated `build`
+and vice versa.
-* __`%pytest`__ runs `pytest` in all flavors with appropriate environmental variables
-(namely, it sets `$PYTHONPATH` to ``%{python_sitelib}``). All paramteres to this macro are
-passed without change to the pytest command. Explicit `BuildRequires` on `%{python_module pytest}`
-is still required.
+##### General command expansion macros
+
+* __`%python_exec something.py`__ expands to `$python something.py` for all flavors, where `$python`
+is the basename of the flavor executable. Make sure it is in `$PATH`.
+
+* __`%python_expand something`__ is a more general form of the above. It performs rpm macro expansion
+ of its arguments for every flavor. Importantly, `$python` is not expanded by the shell, but replaced
+ beforehand for the current flavor, even in macros:
+
+ - When used as command delimited by space or one of `"'\)&|;<>`, it is replaced by the path to the executable
+ - When used as part of a macro name or other string, it is replaced by the current flavor name.
+
+ So:
+ `%{python_expand $python generatefile.py %{$python_bin_suffix}}`
+ expands to:
+
+ ```
+ python2 generatefile.py 2.7
+ python3.6 generatefile.py 3.6
+ python3.8 generatefile.py 3.8
+ ```
+
+ etc. (plus the moving around of the `build` directory in between).
+
+ If you want to check for the current python flavor inside `%python_expand` use something like
+
+ ```spec
+ %{python_expand #
+ if [ $python_ = python36_ ]; then
+ $python command-for-py-36-only (we have %{$python_version})
+ fi
+ }
+ ```
+
+ which expands to
+
+ ```sh
+ #
+ if [ python38_ = python36_ ]; then
+ python3.8 command-for-py-36-only (we have 3.8)
+ fi
+ ```
+
+ and so on for all flavors.
+
+##### Install macros
+
+* __`%python_build`__ expands to distutils/setuptools build instructions for all flavors.
-* __`%pytest_arch`__ the same as the above, except it sets ``$PYTHONPATH`` to ``%{$python_sitearch}``
+* __`%python_install`__ expands to distutils/setuptools install instructions for all flavors.
+
+* __`%pyproject_wheel`__ expands to
+[PEP517](https://www.python.org/dev/peps/pep-0517)/[PEP518](https://www.python.org/dev/peps/pep-0518/)
+build instructions for all flavors and creates wheels. This is useful if the package has a
+``pyproject.toml`` file but no ``setup.py``
+
+* __`%pyproject_install`__ expands to install instructions for all flavors to install the created wheels.
+
+* __`%python_compileall`__ precompiles all python source files in `%{python_sitelib}` and `%{python_sitearch}`
+for all flavors. Generally Python 2 creates the cached byte-code `.pyc` files directly in the script directories, while
+newer flavors generate `__pycache__` directories. Use this if you have modified the source files in `%buildroot` after
+`%python_install` or `%pyproject_install` has compiled the files the first time.
* __`%python_clone filename`__ creates a copy of `filename` under a flavor-specific name for every
flavor. This is useful for packages that install unversioned executables: `/usr/bin/foo` is copied
@@ -135,22 +214,25 @@
__`%python_clone -a filename`__ will also invoke __`%prepare_alternative`__ with the appropriate
arguments.
-* __`%python2_build`, `%python3_build`, `%pypy3_build`__ expands to build instructions for the
-particular flavor.
+* __`%python_find_lang foo`__ calls `%find_lang foo` for all flavors and creates flavor specific
+ files `%{python_prefix}-foo.lang`. Additional arguments of `%find_lang` are supported. The filelist
+ can then be used as `%files %{python_files} -f %{python_prefix}-foo.lang` in the `%files` section header.
-* __`%python2_install`, `%python3_install`, `%pypy3_install`__ expands to install
-instructions for the particular flavor.
-* __`%python_subpackages`__ expands to the autogenerated subpackages. This should go at the end of the
-main headers section.
+##### Unit testing
-* __`%python_enable_dependency_generator`__ expands to a define to enable automatic requires generation
-of Python module dependencies using egg-info/dist-info metadata. This should go above the
-`%python_subpackages` macro, preferably closer to the top of the spec. Intended usage:
-`%{?python_enable_dependency_generator}`. This macro will eventually be removed when the generator
-is configured to automatically run, hence the `?` at the beginning of the macro invocation.
+* __`%pytest`__ runs `pytest` in all flavors with appropriate environmental variables
+(namely, it sets `$PYTHONPATH` to ``%{$python_sitelib}``). All paramteres to this macro are
+passed without change to the pytest command. Explicit `BuildRequires` on `%{python_module pytest}`
+is still required.
+
+* __`%pytest_arch`__ the same as the above, except it sets ``$PYTHONPATH`` to ``%{$python_sitearch}``.
-Alternative-related, general:
+* __`%pyunittest`__ and __`%pyunittest_arch`__ run `$python -m unittest` on all flavors with
+appropriate environmental variables very similar to `%pytest` and `%pytest_arch`.
+
+
+#### Alternative-related, general:
* __`%prepare_alternative [-t <targetfile> ] <name>`__ replaces `<targetfile>` with a symlink to
`/etc/alternatives/<name>`, plus related housekeeping. If no `<targetfile>` is given, it is
@@ -167,7 +249,8 @@
* __`%alternative_to <file>`__ generates a filelist entry for `<file>` and a ghost entry for
`basename <file>` in `/etc/alternatives`
-Alternative-related, for Python:
+
+#### Alternative-related, for Python:
* __`%python_alternative <file>`__: expands to filelist entries for `<file>`, its symlink in
`/etc/alternatives`, and the target file called `<file>-%python_bin_suffix`.
@@ -187,33 +270,53 @@
Each of these has a flavor-specific spelling: `%python2_alternative` etc.
+
+#### Flavor-specific macros
+
In addition, the following flavor-specific macros are known and supported by the configuration:
-* __`%__python2`__: path to the $flavor executable.
-This exists mostly for Fedora compatibility. In SUSE code, it is preferable to use `$flavor`
-directly, as it is specified to be the name in `/usr/bin`, and we don't support multiple competing
-binaries (in the OBS environment at least).
+* __`%__<flavor>`__: path to the ``<flavor>`` executable.
+
+* __`%<flavor>_build`__ expands to build instructions for the particular flavor.
+
+* __`%<flavor>_install`__ expands to install instructions for the particular flavor.
-* __`%python2_sitelib`, `%python2_sitearch`__: path to noarch and arch-dependent `site-packages`
+* __`%<flavor>_sitelib`, `%<flavor>_sitearch`__: path to noarch and arch-dependent `site-packages`
directory.
-* __`%python2_version`__: dotted major.minor version. `2.7` for CPython 2.7.
+* __`%<flavor>_version`__: dotted major.minor version. `2.7` for CPython 2.7.
-* __`%python2_version_nodots`__: concatenated major.minor version. `27` for CPython 2.7.
+* __`%<flavor>_version_nodots`__: concatenated major.minor version. `27` for CPython 2.7.
-* __`%python2_bin_suffix`, `%python3_bin_suffix`, `%pypy3_bin_suffix`__: what to put after
+* __`%<flavor>_bin_suffix`__: what to put after
a binary name. Binaries for CPython are called `binary-%{python_version}`, for PyPy the name
is `binary-pp%{pypy3_version}`
-* __`%python2_prefix`__: prefix of the package name. `python` for old-style distros, `python2` for
+* __`%<flavor>_prefix`__: prefix of the package name. `python` for old-style distros, `python2` for
new-style. For other flavors, the value is the same as flavor name.
- For reasons of preferred-flavor-agnosticity, aliases `python_*` are available for all of these.
+For reasons of preferred-flavor-agnosticity, aliases `python_*` are available for all of these.
- We recognize `%py_ver`, `%py2_ver` and `%py3_ver` as deprecated spellings of `%flavor_version`. No
+We recognize `%py_ver`, `%py2_ver` and `%py3_ver` as deprecated spellings of `%<flavor>_version`. No
such shortcut is in place for `pypy3`. Furthermore, `%py2_build`, `_install` and `_shbang_opts`, as
well as `py3` variants, are recognized for Fedora compatibility.
+### `%files` section
+
+* __`%files %{python_files}`__ expands the `%files` section for all generated flavor packages of
+ `<flavor>-modname`.
+
+* __`%files %{python_files foo}`__ expands the `%files` section for all generated flavor subpackages
+ of `<flavor>-modname-foo`.
+
+For subpackages of non-python packages with `%python_subpackage_only`and
+ `%package -n %{python_flavor}-modname`, also use `%files %{python_files modname}`.
+
+Always use the flavor-agnostic macro versions `%python_*` inside `%python_files` marked `%files` sections.
+
+See also the Filelists section of the
+[openSUSE:Packaging Python](https://en.opensuse.org/openSUSE:Packaging_Python#Filelists)
+guidelines
### Files in Repository
@@ -229,13 +332,16 @@
* __`macros/030-fallbacks`__: compatibility and deprecated spellings for some macros.
-* __`compile-macros.sh`__: the compile script. Builds flavor-specific macros, Lua script definition,
-and concatenates all of it into `macros.python_all`.
-
* __`apply-macros.sh`__: compile macros and run `rpmspec` against first argument. Useful for examining
what is going on with your spec file.
-* __`flavor.in`__: template for flavor-specific macros. Generates `macros/020-flavor-$flavor` for
+* __`buildset.in`__: template to generate `macros/040-buildset` for the `%pythons`, `%skip_<flavor>` and
+ `%python_module` macros.
+
+* __`compile-macros.sh`__: the compile script. Builds flavor-specific macros, Lua script definition,
+and concatenates all of it into `macros.python_all`.
+
+* __`flavor.in`__: template for flavor-specific macros. Generates `macros/020-flavor-<flavor>` for
every flavor listed in `compile-macros.sh`.
* __`functions.lua`__: Lua function definitions used in `macros.lua` and elsewhere. In the compile
@@ -254,12 +360,4 @@
where this is not provided by your Python installation. The spec file uses this for SUSE <= Leap 42.3.
`apply-macros` also uses it implicitly (for now).
-* __`embed-macros.pl`__: takes care of slash-escaping and wrapping the Lua functions and inserting
-them into the `macros.in` file in order to generate the resulting macros.
-
-* __`python-rpm-macros.spec`__: spec file for the `python-rpm-macros` package generated from this
-GitHub repository.
-
-* __`process-spec.pl`__: Simple regexp-based converter into the singlespec format.
-
* __`README.md`__: This file. As if you didn't know.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-rpm-macros-20200824.8fa42a7/compile-macros.sh new/python-rpm-macros-20210112.86f4d9d/compile-macros.sh
--- old/python-rpm-macros-20200824.8fa42a7/compile-macros.sh 2020-08-24 10:07:22.000000000 +0200
+++ new/python-rpm-macros-20210112.86f4d9d/compile-macros.sh 2021-01-12 08:17:34.000000000 +0100
@@ -1,15 +1,19 @@
#!/bin/bash
-FLAVORS="python2 python3 pypy3"
+FLAVORS="python2 python3 python36 python38 pypy3"
# order of BUILDSET is important, it is copied to order of %pythons,
# and that determines the last installed binary
-BUILDSET="python2 python3"
+BUILDSET="python2 python3 python36 python38"
### flavor-specific: generate from flavor.in
for flavor in $FLAVORS; do
sed 's/#FLAVOR#/'$flavor'/g' flavor.in > macros/020-flavor-$flavor
+ if [ "$flavor" = "python2" ]; then
+ # special old-style package provides and obsoletes for python2
+ echo "%${flavor}_provides python" >> macros/020-flavor-$flavor
+ fi
done
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-rpm-macros-20200824.8fa42a7/flavor.in new/python-rpm-macros-20210112.86f4d9d/flavor.in
--- old/python-rpm-macros-20200824.8fa42a7/flavor.in 2020-08-24 10:07:22.000000000 +0200
+++ new/python-rpm-macros-20210112.86f4d9d/flavor.in 2021-01-12 08:17:34.000000000 +0100
@@ -1,17 +1,29 @@
##### macro definitions for flavor "#FLAVOR#" #####
-%__#FLAVOR# /usr/bin/#FLAVOR#
-
%#FLAVOR#_shbang_opts %py_shbang_opts
-%#FLAVOR#_prefix #FLAVOR#
-%#FLAVOR#_sitelib %{_python_sysconfig_path #FLAVOR# purelib}
-%#FLAVOR#_sitearch %{_python_sysconfig_path #FLAVOR# platlib}
-%#FLAVOR#_version %{_python_sysconfig_var #FLAVOR# py_version_short}
-%#FLAVOR#_version_nodots %{_python_sysconfig_var #FLAVOR# py_version_nodot}
+%__#FLAVOR# %{_bindir}/%{lua: print((string.gsub("#FLAVOR#", "(%w+%d)(%d)", "%1.%2")))}
-%#FLAVOR#_sysconfig_path() %{_rec_macro_helper}%{lua:call_sysconfig("path", "#FLAVOR#")}
-%#FLAVOR#_sysconfig_var() %{_rec_macro_helper}%{lua:call_sysconfig("var", "#FLAVOR#")}
+%#FLAVOR#_prefix #FLAVOR#
+%#FLAVOR#_sitelib %{_python_sysconfig_path %__#FLAVOR# purelib}
+%#FLAVOR#_sitearch %{_python_sysconfig_path %__#FLAVOR# platlib}
+%#FLAVOR#_version %{_python_sysconfig_var %__#FLAVOR# py_version_short}
+%#FLAVOR#_version_nodots %{_python_sysconfig_var %__#FLAVOR# py_version_nodot}
+
+%#FLAVOR#_sysconfig_path() %{_python_sysconfig_path %__#FLAVOR# %1}
+%#FLAVOR#_sysconfig_var() %{_python_sysconfig_var %__#FLAVOR# %1}
+
+%#FLAVOR#_bin_suffix %{?!_#FLAVOR#_bin_suffix:%#FLAVOR#_version}%{?_#FLAVOR#_bin_suffix}
+
+# Check if there is a major version symlink to our flavor in the current build system. If so, we are the primary provider.
+%#FLAVOR#_provides %(provides=""; \
+for flavorbin in %{_bindir}/python?; do \
+ if [ $flavorbin != %__#FLAVOR# -a $(realpath $flavorbin) = %__#FLAVOR# ]; then \
+ provides+=" $(basename $flavorbin)"; \
+ fi; \
+done; \
+echo ${provides# }; \
+)
%if#FLAVOR# %if "%{python_flavor}" == "#FLAVOR#"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-rpm-macros-20200824.8fa42a7/functions.lua new/python-rpm-macros-20210112.86f4d9d/functions.lua
--- old/python-rpm-macros-20200824.8fa42a7/functions.lua 2020-08-24 10:07:22.000000000 +0200
+++ new/python-rpm-macros-20210112.86f4d9d/functions.lua 2021-01-12 08:17:34.000000000 +0100
@@ -34,7 +34,7 @@
function replace_macros(str, targetflavor)
local LONG_MACROS = { "sitelib", "sitearch",
"alternative", "install_alternative", "uninstall_alternative",
- "version", "version_nodots", "bin_suffix", "prefix"}
+ "version", "version_nodots", "bin_suffix", "prefix", "provides"}
local SHORT_MACROS = { "ver" }
for _, srcflavor in ipairs({flavor, "python"}) do
str = str:gsub("%%__" .. srcflavor, "%%__" .. targetflavor)
@@ -64,7 +64,7 @@
name = name .. "-" .. subpkg
end
if append and append ~= "" then
- name = name .. " " .. append
+ name = name .. " " .. replace_macros(append, flavor)
end
return name
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-rpm-macros-20200824.8fa42a7/macros/010-common-defs new/python-rpm-macros-20210112.86f4d9d/macros/010-common-defs
--- old/python-rpm-macros-20200824.8fa42a7/macros/010-common-defs 2020-08-24 10:07:22.000000000 +0200
+++ new/python-rpm-macros-20210112.86f4d9d/macros/010-common-defs 2021-01-12 08:17:34.000000000 +0100
@@ -9,13 +9,9 @@
%_rec_macro_helper %{lua:
rpm.define("_rec_macro_helper %{nil}")
function expand_macro(name, args)
- local interp = rpm.expand("%python_flavor")
+ local pflavor = rpm.expand("%python_flavor")
local args = args and rpm.expand(args) or ""
- print(rpm.expand("%{" .. interp .. "_" .. name .. " " .. args .."}"))
- end
- function call_sysconfig(which, interp)
- local arg = rpm.expand("%1")
- print(rpm.expand("%{_python_sysconfig_" .. which .. " " .. interp .. " " .. arg .. "}"))
+ print(rpm.expand("%{" .. pflavor .. "_" .. name .. " " .. args .."}"))
end
}
@@ -24,24 +20,25 @@
%py_setup setup.py
%py_shbang_opts -s
-##### binary suffixes for flavors #####
+##### non-standard binary suffixes for flavors #####
+
+%_pypy3_bin_suffix pp%{pypy3_version}
-%python2_bin_suffix %python2_version
-%python3_bin_suffix %python3_version
-%pypy3_bin_suffix pp%{pypy3_version}
##### preferred configuration #####
-%python_sitelib %{_python_sysconfig_path %python_flavor purelib}
-%python_sitearch %{_python_sysconfig_path %python_flavor platlib}
-%python_version %{_python_sysconfig_var %python_flavor py_version_short}
-%python_version_nodots %{_python_sysconfig_var %python_flavor py_version_nodot}
+%python_sitelib %{_python_sysconfig_path %{expand:%__%{python_flavor}} purelib}
+%python_sitearch %{_python_sysconfig_path %{expand:%__%{python_flavor}} platlib}
+%python_version %{_python_sysconfig_var %{expand:%__%{python_flavor}} py_version_short}
+%python_version_nodots %{_python_sysconfig_var %{expand:%__%{python_flavor}} py_version_nodot}
+
+%python_sysconfig_path() %{_python_sysconfig_path %{expand:%__%{python_flavor}} %1}
+%python_sysconfig_var() %{_python_sysconfig_var %{expand:%__%{python_flavor}} %1}
%python_prefix %{_rec_macro_helper}%{lua:expand_macro("prefix")}
%python_bin_suffix %{_rec_macro_helper}%{lua:expand_macro("bin_suffix")}
+%python_provides %{_rec_macro_helper}%{lua:expand_macro("provides")}
-%python_sysconfig_path() %{_rec_macro_helper}%{lua:call_sysconfig("path", "%python_flavor")}
-%python_sysconfig_var() %{_rec_macro_helper}%{lua:call_sysconfig("var", "%python_flavor")}
%python_alternative() %{_rec_macro_helper}%{lua:expand_macro("alternative", "%**")}
%python_install_alternative() %{_rec_macro_helper}%{lua:expand_macro("install_alternative", "%**")}
@@ -129,7 +126,8 @@
local args = rpm.expand("%**"); \
local broot = rpm.expand("%buildroot"); \
local intro = "%{python_expand PYTHONPATH=${PYTHONPATH:+$PYTHONPATH:}" .. broot .. "%{$python_sitelib} PYTHONDONTWRITEBYTECODE=1 "; \
- intro = intro .. "pytest-%{$python_bin_suffix} --ignore=_build.python2 --ignore=_build.python3 --ignore=_build.pypy3 -v "; \
+ local ignore_build = "--ignore=_build." .. rpm.expand("%pythons"):gsub("%s+", " --ignore=_build."); \
+ intro = intro .. "pytest-%{$python_bin_suffix} " .. ignore_build .. " -v "; \
print(rpm.expand(intro .. args .. "}")) \
}
@@ -137,7 +135,8 @@
local args = rpm.expand("%**"); \
local broot = rpm.expand("%buildroot"); \
local intro = "%{python_expand PYTHONPATH=${PYTHONPATH:+$PYTHONPATH:}" .. broot .. "%{$python_sitearch} PYTHONDONTWRITEBYTECODE=1 "; \
- intro = intro .. "pytest-%{$python_bin_suffix} --ignore=_build.python2 --ignore=_build.python3 --ignore=_build.pypy3 -v "; \
+ local ignore_build = "--ignore=_build." .. rpm.expand("%pythons"):gsub("%s+", " --ignore=_build."); \
+ intro = intro .. "pytest-%{$python_bin_suffix} " .. ignore_build .. " -v "; \
print(rpm.expand(intro .. args .. "}")) \
}
@@ -145,7 +144,7 @@
%pyproject_wheel(+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-=) %{lua:\
local args = rpm.expand("%**"); \
local intro = "%{python_expand $python -mpip wheel --no-deps %{?py_setup_args:--build-option %{py_setup_args}}"; \
- intro = intro .. " --use-pep517 --no-build-isolation --progress-bar off --verbose . "; \
+ intro = intro .. " --disable-pip-version-check --use-pep517 --no-build-isolation --progress-bar off --verbose . "; \
print(rpm.expand(intro .. args .. "}")) \
}
@@ -153,8 +152,31 @@
%pyproject_install(+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-=) %{lua:\
local args = rpm.expand("%**"); \
local broot = rpm.expand("--root %buildroot"); \
- local intro = "%{python_expand $python -mpip install " .. broot .. " --no-compile --no-deps --progress-bar off *.whl "; \
+ local intro = "%{python_expand $python -mpip install " .. broot .. " --disable-pip-version-check --no-compile --no-deps --progress-bar off *.whl "; \
print(rpm.expand(intro .. args .. "}")) \
+ print(rpm.expand("%python_compileall"))
}
-#vi:tw=0 nowrap:
+##### Precompile scripts macro #####
+
+%python_compileall \
+%{python_expand for d in %{buildroot}%{$python_sitelib} %{buildroot}%{$python_sitearch}; do \
+ if [ -d $d ]; then \
+ find $d -name '*.pyc' -delete; \
+ $python -m compileall $d; \
+ $python -O -m compileall $d; \
+ fi; \
+done \
+} \
+%{nil}
+
+##### Find language files #####
+
+%python_find_lang() \
+%find_lang %{**} \
+langfile=%{?2}%{!?2:%1.lang} \
+%{python_expand # \
+grep -v 'python.*site-packages' ${langfile} > %{$python_prefix}-${langfile} \
+grep -F %{$python_sitelib} ${langfile} >> %{$python_prefix}-${langfile} \
+} \
+%{nil}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-rpm-macros-20200824.8fa42a7/macros.lua new/python-rpm-macros-20210112.86f4d9d/macros.lua
--- old/python-rpm-macros-20200824.8fa42a7/macros.lua 2020-08-24 10:07:22.000000000 +0200
+++ new/python-rpm-macros-20210112.86f4d9d/macros.lua 2021-01-12 08:17:34.000000000 +0100
@@ -52,6 +52,12 @@
flavor = spec_name_prefix
end
+ subpackage_only = rpm.expand("0%{?python_subpackage_only}") ~= "0"
+ if subpackage_only then
+ is_called_python = false
+ modname = ""
+ end
+
-- find the spec file
specpath = rpm.expand("%_specfile")
@@ -77,7 +83,9 @@
-- line processing functions
local function print_altered(line)
-- set %name macro to proper flavor-name
- line = line:gsub("%%{?name}?", current_flavor .. "-" .. modname)
+ if not subpackage_only then
+ line = line:gsub("%%{?name}?", current_flavor .. "-" .. modname)
+ end
-- print expanded
print(rpm.expand(replace_macros(line, current_flavor)) .. "\n")
end
@@ -102,6 +110,9 @@
"Requires(pre):", "Requires(preun):", "Requires(post):", "Requires(postun):",
"Requires(pretrans):", "Requires(posttrans):",
}
+ local PROPERTY_COPY_DEFAULT_PROVIDER = lookup_table {
+ "Conflicts:", "Obsoletes:", "Provides:", "Supplements:", "Enhances:",
+ }
local function process_package_line(line)
-- This function processes lines like "Requires: something something".
@@ -152,15 +163,29 @@
print_altered(line)
elseif PROPERTY_COPY_MODIFIED[property] then
-- specifically handle %name macro before expansion
- line = line:gsub("%%{?name}?", current_flavor .. "-" .. modname)
- -- convert value using the appropriate function
- if value:startswith("packageand") then
- value = fix_packageand(value, flavor)
+ if not subpackage_only then
+ line = line:gsub("%%{?name}?", current_flavor .. "-" .. modname)
+ end
+ local function print_property_copy_modified(value)
+ -- convert value using the appropriate function
+ if value:startswith("packageand") then
+ value = fix_packageand(value, flavor)
+ else
+ value = rename_package(value, flavor)
+ end
+ -- rely on print_altered to perform expansion on the result
+ print_altered(string.format("%s %s", property, value))
+ end
+ if PROPERTY_COPY_DEFAULT_PROVIDER[property] then
+ -- print renamed lines for all flavors which the current_flavor provides.
+ for iflavor in string.gmatch(rpm.expand("%{?" .. current_flavor .. "_provides}") .. " " .. current_flavor, "%S+" ) do
+ current_flavor = iflavor -- make sure to process the main current_flavor last for final reset.
+ print_property_copy_modified(value)
+ end
else
- value = rename_package(value, flavor)
+ print_property_copy_modified(value)
end
- -- rely on print_altered to perform expansion on the result
- print_altered(string.format("%s %s", property, value))
+
end
end
@@ -187,10 +212,11 @@
end
-- end line processing functions
- local function print_obsoletes(modname)
- if current_flavor == "python2" then
- print(rpm.expand("Obsoletes: python-" .. modname .. " < %{?epoch:%{epoch}:}%{version}-%{release}\n"))
- print(rpm.expand("Provides: python-" .. modname .. " = %{?epoch:%{epoch}:}%{version}-%{release}\n"))
+ local function print_provided_flavor(modname)
+ for provided_flavor in string.gmatch(rpm.expand("%{?" .. current_flavor .. "_provides}"), "%S+" ) do
+ local pkg = provided_flavor .. "-" .. modname
+ print(rpm.expand("Obsoletes: " .. pkg .. " < %{?epoch:%{epoch}:}%{version}-%{release}\n"))
+ print(rpm.expand("Provides: " .. pkg .. " = %{?epoch:%{epoch}:}%{version}-%{release}\n"))
end
end
@@ -280,7 +306,7 @@
"pre", "post", "preun", "postun", "pretrans", "posttrans"}
-- before we start, print Provides: python2-modname
- if is_called_python and old_python2 then
+ if is_called_python and old_python2 and not subpackage_only then
print(rpm.expand("Provides: python2-" .. modname .. " = %{?epoch:%{epoch}:}%{version}-%{release}\n"))
end
@@ -300,15 +326,21 @@
current_flavor = python
-- rescan spec for each flavor
- if not is_current_flavor then
+ if not is_current_flavor or subpackage_only then
local spec, err = io.open(specpath, "r")
if err then print ("could not find spec file at path: " .. specpath) return end
rpm.define("python_flavor " .. python)
- local section_function = process_package_line
- print(section_headline("package", current_flavor, nil))
- print_obsoletes(modname)
+ local section_function
+
+ if subpackage_only then
+ section_function = ignore_line
+ else
+ section_function = process_package_line
+ print(section_headline("package", current_flavor, nil))
+ print_provided_flavor(modname)
+ end
while true do
-- collect lines until braces match. it's what rpm does, kind of.
@@ -330,12 +362,36 @@
if KNOWN_SECTIONS[newsection] then
-- enter new section
- if param and param:startswith("-n") then
- -- ignore named section
+ local ignore_section = false
+ if subpackage_only then
+ ignore_section = true
+ if param then
+ local subparam
+ if newsection == "files" then
+ subparam = param:match("%%{python_files%s+(.*)}")
+ else
+ subparam = param:match("^%-n%s+python%-(.*)$")
+ end
+ if subparam then
+ local submodname, subsubparam = rpm.expand(subparam):match("^(%S+)%s*(.*)$")
+ modname = submodname
+ param = subsubparam
+ ignore_section = false
+ end
+ end
+ elseif (param and param:startswith("-n")) then
+ ignore_section = true
+ end
+ if ignore_section then
section_function = ignore_line
elseif newsection == "package" then
print(section_headline("package", current_flavor, param))
- print_obsoletes(modname .. "-" .. param)
+ if subpackage_only then
+ print_provided_flavor(modname)
+ else
+ -- only valid param is a regular subpackage name
+ print_provided_flavor(modname .. "-" .. param)
+ end
section_function = process_package_line
elseif newsection == "files" and current_flavor == flavor then
section_function = ignore_line
@@ -388,7 +444,7 @@
function python_exec(+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-=)
local args = rpm.expand("%**")
- print(rpm.expand("%{python_expand %__$python " .. args .. "}"))
+ print(rpm.expand("%{python_expand $python " .. args .. "}"))
end
function python_expand(+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-=)
@@ -398,6 +454,9 @@
for _, python in ipairs(pythons) do
print(rpm.expand("%{_python_use_flavor " .. python .. "}\n"))
local cmd = replace_macros(args, python)
+ -- when used as call of the executable, basename only
+ cmd = cmd:gsub("$python%f[%s\"\'\\%)&|;<>]", string.basename(rpm.expand("%__" .. python)))
+ -- when used as flavor expansion for a custom macro
cmd = cmd:gsub("$python", python)
print(rpm.expand(cmd .. "\n"))
end
@@ -423,6 +482,11 @@
local param = ""
if tonumber(nparams) > 0 then param = rpm.expand("%1") end
+ if subpackage_only then
+ modname = param
+ param = ""
+ end
+
print("-n " .. package_name(flavor, modname, param))
if not _python_subpackages_emitted then
@@ -442,7 +506,7 @@
local binsuffix = rpm.expand("%" .. python .. "_bin_suffix")
link,name,path = python_alternative_names(param, binsuffix, true)
print(rpm.expand(string.format("cp %s %s\n", param, path)))
- print(rpm.expand(string.format("sed -ri '1s@#!.*python.*@#!/usr/bin/%s@' %s\n", python, path)))
+ print(rpm.expand(string.format("sed -ri '1s@#!.*python.*@#!%s@' %s\n", "%__" .. python, path)))
end
-- %python_clone -a
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package lxd for openSUSE:Leap:15.2:Update checked in at 2021-01-15 12:25:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2:Update/lxd (Old)
and /work/SRC/openSUSE:Leap:15.2:Update/.lxd.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lxd"
Fri Jan 15 12:25:24 2021 rev:7 rq:862556 version:unknown
Changes:
--------
New Changes file:
NO CHANGES FILE!!!
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ _link ++++++
--- /var/tmp/diff_new_pack.Pl3TQn/_old 2021-01-15 12:25:25.574085479 +0100
+++ /var/tmp/diff_new_pack.Pl3TQn/_new 2021-01-15 12:25:25.578085485 +0100
@@ -1 +1 @@
-<link package='lxd.15315' cicount='copy' />
+<link package='lxd.15505' cicount='copy' />
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package nodejs14 for openSUSE:Leap:15.2:Update checked in at 2021-01-15 10:23:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2:Update/nodejs14 (Old)
and /work/SRC/openSUSE:Leap:15.2:Update/.nodejs14.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nodejs14"
Fri Jan 15 10:23:30 2021 rev:2 rq:862476 version:unknown
Changes:
--------
New Changes file:
NO CHANGES FILE!!!
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ _link ++++++
--- /var/tmp/diff_new_pack.geKsQl/_old 2021-01-15 10:24:32.691042760 +0100
+++ /var/tmp/diff_new_pack.geKsQl/_new 2021-01-15 10:24:32.691042760 +0100
@@ -1 +1 @@
-<link package='nodejs14.15177' cicount='copy' />
+<link package='nodejs14.15503' cicount='copy' />
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package nodejs10 for openSUSE:Leap:15.2:Update checked in at 2021-01-15 10:23:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2:Update/nodejs10 (Old)
and /work/SRC/openSUSE:Leap:15.2:Update/.nodejs10.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nodejs10"
Fri Jan 15 10:23:22 2021 rev:3 rq:862475 version:unknown
Changes:
--------
New Changes file:
NO CHANGES FILE!!!
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ _link ++++++
--- /var/tmp/diff_new_pack.MKGWvL/_old 2021-01-15 10:24:29.259037622 +0100
+++ /var/tmp/diff_new_pack.MKGWvL/_new 2021-01-15 10:24:29.259037622 +0100
@@ -1 +1 @@
-<link package='nodejs10.14365' cicount='copy' />
+<link package='nodejs10.15500' cicount='copy' />
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package nodejs12 for openSUSE:Leap:15.2:Update checked in at 2021-01-15 10:23:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2:Update/nodejs12 (Old)
and /work/SRC/openSUSE:Leap:15.2:Update/.nodejs12.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nodejs12"
Fri Jan 15 10:23:16 2021 rev:3 rq:862474 version:unknown
Changes:
--------
New Changes file:
NO CHANGES FILE!!!
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ _link ++++++
--- /var/tmp/diff_new_pack.iov3Uj/_old 2021-01-15 10:24:06.883004125 +0100
+++ /var/tmp/diff_new_pack.iov3Uj/_new 2021-01-15 10:24:06.883004125 +0100
@@ -1 +1 @@
-<link package='nodejs12.14340' cicount='copy' />
+<link package='nodejs12.15499' cicount='copy' />
1
0