Re: rpmlint report for lyx on opensuse

2018-08-30 Thread José Abílio Matos
On Wednesday, 29 August 2018 19.10.31 WEST Kornel Benko wrote:
> Quick look does not show a problem since we call perl executable explicitly
> here.

Just like in python.
 
> I had (erroneously?) the impression, that the use of 'env' is a more
> portable way. So it is for me somehow surprising to see these warnings.
> 
> Kornel

Sometimes too much choice can be a problem. :-)

The man page for env says:
env - run a program in a modified environment

https://unix.stackexchange.com/questions/29608/why-is-it-better-to-use-usr-bin-env-name-instead-of-path-to-name-as-my/29620
As the url that I sent before says:
"A minor point: the #!/usr/bin/env trick is arguably an abuse of the env 
command, which was originally intended (as the name implies) to invoke a 
command with an altered environment."

So we are using a side effect from a command to provide further choice.

The general consensus was that the problem that we are trying to solve is not 
worth all the potential problems that come from that mechanism.


There is something similar with rpms. It was possible to specify the root 
where the rpm would be installed. By default all rpms are installed in the 
file system root directory /. It is possible to specify another root to be 
appended to all files paths. Packages that work like this are called 
relocatable rpms.

The Fedora rules are very clear about this:
https://fedoraproject.org/wiki/Packaging:Guidelines#Relocatable_packages

"The use of RPM's facility for generating relocatable packages is strongly 
discouraged. It is difficult to make work properly, impossible to use from the 
installer or from yum, and not generally necessary if other packaging 
guidelines are followed. However, in the unlikely event that you have a good 
reason to make a package relocatable, you MUST state this intent and reasoning 
in the request for package review."

Conclusion: I do not remember to ever see a relocatable package in Fedora.

There are more modern solutions, like containers, to solve this type of 
problems.

I hope that this summarize what the problems are and why it is discouraged.

Something else that should have been said is that gnu/linux has helped to 
normalize most of this and brought some sanity to the standard file system 
hierarchy. :-)
-- 
José Abílio




Re: rpmlint report for lyx on opensuse

2018-08-29 Thread Kornel Benko
Am Mittwoch, 29. August 2018 17:50:00 CEST schrieb José Abílio Matos 
:
> 
> > [ 1139s] lyx.x86_64: W: non-executable-script
> > /usr/share/lyx/scripts/prefTest.pl.in 644 /usr/bin/env perl
> > [ 1139s] This text file contains a shebang or is located in a path dedicated
> > for [ 1139s] executables, but lacks the executable bits and cannot thus be
> > executed.  If
> > [ 1139s] the file is meant to be an executable script, add the executable
> > bits, [ 1139s] otherwise remove the shebang or move the file elsewhere.
> > [ 1139s]
> 
> I could probably do the same for perl. Is there any objection?
> 

Quick look does not show a problem since we call perl executable explicitly 
here.

I had (erroneously?) the impression, that the use of 'env' is a more portable 
way.
So it is for me somehow surprising to see these warnings.

Kornel


signature.asc
Description: This is a digitally signed message part.


Re: rpmlint report for lyx on opensuse

2018-08-29 Thread José Abílio Matos
On Tuesday, 28 August 2018 07.07.19 WEST Cor Blom wrote:
> LyX 2.3.1 builds fine on openSUSE.
> 
> Maybe you are interested in warnings and errors that the buildsystem
> used by openSUSE report:

I also a couple of them from building in Fedora. :-)
 
> [ 1130s] RPMLINT report:
> [ 1130s] ===
> [ 1139s] lyx.x86_64: W: empty-%post
> [ 1139s] lyx.x86_64: W: empty-%postun

Those are harmless and useless, a common pattern among linters :-)

> [ 1139s] lyx.x86_64: W: non-executable-script
> /usr/share/lyx/lyx2lyx/profiling.py 644 /usr/bin/env python

