eix icon indicating copy to clipboard operation
eix copied to clipboard

eix-update with git produces empty database

Open hartwork opened this issue 8 years ago • 13 comments

Hi!

I turned /usr/portage/ from rsync to Git like this:

# cat /etc/portage/repos.conf 
[gentoo]
sync-type = git
sync-uri = https://github.com/gentoo/gentoo.git
auto-sync = yes

# emaint sync --auto
[..]

Now I would expect eix-update to re-build a healthy index but it reports to not find any e-builds (which there are plenty) as I read the output:

# eix-update 
Reading Portage settings...
Building database (/var/cache/eix/portage.eix)...
[0] "gentoo" /usr/portage/ (cache: metadata-md5-or-flat)
     Reading category 163|163 (100) EMPTY!
Applying masks...
Calculating hash tables...
Writing database file /var/cache/eix/portage.eix...
Database contains 0 packages in 163 categories.

Is my setup not supported? Could it be? Are there workarounds that I could try? Many thanks in advance,

Sebastian

hartwork avatar Dec 19 '15 21:12 hartwork

If you use a git repository which does not contain metadata, you must create them locally, using egencache.

vaeth avatar Dec 20 '15 07:12 vaeth

Thanks for the pointer to egencache. I am unsure how to best improve the situation so the the next person will not have to find this ticket or open a duplicate. Any ideas?

hartwork avatar Dec 20 '15 16:12 hartwork

Let's leave the ticket open. It is about the 5th time already I gave a similar answer...

vaeth avatar Dec 20 '15 17:12 vaeth

@hartwork

thanks for the tip. I just moved to git repo and got this issue

For the eix-update EMPTY issue, the command which fixed my issue is

egencache --repo=gentoo --update
# eix-update 
Reading Portage settings ..
Building database (/var/cache/eix/portage.eix) ..
[0] 'gentoo' /usr/portage/ (cache: metadata-md5-or-flat)
     Reading category 163|163 (100%) Finished         
Applying masks ..
Calculating hash tables ..
Writing database file /var/cache/eix/portage.eix ..
Database contains 18915 packages in 163 categories.

dxli avatar Jan 26 '16 14:01 dxli

So does the egencache command now need to be run every time the git repo is synced?

shiznix avatar Mar 20 '16 07:03 shiznix

I hit the same issue. Thanks you very much.

mercuriete avatar Apr 16 '16 17:04 mercuriete

Here's my script /etc/portage/postsync.d/eix-update:

#!/bin/bash

if [ -e /etc/portage/make.conf ]; then . /etc/portage/make.conf if [ ! -d $PORTDIR/metadata/md5-cache -o -d $PORTDIR/.git ]; then echo "updating metadata cache ..." egencache --repo=gentoo --update fi fi

/usr/bin/eix-update

But the first egencache --repo=gentoo --update is very very long ...

drunkard avatar Jun 16 '16 04:06 drunkard

hi guys. for someones that hit this issue...

this repo -> https://github.com/gentoo-mirror/gentoo.git

this is a git repo that actually have metadata.

i will fix the problem with this repos.conf

[DEFAULT] main-repo = gentoo

[gentoo] location = /usr/portage sync-type = git sync-uri = https://github.com/gentoo-mirror/gentoo.git auto-sync = yes

Cheers! :smile:

mercuriete avatar Jul 26 '16 21:07 mercuriete

One does not really want to keep the history of metadata in a git repository: It's an enormous waste of disk space.

I have now created a set of /etc/portage/repo.postsync.d/* files which take care about downloading the cache and/or calling egencache to generate the metadata (and also download some other data like news and GLSAs which are not provided in the gentoo repository). Details are highly configurable, and some emphasis is put on security.

You can install it as the package app-portage/portage-postsyncd-mv from the mv overlay (available over layman).

vaeth avatar Aug 26 '16 22:08 vaeth

Hello from 2021, just upgraded to using git for main gentoo overlay & faced the same problem. Maybe there should be at least some warning message somewhere at eix when moving to a git repo?

lisyarus avatar Mar 10 '21 07:03 lisyarus

Nobody should be using sync-uri = https://github.com/gentoo/gentoo.git. Instead point sync-uri at https://github.com/gentoo-mirror/gentoo, which contains the metadata cache.

ajakk avatar Oct 26 '22 00:10 ajakk