Fix build errors on Ubuntu 24.04 39/314539/8
authorxuhy <huayong.xu@samsung.com>
Wed, 5 Jun 2024 07:02:03 +0000 (15:02 +0800)
committerxuhy <huayong.xu@samsung.com>
Mon, 22 Jul 2024 03:53:59 +0000 (11:53 +0800)
Change-Id: Ifa871acfcedcfd55e63cd66eaecce7dc33bcf357
Signed-off-by: xuhy <huayong.xu@samsung.com>
15 files changed:
Makefile
bsr/bsr/gbs/gbs_actions.py
bsr/setup.cfg
bsr/setup.py
bsr/tox.ini
debian/compat
debian/control
debian/gbs-bsr.install
debian/rules
gitbuildsys/cmd_chroot.py
gitbuildsys/cmd_devel.py
gitbuildsys/oscapi.py
packaging/gbs.spec
setup.py
tests/test_passwdx.py

index 9b9a02ddba2dc7ea35ecb60e243c52266ee5f693..3121d5242c23cccad923fec398bbcf83999a89be 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -12,10 +12,6 @@ ifndef PREFIX
     PREFIX = "/usr/local"
 endif
 
-all:
-       python3 setup.py build
-       cd bsr && python3 setup.py build && cd ..
-
 tag:
        git tag $(VERSION)
 
@@ -43,12 +39,10 @@ pdf:
 
 docs: man html pdf
 
-install: all
-       python3 setup.py install --prefix=${PREFIX}
-       cd bsr && python3 setup.py install --prefix=${PREFIX} && cd ..
-
 clean:
        rm -rf {build/,dist/,*.egg-info/}
        cd bsr && rm -rf {build/,dist/,*.egg-info/} && cd ..
+
 test:
        nosetests -v --with-coverage --with-xunit
+
index c8149cc11051e1e853974f17c53b726bcee21e76..990fc0d02d8b31e5029d23a48d8de89419bc5d26 100755 (executable)
@@ -18,10 +18,7 @@ import os
 import subprocess
 import shutil
 
-try:
-    from configparser import SafeConfigParser
-except ImportError:
-    from configparser import SafeConfigParser
+from configparser import ConfigParser
 
 from bsr.utility.utils import pushd, console, list_all_directories
 
@@ -130,7 +127,7 @@ class GbsAction:
         console('Use gbs configuration file from {}'.format(self.get_config_file()), \
                 self.verbose)
 
-        parser = SafeConfigParser()
+        parser = ConfigParser()
         parser.read(self.get_config_file())
 
         conf_profile = parser.get('general', 'profile')
index 0c9e0fc1447e98b7f63ae8c9eb552c2af7b83f45..8183238ab1c7f1b7f360cd8536d5f4f75e3fe170 100644 (file)
@@ -1,2 +1,2 @@
 [metadata]
-license_file = LICENSE
+license_files = LICENSE
index 166b5cdcf2f5301ed1023819a88618d4417369fe..9567c34293d543922779856885b94b1f36615dc8 100644 (file)
@@ -3,7 +3,7 @@
 """A setuptools based setup module.
 """
 
-from setuptools import setup, find_packages
+from setuptools import setup
 import os
 import sys
 
@@ -23,15 +23,6 @@ with open(os.path.join(here, 'bsr', '__version__.py'), 'r') as f:
 with open('README.md', 'r') as f:
     readme = f.read()
 
-def package_files(directory):
-    paths = []
-    for (path, directories, filenames) in os.walk(directory):
-        for filename in filenames:
-            paths.append(os.path.join('..', path, filename))
-    return paths
-
-extra_files = package_files('bsr/web_dist')
-
 def check_debian():
     """--install-layout is recognized after 2.5"""
     if sys.version_info[:2] > (2, 5):
