7
0
forked from pool/rpmdevtools
Files
rpmdevtools/bumpspec_checksig_avoid_python_3.6_regex_related_deprecations.patch
Martin Pluskal 237978c956 Accepting request 797224 from home:benoit_monin:branches:devel:tools
- Switch to python 3:
  * Require python3-rpm instead of python2-rpm
  * Add python3-shebang.patch to run python scripts with python3
  * Add rmdevelrpms_fix_filename_search.patch to add compatibility
    with both newer and older rpm binding
  * Backport upstream commits 2ddae80, 693c954 and ea772da

OBS-URL: https://build.opensuse.org/request/show/797224
OBS-URL: https://build.opensuse.org/package/show/devel:tools/rpmdevtools?expand=0&rev=26
2020-04-24 17:41:48 +00:00

40 lines
1.3 KiB
Diff

From 693c9549280b78860b756b593b5922bf3be46888 Mon Sep 17 00:00:00 2001
From: Ville Skyttä <ville.skytta@iki.fi>
Date: Feb 15 2017 09:19:29 +0000
Subject: bumpspec, checksig: Avoid python 3.6 regex related deprecations
---
diff --git a/rpmdev-bumpspec b/rpmdev-bumpspec
index ea2ddd9..35e6c9c 100755
--- a/rpmdev-bumpspec
+++ b/rpmdev-bumpspec
@@ -44,8 +44,10 @@ class SpecFile(object):
# supported release value macro definitions
_macro_bump_patterns = (
- re.compile(r"^%(?:define|global)\s+(?i)release\s+(\d+.*)"),
- re.compile(r"^%(?:define|global)\s+(?i)baserelease\s+(\d+.*)"),
+ re.compile(r"^%(?:define|global)\s+"
+ r"[Rr][Ee][Ll][Ee][Aa][Ss][Ee]\s+(\d+.*)"),
+ re.compile(r"^%(?:define|global)\s+"
+ r"[Bb][Aa][Ss][Ee][Rr][Ee][Ll][Ee][Aa][Ss][Ee]\s+(\d+.*)"),
)
# normal "Release:" tag lines
_tag_bump_patterns = (
diff --git a/rpmdev-checksig b/rpmdev-checksig
index 0e90fe5..76b5967 100755
--- a/rpmdev-checksig
+++ b/rpmdev-checksig
@@ -44,7 +44,7 @@ def lookupKeyID(ts, keyid):
mi.pattern('version', rpm.RPMMIRE_STRCMP, keyid)
for hdr in mi:
sum = hdr['summary']
- mo = re.search(b'\<.*\>', sum)
+ mo = re.search(rb'\<.*\>', sum)
email = mo.group().decode(errors='replace')
return email