Remove dpatch dependency. 45/314545/1
authorxuhy <huayong.xu@samsung.com>
Mon, 24 Jun 2024 01:50:22 +0000 (09:50 +0800)
committerxuhy <huayong.xu@samsung.com>
Mon, 15 Jul 2024 06:47:28 +0000 (14:47 +0800)
dpatch package is not available on ubuntu 24.04.

Change-Id: I2e155d33f33f84f720786683c5c51d632d632d5f
Signed-off-by: xuhy <huayong.xu@samsung.com>
debian/control
osc/OscConfigParser.py
osc/commandline.py
osc/core.py
osc/util/archquery.py
osc/util/debquery.py
osc/util/rpmquery.py

index 9556ff909b9142bd1e8988faefbfa135055afe17..600e91d6433908731cf64e2dbcb1c3a9b7d83933 100644 (file)
@@ -2,7 +2,7 @@ Source: osc
 Section: devel
 Priority: extra
 Maintainer: Adrian Schroeter <adrian@suse.de>
-Build-Depends: debhelper (>= 7.0.15), dpatch, dh-python, python3, python3-dev, python3-urlgrabber
+Build-Depends: debhelper (>= 7.0.15), dh-python, python3, python3-dev, python3-urlgrabber
 Standards-Version: 3.8.3
 Homepage: http://en.opensuse.org/Build_Service/CLI
 
index f552887ee0c8117c913b7a691c90af130cd6b018..92e47d74db956b8e21b43e66792ac9270d8a19ac 100644 (file)
@@ -203,7 +203,7 @@ class OptionLine(Line):
         return self.value
 
 
-class OscConfigParser(configparser.SafeConfigParser):
+class OscConfigParser(configparser.ConfigParser):
     """
     OscConfigParser() behaves like a normal ConfigParser() object. The
     only differences is that it preserves the order+format of configuration entries
@@ -212,7 +212,7 @@ class OscConfigParser(configparser.SafeConfigParser):
     class.
     """
     def __init__(self, defaults={}):
-        configparser.SafeConfigParser.__init__(self, defaults)
+        configparser.ConfigParser.__init__(self, defaults)
         self._sections = ConfigLineOrder()
 
     # XXX: unfortunately we have to override the _read() method from the ConfigParser()
@@ -321,7 +321,7 @@ class OscConfigParser(configparser.SafeConfigParser):
             fp.write(str(self))
             fp.write('\n')
         else:
-            configparser.SafeConfigParser.write(self, fp)
+            configparser.ConfigParser.write(self, fp)
 
     def has_option(self, section, option, proper=False, **kwargs):
         """
@@ -331,7 +331,7 @@ class OscConfigParser(configparser.SafeConfigParser):
         """
         if proper:
             return self.optionxform(option) in list(self._sections[section].keys())
-        return configparser.SafeConfigParser.has_option(self, section, option, **kwargs)
+        return configparser.ConfigParser.has_option(self, section, option, **kwargs)
 
     # XXX: simplify!
     def __str__(self):
index 3516e5218733dcbe5d81c159ef2b27b30ee98b44..8b0d3c78e1149d3c32d3824e0c4155531f638b7a 100644 (file)
@@ -8,9 +8,9 @@
 from . import cmdln
 from . import conf
 from . import oscerr
+from importlib.machinery import SourceFileLoader
 import sys
 import time
-import imp
 import inspect
 try:
     from urllib.parse import urlsplit
@@ -6814,8 +6814,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
 
         # XXX: is it a good idea to make this the default?
         # support perl symbols:
-        if re.match('^perl\(\w+(::\w+)*\)$', search_term):
-            search_term = re.sub('\)', '', re.sub('(::|\()', '-', search_term))
+        if re.match(r'^perl\(\w+(::\w+)*\)$', search_term):
+            search_term = re.sub(r'\)', '', re.sub(r'(::|\()', '-', search_term))
             opts.package = True
 
         if opts.mine:
@@ -6835,8 +6835,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
 
         if opts.binary and (opts.title or opts.description or opts.involved or opts.bugowner or opts.maintainer
                             or opts.project or opts.package):
