Bug 498588
Summary: | rpmdev-newspec -o perl-test.spec falls back to generic template (incl. patch) | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Edwin ten Brink <fedora> | ||||||
Component: | rpmdevtools | Assignee: | Ville Skyttä <ville.skytta> | ||||||
Status: | CLOSED NEXTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
Severity: | low | Docs Contact: | |||||||
Priority: | low | ||||||||
Version: | 10 | CC: | ville.skytta | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | 7.3-1.fc10 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2009-06-16 01:57:13 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: | |||||||||
Attachments: |
|
Created attachment 342078 [details]
Alternative patch
Agreed, but I think your patch isn't quite optimal in "-o -" or "-o /dev/stdout" cases. Also, did you intend to set the value of $appname_guessed (not $appname) in the -o only case? It seems to me that the value of $appname_guessed is never set.
How about the attached alternative patch, do you see any drawbacks in it?
I didn't have any stdout cases in mind with the patch, so the alternative handles such cases much better. A strange appname could be set, though it doesn't seem to harm anything. $appname_guessed in my patch was set as soon as the "-o" option was detected. Only at the end it would be written in $appname when it was not set already. This last case you handled effectively by unconditionally assigning $appname as soon as a ".spec" is seen and conditionally when "-o" is parsed (which were my greatest concerns). In summary: your patch handles /dev/stdout better and behaves otherwise the same, so please incorporate your patch. Will you close this bug when you have committed the patch? (In reply to comment #2) > $appname_guessed in my patch was set as soon as the "-o" option was detected. Hmm... > + [ -z "$appname_guessed" ] && appname="$(basename $1 .spec)" ...note "appname=...", not "appname_guessed=...". But nevermind, now I at least know what the intention was ;) > In summary: your patch handles /dev/stdout better and behaves otherwise the > same, so please incorporate your patch. Done in git: https://fedorahosted.org/rpmdevtools/changeset/0f00df9ce9a9ef96dbeefaeb3b06e12b1de4be7d > Will you close this bug when you have committed the patch? If it's fine with you, I'd rather not close it until we have a package release in Fedora repos that contain the change. rpmdevtools-7.2-1.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/rpmdevtools-7.2-1.fc11 rpmdevtools-7.2-1.fc10 has been submitted as an update for Fedora 10. http://admin.fedoraproject.org/updates/rpmdevtools-7.2-1.fc10 rpmdevtools-7.3-1.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/rpmdevtools-7.3-1.fc11 rpmdevtools-7.3-1.fc10 has been submitted as an update for Fedora 10. http://admin.fedoraproject.org/updates/rpmdevtools-7.3-1.fc10 rpmdevtools-7.2-1.fc10 has been pushed to the Fedora 10 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update rpmdevtools'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-5334 rpmdevtools-7.3-1.fc10 has been pushed to the Fedora 10 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update rpmdevtools'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-5511 rpmdevtools-7.3-1.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report. rpmdevtools-7.3-1.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report. |
Created attachment 342073 [details] Possible solution to guess the appname from the -o parameter Description of problem: When a user only supplies "-o foo.spec" but does not state package "foo", the appname is not set. This has the consequence that no template guessing can be performed. Of course, the user who has read the help the right way, does not do such things. :-) The script however should be able to tolerate such users. Version-Release number of selected component (if applicable): $ rpm -q --file /usr/bin/rpmdev-newspec rpmdevtools-7.0-1.fc10.noarch How reproducible: Always Steps to Reproduce: 1. rpmdev-newspec -o perl-test.spec Actual results: Skeleton specfile (minimal) has been created to "perl-test.spec". Expected results: Skeleton specfile (perl) has been created to "perl-test.spec". Additional info: See attached patch for possible solution. If the user only supplied the "-o" parameter, guess the appname from that value. If the appname is given too, that one prevails to actually set the appname.