@@ -57,13 +48,19 @@ setup(
     author=about['__author__'],
     author_email=about['__author_email__'],
     url=about['__url__'],
-    packages=find_packages(),
     scripts=['bsr/bsr'],
+    packages=['bsr', 'bsr.analyzer', 'bsr.network', 'bsr.tests', 'bsr.report', 'bsr.utility', 'bsr.gbs',
+              'bsr.web_dist', 'bsr.web_dist.images', 'bsr.web_dist.static.css',
+              'bsr.web_dist.static.js', 'bsr.web_dist.static.media'],
     package_data={
-        '': ['LICENSE', 'NOTICE'] + extra_files,
-        'requests': ['*.pem']
+        '': ['LICENSE', 'NOTICE'],
+        'requests': ['*.pem'],
+        'bsr.web_dist': ["*.json", "*.html"],
+        'bsr.web_dist.images': ["*.svg", "*.png"],
+        'bsr.web_dist.static.css': ["*.css"],
+        'bsr.web_dist.static.js': ["*.js", "*.txt"],
+        'bsr.web_dist.static.media': ["*.woff2", "*.ttf", "*.svg", "*.woff", "*.eot", "*.png"],
         },
-    package_dir={'bsr': 'bsr'},
     include_package_data=True,
     python_requires=">=2.7.17, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
     install_requires=requires,
index 80454e0117b5edaa0b6f350e1760dc02ad55abeb..9767ba1f120f2b6ef197ce3dbcf42257f8d8f798 100644 (file)
@@ -4,4 +4,4 @@ envlist = py27,py35,py36,py37,py38
 [testenv]
 
 commands =
-    python setup.py test
+    pytest
index 7f8f011eb73d6043d2e6db9d2c101195ae2801f2..f599e28b8ab0d8c9c57a486c89c4a5132dcbd3b2 100644 (file)
@@ -1 +1 @@
-7
+10
index fc1cf9c66a0c8d366b499249eef841b84c32b6ae..c2e7f652110ece0556e469eaa333896f6fcd9738 100755 (executable)
@@ -15,7 +15,7 @@ Depends: ${misc:Depends}, ${python3:Depends},
  python3-lxml,
  sudo,
  osc (>= 0.170.1),
- git-buildpackage-rpm (>= 0.9.28-tizen20231130),
+ git-buildpackage-rpm (>= 0.9.36+tizen20240605),
  gbs-api (= ${binary:Version}),
  gbs-export (= ${binary:Version}),
  gbs-remotebuild (= ${binary:Version}),
index 11210327f35d8b2d5d5b2aa3d9b83ecdd2c19d05..26bdaf31d08fb092ec792c59acbdda071753edd5 100644 (file)
@@ -1,8 +1,8 @@
-usr/lib/python*/*packages/bsr/*.py
-usr/lib/python*/*packages/bsr/analyzer/*.py
-usr/lib/python*/*packages/bsr/gbs/*.py
-usr/lib/python*/*packages/bsr/network/*.py
-usr/lib/python*/*packages/bsr/report/*.py
-usr/lib/python*/*packages/bsr/utility/*.py
-usr/lib/python*/*packages/bsr/web_dist/*
-usr/bin/bsr
+usr/local/lib/python*/*packages/bsr/*.py
+usr/local/lib/python*/*packages/bsr/analyzer/*.py
+usr/local/lib/python*/*packages/bsr/gbs/*.py
+usr/local/lib/python*/*packages/bsr/network/*.py
+usr/local/lib/python*/*packages/bsr/report/*.py
+usr/local/lib/python*/*packages/bsr/utility/*.py
+usr/local/lib/python*/*packages/bsr/web_dist/*
+usr/local/bin/bsr /usr/bin
index 262f1b4dc76c738e0be1510f427bb6e9a1c71995..48ac8e073cdf53787fbc7b008ead1671ebcd6cbe 100644 (file)
@@ -6,7 +6,7 @@
 override_dh_auto_install:
        python3 setup.py install --root=debian/tmp --prefix=/usr
        make man
-       cd bsr && python3 setup.py install --root=../debian/tmp --prefix=/usr && cd ..
+       cd bsr && python3 setup.py install --root=../debian/tmp --prefix=/usr/local && cd ..
        mkdir -p debian/tmp/usr/share/man/man1
        mkdir -p debian/tmp/usr/share/gbs
        install -m644 docs/gbs.1 debian/tmp/usr/share/man/man1
index 796e986f22a096eaee95db4bd4735ebd6c1e9d75..fd59ee84c4da172a4bb93c4c220e784bf8dd3106 100644 (file)
@@ -47,7 +47,7 @@ def main(args):
 
     try:
         build_env = os.environ
-        build_env['PS1'] = "(tizen-build-env)@\h \W]\$ "
+        build_env['PS1'] = r"(tizen-build-env)@\h \W]\$ "
         subprocess.call(cmd, env=build_env)
     except OSError as err:
         raise GbsError('failed to chroot to %s: %s' % (build_root, err))
index 05c119b2981b37acfbe32d4fff9e0dcf4cf32bae..912ecc197c2998ddcd239a8e6a143f33e9ba7232 100644 (file)
@@ -67,7 +67,7 @@ def update_local_conf(repo, values):
     conf_fn = os.path.join(repo.path, '.gbs.conf')
     log.info('Updating local .gbs.conf')
     with open(conf_fn, 'a+') as conf_fp:
-        parser.readfp(conf_fp)
+        parser.read_file(conf_fp)
     for section, items in list(values.items()):
         for key, value in list(items.items()):
             parser.set_into_file(section, key, value)
index 3d5cbee731406d6a2872fc02da408e921809bbed..3dfb4b94886804084b187d6a64f57e65f93a6769 100644 (file)
@@ -327,7 +327,7 @@ class OSC(object):
         # This regular expression is created for parsing the
         # results of of core.get_results()
         stat_re = re.compile(r'^(?P<repo>\S+)\s+(?P<arch>\S+)\s+'
-                             '(?P<status>\S*)$')
+                             r'(?P<status>\S*)$')
         for res in build_status:
             match = stat_re.match(res)
             if match:
index 80f2844bf4f64859bc8a96479d20fbe1d6f2573b..40d9ea6838762e3f1b9d133cbf3f8f69a8279a0b 100755 (executable)
@@ -23,7 +23,7 @@ Requires:   python3-requests
 Requires:   python3-lxml
 Requires:   sudo
 Requires:   osc >= 0.170.1
-Requires:   tizen-gbp-rpm >= 20231130
+Requires:   tizen-gbp-rpm >= 20240605
 Requires:   depanneur >= 0.16.24
 
 %if ! 0%{?tizen_version:1}
index 03dbff8a7425978641614f4af0426d41c90b953d..cbee27368c949aa63988cb679bf44d93d01b057d 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@
 import os, sys
 import re
 
-from distutils.core import setup
+from setuptools import setup
 
 MOD_NAME = 'gitbuildsys'
 
index 59d5a860d46c1289f0cd8ba19f4fca27d3605959..a8dafc2a3aa427373848696f7186c5256a9a1a6d 100644 (file)
@@ -166,7 +166,7 @@ class AutoGenerateTest(unittest.TestCase):
         reload(gitbuildsys.conf)
 
         parser = BrainConfigParser()
-        parser.readfp(StringIO(conf.getvalue()))
+        parser.read_file(StringIO(conf.getvalue()))
 
         name = parser.get('general', 'profile')
         repos = parser.get(name, 'repos')