Gentoo的portage已支持直接更新第三方源(overlay)

多数发行版都会自动更新所有添加的源,包括第三方源,如redhat系、debian系、arch linux等,而Gentoo添加了第三方源(overlay)之后,更新时,需要用layman -S命令来单独更新全部overlay。

现在,最新的portage管理器也终于支持用emerge命令来更新overlay了!

2015-02-04-portage-sync-changes
  Title                     New portage plug-in sync system
  Author                    Brian Dolbec <dolsen@gentoo.org>
  Posted                    2015-02-02
  Revision                  1

There is a new plug-in sync system in >=sys-apps/portage-2.2.16.
This system will allow third party modules to be easily installed.  Look
for a new layman plug-in sync module in layman's next release.  Next is
a brief look at the changes.  See the url [1] listed below for detailed
descriptions and usage.

Changes:  /etc/portage/repos.conf/*
    New setting for all repository types (needed):
        auto-sync = yes/no, true/false  # default if absent: yes/true

    New for git sync-type: (applies to clone only)
        sync-depth = n  where n = {0,1,2,3,...} (optional, default = 1)
            0 -- full history
            1 -- shallow clone, only current state (default)
            2,3,... number of history changes to download

    New sync-type modules:
        sync-type = svn  # sync a subversion repository
        sync-type = websync # Perform an emerge-webrsync operation
        sync-type = laymanator  # (if installed) runs a layman -s action

    New native portage postsync hooks
        /etc/portage/postsync.d/*
            Runs hooks once, only after all repos have been synced.
        /etc/portage/repo.postsync.d/*
            Runs each script with three arguments:
                repo name, sync-uri, location
            Each script is run at the completion of every repo synced.

Migration:
    Edit /etc/portage/repos.conf/*.conf files, add the auto-sync option
    to each repository definition.  Edit sync-type option to one of the
    supported types {rsync, git, cvs, svn, websync, laymanator}.
        [some-repo]
        ...
        sync-type = rsync
        auto-sync = yes

    For an existing /etc/portage/repos.conf/layman.conf file:
        1) change/add the sync-type
            sync-type = laymanator
        2) Ensure you have the correct layman version installed with
           it's laymanator module also installed.
    Alternate method:
        Please see the wiki page url [1] for detailed instructions.

Primary control of all sync operations has been moved from emerge to
emaint.  "emerge --sync" now just calls the emaint sync module with the
--auto option.  The --auto option performs a sync on only those
repositories with the auto-sync setting not set to 'no' or 'false'. If
it is absent, then it will default to yes and "emerge --sync" will sync
the repository.

NOTE: As a result of the default auto-sync = True/Yes setting, commands
    like "eix-sync", "esync -l", "emerge --sync && layman -S" will cause
    many repositories to be synced multiple times in a row.  Please edit
    your configs or scripts to adjust for the new operation.

WARNING:
    Due to the above default. For any repos that you EXPLICITLY do not
    want to be synced. You MUST set "auto-sync = no"

The 'emaint sync' module operates similar to layman.  It can sync
single or multiple repos.  See "emaint --help" or for more details and
examples see the wiki page listed below [1].

Additional help and project API documentation can be found at:

[1] https://wiki.gentoo.org/wiki/Project:Portage/Sync

也就是从sys-apps/portage-2.2.16开始,添加了配置文件之后,用emerge –sync就可以直接更新overlay了。另外,layman也增加了一个use,sync-plugin-portage(Install the sys-apps/portage sync module),默认不开启。如果需要手动配置,可以采用以下方法:

1、首先,需要创建一个配置文件。安装portage和layman时没有自动创建文件和目录,只好手动创建了。

mkdir /etc/portage/repos.conf
touch /etc/portage/repos.conf/layman.conf

2、手动添加配置信息,例如gentoo-zh:

[gentoo-zh]
location = /var/lib/layman/gentoo-zh
auto-sync = yes
sync-type = git
sync-uri = https://github.com/microcai/gentoo-zh.git

注:有了配置文件之后,新安装的overlay也会自动添加配置文件,但需要修改,否则更新时出错。这是默认添加的配置:

[kde]
priority = 50
location = /var/lib/layman/kde
auto-sync = No
layman-type = git

有三个地方需要修改:auto-sync的No修改为yes;layman-type改为sync-type;按前面配置方式添加sync-uri项。改成下面内容:

[kde]
priority = 50
location = /var/lib/layman/kde
auto-sync = yes
sync-type = git
sync-uri = https://github.com/gentoo/kde.git

配置完成。

以后,再用emerge –sync更新portage时,官方portage更新完成之后,会自动更新overlay,出现如下信息:

>>> Syncing repository 'gentoo-zh' into '/var/lib/layman/gentoo-zh'...
/usr/bin/git pull
remote: Counting objects: 15, done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 15 (delta 4), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (15/15), done.
From git://github.com/microcai/gentoo-zh
   da7bbf3..a4d1c13  master     -> origin/master
Updating da7bbf3..a4d1c13
Fast-forward
 media-video/bilibili-player/Manifest                                                     | 2 +-
 media-video/bilibili-player/{bilibili-player-0.10.ebuild => bilibili-player-0.12.ebuild} | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)
 rename media-video/bilibili-player/{bilibili-player-0.10.ebuild => bilibili-player-0.12.ebuild} (88%)
=== Sync completed for gentoo-zh
>>> Syncing repository 'kde' into '/var/lib/layman/kde'...
/usr/bin/git pull
Already up-to-date.
=== Sync completed for kde

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据