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

Bug#807695: lintian: false positive for command-with-path-in-maintainer-script



Jakub Wilk dixit:

> Guillem Jover requested that command-with-path-in-maintainer-script should
> trigger also for "[ -x ... ]" constructs in #769845. Unfortunately, the tag

I think his reasoning for that is wrong, more below.

> description wasn't adequately updated when this change was implemented.

This is *still* something devref explicitly suggests.

> * Axel Beckert <abe@debian.org>, 2015-12-11, 18:04:
> > I guess _that_ is the part, Lintian refers, too.

The entire section is valid though, and it’s perfectly fine to
just check for a well-known tool with test -x absolute-pathname.

> Eww. There's no reason to use this monster in maintainer scripts. Please use
> which(1) instead. See also bug #747320.

Yes, which(1) is something I considered, or the sh equivalent
of whence -p (I think type or type -v or something). But…

| I'm not entirely sure why most of those packages are using a construct
| like this though:
|
|   ,---
|   if [ ! -x /usr/sbin/dpkg-statoverride ] || \
|      ! dpkg-statoverride --list $CONF > /dev/null
|   then
|       [#]
|   fi
|   `---
|
| instead of just using the command directly? Maybe cargo-culted from

let’s come back to Guillem’s message: the packages use these constructs
for several reasons:

• devref suggests it for checking whether a command exists

• a command may not exist yet or any more (especially in postrm)

• depending on a command (think Recommends or Suggests),
  the behaviour may differ (which is the case in FusionForge,
  where the non-pg_lsclusters case causes separate handling)

These are all valid cases, and while I consider Guillem’s idea
of using lintian to catch use cases of compatibility symlinks,
this is the wrong tag to use as well as the wrong check to do
(it could be done by shipping a specific list of files to check
for as legacy scripts in lintian, for example, but even then,
it would not necessarily catch all use cases as maintainer
scripts can call other scripts/programs, especially if that’s
common code shared between maintainer scripts and other code),
so I believe he’d be better off with codesearch.d.n or similar
tools instead of using lintian for it.

bye,
//mirabilos
-- 
22:20⎜<asarch> The crazy that persists in his craziness becomes a master
22:21⎜<asarch> And the distance between the craziness and geniality is
only measured by the success 18:35⎜<asarch> "Psychotics are consistently
inconsistent. The essence of sanity is to be inconsistently inconsistent


Reply to: