mirror of
https://github.com/clearlinux/autospec.git
synced 2026-08-19 21:46:14 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 239d8cd618 | |||
| 16ee88cb20 | |||
| 617c67c388 | |||
| 2cf51ddfb9 | |||
| 6174188098 | |||
| 61e16733c8 | |||
| 5905be97e8 | |||
| 81e1eebe28 |
@@ -113,6 +113,7 @@ def commit_to_git(config, name, success):
|
|||||||
call("git add whatrequires", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
call("git add whatrequires", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
||||||
call("git add description", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
call("git add description", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
||||||
call("git add attrs", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
call("git add attrs", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
||||||
|
call("git add archive.diff", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
||||||
|
|
||||||
# remove deprecated config files
|
# remove deprecated config files
|
||||||
call("git rm make_install_append", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
call("git rm make_install_append", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
||||||
|
|||||||
@@ -444,7 +444,7 @@ class Specfile(object):
|
|||||||
self._write_strip("chmod 700 .gnupg")
|
self._write_strip("chmod 700 .gnupg")
|
||||||
self._write_strip(f"gpg --homedir .gnupg --import {self.config.pkey_macro}")
|
self._write_strip(f"gpg --homedir .gnupg --import {self.config.pkey_macro}")
|
||||||
self._write_strip(f"gpg --homedir .gnupg --status-fd 1 --verify {self.config.signature_macro} %{{SOURCE0}} > gpg.status")
|
self._write_strip(f"gpg --homedir .gnupg --status-fd 1 --verify {self.config.signature_macro} %{{SOURCE0}} > gpg.status")
|
||||||
self._write_strip(f"grep '^\\[GNUPG:\\] GOODSIG {self.keyid}' gpg.status")
|
self._write_strip(f"grep -E '^\\[GNUPG:\\] (GOODSIG|EXPKEYSIG) {self.keyid}' gpg.status")
|
||||||
self.write_prep_prepend()
|
self.write_prep_prepend()
|
||||||
prefix = self.content.prefixes[self.url]
|
prefix = self.content.prefixes[self.url]
|
||||||
if self.config.default_pattern == 'R':
|
if self.config.default_pattern == 'R':
|
||||||
|
|||||||
+26
-2
@@ -26,7 +26,7 @@ import tarfile
|
|||||||
import zipfile
|
import zipfile
|
||||||
|
|
||||||
import download
|
import download
|
||||||
from util import do_regex, get_sha1sum, print_fatal, write_out
|
from util import call, do_regex, get_sha1sum, print_fatal, write_out
|
||||||
|
|
||||||
|
|
||||||
class Source():
|
class Source():
|
||||||
@@ -135,7 +135,7 @@ def convert_version(ver_str, name):
|
|||||||
# them out with expensive regular expressions
|
# them out with expensive regular expressions
|
||||||
banned_subs = ["x86.64", "source", "src", "all", "bin", "release", "rh",
|
banned_subs = ["x86.64", "source", "src", "all", "bin", "release", "rh",
|
||||||
"ga", ".ce", "lcms", "onig", "linux", "gc", "sdk", "orig",
|
"ga", ".ce", "lcms", "onig", "linux", "gc", "sdk", "orig",
|
||||||
"jurko", "%2f", "%2F", "%20"]
|
"jurko", "%2f", "%2F", "%20", "x265"]
|
||||||
|
|
||||||
# package names may be modified in the version string by adding "lib" for
|
# package names may be modified in the version string by adding "lib" for
|
||||||
# example. Remove these from the name before trying to remove the name from
|
# example. Remove these from the name before trying to remove the name from
|
||||||
@@ -184,6 +184,7 @@ class Content():
|
|||||||
self.prefixes = dict()
|
self.prefixes = dict()
|
||||||
self.config = config
|
self.config = config
|
||||||
self.base_path = base_path
|
self.base_path = base_path
|
||||||
|
self.autogenerated_tarball = None
|
||||||
|
|
||||||
def write_upstream(self, sha, tarfile, mode="w"):
|
def write_upstream(self, sha, tarfile, mode="w"):
|
||||||
"""Write the upstream hash to the upstream file."""
|
"""Write the upstream hash to the upstream file."""
|
||||||
@@ -213,6 +214,14 @@ class Content():
|
|||||||
main_src = Source(url, '', src_path, self.config.default_pattern)
|
main_src = Source(url, '', src_path, self.config.default_pattern)
|
||||||
return main_src
|
return main_src
|
||||||
|
|
||||||
|
def process_autogenerated_source(self, url):
|
||||||
|
"""Download any autogenerated source tarball for comparison."""
|
||||||
|
autogenerated_src = None
|
||||||
|
if url:
|
||||||
|
src_path = self.check_or_get_file(url, os.path.basename(url), mode="")
|
||||||
|
autogenerated_src = Source(url, '../autogenerated-tmp', src_path, self.config.default_pattern)
|
||||||
|
return autogenerated_src
|
||||||
|
|
||||||
def print_header(self):
|
def print_header(self):
|
||||||
"""Print header for autospec run."""
|
"""Print header for autospec run."""
|
||||||
print("\n")
|
print("\n")
|
||||||
@@ -295,6 +304,9 @@ class Content():
|
|||||||
name = re.sub(r"release-", '', name)
|
name = re.sub(r"release-", '', name)
|
||||||
name = re.sub(r"\d*$", '', name)
|
name = re.sub(r"\d*$", '', name)
|
||||||
self.rawname = name
|
self.rawname = name
|
||||||
|
# Identify the auto-generated tarball URL for comparison
|
||||||
|
if "/releases/download/" in self.url:
|
||||||
|
self.autogenerated_tarball = "https://github.com/" + match.group(1).strip() + "/" + self.repo + "/archive/refs/tags/" + match.group(3).strip() + ".tar.gz"
|
||||||
version = match.group(3).replace(name, '')
|
version = match.group(3).replace(name, '')
|
||||||
if "/archive/" not in self.url:
|
if "/archive/" not in self.url:
|
||||||
version = re.sub(r"^[-_.a-zA-Z]+", "", version)
|
version = re.sub(r"^[-_.a-zA-Z]+", "", version)
|
||||||
@@ -427,3 +439,15 @@ class Content():
|
|||||||
archives_src = self.process_archives()
|
archives_src = self.process_archives()
|
||||||
# Extract all sources
|
# Extract all sources
|
||||||
self.extract_sources(main_src, archives_src)
|
self.extract_sources(main_src, archives_src)
|
||||||
|
# Download and process any auto-generated source-tree archive for comparison
|
||||||
|
autogenerated_src = self.process_autogenerated_source(self.autogenerated_tarball)
|
||||||
|
# Extract autogenerated source for comparison
|
||||||
|
if autogenerated_src:
|
||||||
|
autogenerated_src.extract(os.path.join(self.base_path, 'autogenerated-tmp'))
|
||||||
|
# Move the autogenerated source to a non-version-named directory for consistent diffs
|
||||||
|
call(f"mv autogenerated-tmp/{autogenerated_src.prefix} autogenerated", check=True, cwd=self.base_path)
|
||||||
|
call("diff -u -r --unidirectional-new-file ../autogenerated ./",
|
||||||
|
logfile="archive.diff.in", check=False, cwd=os.path.join(self.base_path, main_src.prefix))
|
||||||
|
call("grep -A14 -E '^(diff|Only in)' archive.diff.in",
|
||||||
|
logfile="archive.diff", check=False, cwd=os.getcwd())
|
||||||
|
call("rm archive.diff.in", check=False, cwd=os.getcwd())
|
||||||
|
|||||||
+3
-2
@@ -150,8 +150,9 @@ def binary_in_path(binary):
|
|||||||
|
|
||||||
def write_out(filename, content, mode="w"):
|
def write_out(filename, content, mode="w"):
|
||||||
"""File.write convenience wrapper."""
|
"""File.write convenience wrapper."""
|
||||||
with open_auto(filename, mode) as require_f:
|
if mode:
|
||||||
require_f.write(content)
|
with open_auto(filename, mode) as require_f:
|
||||||
|
require_f.write(content)
|
||||||
|
|
||||||
|
|
||||||
def open_auto(*args, **kwargs):
|
def open_auto(*args, **kwargs):
|
||||||
|
|||||||
Reference in New Issue
Block a user