Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 297285 - app-portage/portage-utils-0.2.1 qsearch no longer supports read-only PORTDIR
Summary: app-portage/portage-utils-0.2.1 qsearch no longer supports read-only PORTDIR
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage Utils Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-17 14:17 UTC by michael@smith-li.com
Modified: 2010-06-08 05:39 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description michael@smith-li.com 2009-12-17 14:17:07 UTC
Between versions 0.1.29 and 0.2.1 changes to portage-utils' qsearch prevent it from working when PORTDIR is a readonly filesystem. In my case, I have multiple machines using the same NFS-mounted PORTDIR. After upgrading portage-utils to 0.2.1 when I try to use qsearch:

WEB-GENWK01 ~ # q -r && qsearch beans
search: Updating ebuild metacache ... 
search: initialize_flat(): opening '/usr/portage/metadata/cache/.metadata.x' failed: Read-only file system

Line 676 of main.c seems to be the culprit, but I'm not familiar enough with the codebase to change it without knowing why it's there.
if ((fp = fopen(cache_file, "w")) == NULL)


Reproducible: Always
Comment 1 michael@smith-li.com 2010-03-21 07:58:29 UTC
$ strace q -r
execve("/usr/bin/q", ["q", "-r"], [/* 27 vars */]) = 0
brk(0)                                  = 0x1adc000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f63265a6000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f63265a5000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=43880, ...}) = 0
mmap(NULL, 43880, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f632659a000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\353\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1399984, ...}) = 0
mmap(NULL, 3508264, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6326032000
mprotect(0x7f6326181000, 2097152, PROT_NONE) = 0
mmap(0x7f6326381000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14f000) = 0x7f6326381000
mmap(0x7f6326386000, 18472, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6326386000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6326599000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6326598000
arch_prctl(ARCH_SET_FS, 0x7f63265986f0) = 0
mprotect(0x7f6326381000, 16384, PROT_READ) = 0
mprotect(0x628000, 4096, PROT_READ)     = 0
mprotect(0x7f63265a7000, 4096, PROT_READ) = 0
munmap(0x7f632659a000, 43880)           = 0
fstat(1, {st_mode=S_IFREG|0644, st_size=1595, ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff638344d0) = -1 ENOTTY (Inappropriate ioctl for device)
brk(0)                                  = 0x1adc000
brk(0x1afd000)                          = 0x1afd000
readlink("/etc/make.profile", "../usr/portage/profiles/default/linux/amd64/10.0", 4095) = 48
open("/etc/../usr/portage/profiles/default/linux/amd64/10.0/make.defaults", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/etc/../usr/portage/profiles/default/linux/amd64/10.0/parent", {st_mode=S_IFREG|0644, st_size=29, ...}) = 0
open("/etc/../usr/portage/profiles/default/linux/amd64/10.0/parent", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=29, ...}) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=29, ...}) = 0
mmap(NULL, 262144, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6326558000
read(3, "..\n../../../../releases/10.0\n", 262144) = 29
close(3)                                = 0
munmap(0x7f6326558000, 262144)          = 0
open("/etc/../usr/portage/profiles/default/linux/amd64/10.0/..\n../../../../releases/10.0/make.defaults", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/etc/../usr/portage/profiles/default/linux/amd64/10.0/..\n../../../../releases/10.0/parent", 0x7fff63834470) = -1 ENOENT (No such file or directory)
open("/etc/make.globals", O_RDONLY)     = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=3951, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f63265a4000
read(3, "# Copyright 1999-2006 Gentoo Fou"..., 4096) = 3951
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x7f63265a4000, 4096)            = 0
open("/etc/make.conf", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=215, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f63265a4000
read(3, "CFLAGS=\"-march=native -O2 -pipe\""..., 4096) = 215
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x7f63265a4000, 4096)            = 0
chdir("/usr/portage")                   = 0
unlink(".ebuild.x")                     = -1 EROFS (Read-only file system)
chdir("/usr/portage")                   = 0
stat(".ebuild.x", {st_mode=S_IFREG|0644, st_size=1226001, ...}) = 0
access(".ebuild.x", R_OK)               = 0
close(2)                                = 0
exit_group(0)                           = ?
Comment 2 michael@smith-li.com 2010-03-24 20:26:04 UTC
This appears fixed in app-portage/portage-utils-0.3.1 (currently ~amd64).