Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 358185 - eselect news has problems with ROOT
Summary: eselect news has problems with ROOT
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: eselect (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo eselect Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2011-03-10 09:20 UTC by Dennis Schridde
Modified: 2011-03-15 16:32 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 Dennis Schridde 2011-03-10 09:20:07 UTC
---
# ROOT=/vz/private/1100/ emerge -uDN @world 

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

[...]

# ROOT=/vz/private/1100/ eselect news read new
2011-02-19-ia64-java-removal

!!! Warning: News item "2011-02-19-ia64-java-removal" no longer exists
---

I assume it queries the applicable news items from /, but later tries to display a file in $ROOT.

Reproducible: Always
Comment 1 Dennis Schridde 2011-03-10 09:20:41 UTC
Version used: app-admin/eselect-1.2.11
Comment 2 Dennis Schridde 2011-03-10 09:22:48 UTC
P.S: More info:
 * $ROOT contains no portage tree
 * /etc/portage is bind-mounted
Comment 3 Ulrich Müller gentoo-dev 2011-03-10 09:42:55 UTC
What does "portageq get_repo_path ${ROOT} gentoo" output for your ROOT?
Comment 4 Dennis Schridde 2011-03-10 10:11:10 UTC
# ROOT=/vz/private/123/ portageq get_repo_path /vz/private/123/ gentoo
/var/cache/portage/gentoo

The problem is reproducible (i.e. no one-shot):
---
# ROOT=/vz/private/123/ eselect news unread all
# ROOT=/vz/private/123/ eselect news read new
2010-02-28-layman-storage-path-change

!!! Warning: News item "2010-02-28-layman-storage-path-change" no longer exists

[...]
---

The read-states are stored correctly, too:
---
# ROOT=/vz/private/123/ eselect news read new
No news is good news.
---
Comment 5 Dennis Schridde 2011-03-10 10:12:31 UTC
P.S: It works on /, too:
---
# ROOT=/ eselect news unread all
# ROOT=/ eselect news read new

[...expected output...]
---
Comment 6 Ulrich Müller gentoo-dev 2011-03-10 10:27:57 UTC
(In reply to comment #4)
> # ROOT=/vz/private/123/ portageq get_repo_path /vz/private/123/ gentoo
> /var/cache/portage/gentoo

Did I get it right that there is _no_ portage tree in /vz/private/123/var/cache/portage/gentoo ?

But directory /vz/private/123/var/lib/gentoo/news exists and contains some files (like news-gentoo.unread)?
Comment 7 Dennis Schridde 2011-03-10 10:34:57 UTC
(In reply to comment #4)
> !!! Warning: News item "2010-02-28-layman-storage-path-change" no longer exists
Just checked, the directory exists:
/var/cache/portage/gentoo/metadata/news/2010-02-28-layman-storage-path-change

(In reply to comment #6)
> (In reply to comment #4)
> > # ROOT=/vz/private/123/ portageq get_repo_path /vz/private/123/ gentoo
> > /var/cache/portage/gentoo
> 
> Did I get it right that there is _no_ portage tree in
> /vz/private/123/var/cache/portage/gentoo ?
Correct:
# ls /vz/private/123/var/cache/portage/gentoo
ls: cannot access /vz/private/123/var/cache/portage/gentoo: No such file or directory

> But directory /vz/private/123/var/lib/gentoo/news exists and contains some
> files (like news-gentoo.unread)?
Correct.

# ll /vz/private/123/var/lib/gentoo/news
total 8
-rw-rw-r-- 1 root portage 222 Mar 10 11:07 news-gentoo.read
-rw-rw-r-- 1 root portage 222 Mar 10 10:16 news-gentoo.skip
-rw-rw-r-- 1 root portage   0 Mar 10 11:07 news-gentoo.unread

Some more output (maybe interesting):
# ROOT=/vz/private/123/ eselect news list
News items:
  [1]   read    2010-02-28  (2010-02-28-layman-storage-path-change - removed?)
  [2]   read    2010-03-25  (2010-03-25-python-3.1 - removed?)
  [3]   read    2010-08-01  (2010-08-01-as-needed-default - removed?)
  [4]   read    2010-10-22  (2010-10-22-perl-5.12-upgrade-procedure - removed?)
  [5]   read    2010-11-13  (2010-11-13-hardened-profiles - removed?)
  [6]   read    2009-04-18  (2009-04-18-java-config-wrapper-0.16 - removed?)
  [7]   read    2011-02-19  (2011-02-19-ia64-java-removal - removed?)
Comment 8 Dennis Schridde 2011-03-10 10:44:34 UTC
Ok, theory:
 * The files in /vz/private/123/var/lib/gentoo/news/ were remaining from an older setup where there *was* a portage tree in /vz/private/123/var/cache/portage/gentoo.
 * eselect still decided to update the mtime of these status files even though they were not backed up by any real files in metadata/news anymore.
 * This made me think that "ROOT=... eselect news" would work the way I assumed: List news that apply to the specified ROOT instead of /.

I just did this:
# rm /vz/private/123/var/lib/gentoo/news/*
# ROOT=/vz/private/123/ eselect news unread all
# ROOT=/vz/private/123/ eselect news list
News items:
  (none found)              

Suggestion: Either mark as RESOLVED/INVALID and make me open a new bug for ROOT support in eselect-news, or just change the topic/importance into a feature request: "eselect news should support listing items which apply to a different ROOT".
Comment 9 Dennis Schridde 2011-03-10 10:45:38 UTC
Another request would be enhanced diagnostics: eselect should notice that the whole portage tree is missing and notify me about that problem.
Comment 10 Zac Medico gentoo-dev 2011-03-10 15:05:46 UTC
(In reply to comment #6)
> (In reply to comment #4)
> > # ROOT=/vz/private/123/ portageq get_repo_path /vz/private/123/ gentoo
> > /var/cache/portage/gentoo
> 
> Did I get it right that there is _no_ portage tree in
> /vz/private/123/var/cache/portage/gentoo ?

portageq get_repo_path is supposed to return an absolute path, so eselect shouldn't join that path with $ROOT. This is because people typically don't put things like the portage tree inside $ROOT. They can if they want to, but if they do then they need to configure PORTDIR to point at the directory inside $ROOT.
Comment 11 Ulrich Müller gentoo-dev 2011-03-10 18:32:22 UTC
Should be fixed in SVN r808:
<http://sources.gentoo.org/cgi-bin/viewvc.cgi/eselect?view=revision&revision=808>
Comment 12 Dennis Schridde 2011-03-10 20:25:29 UTC
(In reply to comment #11)
> Should be fixed in SVN r808:
> <http://sources.gentoo.org/cgi-bin/viewvc.cgi/eselect?view=revision&revision=808>
Does this implement my feature request? I.e. "eselect news should support listing items which apply to a different ROOT" or "'ROOT=... eselect news ...' should only list news items that apply to the specified ROOT".
Comment 13 Ulrich Müller gentoo-dev 2011-03-11 06:17:17 UTC
(In reply to comment #12)
> Does this implement my feature request? I.e. "eselect news should support
> listing items which apply to a different ROOT" or "'ROOT=... eselect news ...'
> should only list news items that apply to the specified ROOT".

eselect will take the list of news items from ${ROOT}/var/lib/gentoo/news/, so I believe the answer is yes.

(In reply to comment #8)
> Ok, theory:
>  * The files in /vz/private/123/var/lib/gentoo/news/ were remaining from an
> older setup where there *was* a portage tree in
> /vz/private/123/var/cache/portage/gentoo.

The files in this directory are updated by portage. Note the timestamp of news-gentoo.skip (which is never touched by eselect):

(In reply to comment #7)
> # ll /vz/private/123/var/lib/gentoo/news
> total 8
> -rw-rw-r-- 1 root portage 222 Mar 10 11:07 news-gentoo.read
> -rw-rw-r-- 1 root portage 222 Mar 10 10:16 news-gentoo.skip
> -rw-rw-r-- 1 root portage   0 Mar 10 11:07 news-gentoo.unread
Comment 14 Dennis Schridde 2011-03-11 06:35:52 UTC
(In reply to comment #13)
> (In reply to comment #8)
> >  * The files in /vz/private/123/var/lib/gentoo/news/ were remaining from an
> > older setup where there *was* a portage tree in
> > /vz/private/123/var/cache/portage/gentoo.
> 
> The files in this directory are updated by portage. Note the timestamp of
> news-gentoo.skip (which is never touched by eselect):
So the files will be regenerated after deletion once I run "emerge <something>"?
Comment 15 Zac Medico gentoo-dev 2011-03-11 06:50:57 UTC
Yes, $ROOT/var/lib/gentoo/news/ will be updated after --sync, after --pretend, and before emerge <target>, when it displays news notifications. It's part of the spec:

  http://www.gentoo.org/proj/en/glep/glep-0042.html#client-side
Comment 16 Ulrich Müller gentoo-dev 2011-03-15 16:32:43 UTC
Fixed in eselect-1.2.15.
Thank you for reporting this bug.