Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 587474 - [RAP] app-portage/layman: config of repos_conf respect Prefix by default
Summary: [RAP] app-portage/layman: config of repos_conf respect Prefix by default
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Layman Overlay Manager project
URL:
Whiteboard:
Keywords:
: 604870 (view as bug list)
Depends on:
Blocks: prefix-gx86
  Show dependency tree
 
Reported: 2016-06-29 07:18 UTC by Martin Mokrejš
Modified: 2017-02-02 12:43 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
layman-cfg.patch (layman-cfg.patch,542 bytes, patch)
2016-07-22 05:24 UTC, Benda Xu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2016-06-29 07:18:34 UTC
I have a second prefix-ed instance, installed through bootstrap_rap.sh (so it has it's own glibc). It seems layman do not respect the Prefix path:

$ layman -a science

 * Adding overlay...
 * Running Git... # ( cd /scratch/mmokrejs/gentoo_rap/var/lib/layman  && /scratch/mmokrejs/gentoo_rap/usr/bin/git clone git://anongit.gentoo.org/proj/sci.git /scratch/mmokrejs/gentoo_rap/var/lib/layman/science )
Cloning into '/scratch/mmokrejs/gentoo_rap/var/lib/layman/science'...
remote: Counting objects: 102863, done.
remote: Compressing objects: 100% (47368/47368), done.
remote: Total 102863 (delta 63870), reused 89612 (delta 54386)
Receiving objects: 100% (102863/102863), 23.02 MiB | 8.89 MiB/s, done.
Resolving deltas: 100% (63870/63870), done.
Checking connectivity... done.
Checking out files: 100% (3487/3487), done.
 * Running Git... # ( cd /scratch/mmokrejs/gentoo_rap/var/lib/layman/science  && /scratch/mmokrejs/gentoo_rap/usr/bin/git config user.name "layman" )
 * Running Git... # ( cd /scratch/mmokrejs/gentoo_rap/var/lib/layman/science  && /scratch/mmokrejs/gentoo_rap/usr/bin/git config user.email "layman@localhost" )

 * CLI: Errors occurred processing action add
 * Exception caught installing repository "science":
 * /etc/portage/repos.conf is not a directory when it should be.

[mmokrejs@login2.anselm sci-biology]$ emerge -pv layman

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] app-portage/layman-2.4.1-r1::gentoo  USE="git -bazaar -cvs -darcs -g-sorcery -gpg -mercurial -sqlite -squashfs -subversion -sync-plugin-portage {-test}" PYTHON_TARGETS="python2_7 -pypy -python3_3 -python3_4 -python3_5" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

 * IMPORTANT: 11 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

$
$ emerge --info
Portage 2.3.0 (python 3.4.4-final-0, prefix/linux-standalone/amd64, gcc-5.4.0, unavailable, 2.6.32-573.12.1.el6.Bull.88.x86_64 x86_64)
=================================================================
System uname: Linux-2.6.32-573.12.1.el6.Bull.88.x86_64-x86_64-Intel-R-_Xeon-R-_CPU_E5-2670_0_@_2.60GHz-with-redhat-6.4-Santiago
KiB Mem:   131942764 total,  21179540 free
KiB Swap:   65536128 total,  64525500 free
Timestamp of repository gentoo: Sat, 25 Jun 2016 00:45:01 +0000
sh bash 4.3_p46
ld GNU ld (Gentoo 2.26) 2.26.20160125
app-shells/bash:          4.3_p46::gentoo
dev-lang/perl:            5.24.0-r1::gentoo
dev-lang/python:          2.7.11-r2::gentoo, 3.4.4::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.2::rap
sys-apps/sandbox:         2.10-r2::gentoo
sys-devel/autoconf:       2.69-r2::gentoo
sys-devel/automake:       1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.26::rap
sys-devel/gcc:            5.4.0::gentoo
sys-devel/gcc-config:     1.8_p20160608::rap
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.6::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r2::rap
Repositories:

gentoo
    location: /scratch/mmokrejs/gentoo_rap/usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    eclass-overrides: rap

rap
    location: /scratch/mmokrejs/gentoo_rap/usr/portage-stage
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/proj/android.git
    masters: gentoo
    eclass-overrides: rap

