Re: Usage of dpkg under cygwin

Paul Baker <[email protected]> Wed, 9 Oct 2002 13:23:56 -0500
Newsgroups gmane.linux.debian.ports.windows
Message-ID <[email protected]>
On Wednesday, October 9, 2002, at 01:43 AM, Robert Collins wrote:

> The *real* solution is to fix dpkg. Checking for being root is a broken
> test. Checking if the current user has the appropriate access is a more
> flexible and portable test.

NO NO NO NO NO!!! It is absolutely needed. You don't get it. It is 
needed during the final packaging stages because when the built 
binaries are tar'd up, THEY HAVE TO BE OWNED BY ROOT because this tar 
is then extracted directly into the filesystem when that package is 
installed later on someone's machine. You do not want programs being 
installed into /usr/bin owned by some random user that had the same uid 
as some random developer. THEY HAVE TO BE OWNED BY ROOT!

There are several ways to accomplish this:

1. do the whole build as root. This of course carries with it the issue 
that you will be running all the steps of the package build process as 
root which some would say is a bad thing:

    $ su
    % dpkg-buildpackage

2. tell dpkg-buildpackage to use sudo during the stages that require 
it. this is better because it means that most of the work is done as an 
unprivileged user. the threat is that if something screws up during the 
root required part, it's screwing up as root.

    $ dpkg-buildpackage -rsudo

3. use fakeroot because it kicks ass! fakeroot is a magical utility 
that fakes out the glibc into thinking you are running as root without 
actually letting you do anything that root can do. read the fakeroot 
manpage.

    $ dpkg-buildpackage -rfakeroot


Once again, dpkg does NOT need to be fixed. Nothing needs to be fixed 
but your understanding of the debian package building process. Have you 
read the debian policy yet?

-- 
Paul Baker

"They that can give up essential liberty to obtain a little temporary 
safety deserve neither liberty nor safety."
          -- Benjamin Franklin, 1759

GPG Key: http://homepage.mac.com/pauljbaker/public.asc