Handbuch:Parts/Portage/Variablen
Bitte versuchen Sie nicht, den Anweisungen aus dem Handbook:Parts Namespace (DIESE SEITE) oder den Unterseiten zu folgen. Handbook:Parts ist ein Meta-Handbuch, um Text über Transklusion in andere Handbücher einzufügen. Bitte verwenden Sie die Architektur-spezifischen Handbücher für eine vollständige Installations-Anleitung.
Portage-Konfiguration
Wie bereits erwähnt, ist Portage über viele Variablen konfigurierbar, die in /etc/portage/make.conf oder einem der Unterverzeichnisse von /etc/portage/ definiert werden sollten. Bitte lesen Sie die make.conf und portage Manpages für weitere und vollständige Informationen:
user $
man make.conf
user $
man portage
Build-spezifische Optionen
Configure und Compiler-Optionen
Wenn Portage Anwendungen baut, übergibt es den Inhalt der folgenden Variablen an den Compiler und das configure Skript:
- CFLAGS and CXXFLAGS
- Define the desired compiler flags for C and C++ compiling.
- CHOST
- Defines the build host information for the application's configure script
- MAKEOPTS
- Passed to the make command and is usually set to define the amount of parallelism used during the compilation. More information about the make options can be found in the make man page.
Die USE-Variable wird auch bei configure und Kompilierungen verwendet, wurde aber bereits in den vorherigen Kapiteln ausführlich erklärt.
Merge-Optionen
When Portage has merged a newer version of a certain software title, it will remove the obsoleted files of the older version from the system. Portage gives the user a 5 second delay before unmerging the older version. These 5 seconds are defined by the CLEAN_DELAY variable.
It is possible to tell emerge to use certain options every time it is run by setting EMERGE_DEFAULT_OPTS. Some useful options would be --ask
, --verbose
, --tree
, and so on.
Schutz von Konfigurationsdateien
Portage geschützte Orte
Portage overwrites files provided by newer versions of a software title if the files aren't stored in a protected location. These protected locations are defined by the CONFIG_PROTECT variable and are generally configuration file locations. The directory listing is space-delimited.
Eine Datei, die in einen solchen geschützten Speicherort geschrieben würde, wird umbenannt, und der Benutzer wird über das Vorhandensein einer neueren Version der (mutmaßlichen) Konfigurationsdatei gewarnt.
Um sich über die aktuelle CONFIG_PROTECT-Einstellung zu informieren, verwenden Sie die emerge --info Ausgabe:
user $
emerge --info | grep 'CONFIG_PROTECT='
Weitere Informationen über den Schutz von Portage's Konfigurationsdateien finden Sie im Abschnitt CONFIGURATION FILES in der emerge Manpage:
user $
man emerge
Verzeichnisse ausschließen
Um den Schutz bestimmter Unterverzeichnisse geschützter Orte aufzuheben, können Benutzer die Variable CONFIG_PROTECT_MASK verwenden.
Download-Optionen
Server-Standorte
Wenn die angeforderten Informationen oder Daten nicht im System verfügbar sind, wird Portage sie aus dem Internet abrufen. Die Serverstandorte für die verschiedenen Informations- und Datenkanäle werden durch die folgenden Variablen definiert:
- GENTOO_MIRRORS
- Defines a list of server locations which contain source code (distfiles).
- PORTAGE_BINHOST
- Defines a particular server location containing prebuilt packages for the system.
Eine dritte Einstellung betrifft den Ort des rsync-Servers, den Benutzer verwenden, um ihr lokales Gentoo-Repositorium zu aktualisieren. Dieser wird in der Datei /etc/portage/repos.conf definiert (oder in einer Datei innerhalb dieses Verzeichnisses, wenn es als Verzeichnis definiert ist):
- sync-type
- Defines the type of server and defaults to
rsync
. - sync-uri
- Defines a particular server which Portage uses to fetch the Gentoo repository.
The GENTOO_MIRRORS, sync-type, and sync-uri variables can be set automatically through the mirrorselect application. Of course, app-portage/mirrorselect needs to be installed first before it can be used. For more information, see mirrorselect's online help:
root #
mirrorselect --help
If the environment requires the use of a proxy server, then the http_proxy, ftp_proxy, and RSYNC_PROXY variables can be declared.
Fetch commands
When Portage needs to fetch source code, it uses wget by default. This can be changed through the FETCHCOMMAND variable.
Portage is able to resume partially downloaded source code. It uses wget by default, but this can be altered through the RESUMECOMMAND variable.
Make sure that the FETCHCOMMAND and RESUMECOMMAND store the source code in the correct location. Inside the variables the \${URI} and \${DISTDIR} variables can be used to point to the source code location and distfiles location respectively.
It is also possible to define protocol-specific handlers with FETCHCOMMAND_HTTP, FETCHCOMMAND_FTP, RESUMECOMMAND_HTTP, RESUMECOMMAND_FTP, and so on.
Rsync settings
It is not possible to alter the rsync command used by Portage to update the Gentoo repository, but it is possible to set some variables related to the rsync command:
- PORTAGE_RSYNC_OPTS
- Sets a number of default variables used during sync, each space-separated. These shouldn't be changed unless you know exactly what you're doing. Note that certain absolutely required options will always be used even if PORTAGE_RSYNC_OPTS is empty.
- PORTAGE_RSYNC_EXTRA_OPTS
- Used to set additional options when syncing. Each option should be space separated:
--timeout=<number>
- This defines the number of seconds an rsync connection can idle before rsync sees the connection as timed-out. This variable defaults to
180
but dialup users or individuals with slow computers might want to set this to300
or higher. --exclude-from=/etc/portage/rsync_excludes
- This points to a file listing the packages and/or categories rsync should ignore during the update process. In this case, it points to /etc/portage/rsync_excludes.
--quiet
- Reduces output to the screen.
--verbose
- Prints a complete filelist.
--progress
- Displays a progress meter for each file.
- PORTAGE_RSYNC_RETRIES
- Defines how many times rsync should try connecting to the mirror pointed to by the SYNC variable before bailing out. This variable defaults to
3
.
For more information on these options and others, please read man rsync.
Gentoo configuration
Branch selection
It is possible to change the default branch with the ACCEPT_KEYWORDS variable. It defaults to the architecture's stable branch. More information on Gentoo's branches can be found in the next chapter.
Portage features
It is possible to activate certain portage features through the FEATURES variable. The Portage features have been discussed in previous chapters.
Portage behavior
Resource management
With the PORTAGE_NICENESS variable users can augment or reduce the nice value Portage will use while running. The PORTAGE_NICENESS value is added to the current nice value of Portage.
For more information about nice values, see Portage niceness and the nice man page:
user $
man nice
Output behavior
The NOCOLOR variable, which defaults to false
, defines if Portage should disable the use of colored output.