[Bug 1427341] Review Request: python-gamera - Gamera is a framework for building document analysis applications.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=1427341



--- Comment #16 from Miro Hrončok <mhroncok@xxxxxxxxxx> ---
(In reply to VincentS from comment #15)
> (In reply to Charalampos Stratakis from comment #11)
> > Also what is the reason for this line?
> > chmod 755 %{buildroot}/%{python2_sitearch}/%{srcname}/gendoc.py
> > Same for: %doc %attr(644,-,-) README
> > And: %defattr(644,root,root,755)
> 
> As guidelines say, Permissions on files must be set properly.
> I saw with rmplint : 
> - python-gamera.x86_64: E: wrong-script-interpreter
> /usr/lib64/python2.7/site-packages/gamera/gendoc.py /usr/bin/env python
> - python-gamera.x86_64: E: non-executable-script
> /usr/lib64/python2.7/site-packages/gamera/gendoc.py 644 /usr/bin/env python
> - python-gamera.x86_64: W: spurious-executable-perm
> /usr/share/doc/python-gamera/README
> I thought permissions hadn't set properly, so I added chmod and %defattr to
> solve these problems.
> What do you think about ?

First, /usr/lib64/python2.7/site-packages/gamera/gendoc.py:

This is a bit more complicated.

Based on the rpmlint output you can say that:

 * the file has a shebang that says "#!/usr/bin/env python" (note that using
/usr/bin/env in shebangs is forbidden in Fedora packages)
 * the file does not have executable permissions

So you have to ask yourself the question: "Shall this file be treated as
executable or not?" The answer is usually "not" unless the file is in PATH
(such as /usr/bin). So in this case instead of giving it permissions, remove
the shebang. This is nice approach, as it checks if the shebang is there and if
so, it removes it:

    head -n 1 gamera/gendoc.py | grep '#!/usr/' && sed -i '1d' gamera/gendoc.py

If the file should have been an executable (not this case), you would need to
change the shebang to "#!/usr/bin/python2" and add the executable permission.

Second: README:

I'd suggest running "chmod -x README" in %prep instead, as it explicitly says
"remove the executable permission" rather than "set the permissions to exactly
this and that".

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
_______________________________________________
package-review mailing list -- package-review@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to package-review-leave@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora Legacy]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]