Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 598529 - app-shells/quoter: installs stray 'quoter_pipe.sh' in /usr/bin
Summary: app-shells/quoter: installs stray 'quoter_pipe.sh' in /usr/bin
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal QA (vote)
Assignee: Martin Väth
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-30 13:44 UTC by Michał Górny
Modified: 2017-02-10 09:47 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-10-30 13:44:56 UTC
$ head /usr/bin/quoter_pipe.sh 
#!/bin/sh  This line is only for editors: This file must be sourced
# This file is part of quoter v2.0 and distributed under the MIT license

/usr/bin is for executable programs, not shell script libraries. Put it somewhere in /usr/lib.
Comment 1 Martin Väth 2016-10-30 19:10:54 UTC
/usr/lib is not for shell script libraries either. Neither is /usr/share.

It is the same problem as with bug 598527 and bug 493000:

These tools are meant to be used (easily) by user-written scripts, in case of push.sh and quoter_pipe.sh especially by scripts which are meant to be very compatible, i.e. to run unmodified on many different systems.

Unfortunately, neither FHS nor POSIX does specify any compatible way how to handle shell script libraries. However, the POSIX definition of PATH being searched for sourcing, even if the file is non-executable, hints that putting it into PATH is the intended way to handle such libraries.

In fact, I was even thinking about recommending to make these scripts executable, so that users can test in scripts with
  command -v quoter_pipe.sh >/dev/null 2>&1
in a semi-compatible way whether the tool is installed, but I decided against it, because it would "pollute" the completion function of some shells.
Comment 2 Michael Weber (RETIRED) gentoo-dev 2017-02-10 09:47:06 UTC
commit 1f2c76f541de6c0d4248abbddb2553c85273c0bb
Author: Michael Weber <xmw@gentoo.org>
Date:   Fri Feb 10 10:14:24 2017 +0100

    app-shells/quoter: Move quoter_pipe.sh into /usr/share/quoter (bug 598529).
    
    Package-Manager: Portage-2.3.3, Repoman-2.3.1

app-shells/quoter/quoter-3.0_p2-r1.ebuild