pkgsrc-Bugs archive

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

pkg/54675: pkg_chk: hostname not found



I foolishly submit this PR as confidential, but it is not. I would like to get feedback before committing a fix that could go against the pkgsrc policy.

Number:         54675
Category:       pkg
Synopsis:       pkg_chk: hostname not found
Confidential:   no
Severity:       non-critical
Priority:       low
Responsible:    abs
State:          open
Class:          sw-bug
Submitter-Id:   net
Arrival-Date:   Tue Nov 05 15:05:00 +0000 2019
Last-Modified:  Wed Nov 06 20:36:32 +0000 2019
Originator:     Frédéric Fauberteau
Release:        Linux 5.3.8-arch1-1 | pkgsrc-HEAD
Organization:
Environment:
System: Linux marine 5.3.8-arch1-1 #1 SMP PREEMPT @1572357769 x86_64 GNU/Linux
Architecture: x86_64
Machine: amd64
Description:
The inetutils package is not in the base set of Arch Linux and the hostname command is not available by default on a minimal system. pkgtools/pkg_chk uses this command in its script and fails.

The patch provided fixes the issue by adding net/inetutils as a dependency if OPSYS is Arch. It works but there maybe is a more elegant/general way to solve it. I prefer requesting the opinion of the maintainer before savagely committing.
How-To-Repeat:
$ pkg_chk -qu
/usr/pkg/sbin/pkg_chk: line 274: hostname: command not found
Fix:
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_chk/Makefile,v
retrieving revision 1.89
diff -r1.89 Makefile
17a18
NO_CHECKSUM=  yes
24a26,30
.if ${OPSYS} == "Linux" && exists(/etc/arch-release)
DEPENDS+=     inetutils-[0-9]*:../../net/inetutils
HOSTNAME=     ${PREFIX}/bin/ghostname
.endif

29,31c35,37
< SUBST_VARS.vars= AWK BZCAT GREP GZCAT GZIP_CMD ID MAKE MAKECONF MKTEMP \ < PKG_ADD PKG_ADMIN PKG_DELETE PKG_INFO PKG_SYSCONFDIR \
<                       SED SH SORT TSORT PREFIX PKG_DBDIR XARGS
---
SUBST_VARS.vars= AWK BZCAT GREP GZCAT GZIP_CMD HOSTNAME ID MAKE MAKECONF \
                      MKTEMP PKG_ADD PKG_ADMIN PKG_DELETE PKG_INFO \
PKG_SYSCONFDIR SED SH SORT TSORT PREFIX PKG_DBDIR XARGS
Index: files/pkg_chk.sh
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_chk/files/pkg_chk.sh,v
retrieving revision 1.75
diff -r1.75 pkg_chk.sh
274c274
<       PKGCHK_UPDATE_CONF=$PKGSRCDIR/pkgchk_update-$(hostname).conf
---
      PKGCHK_UPDATE_CONF=$PKGSRCDIR/pkgchk_update-$(@HOSTNAME@).conf
474c474
< TAGS="$(hostname | ${SED} -e 's,\..*,,'),$(hostname),$OPSYS-$OS_VERSION-$MACHINE_ARCH,$OPSYS-$OS_VERSION,$OPSYS-$MACHINE_ARCH,$OPSYS,$OS_VERSION,$MACHINE_ARCH"
---
TAGS="$(@HOSTNAME@ | ${SED} -e 's,\..*,,'),$(@HOSTNAME@),$OPSYS-$OS_VERSION-$MACHINE_ARCH,$OPSYS-$OS_VERSION,$OPSYS-$MACHINE_ARCH,$OPSYS,$OS_VERSION,$MACHINE_ARCH"


Home | Main Index | Thread Index | Old Index