[Top] [All Lists]

Re: [PATCH] xfsprogs: use uid/gid instead of actual name to fix install

To: Luo Zhenhua-B19537 <B19537@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfsprogs: use uid/gid instead of actual name to fix install issue
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Sat, 24 Dec 2011 08:08:26 +1100
Cc: "xfs@xxxxxxxxxxx" <xfs@xxxxxxxxxxx>
In-reply-to: <CA452391058F6D4E9715FB2C29D9312A010BC015@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
References: <1324623173-32707-1-git-send-email-b19537@xxxxxxxxxxxxx> <20111223100135.GA12731@dastard> <CA452391058F6D4E9715FB2C29D9312A010BC015@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Fri, Dec 23, 2011 at 02:20:24PM +0000, Luo Zhenhua-B19537 wrote:
> If the specified user/group is invalid, I think this should be an
> usage error instead of script error.

Hold on - how are you getting an invalid uid/gid? Those values are
set by the configure script to the uid/gid of the builder process,
and so should -never- be invalid.

Are you building on one machine, rsyncing to another machine with
different user/groups and then running make install?  If so, you are
using make install incorrectly. make install is designed to install
the binaries on the host that they were built, not some other random
machine. If you are going to install binaries on a different machine
to where they were built, you are supposed to build a tarball, a
.deb or .rpm package and install that. Those targets are macine
independent and won't have install problems.

> Current the problem I met is that, even if I specified a valid
> user/group of my host, "chown user:group file" failed, after
> switching to corresponding uid/gid, the script can be executed
> successfully during the install process. 

I had to manually change the include/builddefs file to have an
invalid PKG_USER/PKG_GROUP variables to get chown to fail because
all my build/test machines have consistent uid/gid entries, so even
build/rsync/install works without fail....

And if you look at what your change actually does, the script still
executes and installs -some- stuff, it just doesn't run the chown
because _chown() is now not passed the correct number of parameters.
IOWs, the script now fails with a partial install with no indication
of what was installed or not.

If you are going to check whether uid/gid exist, you need to exit
immediately if they don't exist, not allow the script to continue.


Dave Chinner

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