xfs
[Top] [All Lists]

xfsprogs patch 2

To: linux-xfs@xxxxxxxxxxx
Subject: xfsprogs patch 2
From: Craig Rodrigues <rodrigc@xxxxxxxxxxxxxx>
Date: Fri, 7 Oct 2005 17:27:24 -0400
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
Hi,

For quite a while, I've been applying some hacks to the xfsprogs 
Makefiles to work around problems while installing on FreeBSD.

This is the problem:

=== db ===
../install-sh -o root -g root -m 755 -d /tmp/foo/bin
chown: root: Invalid argument
gmake[1]: *** [install] Error 1
gmake: *** [install] Error 2
*** Error code 2

Stop in /opt/home/rodrigc/fbsd/ports/sysutils/xfsprogs.
*** Error code 1

Stop in /opt/home/rodrigc/fbsd/ports/sysutils/xfsprogs.


The problem is this that "-g root" is invalid on FreeBSD,
because "root" is not a group.

The line that causes this is in buildmacros:

INSTALL    = $(TOPDIR)/install-sh -o $(PKG_USER) -g $(PKG_GROUP)

PKG_USER and PKG_GROUP can be overridden at compile time,
but default to 'root' and 'root'.  Since 'root' is not a valid
group on FreeBSD, this will fail.  'root' seems to be a valid
group on Linux and IRIX.  Inside install-sh, we have:

OWNER=`id -u`
GROUP=`id -g`

while getopts "Dcm:d:S:o:g:T:" c $*
do
   case $c in
   c)
    ;;
   g)
    GROUP=$OPTARG
    ;;
   o)
    OWNER=$OPTARG
    ;;



So, if you don't override these values on the command-line while
invoking install-sh, they default to the values of the
user and group who typed 'make install'.  This seems to be a reasonable
convention to follow (and seems to be what other packages do).

To avoid this problem on other platforms, I recommend removing
PKG_USER and PKG_GROUP from the autoconf files, and just
use the OWNER and GROUP of the user that typed 'make install'.

-- 
Craig Rodrigues        
rodrigc@xxxxxxxxxxxxxx

Attachment: patch2.txt
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>