GLEP:60
Title:Manifest2 filetypes
Version:1.2
Last-Modified:2008/10/22 17:59:43
Author:Robin Hugh Johnson <robbat2 at gentoo.org>
Status:Draft
Type:Standards Track
Content-Type:text/x-rst
Requires:44
Created:November 2007
Updated:June 2008, July 2008
Updates:44

Contents

Abstract

Clarification of the Manifest2 [GLEP44] specification, including new types to help in the tree-signing specification.

Motivation

[GLEP44] was not entirely clear on the usage of filetype specifiers. This document serves to provide some of the internal logic used by Portage at the point of writing, as well as adding new types to cover the rest of the tree, for the purposes of tree-signing coverage.

Specification

General

For any given directory with a Manifest file, every file located in that directory, or a sub-directory must be listed in that Manifest file, unless stated otherwise in the following sections. The Manifest file must not contain an entry for itself.

Excluded files

When generating or validating a Manifest, or commiting to a version control system, the package manager should endeavour to ignore files created by a version control system, backup files from text editors. A non-exhaustive list is suggested here: CVS/, .svn/, .bzr/, .git/, .hg/, .#*, *.rej, *.orig, *.bak, *~.

System Message: WARNING/2 (glep-0060.txt, line 37); backlink

Inline emphasis start-string without end-string.

System Message: WARNING/2 (glep-0060.txt, line 37); backlink

Inline emphasis start-string without end-string.

System Message: WARNING/2 (glep-0060.txt, line 37); backlink

Inline emphasis start-string without end-string.

System Message: WARNING/2 (glep-0060.txt, line 37); backlink

Inline emphasis start-string without end-string.

Additionally, for a transitional Manifest1->Manifest2 system, old-style digest files located in a 'files/' directory, may be excluded from Manifest2 generation, or included with a type of MISC.

Under strict security conditions, the exclusion list may be ignored during validation if the existence of a file would be considered a security risk.

Existing filetypes:

AUX

  • The AUX type is used for all items under the 'files' subdirectory.
  • They should be verified relative to $FILESDIR.
  • The string 'files/' is left out of the Manifest line.
  • The absence of a file mentioned by AUX must be treated as an error.
  • The AUX type is intended to denote potentially executable content (either directly or indirectly), that must be treated an error if modified or absent.

EBUILD

  • The EBUILD type is used solely for files ending in .ebuild, or other suffixes as defined by the EAPI.
  • The files are located in the same directory as the Manifest file.
  • The modification or absence of a file mentioned by EBUILD must be treated as an error.

DIST

  • The DIST type is used for distfiles
  • They may be found directly via the $DISTDIR setting of the package manager.
  • During simple verification of a Manifest, a missing DIST file should not be consider as a validation error (it is however a failure to fetch or unpack).

MISC

  • The MISC type covers all remaining files in a directory.
  • MISC is intended to mark all content that was not used in some way that directly affected execution of the package manager.
  • This includes metadata.xml and ChangeLog entries, and any other purely informational content.
  • MISC entries where the file is missing may optionally be ignored as by non-strict package managers.
  • It should be possible to install a package while all MISC entries have been deleted from the tree.

New filetypes:

_INFO (new, abstract)

  • This is the functionality of the old AUX, but does not include the implicit 'files/' prefix in the path, and is verified relative to the working directory instead of $FILESDIR.
  • The modification or absence of a file listed as a _INFO-derived type is not an error unless the package manager is attempting to be strict.

_CRIT (new, abstract)

  • _CRIT is based off the _INFO type.
  • The modification or absence of a file listed as a _CRIT-derived type must be treated as an error.

EBUILD

  • Now derived from _CRIT.
  • Otherwise unchanged.

DIST

  • Now derived from _CRIT.
  • Otherwise unchanged.

MISC

  • Now derived from _INFO.
  • Otherwise unchanged.

MANIFEST (new)

  • The MANIFEST type is explicitly to cover all nested Manifest files.
  • During validation, this serves as an indicator that the package manager may need to check subtree Manifest file.
  • A missing MANIFEST file may be treated as a minor (eg excluding an entire category) or critical validation failure.
  • The failure should be considered as critical only if files that would be directly covered by this Manifest are missing. Deletion of a category-level Manifest while preserving the packages is forbidden. Deletion of an entire category is not.

ECLASS (new)

  • uses _CRIT.
  • This type shall be used for all eclasses only.
  • TODO: What about patches etc under eclasses/? Probably EXEC?

DATA (new)

  • uses _CRIT.
  • The DATA type shall be used for all files that directly affect the package manager, such as metadata/cache/* and profiles/.

EXEC (new)

  • uses _CRIT.
  • If the file gets sourced, executed, or causes a change (patches) in how something is sourced or execututed, it belongs in the EXEC filetype.
  • This filetype should be used for the scripts directories of a repository for important files.

UNKNOWN (new)

  • uses _CRIT.
  • All other files that are not covered by another type should be considered as 'UNKNOWN'.

On Bloat

If repeated use of a common path prefix is considered a bloat problem, a Manifest file should be added inside the common directory, however this should not be done blindly, as bloat by inodes is more significant for the majority of use cases.

Chosing a filetype

  1. matches Manifest

    => MANIFEST, stop.

  2. matches *.ebuild

    System Message: WARNING/2 (glep-0060.txt, line 174); backlink

    Inline emphasis start-string without end-string.

    => EBUILD, stop.

  3. matches *.eclass

    System Message: WARNING/2 (glep-0060.txt, line 176); backlink

    Inline emphasis start-string without end-string.

    => ECLASS, stop.

  4. listed in SRC_URI

    => DIST, stop.

  5. matches files/*

    => AUX, continue [see note].

  6. matches {.sh,.bashrc,*.patch,...}

    => EXEC, stop.

  7. matches {metadata/cache/,profiles/,package.,use.mask*,...}

    => DATA, stop.

  8. matches {ChangeLog,metadata.xml,*.desc,...}

    => MISC, stop.

  9. not matched by any other rule

    => UNKNOWN, stop.

The logic behind 5, 6, 7 is ensuring that every item that by it's presence or absense may be dangerous should always be treated strictly. (Consider epatch given a directory of patches ${FILESDIR}/${PV}/, where it blindly includes them, or alternatively, the package.mask file or a profile being altered/missing).

Note: The AUX entries should only be generated if we are generating a compatible Manifest that supports older versions of Portage. They should be generated along with the new type.

Backwards Compatibility

For generation of existing package Manifests, the AUX entries must continue to be present for the standard Portage deprecation cycle. The new entries may be included already in all Manifest files, as they will be ignored by older Portage versions. Over time, ECLASS, DATA, EXEC, UNKNOWN may replace the existing AUX type.

The adoption of this proposal does also affect [GLEPxx+1] as part of this GLEP series, however this GLEP was an offset of the research in that GLEP.

Thanks to

I'd like to thank the following people for input on this GLEP. - Marius Mauch (genone) & Zac Medico (zmedico): Portage Manifest2

References

[1]Mauch, M. (2005) GLEP44 - Manifest2 format. http://www.gentoo.org/proj/en/glep/glep-0044.html