From 61d2a20dc0f8d4d45d296ac223fc59bfb8194a7e Mon Sep 17 00:00:00 2001 From: xuhy Date: Mon, 24 Jun 2024 10:35:47 +0800 Subject: [PATCH] Fix some build errors on ubuntu 24.04 sgml2x is not available on ubuntu 24.04. version is slower than that from ubuntu 24.04 mirrors. Change-Id: I209cf79a219d016c40e6ec71d80879572bb6ec97 Signed-off-by: xuhy --- debian/changelog | 7 +++++++ debian/control | 1 - debian/git-buildpackage-bb.install | 4 ++-- debian/git-buildpackage-common.install | 24 ++++++++++++------------ debian/git-buildpackage-rpm.install | 6 +++--- debian/git-buildpackage.install | 32 ++++++++++++++++---------------- debian/not-installed | 14 +++++++------- debian/rules | 4 +++- docs/Makefile | 2 +- gbp/config.py | 4 ++-- gbp/git/repository.py | 4 ++-- gbp/rpm/__init__.py | 10 +++++----- gbp/rpm/policy.py | 2 +- gbp/scripts/common/pq.py | 4 ++-- gbp/scripts/import_srpm.py | 2 +- packaging/git-buildpackage.changes | 4 ++++ packaging/git-buildpackage.spec | 4 ++-- setup.py | 5 +++-- 18 files changed, 73 insertions(+), 60 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6a209ec..eced6a8 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +git-buildpackage (0.9.36+tizen20240605) unstable; urgency=medium + + * Upgrade version to override the version from mirrors. + * Fix build errors on ubuntu 24.04. + + -- Xu Huayong Tue, 18 Jun 2024 18::02 +0800 + git-buildpackage (0.9.28-tizen20231130) unstable; urgency=medium * Fix git-buildpackage issue to adapt the librpm-tizen 4.14 version. diff --git a/debian/control b/debian/control index b068b91..23509a5 100755 --- a/debian/control +++ b/debian/control @@ -16,7 +16,6 @@ Build-Depends: python3-pkg-resources, python3-setuptools, python3-dateutil, - sgml2x, librpm-tizen, # For rpm (epydoc) python3-rpm diff --git a/debian/git-buildpackage-bb.install b/debian/git-buildpackage-bb.install index c76b64b..c19db95 100644 --- a/debian/git-buildpackage-bb.install +++ b/debian/git-buildpackage-bb.install @@ -1,2 +1,2 @@ -usr/lib/python*/dist-packages/gbp/bb/ -usr/lib/python*/dist-packages/gbp/scripts/*bb*.py* +usr/local/lib/python*/dist-packages/gbp/bb/ +usr/local/lib/python*/dist-packages/gbp/scripts/*bb*.py* diff --git a/debian/git-buildpackage-common.install b/debian/git-buildpackage-common.install index 5283d54..4ab7714 100644 --- a/debian/git-buildpackage-common.install +++ b/debian/git-buildpackage-common.install @@ -1,13 +1,13 @@ -usr/bin/gbp -usr/bin/gbp-clone -usr/bin/gbp-pull -usr/lib/python*/dist-packages/gbp/*.py* -usr/lib/python*/dist-packages/gbp/scripts/__init__.py* -usr/lib/python*/dist-packages/gbp/scripts/clone.py* -usr/lib/python*/dist-packages/gbp/scripts/config.py* -usr/lib/python*/dist-packages/gbp/scripts/pull.py* -usr/lib/python*/dist-packages/gbp/scripts/supercommand.py* -usr/lib/python*/dist-packages/gbp/scripts/common/*.py* -usr/lib/python*/dist-packages/gbp/git/*.py* -usr/lib/python*/dist-packages/gbp/pkg/*.py* +usr/local/bin/gbp /usr/bin +usr/local/bin/gbp-clone /usr/bin +usr/local/bin/gbp-pull /usr/bin +usr/local/lib/python*/dist-packages/gbp/*.py* +usr/local/lib/python*/dist-packages/gbp/scripts/__init__.py* +usr/local/lib/python*/dist-packages/gbp/scripts/clone.py* +usr/local/lib/python*/dist-packages/gbp/scripts/config.py* +usr/local/lib/python*/dist-packages/gbp/scripts/pull.py* +usr/local/lib/python*/dist-packages/gbp/scripts/supercommand.py* +usr/local/lib/python*/dist-packages/gbp/scripts/common/*.py* +usr/local/lib/python*/dist-packages/gbp/git/*.py* +usr/local/lib/python*/dist-packages/gbp/pkg/*.py* etc/git-buildpackage/gbp.conf diff --git a/debian/git-buildpackage-rpm.install b/debian/git-buildpackage-rpm.install index 8c49491..28b07a2 100644 --- a/debian/git-buildpackage-rpm.install +++ b/debian/git-buildpackage-rpm.install @@ -1,3 +1,3 @@ -usr/bin/*rpm* -usr/lib/python*/dist-packages/gbp/rpm/*.py* -usr/lib/python*/dist-packages/gbp/scripts/*rpm*.py* +usr/local/bin/*rpm* /usr/bin +usr/local/lib/python*/dist-packages/gbp/rpm/*.py* +usr/local/lib/python*/dist-packages/gbp/scripts/*rpm*.py* diff --git a/debian/git-buildpackage.install b/debian/git-buildpackage.install index 7a276d7..e43e847 100644 --- a/debian/git-buildpackage.install +++ b/debian/git-buildpackage.install @@ -1,16 +1,16 @@ -usr/bin/gbp-pq -usr/bin/git-buildpackage -usr/bin/git-dch -usr/bin/git-import-dsc -usr/bin/git-import-dscs -usr/bin/git-import-orig -usr/bin/git-pbuilder -usr/bin/gbp-create-remote-repo -usr/lib/python*/dist-packages/gbp/deb/*.py* -usr/lib/python*/dist-packages/gbp/scripts/pq.py* -usr/lib/python*/dist-packages/gbp/scripts/buildpackage.py* -usr/lib/python*/dist-packages/gbp/scripts/dch.py* -usr/lib/python*/dist-packages/gbp/scripts/import_dsc.py* -usr/lib/python*/dist-packages/gbp/scripts/import_dscs.py* -usr/lib/python*/dist-packages/gbp/scripts/import_orig.py* -usr/lib/python*/dist-packages/gbp/scripts/create_remote_repo.py* +usr/local/bin/gbp-pq /usr/bin +usr/local/bin/git-buildpackage /usr/bin +usr/local/bin/git-dch /usr/bin +usr/local/bin/git-import-dsc /usr/bin +usr/local/bin/git-import-dscs /usr/bin +usr/local/bin/git-import-orig /usr/bin +usr/local/bin/git-pbuilder /usr/bin +usr/local/bin/gbp-create-remote-repo /usr/bin +usr/local/lib/python*/dist-packages/gbp/deb/*.py* +usr/local/lib/python*/dist-packages/gbp/scripts/pq.py* +usr/local/lib/python*/dist-packages/gbp/scripts/buildpackage.py* +usr/local/lib/python*/dist-packages/gbp/scripts/dch.py* +usr/local/lib/python*/dist-packages/gbp/scripts/import_dsc.py* +usr/local/lib/python*/dist-packages/gbp/scripts/import_dscs.py* +usr/local/lib/python*/dist-packages/gbp/scripts/import_orig*.py* +usr/local/lib/python*/dist-packages/gbp/scripts/create_remote_repo.py* diff --git a/debian/not-installed b/debian/not-installed index e5804d0..df15f80 100644 --- a/debian/not-installed +++ b/debian/not-installed @@ -1,7 +1,7 @@ -debian/tmp/usr/lib/python3.*/dist-packages/gbp/deb/__pycache__ -debian/tmp/usr/lib/python3.*/dist-packages/gbp/git/__pycache__ -debian/tmp/usr/lib/python3.*/dist-packages/gbp/pkg/__pycache__ -debian/tmp/usr/lib/python3.*/dist-packages/gbp/__pycache__ -debian/tmp/usr/lib/python3.*/dist-packages/gbp/rpm/__pycache__ -debian/tmp/usr/lib/python3.*/dist-packages/gbp/scripts/common/__pycache__ -debian/tmp/usr/lib/python3.*/dist-packages/gbp/scripts/__pycache__ +debian/tmp/usr/local/lib/python3.*/dist-packages/gbp/deb/__pycache__ +debian/tmp/usr/local/lib/python3.*/dist-packages/gbp/git/__pycache__ +debian/tmp/usr/local/lib/python3.*/dist-packages/gbp/pkg/__pycache__ +debian/tmp/usr/local/lib/python3.*/dist-packages/gbp/__pycache__ +debian/tmp/usr/local/lib/python3.*/dist-packages/gbp/rpm/__pycache__ +debian/tmp/usr/local/lib/python3.*/dist-packages/gbp/scripts/common/__pycache__ +debian/tmp/usr/local/lib/python3.*/dist-packages/gbp/scripts/__pycache__ diff --git a/debian/rules b/debian/rules index 0ac72e4..3ca35af 100755 --- a/debian/rules +++ b/debian/rules @@ -39,7 +39,7 @@ override_dh_auto_build: make -C docs override_dh_auto_install: - dh_auto_install + python3 setup.py install --root=debian/tmp --prefix=/usr/local dh_bash-completion mkdir -p debian/git-buildpackage/$(ZSH_COMPDIR) install -m644 debian/git-buildpackage.zsh-completion \ @@ -59,3 +59,5 @@ override_dh_auto_clean: override_dh_compress: dh_compress --exclude=usr/share/doc/git-buildpackage/examples/ +override_dh_usrlocal: + diff --git a/docs/Makefile b/docs/Makefile index cd65701..b2220d1 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -31,7 +31,7 @@ DEB_VERSION=$(shell sed -ne 's/^gbp_version="\([.a-z0-9~-]\+\)"/\1/p' $(GBP_VERS CHANGELOG=../debian/changelog # Stuff to build docs outside Debian -HAVE_SGML2X ?= 1 +HAVE_SGML2X ?= 0 GTK_DOC_CATALOG_FILE ?= /usr/share/sgml/gtk-doc/gtk-doc.cat all: $(MANUAL) $(MANPAGES) diff --git a/gbp/config.py b/gbp/config.py index 8b65924..ab24f22 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -17,7 +17,7 @@ """handles command line and config file option parsing for the gbp commands""" from optparse import OptionParser, OptionGroup, Option, OptionValueError -from configparser import SafeConfigParser, NoSectionError +from configparser import ConfigParser, NoSectionError from copy import copy import os.path import tempfile @@ -393,7 +393,7 @@ class GbpOptionParser(OptionParser): Parse the possible config files and set appropriate values default values """ - parser = SafeConfigParser() + parser = ConfigParser() # Fill in the built in values self.config = dict(self.__class__.defaults) # Update with the values from the defaults section. This is needed diff --git a/gbp/git/repository.py b/gbp/git/repository.py index 4d82d28..9d94b82 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -1197,10 +1197,10 @@ class GitRepository(object): fetch_url = None push_urls = [] for line in out.decode().splitlines(): - match = re.match('\s*Fetch\s+URL:\s*(\S.*)', line) + match = re.match(r'\s*Fetch\s+URL:\s*(\S.*)', line) if match: fetch_url = match.group(1) - match = re.match('\s*Push\s+URL:\s*(\S.*)', line) + match = re.match(r'\s*Push\s+URL:\s*(\S.*)', line) if match: push_urls.append(match.group(1)) remotes[remote] = GitRemote(remote, fetch_url, push_urls) diff --git a/gbp/rpm/__init__.py b/gbp/rpm/__init__.py index a4e6b79..6395680 100644 --- a/gbp/rpm/__init__.py +++ b/gbp/rpm/__init__.py @@ -111,11 +111,11 @@ class SrcRpmFile(object): class SpecFile(object): """Class for parsing/modifying spec files""" tag_re = re.compile(r'^(?P[a-z]+)(?P[0-9]+)?\s*:\s*' - '(?P\S(.*\S)?)\s*$', flags=re.I) + r'(?P\S(.*\S)?)\s*$', flags=re.I) directive_re = re.compile(r'^%(?P[a-z]+)(?P[0-9]+)?' - '(\s+(?P.*))?$', flags=re.I) + r'(\s+(?P.*))?$', flags=re.I) gbptag_re = re.compile(r'^\s*#\s*gbp-(?P[a-z-]+)' - '(\s*:\s*(?P\S.*))?$', flags=re.I) + r'(\s*:\s*(?P\S.*))?$', flags=re.I) # Here "sections" stand for all scripts, scriptlets and other directives, # but not macros section_identifiers = ('package', 'description', 'prep', 'build', 'install', @@ -622,7 +622,7 @@ class SpecFile(object): if not tag['num'] in ignored: tag_prev = self._delete_tag('patch', tag['num']) # Remove a preceding comment if it seems to originate from GBP - if re.match("^\s*#.*patch.*auto-generated", + if re.match(r"^\s*#.*patch.*auto-generated", str(tag_prev), flags=re.I): tag_prev = self._content.delete(tag_prev) @@ -639,7 +639,7 @@ class SpecFile(object): # Remove a preceding comment line if it ends with '.patch' or # '.diff' plus an optional compression suffix - if re.match("^\s*#.+(patch|diff)(\.(gz|bz2|xz|lzma))?\s*$", + if re.match(r"^\s*#.+(patch|diff)(\.(gz|bz2|xz|lzma))?\s*$", str(macro_prev), flags=re.I): macro_prev = self._content.delete(macro_prev) diff --git a/gbp/rpm/policy.py b/gbp/rpm/policy.py index 82e877d..9af2809 100644 --- a/gbp/rpm/policy.py +++ b/gbp/rpm/policy.py @@ -29,7 +29,7 @@ class RpmPkgPolicy(PkgPolicy): alnum = 'a-zA-Z0-9' # Valid characters for RPM pkg name - name_whitelist_chars = '._+%{}\-' + name_whitelist_chars = r'._+%{}\-' # Valid characters for RPM pkg version version_whitelist_chars = '._+%{}~' diff --git a/gbp/scripts/common/pq.py b/gbp/scripts/common/pq.py index bd49e94..fd53eb7 100644 --- a/gbp/scripts/common/pq.py +++ b/gbp/scripts/common/pq.py @@ -50,7 +50,7 @@ def pq_branch_match(branch, pq_fmt_str): >>> pq_branch_match('foo/bar/1.0/pq', 'foo/%(br)s/%(ver)s/pq').groupdict() {'ver': '1.0', 'br': 'bar'} """ - pq_re = '^%s$' % re.sub('%\(([a-z_\-]+)\)s', r'(?P<\1>\\S+)', pq_fmt_str) + pq_re = '^%s$' % re.sub(r'%\(([a-z_\-]+)\)s', r'(?P<\1>\\S+)', pq_fmt_str) return re.match(pq_re, branch) @@ -207,7 +207,7 @@ def write_patch_file(filename, commit_info, diff): name = commit_info['author']['name'] email = commit_info['author']['email'] # Git compat: put name in quotes if special characters found - if re.search("[,.@()\[\]\\\:;]", name): + if re.search(r"[,.@()\[\]\\\:;]", name): name = '"%s"' % name from_header = Header(header_name='from') try: diff --git a/gbp/scripts/import_srpm.py b/gbp/scripts/import_srpm.py index 88ca481..2806e59 100755 --- a/gbp/scripts/import_srpm.py +++ b/gbp/scripts/import_srpm.py @@ -382,7 +382,7 @@ def main(argv): # for both upstream sources and packaging files author = None if spec.packager: - match = re.match('(?P.*[^ ])\s*<(?P\S*)>', + match = re.match(r'(?P.*[^ ])\s*<(?P\S*)>', spec.packager.strip()) if match: author = GitModifier(match.group('name'), match.group('email')) diff --git a/packaging/git-buildpackage.changes b/packaging/git-buildpackage.changes index 91c749e..20a58d9 100755 --- a/packaging/git-buildpackage.changes +++ b/packaging/git-buildpackage.changes @@ -1,3 +1,7 @@ +* Wed Jun 05 2024 Xu Huayong tizen/0.9.36-20240605 +- Upgrade version to override the version from mirrors. +- Fix build errors on ubuntu 24.04. + * Thu Nov 30 2023 Xu Huayong tizen/0.9.28-20231130 - Fix git-buildpackage issue to adapt the librpm-tizen 4.14 version diff --git a/packaging/git-buildpackage.spec b/packaging/git-buildpackage.spec index 4a04715..c8cede6 100755 --- a/packaging/git-buildpackage.spec +++ b/packaging/git-buildpackage.spec @@ -5,7 +5,7 @@ Name: git-buildpackage Summary: Build packages from git -Version: 0.9.28 +Version: 0.9.36 Release: 0 Group: Development/Tools/Building License: GPLv2 @@ -115,7 +115,7 @@ Recommends: rpm-build %else Requires: rpm-build %endif -Provides: tizen-gbp-rpm = 20231130 +Provides: tizen-gbp-rpm = 20240605 %description rpm Set of tools from Debian that integrate the package build system with Git. diff --git a/setup.py b/setup.py index a0a94b9..93ab02c 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ # END OF COPYRIGHT # import subprocess -from setuptools import setup, find_packages +from setuptools import setup import os @@ -76,7 +76,8 @@ setup(name = "gbp", 'bin/git-buildpackage-rpm', 'bin/git-import-orig-rpm', 'bin/git-rpm-ch'], - packages = find_packages(exclude=['tests', 'tests.*']), + packages = ['gbp', 'gbp.bb', 'gbp.rpm', 'gbp.scripts', 'gbp.scripts.common', + 'gbp.git', 'gbp.deb', 'gbp.pkg'], data_files = [("/etc/git-buildpackage/", ["gbp.conf"]),], requires=['dateutil'], install_requires=[ -- 2.7.4