Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-specfile for openSUSE:Factory checked in at 2023-02-27 12:55:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-specfile (Old) and /work/SRC/openSUSE:Factory/.python-specfile.new.31432 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-specfile" Mon Feb 27 12:55:32 2023 rev:8 rq:1067894 version:0.14.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-specfile/python-specfile.changes 2023-02-06 14:15:57.192743385 +0100 +++ /work/SRC/openSUSE:Factory/.python-specfile.new.31432/python-specfile.changes 2023-02-27 12:55:33.651493671 +0100 @@ -1,0 +2,9 @@ +Sat Feb 25 12:10:44 UTC 2023 - David Anes <david.a...@suse.com> + +- Update to version 0.14.0: + * Fixed a bug that broke parsing in case spec file contained + conditionalized macro definitions or similar constructs + * Specfile no longer depends on rpm-py-installer, it now depends + directly on rpm. + +------------------------------------------------------------------- Old: ---- specfile-0.13.2.tar.gz New: ---- specfile-0.14.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-specfile.spec ++++++ --- /var/tmp/diff_new_pack.zWELu8/_old 2023-02-27 12:55:34.227497222 +0100 +++ /var/tmp/diff_new_pack.zWELu8/_new 2023-02-27 12:55:34.231497247 +0100 @@ -18,7 +18,7 @@ %define skip_python38 1 Name: python-specfile -Version: 0.13.2 +Version: 0.14.0 Release: 0 Summary: A library for parsing and manipulating RPM spec files License: MIT ++++++ specfile-0.13.2.tar.gz -> specfile-0.14.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.13.2/.github/workflows/prepare-release.yml new/specfile-0.14.0/.github/workflows/prepare-release.yml --- old/specfile-0.13.2/.github/workflows/prepare-release.yml 2023-01-30 14:24:54.000000000 +0100 +++ new/specfile-0.14.0/.github/workflows/prepare-release.yml 2023-02-23 17:10:09.000000000 +0100 @@ -17,7 +17,7 @@ with: fetch-depth: 0 - name: Prepare release content - uses: packit/prepare-release@v0 + uses: packit/prepare-release@v1 with: version: ${{ inputs.version }} specfiles: fedora/python-specfile.spec diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.13.2/.github/workflows/update-constants.yml new/specfile-0.14.0/.github/workflows/update-constants.yml --- old/specfile-0.13.2/.github/workflows/update-constants.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/specfile-0.14.0/.github/workflows/update-constants.yml 2023-02-23 17:10:09.000000000 +0100 @@ -0,0 +1,42 @@ +name: Update constants from RPM sources +on: + workflow_dispatch: + schedule: + - cron: "0 0 1 * *" + +jobs: + update-constants: + # To not run in forks + if: github.repository_owner == 'packit' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + - name: Install Python dependencies + run: pip install --upgrade click pyparsing + - name: Checkout RPM source tree + uses: actions/checkout@v3 + with: + repository: "rpm-software-management/rpm" + path: "rpm-source-tree" + - name: Update constants + id: update_constants + run: | + python scripts/update_constants.py specfile/constants.py rpm-source-tree/ + case $? in + 0) echo "pr=true" >> $GITHUB_OUTPUT;; + 100) echo "pr=false" >> $GITHUB_OUTPUT;; + *) exit $?;; + esac + - name: Create Pull Request + if: steps.update_constants.outputs.pr == 'true' + uses: peter-evans/create-pull-request@v4 + with: + add-paths: specfile/constants.py + commit-message: Update constants + title: Update constants + body: Update `specfile/constants.py` from RPM sources + delete-branch: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.13.2/CHANGELOG.md new/specfile-0.14.0/CHANGELOG.md --- old/specfile-0.13.2/CHANGELOG.md 2023-01-30 14:24:54.000000000 +0100 +++ new/specfile-0.14.0/CHANGELOG.md 2023-02-23 17:10:09.000000000 +0100 @@ -1,3 +1,8 @@ +# 0.14.0 + +- Fixed a bug that broke parsing in case spec file contained conditionalized macro definitions or similar constructs. (#209) +- Specfile no longer depends on rpm-py-installer, it now depends directly on rpm. (#207) + # 0.13.2 - Fixed infinite loop that occured when section options were followed by whitespace. (#197) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.13.2/PKG-INFO new/specfile-0.14.0/PKG-INFO --- old/specfile-0.13.2/PKG-INFO 2023-01-30 14:25:04.099290000 +0100 +++ new/specfile-0.14.0/PKG-INFO 2023-02-23 17:10:24.365865700 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: specfile -Version: 0.13.2 +Version: 0.14.0 Summary: A library for parsing and manipulating RPM spec files. Home-page: https://github.com/packit/specfile Author: Red Hat @@ -228,6 +228,9 @@ del patches[2] # inserting a patch with a specific number patches.insert_numbered(999, 'final.patch') + +# adding a single patch +specfile.add_patch('necessary.patch', comment='a human-friendly comment to the patch') ``` #### Other attributes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.13.2/README.md new/specfile-0.14.0/README.md --- old/specfile-0.13.2/README.md 2023-01-30 14:24:54.000000000 +0100 +++ new/specfile-0.14.0/README.md 2023-02-23 17:10:09.000000000 +0100 @@ -201,6 +201,9 @@ del patches[2] # inserting a patch with a specific number patches.insert_numbered(999, 'final.patch') + +# adding a single patch +specfile.add_patch('necessary.patch', comment='a human-friendly comment to the patch') ``` #### Other attributes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.13.2/fedora/python-specfile.spec new/specfile-0.14.0/fedora/python-specfile.spec --- old/specfile-0.13.2/fedora/python-specfile.spec 2023-01-30 14:24:54.000000000 +0100 +++ new/specfile-0.14.0/fedora/python-specfile.spec 2023-02-23 17:10:09.000000000 +0100 @@ -13,7 +13,7 @@ Name: python-specfile -Version: 0.13.2 +Version: 0.14.0 Release: 1%{?dist} Summary: A library for parsing and manipulating RPM spec files @@ -41,8 +41,6 @@ %prep %autosetup -p1 -n specfile-%{version} -# Use packaged RPM python bindings downstream -sed -i 's/rpm-py-installer/rpm/' setup.cfg %generate_buildrequires @@ -69,6 +67,9 @@ %changelog +* Thu Feb 23 2023 Packit Team <he...@packit.dev> - 0.14.0-1 +- New upstream release 0.14.0 + * Mon Jan 30 2023 Packit Team <he...@packit.dev> - 0.13.2-1 - New upstream release 0.13.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.13.2/scripts/extract.py new/specfile-0.14.0/scripts/extract.py --- old/specfile-0.13.2/scripts/extract.py 1970-01-01 01:00:00.000000000 +0100 +++ new/specfile-0.14.0/scripts/extract.py 2023-02-23 17:10:09.000000000 +0100 @@ -0,0 +1,198 @@ +#!/usr/bin/env python3 + +# Copyright Contributors to the Packit project. +# SPDX-License-Identifier: MIT + +from pathlib import Path +from typing import List + +import click +from pyparsing import ( + Combine, + Group, + Literal, + ParserElement, + Suppress, + Word, + c_style_comment, + dbl_quoted_string, + delimited_list, + pyparsing_common, + remove_quotes, + srange, +) + +# automatically suppress all string literals +ParserElement.inline_literals_using(Suppress) + + +def extract_sections(filename: Path) -> List[str]: + """ + Extracts section names from a constant array looking like this: + + static const struct PartRec { + int part; + size_t len; + const char * token; + } partList[] = { + { PART_PREAMBLE, LEN_AND_STR("%package")}, + { PART_PREP, LEN_AND_STR("%prep")}, + ... + {0, 0, 0} + }; + + Args: + filename: Path to the file to extract sections from. + + Returns: + List of section names. + """ + constant = Word(srange("[A-Z_]")).suppress() + name = dbl_quoted_string.set_parse_action(remove_quotes) + macro = "LEN_AND_STR(" + name + ")" + item = "{" + Suppress(constant) + "," + macro + "}" + sentinel = Suppress("{" + delimited_list(Literal("0")) + "}") + parser = ( + Suppress("partList[]") + "=" + "{" + delimited_list(item) + "," + sentinel + "}" + ) + parser.ignore(c_style_comment) + result = parser.search_string(filename.read_text(), max_matches=1) + if not result: + return [] + return [s.lstrip("%") for s in result[0]] + + +def extract_tags(filename: Path, with_args: bool = False) -> List[str]: + """ + Extracts tag names from a constant array looking like this: + + static struct PreambleRec_s const preambleList[] = { + {RPMTAG_NAME, 0, 0, 1, LEN_AND_STR("name")}, + {RPMTAG_VERSION, 0, 0, 1, LEN_AND_STR("version")}, + ... + {0, 0, 0, 0} + }; + + Args: + filename: Path to the file to extract tags from. + with_args: Include only tags that accept arguments. + + Returns: + List of tag names. + """ + constant = Word(srange("[A-Z_]")).suppress() + name = dbl_quoted_string("name").set_parse_action(remove_quotes) + macro = "LEN_AND_STR(" + name + ")" + number = pyparsing_common.number + item = Group( + "{" + + constant + + "," + + number("type") + + "," + + number.suppress() + + "," + + number.suppress() + + "," + + macro + + "}" + ) + sentinel = Suppress("{" + delimited_list(Literal("0")) + "}") + parser = ( + Suppress("preambleList[]") + + "=" + + "{" + + delimited_list(item) + + "," + + sentinel + + "}" + ) + parser.ignore(c_style_comment) + result = parser.search_string(filename.read_text(), max_matches=1) + if not result: + return [] + return [t.name for t in result[0] if not with_args or t.type > 0] + + +def extract_arches(filename: Path) -> List[str]: + """ + Extracts arch names from a list looking like this: + + arch_canon: athlon: athlon 1 + arch_canon: geode: geode 1 + ... + arch_canon: IP: sgi 7 + ... + arch_canon: atariclone: m68kmint 13 + ... + + Args: + filename: Path to the file to extract arches from. + + Returns: + List of arch names. + """ + identifier = pyparsing_common.identifier + number = pyparsing_common.number + parser = ( + Suppress("arch_canon:") + + Combine(identifier + ":") + + identifier.suppress() + + number.suppress() + ) + result = parser.search_string(filename.read_text()) + return [a[0] for a in result] + + +@click.group() +def extract(): + pass + + +@extract.command( + help="Extract section names from the specified source file (typically build/parseSpec.c)." +) +@click.argument( + "filename", + type=click.Path(exists=True, dir_okay=False, path_type=Path), + required=True, +) +def sections(filename: Path) -> None: + for section in extract_sections(filename): + click.echo(section) + + +@extract.command( + help="Extract tag names from the specified source file (typically build/parsePreamble.c)." +) +@click.argument( + "filename", + type=click.Path(exists=True, dir_okay=False, path_type=Path), + required=True, +) +@click.option( + "--with-args", + is_flag=True, + default=False, + help="List only tags that accept arguments.", +) +def tags(filename: Path, with_args: bool = False) -> None: + for tag in extract_tags(filename, with_args): + click.echo(tag) + + +@extract.command( + help="Extract arch names from the specified template file (typically rpmrc.in)." +) +@click.argument( + "filename", + type=click.Path(exists=True, dir_okay=False, path_type=Path), + required=True, +) +def arches(filename: Path) -> None: + for arch in extract_arches(filename): + click.echo(arch) + + +if __name__ == "__main__": + extract() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.13.2/scripts/update_constants.py new/specfile-0.14.0/scripts/update_constants.py --- old/specfile-0.13.2/scripts/update_constants.py 1970-01-01 01:00:00.000000000 +0100 +++ new/specfile-0.14.0/scripts/update_constants.py 2023-02-23 17:10:09.000000000 +0100 @@ -0,0 +1,58 @@ +#!/usr/bin/env python3 + +# Copyright Contributors to the Packit project. +# SPDX-License-Identifier: MIT + +import re +import sys +from pathlib import Path + +import click +from extract import extract_arches, extract_sections, extract_tags + +SECTIONS_SOURCE = Path("build/parseSpec.c") +TAGS_SOURCE = Path("build/parsePreamble.c") +ARCHES_SOURCE = Path("rpmrc.in") + + +@click.command( + help="Update CONSTANTS_FILE with constants extracted from RPM_SOURCE_TREE." +) +@click.argument( + "constants_file", + type=click.Path(exists=True, dir_okay=False, path_type=Path), + required=True, + default=Path("specfile/constants.py"), +) +@click.argument( + "rpm_source_tree", + type=click.Path(exists=True, file_okay=False, path_type=Path), + required=True, +) +def update_constants(constants_file: Path, rpm_source_tree: Path) -> None: + section_names = extract_sections(rpm_source_tree / SECTIONS_SOURCE) + tag_names = extract_tags(rpm_source_tree / TAGS_SOURCE) + tags_with_args = extract_tags(rpm_source_tree / TAGS_SOURCE, with_args=True) + arch_names = extract_arches(rpm_source_tree / ARCHES_SOURCE) + content = original_content = constants_file.read_text() + for constant, values in ( + ("SECTION_NAMES", section_names), + ("TAG_NAMES", tag_names), + ("TAGS_WITH_ARGS", tags_with_args), + ("ARCH_NAMES", arch_names), + ): + formatted_values = "\n".join([f' "{v}",' for v in sorted(set(values))]) + content = re.sub( + rf"({constant}\s*=\s*{{).*?(}})", + rf"\g<1>\n{formatted_values}\n\g<2>", + content, + flags=re.DOTALL, + ) + if content == original_content: + sys.exit(100) + return + constants_file.write_text(content) + + +if __name__ == "__main__": + update_constants() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.13.2/setup.cfg new/specfile-0.14.0/setup.cfg --- old/specfile-0.13.2/setup.cfg 2023-01-30 14:25:04.099290000 +0100 +++ new/specfile-0.14.0/setup.cfg 2023-02-23 17:10:24.365865700 +0100 @@ -32,7 +32,7 @@ [options] packages = find: install_requires = - rpm-py-installer + rpm python_requires = >=3.9 include_package_data = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.13.2/specfile/constants.py new/specfile-0.14.0/specfile/constants.py --- old/specfile-0.13.2/specfile/constants.py 2023-01-30 14:24:54.000000000 +0100 +++ new/specfile-0.14.0/specfile/constants.py 2023-02-23 17:10:09.000000000 +0100 @@ -3,153 +3,157 @@ # valid section names as defined in build/parseSpec.c in RPM source SECTION_NAMES = { - "package", - "prep", - "generate_buildrequires", - "conf", "build", - "install", + "changelog", "check", "clean", - "preun", - "postun", - "pretrans", + "conf", + "description", + "end", + "files", + "filetrigger", + "filetriggerin", + "filetriggerpostun", + "filetriggerun", + "generate_buildrequires", + "install", + "package", + "patchlist", + "post", "posttrans", + "postun", + "postuntrans", "pre", - "post", - "files", - "changelog", - "description", + "prep", + "pretrans", + "preun", + "preuntrans", + "sepolicy", + "sourcelist", + "transfiletrigger", + "transfiletriggerin", + "transfiletriggerpostun", + "transfiletriggerun", + "trigger", + "triggerin", "triggerpostun", "triggerprein", "triggerun", - "triggerin", - "trigger", "verifyscript", - "sepolicy", - "filetriggerin", - "filetrigger", - "filetriggerun", - "filetriggerpostun", - "transfiletriggerin", - "transfiletrigger", - "transfiletriggerun", - "transfiletriggerpostun", - "end", - "patchlist", - "sourcelist", } SIMPLE_SCRIPT_SECTIONS = { - "conf", - "generate_buildrequires", "build", - "install", "check", "clean", + "conf", + "generate_buildrequires", + "install", } SCRIPT_SECTIONS = { - "pre", + "filetrigger", + "filetriggerin", + "filetriggerpostun", + "filetriggerun", "post", - "preun", + "posttrans", "postun", + "postuntrans", + "pre", "pretrans", - "posttrans", + "preun", "preuntrans", - "postuntrans", - "verifyscript", - "triggerprein", - "trigger", - "triggerin", - "triggerun", - "triggerpostun", - "filetrigger", - "filetriggerin", - "filetriggerun", - "filetriggerpostun", "transfiletrigger", "transfiletriggerin", - "transfiletriggerun", "transfiletriggerpostun", + "transfiletriggerun", + "trigger", + "triggerin", + "triggerpostun", + "triggerprein", + "triggerun", + "verifyscript", } # valid section option strings taken from build/parseSpec.c, build/parsePreamble.c, # build/parseDescription.c, build/parseFiles.c, build/parsePolicies.c and build/parseScript.c # in RPM source SECTION_OPTIONS = { - "package": "n:", "description": "n:l:", "files": "n:f:", + "package": "n:", "sepolicy": "n:", } SECTION_OPTIONS.update({s: "n:f:p:P:eq" for s in SCRIPT_SECTIONS}) # valid tag names as defined in build/parsePreamble.c in RPM source TAG_NAMES = { - "name", - "version", - "release", - "epoch", - "summary", - "license", + "autoprov", + "autoreq", + "autoreqprov", + "bugurl", + "buildarch", + "buildarchitectures", + "buildconflicts", + "buildprereq", + "buildrequires", + "buildroot", + "conflicts", "distribution", + "disttag", "disturl", - "vendor", - "group", - "packager", - "url", - "vcs", - "source", - "patch", - "nosource", - "nopatch", + "docdir", + "enhances", + "epoch", "excludearch", - "exclusivearch", "excludeos", + "exclusivearch", "exclusiveos", + "group", "icon", + "license", + "modularitylabel", + "name", + "nopatch", + "nosource", + "obsoletes", + "orderwithrequires", + "packager", + "patch", + "prefix", + "prefixes", + "prereq", "provides", - "requires", "recommends", + "release", + "removepathpostfixes", + "requires", + "source", + "sourcelicense", "suggests", + "summary", "supplements", - "enhances", - "prereq", - "conflicts", - "obsoletes", - "prefixes", - "prefix", - "buildroot", - "buildarchitectures", - "buildarch", - "buildconflicts", - "buildprereq", - "buildrequires", - "autoreqprov", - "autoreq", - "autoprov", - "docdir", - "disttag", - "bugurl", "translationurl", "upstreamreleases", - "orderwithrequires", - "removepathpostfixes", - "modularitylabel", + "url", + "vcs", + "vendor", + "version", } # tags that can optionally have an argument (language or qualifier) TAGS_WITH_ARG = { - "summary", "group", - "requires", - "prereq", "orderwithrequires", + "prereq", + "requires", + "summary", } # canonical architecture names as defined in rpmrc.in in RPM source ARCH_NAMES = { + "IP", "aarch64", "alpha", "alphaev5", @@ -187,7 +191,6 @@ "i686", "ia32e", "ia64", - "IP", "loongarch64", "m68k", "m68kmint", @@ -234,5 +237,8 @@ "sun4m", "sun4u", "x86_64", + "x86_64_v2", + "x86_64_v3", + "x86_64_v4", "xtensa", } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.13.2/specfile/tags.py new/specfile-0.14.0/specfile/tags.py --- old/specfile-0.13.2/specfile/tags.py 2023-01-30 14:24:54.000000000 +0100 +++ new/specfile-0.14.0/specfile/tags.py 2023-02-23 17:10:09.000000000 +0100 @@ -493,7 +493,7 @@ ) buffer = [] else: - buffer.append(line) + buffer.append(prefix + line + suffix) return cls(data, buffer) def get_raw_section_data(self) -> List[str]: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.13.2/specfile.egg-info/PKG-INFO new/specfile-0.14.0/specfile.egg-info/PKG-INFO --- old/specfile-0.13.2/specfile.egg-info/PKG-INFO 2023-01-30 14:25:04.000000000 +0100 +++ new/specfile-0.14.0/specfile.egg-info/PKG-INFO 2023-02-23 17:10:24.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: specfile -Version: 0.13.2 +Version: 0.14.0 Summary: A library for parsing and manipulating RPM spec files. Home-page: https://github.com/packit/specfile Author: Red Hat @@ -228,6 +228,9 @@ del patches[2] # inserting a patch with a specific number patches.insert_numbered(999, 'final.patch') + +# adding a single patch +specfile.add_patch('necessary.patch', comment='a human-friendly comment to the patch') ``` #### Other attributes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.13.2/specfile.egg-info/SOURCES.txt new/specfile-0.14.0/specfile.egg-info/SOURCES.txt --- old/specfile-0.13.2/specfile.egg-info/SOURCES.txt 2023-01-30 14:25:04.000000000 +0100 +++ new/specfile-0.14.0/specfile.egg-info/SOURCES.txt 2023-02-23 17:10:24.000000000 +0100 @@ -19,6 +19,7 @@ .github/workflows/opened-issues-to-the-board.yml .github/workflows/prepare-release.yml .github/workflows/pypi-publish.yml +.github/workflows/update-constants.yml fedora/python-specfile.spec files/install-requirements-pip.yaml files/install-requirements-rpms.yaml @@ -34,6 +35,8 @@ plans/main.fmf plans/packit-integration.fmf plans/smoke.fmf +scripts/extract.py +scripts/update_constants.py specfile/__init__.py specfile/changelog.py specfile/constants.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.13.2/specfile.egg-info/requires.txt new/specfile-0.14.0/specfile.egg-info/requires.txt --- old/specfile-0.13.2/specfile.egg-info/requires.txt 2023-01-30 14:25:04.000000000 +0100 +++ new/specfile-0.14.0/specfile.egg-info/requires.txt 2023-02-23 17:10:24.000000000 +0100 @@ -1,4 +1,4 @@ -rpm-py-installer +rpm [testing] pytest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.13.2/tests/unit/test_tags.py new/specfile-0.14.0/tests/unit/test_tags.py --- old/specfile-0.13.2/tests/unit/test_tags.py 2023-01-30 14:24:54.000000000 +0100 +++ new/specfile-0.14.0/tests/unit/test_tags.py 2023-02-23 17:10:09.000000000 +0100 @@ -27,6 +27,8 @@ Section( "package", data=[ + "%{?scl:%scl_package scltest}", + "", "%global ver_major 1", "%global ver_minor 0", "", @@ -51,6 +53,7 @@ ], ) ) + assert tags[0].comments._preceding_lines[0] == "%{?scl:%scl_package scltest}" assert tags[0].name == "Name" assert tags[0].comments[0].text == "this is a test package" assert tags[0].comments[1].text == "not to be used in production" @@ -82,7 +85,13 @@ Comment("this is a test package"), Comment("not to be used in production"), ], - ["%global ver_major 1", "%global ver_minor 0", ""], + [ + "%{?scl:%scl_package scltest}", + "", + "%global ver_major 1", + "%global ver_minor 0", + "", + ], ), ), Tag("Version", "%{ver_major}.%{ver_minor}", ": ", Comments()), @@ -107,6 +116,8 @@ [], ) assert tags.get_raw_section_data() == [ + "%{?scl:%scl_package scltest}", + "", "%global ver_major 1", "%global ver_minor 0", "",