Subject: Linux/File and subst.mk errors
To: None <tech-pkg@netbsd.org>
From: Ulrich Habel <uli@habel.name>
List: tech-pkg
Date: 03/12/2007 13:33:06
--=-s+4Bus5K3nTAObJx7YZs
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hej,

when I was building the Linux packages I noticed the following messages
in the bulklogs "Ignoring non-text file". This is the result of an
unproper installation for the utility "file" which is not included in
the Debian base system. I don't think this is an issue to worry about in
pkgsrc, however it's definatelly a documention issue. I am working on a
small article about using pkgsrc on Linux which might lead into a
documentation contribution to the pkgsrc users guide. What do you think
about that? Or shall we include something like test routines in the
bootstrap proccess of pkgsrc for Non-NetBSD/DragonFlyBSD platforms to
insure all binaries which are needed outside pkgsrc are installed (like
file, m4, patch, ...).


I'll try to explain a detail about it:

e.g. for Apache:

=3D> Applying pkgsrc patches for apache-1.3.37
WARNING: [subst.mk] Ignoring non-text file "./src/support/dbmmanage.1".
WARNING: [subst.mk] Ignoring non-text file "./src/support/htdigest.1".
WARNING: [subst.mk] Ignoring non-text file "./src/support/htpasswd.1".
[...]

The Makefile for all the files who reported such error used something
like:

SUBST_FILES.man=3D        src/support/*.1 src/support/*.8
SUBST_SED.man=3D          -e 's,/usr/local/apache/conf,${PKG_SYSCONFDIR},'
SUBST_SED.man+=3D         -e 's,/usr/local/etc/apache,${PKG_SYSCONFDIR},'



When I looked into the issues I found the code snippet in subst.mk:


this is the check routine:
# _SUBST_IS_TEXT_FILE returns 0 if $${file} is a text file.
_SUBST_IS_TEXT_FILE?=3D \
        { ${TEST} -f "$$file"
\
          && ${FILE_CMD} "$$file"
\
             | ${EGREP} "(executable .* script|shell script|text|
Assembler sourcelibtool)";    \
        } >/dev/null 2>&1



this variable leads to a "non-text file" when the utility "find" is not
available or if the file is not a text file. However, the build should
just break here as it leads to non-working packages. E.g. all the perl
scripts start with the shebang. #!@PERL@

So what do you think? Fixing it in the bootstrap proccess or just
correct it with an additional documentation for setting up Linux and
pkgsrc?

Regards
Uli

--=20
Ulrich Habel
http://habel.name

--=-s+4Bus5K3nTAObJx7YZs
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: Dies ist ein digital signierter Nachrichtenteil

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQBF9UiCKLusNOvI6a4RAqSCAJ4r9iN9Stub5FxOVjuJ+QECyNLuSQCeKqh/
cpQI25SUWoecdZH2MZ+/R8I=
=3FHK
-----END PGP SIGNATURE-----

--=-s+4Bus5K3nTAObJx7YZs--