From f9c0b6ff435b5a863ee9367936cd95b7deeb695e Mon Sep 17 00:00:00 2001 From: eabdullin Date: Wed, 14 May 2025 16:06:44 +0000 Subject: [PATCH] import UBI pyxdg-0.27-13.el10 --- .gitignore | 3 +- .pyxdg.metadata | 1 - SOURCES/pyxdg-0.25-CVE-2014-1624.patch | 48 ----- ...pyxdg-0.25-find-first-mimetype-match.patch | 13 -- SPECS/pyxdg.spec => pyxdg.spec | 173 ++++++++++-------- sources | 2 + 6 files changed, 102 insertions(+), 138 deletions(-) delete mode 100644 .pyxdg.metadata delete mode 100644 SOURCES/pyxdg-0.25-CVE-2014-1624.patch delete mode 100644 SOURCES/pyxdg-0.25-find-first-mimetype-match.patch rename SPECS/pyxdg.spec => pyxdg.spec (60%) create mode 100644 sources diff --git a/.gitignore b/.gitignore index f9b699b..6204cc5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -SOURCES/pyxdg-0.25.tar.gz +pyxdg-0.27.tar.gz +pyxdg-test-example.tar.gz diff --git a/.pyxdg.metadata b/.pyxdg.metadata deleted file mode 100644 index d1e03e0..0000000 --- a/.pyxdg.metadata +++ /dev/null @@ -1 +0,0 @@ -1272ee62b8c3909ac4844a34a95f8b1fb3398af2 SOURCES/pyxdg-0.25.tar.gz diff --git a/SOURCES/pyxdg-0.25-CVE-2014-1624.patch b/SOURCES/pyxdg-0.25-CVE-2014-1624.patch deleted file mode 100644 index 614af5f..0000000 --- a/SOURCES/pyxdg-0.25-CVE-2014-1624.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff -up pyxdg-0.25/xdg/BaseDirectory.py.CVE-2014-1624 pyxdg-0.25/xdg/BaseDirectory.py ---- pyxdg-0.25/xdg/BaseDirectory.py.CVE-2014-1624 2014-12-04 11:49:53.681654931 -0500 -+++ pyxdg-0.25/xdg/BaseDirectory.py 2014-12-04 11:52:45.831522703 -0500 -@@ -25,7 +25,7 @@ Typical usage: - Note: see the rox.Options module for a higher-level API for managing options. - """ - --import os -+import os, stat - - _home = os.path.expanduser('~') - xdg_data_home = os.environ.get('XDG_DATA_HOME') or \ -@@ -131,15 +131,29 @@ def get_runtime_dir(strict=True): - - import getpass - fallback = '/tmp/pyxdg-runtime-dir-fallback-' + getpass.getuser() -+ create = False - try: -- os.mkdir(fallback, 0o700) -+ # This must be a real directory, not a symlink, so attackers can't -+ # point it elsewhere. So we use lstat to check it. -+ st = os.lstat(fallback) - except OSError as e: - import errno -- if e.errno == errno.EEXIST: -- # Already exists - set 700 permissions again. -- import stat -- os.chmod(fallback, stat.S_IRUSR|stat.S_IWUSR|stat.S_IXUSR) -- else: # pragma: no cover -+ if e.errno == errno.ENOENT: -+ create = True -+ else: - raise -+ else: -+ # The fallback must be a directory -+ if not stat.S_ISDIR(st.st_mode): -+ os.unlink(fallback) -+ create = True -+ # Must be owned by the user and not accessible by anyone else -+ elif (st.st_uid != os.getuid()) \ -+ or (st.st_mode & (stat.S_IRWXG | stat.S_IRWXO)): -+ os.rmdir(fallback) -+ create = True -+ -+ if create: -+ os.mkdir(fallback, 0o700) - - return fallback diff --git a/SOURCES/pyxdg-0.25-find-first-mimetype-match.patch b/SOURCES/pyxdg-0.25-find-first-mimetype-match.patch deleted file mode 100644 index b46f5ec..0000000 --- a/SOURCES/pyxdg-0.25-find-first-mimetype-match.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up pyxdg-0.25/xdg/Mime.py.BAD pyxdg-0.25/xdg/Mime.py ---- pyxdg-0.25/xdg/Mime.py.BAD 2013-03-05 10:19:10.750845664 -0500 -+++ pyxdg-0.25/xdg/Mime.py 2013-03-05 10:19:14.771845520 -0500 -@@ -360,7 +360,8 @@ def _cache_database(): - if pattern.startswith('*.'): - rest = pattern[2:] - if not ('*' in rest or '[' in rest or '?' in rest): -- exts[rest] = mtype -+ if rest not in exts: -+ exts[rest] = mtype - continue - if '*' in pattern or '[' in pattern or '?' in pattern: - globs.append((pattern, mtype)) diff --git a/SPECS/pyxdg.spec b/pyxdg.spec similarity index 60% rename from SPECS/pyxdg.spec rename to pyxdg.spec index 36ecc53..3f1d7da 100644 --- a/SPECS/pyxdg.spec +++ b/pyxdg.spec @@ -1,115 +1,138 @@ -%global with_python3 1 - -%if 0%{?rhel} > 7 -# Disable python2 build by default -%bcond_with python2 -%else -%bcond_without python2 -%endif - Name: pyxdg -Version: 0.25 -Release: 16%{?dist} +Version: 0.27 +Release: 13%{?dist} Summary: Python library to access freedesktop.org standards -Group: Development/Libraries -License: LGPLv2 +License: LGPL-2.0-only URL: http://freedesktop.org/Software/pyxdg -Source0: http://people.freedesktop.org/~takluyver/%{name}-%{version}.tar.gz -# https://bugs.freedesktop.org/show_bug.cgi?id=61817 -Patch0: pyxdg-0.25-find-first-mimetype-match.patch -# https://bugs.freedesktop.org/show_bug.cgi?id=73878 -Patch1: pyxdg-0.25-CVE-2014-1624.patch +Source0: %pypi_source +# Upstream did not include the test/examples directory in the source tarball +# This tarball is a copy of the directory from https://cgit.freedesktop.org/xdg/pyxdg/ +Source1: pyxdg-test-example.tar.gz BuildArch: noarch # These are needed for the nose tests. -BuildRequires: hicolor-icon-theme -BuildRequires: shared-mime-info +BuildRequires: hicolor-icon-theme +BuildRequires: shared-mime-info %description -PyXDG is a python library to access freedesktop.org standards +PyXDG is a python library to access freedesktop.org standards. -%if %{with python2} -%package -n python2-pyxdg -Summary: Python2 library to access freedesktop.org standards -%{?python_provide:%python_provide python2-pyxdg} -BuildRequires: python2-devel -# These are needed for the nose tests. -BuildRequires: python2-nose -%{?python_provide:%python_provide python2-pyxdg} -Provides: pyxdg = %{version}-%{release} -Obsoletes: pyxdg < 0.25-10 - -%description -n python2-pyxdg -PyXDG is a python library to access freedesktop.org standards. This -package contains a Python 2 version of PyXDG. -%endif # with python2 - -%if 0%{?with_python3} %package -n python%{python3_pkgversion}-pyxdg -Summary: Python3 library to access freedesktop.org standards -%{?python_provide:%python_provide python3-pyxdg} +Summary: Python3 library to access freedesktop.org standards BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools +%if %{with check} # These are needed for the nose tests. -BuildRequires: python%{python3_pkgversion}-nose +BuildRequires: python%{python3_pkgversion}-nose +%endif %{?python_provide:%python_provide python%{python3_pkgversion}-pyxdg} %description -n python%{python3_pkgversion}-pyxdg PyXDG is a python library to access freedesktop.org standards. This package contains a Python 3 version of PyXDG. -%endif # with_python3 %prep -%setup -q -%patch0 -p1 -b .pngfix -%patch1 -p1 -b .CVE-2014-1624 +%setup -q -a 1 %build -%if %{with python2} -%py2_build -%endif # with python2 - -%if 0%{?with_python3} %py3_build -%endif # with_python3 %install -%if 0%{?with_python3} %py3_install -%endif # with_python3 - -%if %{with python2} -%py2_install -%endif # with python2 %check -%if %{with python2} # icon-test currently fails # https://bugs.freedesktop.org/show_bug.cgi?id=104846 -nosetests-%{python2_version} || : -%endif # with python2 - -%if 0%{?with_python3} nosetests-%{python3_version} || : -%endif # with_python3 -%if %{with python2} -%files -n python2-pyxdg -%license COPYING -%doc AUTHORS ChangeLog README TODO -%{python2_sitelib}/xdg -%{python2_sitelib}/pyxdg-*.egg-info -%endif # with python2 - -%if 0%{?with_python3} %files -n python%{python3_pkgversion}-pyxdg %license COPYING %doc AUTHORS ChangeLog README TODO %{python3_sitelib}/xdg %{python3_sitelib}/pyxdg-*.egg-info -%endif #with_python3 %changelog -* Fri Jun 22 2018 Charalampos Stratakis - 0.25-16 -- Conditionalize the python2 subpackage +* Tue Oct 29 2024 Troy Dawson - 0.27-13 +- Bump release for October 2024 mass rebuild: + Resolves: RHEL-64018 + +* Mon Jun 24 2024 Troy Dawson - 0.27-12 +- Bump release for June 2024 mass rebuild + +* Fri Jan 26 2024 Fedora Release Engineering - 0.27-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 0.27-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jul 21 2023 Fedora Release Engineering - 0.27-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Tue Jun 13 2023 Python Maint - 0.27-8 +- Rebuilt for Python 3.12 + +* Fri Jan 20 2023 Fedora Release Engineering - 0.27-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Jul 22 2022 Fedora Release Engineering - 0.27-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jun 13 2022 Python Maint - 0.27-5 +- Rebuilt for Python 3.11 + +* Fri Jan 21 2022 Fedora Release Engineering - 0.27-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jul 23 2021 Fedora Release Engineering - 0.27-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jun 04 2021 Python Maint - 0.27-2 +- Rebuilt for Python 3.10 + +* Tue Apr 13 2021 Tom Callaway - 0.27-1 +- update to 0.27 + +* Wed Jan 27 2021 Fedora Release Engineering - 0.26-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 0.26-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Sun May 24 2020 Miro Hrončok - 0.26-10 +- Rebuilt for Python 3.9 + +* Thu Jan 30 2020 Fedora Release Engineering - 0.26-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Nov 07 2019 Miro Hrončok - 0.26-8 +- Subpackage python2-pyxdg has been removed + See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal + +* Thu Oct 03 2019 Miro Hrončok - 0.26-7 +- Rebuilt for Python 3.8.0rc1 (#1748018) + +* Sat Aug 17 2019 Miro Hrončok - 0.26-6 +- Rebuilt for Python 3.8 + +* Fri Jul 26 2019 Fedora Release Engineering - 0.26-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sat Feb 02 2019 Fedora Release Engineering - 0.26-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Nov 30 2018 Tom Callaway - 0.26-3 +- fix incorrect use of Type attribute (bz 1654857) + +* Thu Nov 1 2018 Tom Callaway - 0.26-2 +- fix OnlyShowIn (bz 1624651) + +* Mon Jul 23 2018 Tom Callaway - 0.26-1 +- update to 0.26 + +* Sat Jul 14 2018 Fedora Release Engineering - 0.25-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Mon Jun 18 2018 Miro Hrončok - 0.25-16 +- Rebuilt for Python 3.7 * Fri Feb 09 2018 Fedora Release Engineering - 0.25-15 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild diff --git a/sources b/sources new file mode 100644 index 0000000..341a5b0 --- /dev/null +++ b/sources @@ -0,0 +1,2 @@ +SHA512 (pyxdg-0.27.tar.gz) = acb24153a4e3e0d8333f1c965c024b15d44f623497b561fc0e9be60d4411441af1dc61f11dcfb22587a510451237a341440bf7ff77a6ab6446dceb83b3c380e2 +SHA512 (pyxdg-test-example.tar.gz) = be077b663b5b94c93655d8622db06d3582a81fc4180038e52b45144f9a6c173d4ff5bf450f9ef56b76652f845e0283c527122fdaa84e35f834523ae205c5ab59