-            raise oscerr.WrongOptions('Sorry, \'--binary\' and \'--title\' or \'--description\' or \'--involved ' \
-                                      'or \'--bugowner\' or \'--maintainer\' or \'--limit-to-attribute <attr>\ ' \
+            raise oscerr.WrongOptions('Sorry, \'--binary\' and \'--title\' or \'--description\' or \'--involved\' ' \
+                                      'or \'--bugowner\' or \'--maintainer\' or \'--limit-to-attribute <attr>\' ' \
                                       'or \'--project\' or \'--package\' are mutually exclusive')
 
         apiurl = self.get_api_url()
@@ -8042,7 +8042,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
                 fp = file(fn_changelog)
                 titleline = fp.readline()
                 fp.close()
-                if re.match('^\*\W+(.+\W+\d{1,2}\W+20\d{2})\W+(.+)\W+<(.+)>\W+(.+)$', titleline):
+                if re.match(r'^\*\W+(.+\W+\d{1,2}\W+20\d{2})\W+(.+)\W+<(.+)>\W+(.+)$', titleline):
                     meego_style = True
             except IndexError:
                 pass
@@ -8338,7 +8338,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
                     continue
                 try:
                     modname = os.path.splitext(extfile)[0]
-                    mod = imp.load_source(modname, os.path.join(plugin_dir, extfile))
+                    mod = SourceFileLoader(modname, os.path.join(plugin_dir, extfile)).load_module()
                     # restore the old exec semantic
                     mod.__dict__.update(globals())
                     for name in dir(mod):
index 9c354baf1bca9887b11c305ef37bee9bb349fc20..8ac8f3896fc60293ffcabfa8e5f4c6c547630876 100644 (file)
@@ -3729,13 +3729,13 @@ def read_meta_from_spec(specfile, *args):
         else:
             tags.append(itm)
 
-    tag_pat = '(?P<tag>^%s)\s*:\s*(?P<val>.*)'
+    tag_pat = r'(?P<tag>^%s)\s*:\s*(?P<val>.*)'
     for tag in tags:
         m = re.compile(tag_pat % tag, re.I | re.M).search(''.join(lines))
         if m and m.group('val'):
             spec_data[tag] = m.group('val').strip()
 
-    section_pat = '^%s\s*?$'
+    section_pat = r'^%s\s*?$'
     for section in sections:
         m = re.compile(section_pat % section, re.I | re.M).search(''.join(lines))
         if m:
@@ -5602,7 +5602,7 @@ def streamfile(url, http_meth = http_GET, bufsize=8192, data=None, progress_obj=
 
 def buildlog_strip_time(data):
     """Strips the leading build time from the log"""
-    time_regex = re.compile('^\[[^\]]*\] ', re.M)
+    time_regex = re.compile(r'^\[[^\]]*\] ', re.M)
     return time_regex.sub('', data)
 
 
@@ -6776,7 +6776,7 @@ def request_interactive_review(apiurl, request, initial_cmd='', group=None, igno
                 prompt = 'd(i)ff/(a)ccept/(b)uildstatus/(e)dit/(s)kip/(c)ancel > '
             else:
                 state_map = {'a': 'accepted', 'd': 'declined', 'r': 'revoked'}
-                mo = re.search('^([adrl])(?:\s+(-f)?\s*-m\s+(.*))?$', repl)
+                mo = re.search(r'^([adrl])(?:\s+(-f)?\s*-m\s+(.*))?$', repl)
                 if mo is None or orequest and mo.group(1) != 'a':
                     print('invalid choice: \'%s\'' % repl, file=sys.stderr)
                     continue
index d89903e1c8e56b17d56875f2d67c83d1aa3793eb..304b41402ac5a2c40f9a6210325cfd1afb0340fe 100644 (file)
@@ -127,8 +127,8 @@ class ArchQuery(packagequery.PackageQuery, packagequery.PackageQueryResult):
             if not (len(ver1) and len(ver2)):
                 break
             # check if we have a digits segment
-            mo1 = re.match('(\d+)', ver1)
-            mo2 = re.match('(\d+)', ver2)
+            mo1 = re.match(r'(\d+)', ver1)
+            mo2 = re.match(r'(\d+)', ver2)
             numeric = True
             if mo1 is None:
                 mo1 = re.match('([a-zA-Z]+)', ver1)
index 0c63983f2d3e01f721f7812805d4e9b67662a1f4..586137a2cb59f226d29a35194acd56715c460ff4 100644 (file)
@@ -48,9 +48,9 @@ class DebQuery(packagequery.PackageQuery, packagequery.PackageQueryResult):
     def __parse_control(self, control, all_tags=False, self_provides=True, *extra_tags):
         data = control.readline().strip()
         while data:
-            field, val = re.split(':\s*', data.strip(), 1)
+            field, val = re.split(r':\s*', data.strip(), 1)
             data = control.readline()
-            while data and re.match('\s+', data):
+            while data and re.match(r'\s+', data):
                 val += '\n' + data.strip()
                 data = control.readline().rstrip()
             field = field.replace('-', '_').lower()
@@ -69,11 +69,11 @@ class DebQuery(packagequery.PackageQuery, packagequery.PackageQueryResult):
             self.fields['version'] = verep[1]
         else:
             self.fields['epoch'] = '0'
-        self.fields['provides'] = [ i.strip() for i in re.split(',\s*', self.fields.get('provides', '')) if i ]
-        self.fields['depends'] = [ i.strip() for i in re.split(',\s*', self.fields.get('depends', '')) if i ]
-        self.fields['pre_depends'] = [ i.strip() for i in re.split(',\s*', self.fields.get('pre_depends', '')) if i ]
-        self.fields['conflicts'] = [ i.strip() for i in re.split(',\s*', self.fields.get('conflicts', '')) if i ]
-        self.fields['breaks'] = [ i.strip() for i in re.split(',\s*', self.fields.get('breaks', '')) if i ]
+        self.fields['provides'] = [ i.strip() for i in re.split(r',\s*', self.fields.get('provides', '')) if i ]
+        self.fields['depends'] = [ i.strip() for i in re.split(r',\s*', self.fields.get('depends', '')) if i ]
+        self.fields['pre_depends'] = [ i.strip() for i in re.split(r',\s*', self.fields.get('pre_depends', '')) if i ]
+        self.fields['conflicts'] = [ i.strip() for i in re.split(r',\s*', self.fields.get('conflicts', '')) if i ]
+        self.fields['breaks'] = [ i.strip() for i in re.split(r',\s*', self.fields.get('breaks', '')) if i ]
         if self_provides:
             # add self provides entry
             self.fields['provides'].append('%s (= %s)' % (self.name(), '-'.join(versrel)))
@@ -142,8 +142,8 @@ class DebQuery(packagequery.PackageQuery, packagequery.PackageQueryResult):
         """
         # 32 is arbitrary - it is needed for the "longer digit string wins" handling
         # (found this nice approach in Build/Deb.pm (build package))
-        ver1 = re.sub('(\d+)', lambda m: (32 * '0' + m.group(1))[-32:], ver1)
-        ver2 = re.sub('(\d+)', lambda m: (32 * '0' + m.group(1))[-32:], ver2)
+        ver1 = re.sub(r'(\d+)', lambda m: (32 * '0' + m.group(1))[-32:], ver1)
+        ver2 = re.sub(r'(\d+)', lambda m: (32 * '0' + m.group(1))[-32:], ver2)
         vers = list(map(lambda x, y: (x or '', y or ''), ver1, ver2))
         for v1, v2 in vers:
             if v1 == v2:
index 9989108bb3d6f48efe18288981156a49f549df80..3c7ce181d38ae2dd7af8f75b5f1d687fbe9e990d 100644 (file)
@@ -292,8 +292,8 @@ class RpmQuery(packagequery.PackageQuery, packagequery.PackageQueryResult):
             if not (len(ver1) and len(ver2)):
                 break
             # check if we have a digits segment
-            mo1 = re.match('(\d+)', ver1)
-            mo2 = re.match('(\d+)', ver2)
+            mo1 = re.match(r'(\d+)', ver1)
+            mo2 = re.match(r'(\d+)', ver2)
             numeric = True
             if mo1 is None:
                 mo1 = re.match('([a-zA-Z]+)', ver1)