From Electron Cloud
Jump to: navigation, search
(Diff between make.conf on two systems)
Line 48: Line 48:
 
}
 
}
 
</pre>
 
</pre>
 +
 +
Usage: userflags by itself will print out the USE flags from /etc/make.conf, one per line.  useflags with a parameter will read from another file.  So you can scp the other system's flags to /tmp or mount its /etc via NFS or some such, and compare your system's flags to the ones on the remote machine.

Revision as of 23:39, 26 September 2009

How to build a package yourself, or modify it between unpacking and merging

The following is an old FAQ which has been officially removed for a long time.

I want to perform the ./configure step myself. Can I?

Yes, but it is not trivial, and the next method only works when it is a simple ebuild (i.e. just ./configure and make && make install). Be sure to read the ebuild itself to see how Gentoo handles it.

Start with unpacking the ebuild: ebuild /usr/portage/<category>/<package>/<ebuild> unpack.

Next, go to /var/tmp/portage/<package>-<version>/work. Inside it you'll find the unpacked sources. Execute the steps you need to perform to configure and compile the package.

When finished, execute touch /var/tmp/portage/<package>-<version>/.compiled to trick Portage into thinking it configured and compiled the package. Then finish up with ebuild /usr/portage/<category>/<package>/<ebuild> merge.

Diff between make.conf on two systems

Since the USE flags are in a sort of paragraph rather than one-per-line, diff is hard. Here's a perl program to help:

#!/usr/bin/perl
use IO::Handle;
$numArgs = $#ARGV + 1;
if ($numArgs > 0)
{
        open (MCONF, $ARGV[0]) or die "can't open $ARGV[0] : $!";
}
else
{
        open (MCONF, "/etc/make.conf") or die "can't open /etc/make.conf: $!";
}
my $isuse = 0;
while ( $line = <MCONF> )
{
        if ($line =~ /USE=\"/)
        {
                $isuse = 1;
        }
        if ($isuse)
        {
                if ($line =~ /\"$/)
                {
                        $isuse = 0;
                }
                $line =~ s/USE=\"//;
                $line =~ s/\"//;
                $line =~ s/\n//;
                $line =~ s/\s+/\n/g;
                print $line;
        }
}

Usage: userflags by itself will print out the USE flags from /etc/make.conf, one per line. useflags with a parameter will read from another file. So you can scp the other system's flags to /tmp or mount its /etc via NFS or some such, and compare your system's flags to the ones on the remote machine.