Rename packager_identity to packager

For some reason, the same thing was called differently in some parts
of the code. Let's use the same name everywhere.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2022-07-12 10:44:04 +02:00
parent d4655c252b
commit fa659143ad
4 changed files with 9 additions and 9 deletions

View file

@ -537,7 +537,7 @@ def main():
if args.dynamic_buildrequires is None: if args.dynamic_buildrequires is None:
args.dynamic_buildrequires = args.target == "fedora" args.dynamic_buildrequires = args.target == "fedora"
packager_identity = util.detect_packager() packager = util.detect_packager()
conf = configparser.ConfigParser(interpolation=configparser.ExtendedInterpolation()) conf = configparser.ConfigParser(interpolation=configparser.ExtendedInterpolation())
confs = conf.read([".rust2rpm.conf", "_rust2rpm.conf", "rust2rpm.conf"]) confs = conf.read([".rust2rpm.conf", "_rust2rpm.conf", "rust2rpm.conf"])
@ -571,7 +571,7 @@ def main():
metadata = metadata, metadata = metadata,
patch_file_automatic=patch_files[0], patch_file_automatic=patch_files[0],
patch_file_manual=patch_files[1], patch_file_manual=patch_files[1],
packager_identity = packager_identity, packager = packager,
doc_files = doc_files, doc_files = doc_files,
license_files = license_files, license_files = license_files,
distconf = conf[args.target], distconf = conf[args.target],

View file

@ -32,7 +32,7 @@ def spec_file_render(
metadata, metadata,
patch_file_manual, patch_file_manual,
patch_file_automatic, patch_file_automatic,
packager_identity, packager,
doc_files, doc_files,
license_files, license_files,
distconf, distconf,
@ -97,8 +97,8 @@ def spec_file_render(
([date] if date else [])) ([date] if date else []))
kwargs['date'] = time.strftime(*time_args) kwargs['date'] = time.strftime(*time_args)
if packager_identity is not None: if packager is not None:
kwargs['packager'] = packager_identity kwargs['packager'] = packager
if metadata.license is not None: if metadata.license is not None:
license, comments = licensing.translate_license(args.target, metadata.license) license, comments = licensing.translate_license(args.target, metadata.license)

View file

@ -62,7 +62,7 @@ def mock_spec_file_render(crate, tomlfile, target, tmpdir):
metadata = metadata, metadata = metadata,
patch_file_automatic = f'{crate}-patch1.diff', patch_file_automatic = f'{crate}-patch1.diff',
patch_file_manual = f'{crate}-patch2.diff', patch_file_manual = f'{crate}-patch2.diff',
packager_identity = 'Jane Jane <jane@jane.org>', packager = 'Jane Jane <jane@jane.org>',
doc_files = ['DOC1', 'DOC2'], doc_files = ['DOC1', 'DOC2'],
license_files = ['LIC1', 'LIC2'], license_files = ['LIC1', 'LIC2'],
distconf = {}, distconf = {},

View file

@ -49,9 +49,9 @@ def detect_packager():
return None return None
# If we're supplying packager identity through an environment variable... # If we're supplying packager identity through an environment variable...
packager_identity = os.getenv('RUST2RPM_PACKAGER') packager = os.getenv('RUST2RPM_PACKAGER')
if packager_identity is not None: if packager is not None:
return packager_identity return packager
# If we're detecting packager identity through rpmdev-packager... # If we're detecting packager identity through rpmdev-packager...
rpmdev_packager = shutil.which('rpmdev-packager') rpmdev_packager = shutil.which('rpmdev-packager')