Layman

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page Layman and the translation is 70% complete.
Other languages:
Resources
警告
Eselect/Repository は layman を置き換えるもので、現時点で、ebuild リポジトリを取り扱うためのより好ましい方法です。

Laymanebuild リポジトリ管理ツールです。エンドユーザがリポジトリを管理するための、単一のコマンドラインインターフェースを提供します。

layman の機能の大部分は今や Portageeselect-repository に統合されましたが、layman は、Portage がネイティブに同期できない一部のバージョン管理システム (例えば、darcs と g-sorcery) をサポートしています。

機能

Eselect/Repository は、ebuild リポジトリの一覧、構成、同期の制御の面で layman に取って代わることができる一方、app-portage/layman ユーザは自身の ebuild リポジトリ (オーバーレイ) を、簡潔で中央集権的な方法で管理することができます。layman は利用可能なリモートリポジトリの概要を表示し、ユーザはシステムで使用するリポジトリを選択することができます。選択すると、ユーザはオーバーレイを (emerge --sync と同様に) 更新、追加、削除、そして情報を表示することができます。

2.1.0 より新しいバージョンでは、プラグイン sync システムによって改善がされています。

注意
Portageプラグイン sync システムは、layman と比較してまだそのすべてがサポートされてはいませんが、Portage の移行はそれに備える良いステップです。

インストール

USE フラグ

USE flags for app-portage/layman Tool to manage Gentoo overlays

cvs Support dev-vcs/cvs based overlays
darcs Support dev-vcs/darcs based overlays
g-sorcery Support app-portage/g-sorcery based overlays
git Support dev-vcs/git based overlays
gpg Support app-crypt/gnupg signed overlays lists and manifests
mercurial Support dev-vcs/mercurial based overlays
sqlite Add support for sqliteembedded sql database
squashfs Support mounting squashfs image overlays locally read-only
subversion Support dev-vcs/subversion based overlays
sync-plugin-portage Install the sys-apps/portage sync module
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)

sync-plugin-portagegit の USE フラグは、新しいバージョンの layman で特に重要です。

ファイル /etc/portage/package.use/layman重要な USE フラグを追加する
app-portage/layman sync-plugin-portage git

portage プロジェクトページも参考にしてください。

Emerge

次に、layman パッケージをインストールしてください:

root #emerge --ask app-portage/layman

設定

Layman は設定ファイルを /etc/portage/repos.conf/ に作成するでしょう。

laymanrepos.conf の方法を使うように、/etc/layman/layman.cfg で設定してください。新しくインストールされた layman は、おそらく既にこれを正しく設定しているでしょう:

ファイル /etc/layman/layman.cfg
# Repository config types used by layman
# (repos.conf, make.conf)
conf_type : repos.conf

まだ存在していない場合は、/etc/portage/repos.conf/ ディレクトリを作成してください:

layman バージョン 2.3.0 以降をインストールしていれば、laymanrepos.conf ファイルの再構築を強制することができます:

root #layman-updater -R

使い方

基本的な機能の呼び出し

laymanman ページ (外部資料をご確認ください) は、利用できる機能の完全な概要を提供しています。しかしほとんどのユーザは、リポジトリ管理活動のためには以下のコマンドで事足りるでしょう。

公式のリファレンスから利用可能なリポジトリの一覧を取得し、表示するには:

root #layman -L

ローカルのリストによって生成されたリストにリポジトリを追加するには:

root #layman -a <名前>

非公式のリポジトリを追加するには:

root #layman -o <リポジトリ xml ファイルの url> -f -a <名前>

ローカルのリストからリポジトリを除去するには:

root #layman -d <名前>

特定のリポジトリを更新するには:

root #layman -s <名前>

すべてのリポジトリを更新するには:

root #layman -S

layman-mounter を利用したマウンタブルリポジトリ

layman バージョン 2.2.0 のリリース以降、squashfs リポジトリタイプへの対応が含まれています。laymanファイルシステム上に squashfs リポジトリを読み取り専用としてマウントすることで、squashfs リポジトリを操作します。squashfs リポジトリの最初のインストール時に、リポジトリが読み取り専用としてマウントされます。しかし、再起動するとリポジトリはもうマウントされておらず、そのリポジトリ内の ebuild はシステムからアクセスできなくなるでしょう。

