Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 558306 - app-portage/portage-utils: support config files as directories like /etc/portage/make.conf/
Summary: app-portage/portage-utils: support config files as directories like /etc/port...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Third-Party Tools (show other bugs)
Hardware: All All
: Normal enhancement (vote)
Assignee: Fabian Groffen
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-20 20:00 UTC by Jaak Ristioja
Modified: 2018-04-05 19:03 UTC (History)
0 users

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 Jaak Ristioja 2015-08-20 20:00:04 UTC
More specifically, quse ignores PORTDIR="/var/portage" in make.conf.

  $ quse -D useflag
  use: skipping use.desc: No such file or directory
  use: skipping use.local.desc: No such file or directory
  use: skipping arch.list: No such file or directory
  use: skipping profiles/desc/: No such file or directory
  $ echo $?
  0
Comment 1 Jaak Ristioja 2015-08-20 20:22:57 UTC
Hmm... it appears that this is actually not due to PORTDIR but seems to be some other strange issue.

Anyway when I added a printf("%s", portdir); to the quse.c source before all the "skipping" printouts, it output "/usr/portage", which is incorrect. Even `emerge --info` outputs:

  Repositories:
  
  gentoo
      location: /var/portage
      sync-type: webrsync
      sync-uri: rsync://rsync.gentoo.org/gentoo-portage
      priority: -1000
Comment 2 Jaak Ristioja 2015-08-20 20:44:11 UTC
It appears that the issue arises when /etc/portage/make.conf is a directory and not a file.

According to `man 5 portage`:
  /etc/portage/
    Files in this directory including make.conf, repos.conf, and any file with a name that begins with "package." can be more than just a flat file. If it is a directory, then all the files in that directory will be sorted in ascending alphabetical order by file name and summed together as if it were a single file.

It appears that read_portage_env_file() in main.c successfully opens "/etc/portage/make.conf" but fails during getline() with

  read(3, 0x3734fc7d000, 4096) = -1 EISDIR (Is a directory)

which then causes the code to skip the while loop, close the file descriptor and continue as if no make.conf files exist. No attempt is made to read the files in that directory. So this is obviously where the dog is buried.

Please fix!
Comment 3 Jaak Ristioja 2015-08-20 20:59:10 UTC
This obviously affects other utilities besides quse as well.
Comment 4 Jaak Ristioja 2015-08-21 20:17:50 UTC
SpanKY, would you please care to comment on why you don't consider this to be a bug? Clearly portage supports make.conf being a directory and do I believe to have a reasonable use-case for having make.conf as a directory. At minimum, the documentation for portage-utils lacks a warning notice about this.
Comment 5 SpanKY gentoo-dev 2015-08-21 21:05:07 UTC
portage-utils has never supported this.  in fact, there are *many* things portage supports that portage-utils does not.  implementing them all would be a waste of time as most people don't use them, and a disservice as it slows things down.  hence, adding support for uncommon things is a feature request.
Comment 6 Larry the Git Cow gentoo-dev 2018-03-31 06:54:38 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=553d512900e5d83ec643475344f57118d8b4ed3f

commit 553d512900e5d83ec643475344f57118d8b4ed3f
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2018-03-31 06:52:40 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2018-03-31 06:52:40 +0000

    read_portage_env_file: support reading directories, bug #558306
    
    In particular /etc/portage/make.conf can be a directory.  If it is,
    process it recursively in sorted order.
    
    Bug: https://bugs.gentoo.org/558306

 main.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)}
Comment 7 Larry the Git Cow gentoo-dev 2018-04-05 19:03:12 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34b636503cc7dcabe32b9b377c2eb77cb5fd5575

commit 34b636503cc7dcabe32b9b377c2eb77cb5fd5575
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2018-04-05 19:02:10 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2018-04-05 19:02:34 +0000

    app-portage/portage-utils: version bump to 0.70
    
    This release fixes multiple bugs lingering around for a while.
    
    Closes: https://bugs.gentoo.org/651546
    Closes: https://bugs.gentoo.org/646310
    Closes: https://bugs.gentoo.org/645554
    Closes: https://bugs.gentoo.org/643820
    Closes: https://bugs.gentoo.org/638032
    Closes: https://bugs.gentoo.org/608960
    Closes: https://bugs.gentoo.org/607498
    Closes: https://bugs.gentoo.org/558306
    Closes: https://bugs.gentoo.org/526596
    Closes: https://bugs.gentoo.org/470168
    Closes: https://bugs.gentoo.org/351100
    Closes: https://bugs.gentoo.org/335453
    Package-Manager: Portage-2.3.24, Repoman-2.3.6

 app-portage/portage-utils/Manifest                 |  2 +-
 .../portage-utils/portage-utils-0.62.ebuild        |  2 +-
 .../portage-utils/portage-utils-0.63.ebuild        | 43 ----------------------
 ...ls-0.64-r1.ebuild => portage-utils-0.70.ebuild} | 16 +-------
 4 files changed, 4 insertions(+), 59 deletions(-)