I have changed all cases in the development branch from "/usr/bin/env python" 
to /usr/bin/python3

With stackexchange to the rescue there is a good discussion here of the 
advantages and disadvantages of this approach:
https://unix.stackexchange.com/questions/29608/why-is-it-better-to-use-usr-bin-env-name-instead-of-path-to-name-as-my/29620

I would say that the modern thinking is to discard the /usr/bin/env without 
being too proselyte. Specially because in the context of lyx we always call

/path/to/pythonx.y

so that the shebang line is always ignored. So in basic terms we are 
discussing how many angels fit in the top of a needle.

> [ 1139s] lyx.x86_64: W: non-executable-script
> /usr/share/lyx/scripts/prefTest.pl.in 644 /usr/bin/env perl
> [ 1139s] This text file contains a shebang or is located in a path dedicated
> for [ 1139s] executables, but lacks the executable bits and cannot thus be
> executed.  If
> [ 1139s] the file is meant to be an executable script, add the executable
> bits, [ 1139s] otherwise remove the shebang or move the file elsewhere.
> [ 1139s]

I could probably do the same for perl. Is there any objection?

> [ 1139s] lyx.x86_64: W: position-independent-executable-suggested
> /usr/bin/lyx [ 1139s] lyx.x86_64: W:
> position-independent-executable-suggested
> /usr/bin/lyxclient
> [ 1139s] lyx.x86_64: W: position-independent-executable-suggested
> /usr/bin/tex2lyx
> [ 1139s] This executable should be position independent (all binaries
> should).  Check
> [ 1139s] that it is built with -fPIE/-fpie in compiler flags and -pie
> in linker flags.
> [ 1139s]
> [ 1139s] lyx.x86_64: W: script-without-shebang
> /usr/share/lyx/scripts/TeXFiles.py
> [ 1139s] lyx.x86_64: W: script-without-shebang
> /usr/share/lyx/scripts/clean_dvi.py
> [ 1139s] lyx.x86_64: W: script-without-shebang
> /usr/share/lyx/scripts/convertDefault.py
> [ 1139s] lyx.x86_64: W: script-without-shebang
> /usr/share/lyx/scripts/convert_pdf.py
> [ 1139s] lyx.x86_64: W: script-without-shebang

Fixed in development.

> /usr/share/lyx/scripts/csv2lyx.py [ 1139s] lyx.x86_64: W:
> script-without-shebang
> /usr/share/lyx/scripts/ext_copy.py
> [ 1139s] lyx.x86_64: W: script-without-shebang
> /usr/share/lyx/scripts/fen2ascii.py
> [ 1139s] lyx.x86_64: W: script-without-shebang
> /usr/share/lyx/scripts/fig2pdftex.py
> [ 1139s] lyx.x86_64: W: script-without-shebang
> /usr/share/lyx/scripts/fig2pstex.py
> [ 1139s] lyx.x86_64: W: script-without-shebang
> /usr/share/lyx/scripts/fig_copy.py
> [ 1139s] lyx.x86_64: W: script-without-shebang
> /usr/share/lyx/scripts/html2latexwrapper.py
> [ 1139s] lyx.x86_64: W: script-without-shebang
> /usr/share/lyx/scripts/include_bib.py
> [ 1139s] lyx.x86_64: W: script-without-shebang
> /usr/share/lyx/scripts/layout2layout.py
> [ 1139s] lyx.x86_64: W: script-without-shebang
> /usr/share/lyx/scripts/legacy_lyxpreview2ppm.py
> [ 1139s] lyx.x86_64: W: script-without-shebang
> /usr/share/lyx/scripts/lyxpak.py [ 1139s] lyx.x86_64: W:
> script-without-shebang
> /usr/share/lyx/scripts/lyxpreview2bitmap.py
> [ 1139s] lyx.x86_64: W: script-without-shebang
> /usr/share/lyx/scripts/lyxpreview_tools.py
> [ 1139s] lyx.x86_64: W: script-without-shebang
> /usr/share/lyx/scripts/prefs2prefs.py
> [ 1139s] lyx.x86_64: W: script-without-shebang
> /usr/share/lyx/scripts/prefs2prefs_lfuns.py
> [ 1139s] lyx.x86_64: W: script-without-shebang
> /usr/share/lyx/scripts/prefs2prefs_prefs.py
> [ 1139s] lyx.x86_64: W: script-without-shebang
> /usr/share/lyx/scripts/tex_copy.py
> [ 1139s] This text file has executable bits set or is located in a
> path dedicated for
> [ 1139s] executables, but lacks a shebang and cannot thus be executed.
> If the file is
> [ 1140s] meant to be an executable script, add the shebang, otherwise remove
> the [ 1140s] executable bits or move the file elsewhere.
> [ 1140s]

