unreliable -m/-x checks in icon-theme-installer

Bug #2022384 reported by Sven M. Hallberg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gEDA
New
Undecided
Unassigned

Bug Description

Discovered during porting to OpenBSD:

The script build-tools/icon-theme-installer performs some sanity checks on its arguments. In particular, it attempts to find the executables for the "mkinstalldirs" and "INSTALL_DATA" commands passed to it via the -m and -x options. The purpose of the checks is to fail early with an error message if the given command does not exist.

However, these tests are unreliable. They originally both assumed that their arguments contained the (absolute) path to the executable in question as the first word. In the case of -x, a call to 'which' was later added to cover the case of providing a command without path, such as 'install'. This is still bogus (although harmless) in case a command of the form 'sh -c ...' is passed (this happens to be the case with the OpenBSD port).

Personally, I would question the point of trying to get these checks right and simply remove them. It is worth noting that the script will still fail at the first use of one of these commands if it fails. The attached patch replaces both with just a check that the required argument was provided.

Otherwise, at least -m should receive the same 'which' wrapper as -x so that commands without path are accepted in both cases.

As an aside, the attached patch also fixes a trivial typo in the error message for the -b argument.

Revision history for this message
Sven M. Hallberg (pesco) wrote :
Revision history for this message
Sven M. Hallberg (pesco) wrote (last edit ):

Correction: The argument of -m in my case ended up being:

    /bin/sh /.../geda-gaf-1.10.2/build-tools/install-sh -d

I suspect this will be the usual case (and not OpenBSD-specific), given that install-sh is part of the distribution and all of this was generated by autoconf/automake.

This means that all that is accomplished by the present check in practice is to test whether the shell exists and is executable.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.