Bug 2308453

Summary: rpmautospec crashes if there's already a change to a spec file
Product: [Fedora] Fedora Reporter: Peter Robinson <pbrobinson>
Component: python-rpmautospecAssignee: Nils Philippsen <nphilipp>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: asaleh, epel-packagers-sig, infra-sig, michel, nphilipp, sgallagh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: python-rpmautospec-0.7.2-1.el9 python-rpmautospec-0.7.2-1.fc40 python-rpmautospec-0.7.2-1.fc41 python-rpmautospec-0.7.2-1.fc39 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-09-09 00:56:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Peter Robinson 2024-08-29 10:53:53 UTC
Looking at moving to rpmautospec as part of a package bump I ran "rpmautospec convert libell.spec" when I'd already locally bumped the spec to the new version and it crashed rather than erroring out with an appropriate errors something along the lines of "please don't have uncommitted package changes when running rpmautospec"


$ rpmautospec convert libell.spec 
Traceback (most recent call last):
  File "/usr/bin/rpmautospec", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/rpmautospec/util.py", line 36, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/rpmautospec/subcommands/convert.py", line 262, in convert
    pkg = PkgConverter(spec_or_path)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/rpmautospec/subcommands/convert.py", line 73, in __init__
    raise FileModifiedError(f"Spec file '{self.specfile}' is modified")
rpmautospec.subcommands.convert.FileModifiedError: Spec file '/home/perobins/fedora/packages/libell/libell.spec' is modified

version: rpmautospec-0.7.1-1.fc40.noarch

Reproducible: Always

Comment 1 Fedora Update System 2024-08-30 13:23:40 UTC
FEDORA-2024-381466b0d6 (python-rpmautospec-0.7.2-1.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-381466b0d6

Comment 2 Fedora Update System 2024-08-30 13:26:20 UTC
FEDORA-2024-376b560f1d (python-rpmautospec-0.7.2-1.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-376b560f1d

Comment 3 Fedora Update System 2024-08-30 13:29:00 UTC
FEDORA-2024-09473f18a2 (python-rpmautospec-0.7.2-1.fc39) has been submitted as an update to Fedora 39.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-09473f18a2

Comment 4 Fedora Update System 2024-08-30 13:31:40 UTC
FEDORA-EPEL-2024-f75632c594 (python-rpmautospec-0.7.2-1.el9) has been submitted as an update to Fedora EPEL 9.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-f75632c594

Comment 5 Fedora Admin user for bugzilla script actions 2024-08-30 14:02:40 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 6 Fedora Update System 2024-08-31 02:13:40 UTC
FEDORA-2024-376b560f1d has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-376b560f1d`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-376b560f1d

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2024-08-31 02:55:24 UTC
FEDORA-2024-09473f18a2 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-09473f18a2`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-09473f18a2

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2024-08-31 03:17:39 UTC
FEDORA-EPEL-2024-f75632c594 has been pushed to the Fedora EPEL 9 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-f75632c594

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2024-08-31 03:38:21 UTC
FEDORA-2024-381466b0d6 has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-381466b0d6`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-381466b0d6

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2024-09-09 00:56:16 UTC
FEDORA-EPEL-2024-f75632c594 (python-rpmautospec-0.7.2-1.el9) has been pushed to the Fedora EPEL 9 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Fedora Update System 2024-09-09 01:17:52 UTC
FEDORA-2024-376b560f1d (python-rpmautospec-0.7.2-1.fc40) has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 12 Fedora Update System 2024-09-13 20:46:16 UTC
FEDORA-2024-381466b0d6 (python-rpmautospec-0.7.2-1.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2024-09-15 02:27:05 UTC
FEDORA-2024-09473f18a2 (python-rpmautospec-0.7.2-1.fc39) has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.