Here I suspect that rpmlint is using an heuristics where it decides that the 
files in a directory called scripts are... scripts and thus should be 
executable, we disagree with the conclusion.

> [ 1140s] lyx.x86_64: W: suse-filelist-forbidden-bashcomp-userdirs
> /etc/bash_completion.d/lyx is not allowed in SUSE
> [ 1140s] This directory is for user files,   use
> /usr/share/bash-
> [ 1140s] completion/completions/
> [ 1140s]
> [ 1140s] lyx.x86_64: E: env-script-interpreter (Badness: 9)
> /usr/share/lyx/configure.py /usr/bin/env python
> [ 1140s] lyx.x86_64: E: 

rpmlint report for lyx on opensuse

2018-08-28 Thread Cor Blom
LyX 2.3.1 builds fine on openSUSE.

Maybe you are interested in warnings and errors that the buildsystem
used by openSUSE report:

[ 1130s] RPMLINT report:
[ 1130s] ===
[ 1139s] lyx.x86_64: W: empty-%post
[ 1139s] lyx.x86_64: W: empty-%postun
[ 1139s] lyx.x86_64: W: non-executable-script
/usr/share/lyx/lyx2lyx/profiling.py 644 /usr/bin/env python
[ 1139s] lyx.x86_64: W: non-executable-script
/usr/share/lyx/scripts/prefTest.pl.in 644 /usr/bin/env perl
[ 1139s] This text file contains a shebang or is located in a path dedicated for
[ 1139s] executables, but lacks the executable bits and cannot thus be
executed.  If
[ 1139s] the file is meant to be an executable script, add the executable bits,
[ 1139s] otherwise remove the shebang or move the file elsewhere.
[ 1139s]
[ 1139s] lyx.x86_64: W: position-independent-executable-suggested /usr/bin/lyx
[ 1139s] lyx.x86_64: W: position-independent-executable-suggested
/usr/bin/lyxclient
[ 1139s] lyx.x86_64: W: position-independent-executable-suggested
/usr/bin/tex2lyx
[ 1139s] This executable should be position independent (all binaries
should).  Check
[ 1139s] that it is built with -fPIE/-fpie in compiler flags and -pie
in linker flags.
[ 1139s]
[ 1139s] lyx.x86_64: W: script-without-shebang
/usr/share/lyx/scripts/TeXFiles.py
[ 1139s] lyx.x86_64: W: script-without-shebang
/usr/share/lyx/scripts/clean_dvi.py
[ 1139s] lyx.x86_64: W: script-without-shebang
/usr/share/lyx/scripts/convertDefault.py
[ 1139s] lyx.x86_64: W: script-without-shebang
/usr/share/lyx/scripts/convert_pdf.py
[ 1139s] lyx.x86_64: W: script-without-shebang /usr/share/lyx/scripts/csv2lyx.py
[ 1139s] lyx.x86_64: W: script-without-shebang
/usr/share/lyx/scripts/ext_copy.py
[ 1139s] lyx.x86_64: W: script-without-shebang
/usr/share/lyx/scripts/fen2ascii.py
[ 1139s] lyx.x86_64: W: script-without-shebang
/usr/share/lyx/scripts/fig2pdftex.py
[ 1139s] lyx.x86_64: W: script-without-shebang
/usr/share/lyx/scripts/fig2pstex.py
[ 1139s] lyx.x86_64: W: script-without-shebang
/usr/share/lyx/scripts/fig_copy.py
[ 1139s] lyx.x86_64: W: script-without-shebang
/usr/share/lyx/scripts/html2latexwrapper.py
[ 1139s] lyx.x86_64: W: script-without-shebang
/usr/share/lyx/scripts/include_bib.py
[ 1139s] lyx.x86_64: W: script-without-shebang
/usr/share/lyx/scripts/layout2layout.py
[ 1139s] lyx.x86_64: W: script-without-shebang
/usr/share/lyx/scripts/legacy_lyxpreview2ppm.py
[ 1139s] lyx.x86_64: W: script-without-shebang /usr/share/lyx/scripts/lyxpak.py
[ 1139s] lyx.x86_64: W: script-without-shebang
/usr/share/lyx/scripts/lyxpreview2bitmap.py
[ 1139s] lyx.x86_64: W: script-without-shebang
/usr/share/lyx/scripts/lyxpreview_tools.py
[ 1139s] lyx.x86_64: W: script-without-shebang
/usr/share/lyx/scripts/prefs2prefs.py
[ 1139s] lyx.x86_64: W: script-without-shebang
/usr/share/lyx/scripts/prefs2prefs_lfuns.py
[ 1139s] lyx.x86_64: W: script-without-shebang
/usr/share/lyx/scripts/prefs2prefs_prefs.py
[ 1139s] lyx.x86_64: W: script-without-shebang
/usr/share/lyx/scripts/tex_copy.py
[ 1139s] This text file has executable bits set or is located in a
path dedicated for
[ 1139s] executables, but lacks a shebang and cannot thus be executed.
If the file is
[ 1140s] meant to be an executable script, add the shebang, otherwise remove the
[ 1140s] executable bits or move the file elsewhere.
[ 1140s]
[ 1140s] lyx.x86_64: W: suse-filelist-forbidden-bashcomp-userdirs
/etc/bash_completion.d/lyx is not allowed in SUSE
[ 1140s] This directory is for user files,   use
/usr/share/bash-
[ 1140s] completion/completions/
[ 1140s]
[ 1140s] lyx.x86_64: E: env-script-interpreter (Badness: 9)
/usr/share/lyx/configure.py /usr/bin/env python
[ 1140s] lyx.x86_64: E: env-script-interpreter (Badness: 9)
/usr/share/lyx/lyx2lyx/lyx2lyx /usr/bin/env python
[ 1140s] lyx.x86_64: E: env-script-interpreter (Badness: 9)
/usr/share/lyx/scripts/listerrors /usr/bin/env python
[ 1140s] lyx.x86_64: E: env-script-interpreter (Badness: 9)
/usr/share/lyx/scripts/svg2pdftex.py /usr/bin/env python
[ 1140s] lyx.x86_64: E: env-script-interpreter (Badness: 9)
/usr/share/lyx/scripts/svg2pstex.py /usr/bin/env python
[ 1140s] This script uses 'env' as an interpreter. For the rpm runtime
dependency
[ 1140s] detection to work, the shebang #!/usr/bin/env python  needs
to be patched into
[ 1140s] #!/usr/bin/python  otherwise the package dependency generator
merely adds a
[ 1140s] dependency on /usr/bin/env rather than the actual interpreter
/usr/bin/python.
[ 1140s] Alternatively, if the file should not be executed, then
ensure that it is not
[ 1140s] marked as executable or don't install it in a path that is reserved for
[ 1140s] executables.