これらのマウンタブルリポジトリを操作するユーザを助けるために、layman-mounter という名前のユーティリティが追加されました。

現在マウントされているすべてのリポジトリを探すには、以下をタイプしてください:

root #layman-mounter -l

layman によってインストールされた、マウントできるすべてのリポジトリを探すには、以下をタイプしてください:

root #layman-mounter -L

マウンタブルリポジトリをマウントするには、以下をタイプしてください:

root #layman-mounter -m <名前>

リポジトリをアンマウントするには、以下をタイプしてください:

root #layman-mounter -u <名前>

Layman を使ってリポジトリの優先順位を設定する

The information in this section has been deprecated. It may or may not be relevant for contemporary usage. Handle with care!

As each ebuild repository is assigned a unique priority, layman provides a simple way of defining priorities for repositories it manages. For more information about repository priorities see the ebuild repository priorities.

The file /var/lib/layman/installed.xml contains some information about the repositories, among which is the priority attribute in the repo tag. The number there determines only the priority relative to the other repository entries, 50 is the default value. Larger numbers take priority over smaller numbers. Layman then analyses this file and sets the order of the repository entries in the PORTDIR_OVERLAY variable defined in /var/lib/layman/make.conf.

As the file /var/lib/layman/make.conf is automatically generated by layman based on the settings in /var/lib/layman/installed.xml, it is strongly recommended that only /var/lib/layman/installed.xml is used to set the priorities.

To add a personal repository, and to ensure that the repository has a higher priority, add the repository before /var/lib/layman/make.conf is sourced.

ファイル /var/lib/layman/make.confExample layman overlays setting
PORTDIR_OVERLAY="
/home/jdoe/gamerlay
/var/lib/layman/lisp
/var/lib/layman/Spring
${PORTDIR_OVERLAY}" #the variable defined in /etc/portage/make.conf is now expanded
                    #when /var/lib/layman/make.conf is sourced in /etc/portage/make.conf

However, this can be also "fooled" by defining the PORTDIR_OVERLAY in /etc/portage/make.conf after /var/lib/layman/make.conf has been sourced.

ファイル /etc/portage/make.confCustom repository setting
source /var/lib/layman/make.conf #this sources the PORTDIR_OVERLAY variable defined by layman.
                                 #however, the variable expanded by layman was empty
PORTDIR_OVERLAY="/home/user/overlay ${PORTDIR} ${PORTDIR_OVERLAY}" #now the layman defined repositories take precedence,
                                                                   #but the user defined repository still has the lowest priority

This "trick" is merely an opportunity offered by shell variable expansion.

Adding custom repositories

To add repositories which are not listed when layman -L is ran, find their repository XML files and add them using the -o option under a name specified by the -a option.

Example: repositories.xml in brother-overlay

Missing repository.xml file

In some cases the custom repository does not provide a repository XML file.

Creating repository XML file manually

The XML file can be created manually in the /etc/layman/overlays folder.

For example, if Larry the cow were to create his repository:

ファイル /etc/layman/overlays/larry.xmlLarry the cow's nginx overlay
<?xml version="1.0" ?>

<repositories version="1.0">
	<repo priority="50" quality="experimental" status="unofficial">
		<name>larry</name>
		<description>nginx server for the barn computer from Larry the cow.</description>
		<homepage>https://github.com/gentoo/nginx-overlay</homepage>
		<owner>
			<email>larry@gentoo.org</email>
		</owner>
		<source type="git">https://github.com/gentoo/nginx-overlay.git</source>
	</repo>
</repositories>
Using layman-overlay-maker utility

With the addition of layman version 2.2.0 a new utility was added to assist users in this process that goes by the name of layman-overlay-maker. As long as the overlay information has been properly added via the prompts, layman-overlay-maker will create a XML defined overlay and save into /etc/layman/overlays or the specified in the layman configuration file for overlay_defs.

layman-overlay-maker can become a useful tool in assisting users who would like to submit a patch to have their overlays added to the official repositories.xml file.

To use the utility simply invoke it by name:

root #layman-overlay-maker

and go through its prompts until completion.

Enabling the repository

When finished rebuild the repos.conf using layman-updater:

root #layman-updater -R

Now you can add the custom repository by:

root #layman -a <名前>

where name is the name of the repository that was created.

関連項目

外部資料

  • Layman の man ページ、ローカル (man layman) またはオンラインでは Sourceforge.net 上にあるもの