Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 585120 - app-portage/repoman: manifest is generated too late
Summary: app-portage/repoman: manifest is generated too late
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Repoman (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 585388
  Show dependency tree
 
Reported: 2016-06-05 21:13 UTC by Zac Medico
Modified: 2022-04-11 20:29 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 Zac Medico gentoo-dev 2016-06-05 21:13:48 UTC
The manifest generation code should be called prior to generating the checkdirlist variable, because otherwise if the Manifest file is not needed then it can result in a FileNotFoundError like the following:

>>> Creating Manifest for /home/michael/dev/gentoo/kde/media-gfx/krita
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.4/repoman", line 44, in <module>
    repoman_main(sys.argv[1:])
  File "/usr/lib64/python3.4/site-packages/repoman/main.py", line 117, in repoman_main
    scanner.scan_pkgs(can_force)
  File "/usr/lib64/python3.4/site-packages/repoman/scanner.py", line 327, in scan_pkgs
    _continue = func(**self.set_func_kwargs(mod[0], dynamic_data))
  File "/usr/lib64/python3.4/site-packages/repoman/modules/scan/ebuild/ebuild.py", line 185, in check_isebuild
    os.stat(os.path.join(checkdir, y)).st_mode) & 0o111
  File "/usr/lib64/python3.4/site-packages/portage/__init__.py", line 259, in __call__
    rval = self._func(*wrapped_args, **wrapped_kwargs)
FileNotFoundError: [Errno 2] No such file or directory: b'/home/michael/dev/gentoo/kde/media-gfx/krita/Manifest'

Really, all the manifest generation code should be moved out of the repoman/pym/repoman/modules/scan/manifest/manifests.py plugin, and this plugin should only contain read-only checks.

Also, the manifest generation code should not be called redundantly. Currently, the code in the "check" method inside repoman/pym/repoman/modules/scan/manifest/manifests.py can call Manifest.create() twice, via the create_manifest method and the digestgen function.
Comment 1 Zac Medico gentoo-dev 2016-06-05 22:33:03 UTC
The portage._doebuild_manifest_exempt_depend += 1 and portage._doebuild_manifest_exempt_depend -= 1 things are meant to be paired, so having them in separate methods (as then are inside repoman/pym/repoman/modules/scan/manifest/manifests.py) looks odd.
Comment 2 Brian Dolbec (RETIRED) gentoo-dev 2016-06-05 23:03:57 UTC
I've done some initial moves of the mainfest creation out to modules/commit/manifest.py.

I've pushed the current changes to my gihub repo in the repoman-manifest branch:

https://github.com/dol-sen/portage/commits/repoman-manifest
Comment 3 Zac Medico gentoo-dev 2016-06-20 09:15:07 UTC
(In reply to Zac Medico from comment #0)
> Also, the manifest generation code should not be called redundantly.
> Currently, the code in the "check" method inside
> repoman/pym/repoman/modules/scan/manifest/manifests.py can call
> Manifest.create() twice, via the create_manifest method and the digestgen
> function.

The Manifest.create() extra Manifest.create() calls are actually not redundant. The first call only serves to remove unwanted DIST digests for the --force option, and was added in this commit:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=005f56110e90c4ff1fef5a8eccd99ecd85cf908b
Comment 4 Zac Medico gentoo-dev 2016-06-20 09:18:49 UTC
The "too late" manifest generation is fixed by this commit:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=4062c69dc27a816b377b3eb91dcb1c93b6f2cab0
Comment 5 Zac Medico gentoo-dev 2016-06-20 09:47:20 UTC
(In reply to Zac Medico from comment #3)
> (In reply to Zac Medico from comment #0)
> > Also, the manifest generation code should not be called redundantly.
> > Currently, the code in the "check" method inside
> > repoman/pym/repoman/modules/scan/manifest/manifests.py can call
> > Manifest.create() twice, via the create_manifest method and the digestgen
> > function.
> 
> The Manifest.create() extra Manifest.create() calls are actually not
> redundant. The first call only serves to remove unwanted DIST digests for
> the --force option, and was added in this commit:
> 
> https://gitweb.gentoo.org/proj/portage.git/commit/
> ?id=005f56110e90c4ff1fef5a8eccd99ecd85cf908b

I've added some clarification here:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=72d09cf05b1998302c7847624cea56328dbbf6e6
Comment 6 Mike Gilbert gentoo-dev 2022-04-11 20:29:08 UTC
Released long ago.