ACCEPT_KEYWORDS="amd64 ~amd64 ~amd64-linux"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -O2 -pipe -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -O2 -pipe -march=native"
DISTDIR="/scratch/mmokrejs/gentoo_rap/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles force-prefix merge-sync news parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans unprivileged userfetch userpriv usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.wheel.sk/ http://ftp.fi.muni.cz/pub/linux/gentoo/ http://gentoo.mirror.web4u.cz/ rsync://gentoo.mirror.dkm.cz/gentoo/ ftp://gentoo.mirror.web4u.cz/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8"
PKGDIR="/scratch/mmokrejs/gentoo_rap/usr/portage/packages"
PORTAGE_CONFIGROOT="/scratch/mmokrejs/gentoo_rap/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/scratch/mmokrejs/gentoo_rap/var/tmp"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm iconv ipv6 mmx mmxext modules ncurses nls nptl openmp pcre prefix readline seccomp session sse sse2 ssl tcpd unicode zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

$
Comment 1 Benda Xu gentoo-dev 2016-06-29 07:29:58 UTC
(In reply to Martin Mokrejš from comment #0)
> I have a second prefix-ed instance, installed through bootstrap_rap.sh (so
> it has it's own glibc). It seems layman do not respect the Prefix path:
>
>  * CLI: Errors occurred processing action add
>  * Exception caught installing repository "science":
>  * /etc/portage/repos.conf is not a directory when it should be.

Does converting EPREFIX/etc/portage/repos.conf into a directory solve this issue?

$ cd EPREFIX/etc/portage/
$ mv repos.conf gentoo.conf
$ mkdir repos.conf
$ mv gentoo.conf repos.conf/
Comment 2 Benda Xu gentoo-dev 2016-06-29 07:31:38 UTC
Probably EPREFIX/etc/layman/layman.cfg needs to be updated, too.
Comment 3 Martin Mokrejš 2016-06-29 08:16:32 UTC
(In reply to Benda Xu from comment #1)
> (In reply to Martin Mokrejš from comment #0)
> > I have a second prefix-ed instance, installed through bootstrap_rap.sh (so
> > it has it's own glibc). It seems layman do not respect the Prefix path:
> >
> >  * CLI: Errors occurred processing action add
> >  * Exception caught installing repository "science":
> >  * /etc/portage/repos.conf is not a directory when it should be.
> 
> Does converting EPREFIX/etc/portage/repos.conf into a directory solve this
> issue?
> 
> $ cd EPREFIX/etc/portage/
> $ mv repos.conf gentoo.conf
> $ mkdir repos.conf
> $ mv gentoo.conf repos.conf/

The above alone it is not enough.
Comment 4 Martin Mokrejš 2016-06-29 08:20:08 UTC
(In reply to Benda Xu from comment #2)
> Probably EPREFIX/etc/layman/layman.cfg needs to be updated, too.

Do not know what to change in this file.


Fo example 'layman -d haskell' also fails with the same error. It seems removing the stale XML entry from EPREFIX/var/lib/layman/installed.xml is enough? Well, maybe some more work is needed to manually finish the removal ... Does this help?
Comment 5 Benda Xu gentoo-dev 2016-06-29 09:03:40 UTC
I cannot reproduce this bug.

(In reply to Martin Mokrejš from comment #4)
> (In reply to Benda Xu from comment #2)
> > Probably EPREFIX/etc/layman/layman.cfg needs to be updated, too.
> 
> Do not know what to change in this file.

[MAIN]
#-----------------------------------------------------------
# Defines the directory where overlays should be installed

storage   : !!!Replace with EPREFIX!!!/var/lib/layman

#-----------------------------------------------------------
# Path to the repos.conf file that should be modified by
# layman

repos_conf : !!!Replace with EPREFIX!!!/etc/portage/repos.conf/layman.conf


> Fo example 'layman -d haskell' also fails with the same error. 

Does it help if you synchronize rap,

  https://wiki.gentoo.org/wiki/Prefix/libc#Synchronize_with_the_RAP_repository

and emerge bash again?
Comment 6 Martin Mokrejš 2016-06-30 10:10:30 UTC
(In reply to Benda Xu from comment #5)
> I cannot reproduce this bug.
> 
> (In reply to Martin Mokrejš from comment #4)
> > (In reply to Benda Xu from comment #2)
> > > Probably EPREFIX/etc/layman/layman.cfg needs to be updated, too.
> > 
> > Do not know what to change in this file.
> 
> [MAIN]
> #-----------------------------------------------------------
> # Defines the directory where overlays should be installed
> 
> storage   : !!!Replace with EPREFIX!!!/var/lib/layman
> 
> #-----------------------------------------------------------
> # Path to the repos.conf file that should be modified by
> # layman
> 
> repos_conf : !!!Replace with EPREFIX!!!/etc/portage/repos.conf/layman.conf


The first was already in there:

storage   : /scratch/mmokrejs/gentoo_rap/var/lib/layman

but the second is wrong

repos_conf : /etc/portage/repos.conf/layman.conf


Why is the placeholder '!!!Replace with EPREFIX!!!' missing?

> 
> 
> > For example 'layman -d haskell' also fails with the same error. 
> 
> Does it help if you synchronize rap,
> 
>  
> https://wiki.gentoo.org/wiki/Prefix/libc#Synchronize_with_the_RAP_repository
> 
> and emerge bash again?


I re-emerged bash, and maybe because of the above manual edits to config files, it behaves better now:


$ layman -d haskell

 * Deleting selected overlay(s)...
 * Deleting directory "/scratch/mmokrejs/gentoo_rap/var/lib/layman/haskell"
 * ReposConf: ConfigHandler.read(); Failed to read "/scratch/mmokrejs/gentoo_rap/etc/portage/repos.conf/layman.conf".
 * File not found.
 * Successfully deleted overlay(s) haskell.

$
Comment 7 Benda Xu gentoo-dev 2016-06-30 13:32:17 UTC
(In reply to Martin Mokrejš from comment #6)
> (In reply to Benda Xu from comment #5)
> > I cannot reproduce this bug.
> > 
> > (In reply to Martin Mokrejš from comment #4)
> > > (In reply to Benda Xu from comment #2)
> > > > Probably EPREFIX/etc/layman/layman.cfg needs to be updated, too.
> > > 
> > > Do not know what to change in this file.
> > 
> > [MAIN]
> > #-----------------------------------------------------------
> > # Defines the directory where overlays should be installed
> > 
> > storage   : !!!Replace with EPREFIX!!!/var/lib/layman
> > 
> > #-----------------------------------------------------------
> > # Path to the repos.conf file that should be modified by
> > # layman
> > 
> > repos_conf : !!!Replace with EPREFIX!!!/etc/portage/repos.conf/layman.conf
> 
> 
> The first was already in there:
> 
> storage   : /scratch/mmokrejs/gentoo_rap/var/lib/layman
> 
> but the second is wrong
> 
> repos_conf : /etc/portage/repos.conf/layman.conf
> 
> 
> Why is the placeholder '!!!Replace with EPREFIX!!!' missing?

I invented it, it doesn't exist.

> > > For example 'layman -d haskell' also fails with the same error. 
> > 
> > Does it help if you synchronize rap,
> > 
> >  
> > https://wiki.gentoo.org/wiki/Prefix/libc#Synchronize_with_the_RAP_repository
> > 
> > and emerge bash again?
> 
> 
> I re-emerged bash, and maybe because of the above manual edits to config
> files, it behaves better now:
> 
> $ layman -d haskell
> 
>  * Deleting selected overlay(s)...
>  * Deleting directory "/scratch/mmokrejs/gentoo_rap/var/lib/layman/haskell"
>  * ReposConf: ConfigHandler.read(); Failed to read
> "/scratch/mmokrejs/gentoo_rap/etc/portage/repos.conf/layman.conf".

Remove and add back overlays will solve that.

>  * File not found.
>  * Successfully deleted overlay(s) haskell.
Comment 8 Martin Mokrejš 2016-06-30 13:46:32 UTC
You seem to be right, as always. ;-)

$ layman -d haskell

 * Deleting selected overlay(s)...
 * Deleting directory "/scratch/mmokrejs/gentoo_rap/var/lib/layman/haskell"
 * Successfully deleted overlay(s) haskell.

$ layman -a haskell

 * Adding overlay...
 * Running Git... # ( cd /scratch/mmokrejs/gentoo_rap/var/lib/layman  && /scratch/mmokrejs/gentoo_rap/usr/bin/git clone git://github.com/gentoo-haskell/gentoo-haskell.git /scratch/mmokrejs/gentoo_rap/var/lib/layman/haskell )
Cloning into '/scratch/mmokrejs/gentoo_rap/var/lib/layman/haskell'...
remote: Counting objects: 169429, done.
remote: Compressing objects: 100% (115/115), done.
remote: Total 169429 (delta 49), reused 0 (delta 0), pack-reused 169314
Receiving objects: 100% (169429/169429), 39.21 MiB | 10.42 MiB/s, done.
Resolving deltas: 100% (91106/91106), done.
Checking connectivity... done.
Checking out files: 100% (5947/5947), done.
 * Running Git... # ( cd /scratch/mmokrejs/gentoo_rap/var/lib/layman/haskell  && /scratch/mmokrejs/gentoo_rap/usr/bin/git config user.name "layman" )
 * Running Git... # ( cd /scratch/mmokrejs/gentoo_rap/var/lib/layman/haskell  && /scratch/mmokrejs/gentoo_rap/usr/bin/git config user.email "layman@localhost" )
!!! Repository 'x-layman' is missing masters attribute in '/scratch/mmokrejs/gentoo_rap/var/lib/layman/metadata/layout.conf'
!!! Set 'masters = gentoo' in this file for future compatibility
 * Successfully added overlay(s) haskell.

$

What what was the problem and what will be fixed in layman or its config files?
Comment 9 Benda Xu gentoo-dev 2016-06-30 13:58:29 UTC
(In reply to Martin Mokrejš from comment #8)

> !!! Repository 'x-layman' is missing masters attribute in
> '/scratch/mmokrejs/gentoo_rap/var/lib/layman/metadata/layout.conf'
> !!! Set 'masters = gentoo' in this file for future compatibility

This is just a warning.  Just does as it said: add masters = gentoo in /scratch/mmokrejs/gentoo_rap/var/lib/layman/metadata/layout.conf .  If you don't you that overlay, just delete it (in EPREFIX/etc/portage/repos.conf/XXXXXX.conf).

Reference: https://wiki.gentoo.org/wiki//etc/portage/repos.conf

The problem was the config file had a wrong default location for repos.conf.
Comment 10 Benda Xu gentoo-dev 2016-07-22 05:24:31 UTC
Created attachment 441336 [details, diff]
layman-cfg.patch

Hi, Layman Team.  The default config of layman sets

  repos_conf : /etc/portage/repos.conf/layman.conf

which does not work on Prefix by default.

In the ebuild, there is eprefixify etc/layman.cfg.  Therefore prefixing @GENTOO_PORTAGE_EPREFIX@ is enough.  Please review.
Comment 11 Benda Xu gentoo-dev 2017-01-15 14:31:57 UTC
Martin, I wish you remembered this bug.

*** This bug has been marked as a duplicate of bug 604870 ***
Comment 12 Benda Xu gentoo-dev 2017-01-15 14:34:39 UTC
*** Bug 604870 has been marked as a duplicate of this bug. ***
Comment 13 François Bissey 2017-01-31 21:24:14 UTC
I voted for this bug. This is annoying.
Comment 14 Fabian Groffen gentoo-dev 2017-02-01 08:04:17 UTC
Benda I think you should just push it for the moment to fix the issue.
Comment 15 Devan Franchini (RETIRED) gentoo-dev 2017-02-02 00:31:33 UTC
Sorry about putting this off, I'm going through the bug now and should just be able to apply the patch and push out a rev.
Comment 16 Devan Franchini (RETIRED) gentoo-dev 2017-02-02 00:43:18 UTC
Seems Benda already added the fix. The problem, however, is that layman should've allowed for this flexibility already:
https://github.com/gentoo/layman/blob/master/layman/config.py#L45

Let's keep this open until I discuss why the behaviour failed to begin with.
Comment 17 Brian Dolbec (RETIRED) gentoo-dev 2017-02-02 02:49:20 UTC
patch applied and released in layman-2.4.2
Comment 18 Martin Mokrejš 2017-02-02 12:43:58 UTC
Seems -2.4.2 works properly now (dropped all my overlays and re-added them back without need to add entries manually to /apps/gentoo/etc/portage/repos.conf/layman.conf). Thank you.