Management Repository

A management repository is a version control repository, that contains machine readable descriptor files (i.e. JSON) which track the state of Sync Database files and thus also of the Binary Repository they describe.

Packages are gathered by pkgbase (see PKGBUILD) and the directory structure follows a layout of <CPU architecture>/<repository>/<pkgbase>, as the same repositories may exist for several architectures.

.
└── x86_64
    ├── core
    │   └── pkgbase_a.json
    ├── core-debug
    └── extra
        └── pkgbase_b.json
    ├── extra-debug
    ├── staging
    ├── testing
    ├── community
    ├── community-debug
    ├── community-staging
    ├── community-testing
    ├── gnome-unstable
    ├── kde-unstable
    ├── multilib
    ├── multilib-debug
    ├── multilib-staging
    └── multilib-testing

JSON Schema

The JSON files contained in a Management Repository can be validated using JSON schema.

The schema is derived from pydantic models, that allow to describe various input files related to a Sync Database.

Files

This is the schema of files that belongs to an OutputPackage.

Below is a list of currently understood versions of the schema.

FilesV1

Note

This schema represents the definition of Files v1.

{
  "title": "FilesV1",
  "description": "A pydantic model to describe files in the context of 'files' files in a repository sync database (version 1)\n\nAttributes\n----------\nfiles: Optional[List[str]]\n    An optional list of files. This is the data below a %FILES% identifier in a 'files' file, which identifies which\n    file(s) belong to a package",
  "type": "object",
  "properties": {
    "schema_version": {
      "title": "Schema Version",
      "default": 1,
      "minimum": 1,
      "maximum": 1,
      "type": "integer"
    },
    "files": {
      "title": "Files",
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[^/][\\w\\d\\s.,:;/_=#()@\\\\&$?!+%~{}<>*\\-\\\"\\'\\[\\]\\`^]+$"
      }
    }
  }
}

OutputPackageBase

This is the schema for a pkgbase file in the Management Repository.

Note

In a split package scenario, the sum of information gathered from all packages, that belong to a given pkgbase comprise an OutputPackageBase.

Below is a list of currently understood versions of the schema.

OutputPackageBaseV1

{
  "title": "OutputPackageBaseV1",
  "description": "A model describing all required attributes for an output file, that describes a list of packages based upon a\npkgbase (version 1)\n\nAttributes\n----------\nbase: str\n    The attribute can be used to describe the (required) data below a %BASE% identifier in a 'desc' file, which\n    identifies a package's pkgbase\nmakedepends: Optional[List[str]]\n    The attribute can be used to describe the (optional) data below a %MAKEDEPENDS% identifier in a 'desc' file,\n    which identifies a package's makedepends\npackager: str\n    The attribute can be used to describe the (required) data below a %PACKAGER% identifier in a 'desc' file, which\n    identifies a package's packager\npackages: List[OutputPackage]\n    A list of OutputPackage instances that belong to the pkgbase identified by base\nschema_version: PositiveInt\n    A positive integer - 1 - identifying the schema version of the object\nversion: str\n    The attribute can be used to describe the (required) data below a %VERSION% identifier in a 'desc' file, which\n    identifies a package's version (this is the accumulation of epoch, pkgver and pkgrel)",
  "type": "object",
  "properties": {
    "version": {
      "title": "Version",
      "pattern": "^([1-9]+[0-9]*:|)([A-Za-z\\d]+)[_+.]?[A-Za-z\\d_+.]*-[1-9]+[0-9]*(|[.]{1}[1-9]+[0-9]*)$",
      "type": "string"
    },
    "schema_version": {
      "title": "Schema Version",
      "default": 1,
      "minimum": 1,
      "maximum": 1,
      "type": "integer"
    },
    "packager": {
      "title": "Packager",
      "pattern": "^[\\w\\s\\-().]+\\s<(.*)>$",
      "type": "string"
    },
    "makedepends": {
      "title": "Makedepends",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "base": {
      "title": "Base",
      "pattern": "^[a-z\\d_@+]+[a-z\\d\\-._@+]*$",
      "type": "string"
    },
    "packages": {
      "title": "Packages",
      "type": "array",
      "items": {
        "$ref": "#/definitions/OutputPackage"
      }
    }
  },
  "required": [
    "version",
    "packager",
    "base",
    "packages"
  ],
  "definitions": {
    "OutputPackage": {
      "title": "OutputPackage",
      "description": "A template class to describe all required attributes that define a package in the context of an output file\n\nThis class should not be instantiated directly. Use one of its subclasses instead!",
      "type": "object",
      "properties": {}
    }
  }
}

OutputPackage

This is the schema of a package that belongs to an OutputPackageBase. It describes all properties that are unique to the specific package and that are not also covered by the pkgbase.

Below is a list of currently understood versions of the schema.

OutputPackageV1

{
  "title": "OutputPackageV1",
  "description": "A model describing all required attributes that define a package in the context of an output file (version 1)\n\nAttributes\n----------\narch: str\n    The attribute can be used to describe the (required) data below an %ARCH% identifier in a 'desc' file, which\n    identifies a package's architecture\nbackup: Optional[List[str]]\n    The attribute can be used to describe the (optional) data below a %BACKUP% identifier in a 'desc' file, which\n    identifies which file(s) of a package pacman will create backups for\nbuilddate: int\n    The attribute can be used to describe the (required) data below a %BUILDDATE% identifier in a 'desc' file,\n    which identifies a package's build date (represented in seconds since the epoch)\ncheckdepends: Optional[List[str]]\n    The attribute can be used to describe the (optional) data below a %CHECKDEPENDS% identifier in a 'desc' file,\n    which identifies a package's checkdepends\nconflicts: Optional[List[str]]\n    The attribute can be used to describe the (optional) data below a %CONFLICTS% identifier in a 'desc' file, which\n    identifies what other package(s) a package conflicts with\ncsize: int\n    The attribute can be used to describe the (required) data below a %CSIZE% identifier in a 'desc' file, which\n    identifies a package's size\ndepends: Optional[List[str]]\n    The attribute can be used to describe the (optional) data below a %DEPENDS% identifier in a 'desc' file, which\n    identifies what other package(s) a package depends on\ndesc: str\n    The attribute can be used to describe the (required) data below a %DESC% identifier in a 'desc' file, which\n    identifies a package's description\nfilename: str\n    The attribute can be used to describe the (required) data below a %FILENAME% identifier in a 'desc' file, which\n    identifies a package's file name\nfiles: Optional[List[str]]\n    The attribute can be used to describe the (optional) data below a %FILES% identifier in a 'files' file, which\n    identifies which file(s) belong to a package\ngroups: Optional[List[str]]\n    The attribute can be used to describe the (optional) data below a %GROUPS% identifier in a 'desc' file, which\n    identifies a package's groups\nisize: int\n    The attribute can be used to describe the (required) data below an %ISIZE% identifier in a 'desc' file, which\n    identifies a package's installed size\nlicense: List[str]\n    The attribute can be used to describe the (required) data below a %LICENSE% identifier in a 'desc' file, which\n    identifies a package's license(s)\nmd5sum: str\n    The attribute can be used to describe the (required) data below an %MD5SUM% identifier in a 'desc' file, which\n    identifies a package's md5 checksum\nname: str\n    The attribute can be used to describe the (required) data below a %NAME% identifier in a 'desc' file, which\n    identifies a package's name\noptdepends: Optional[List[str]]\n    The attribute can be used to describe the (optional) data below a %OPTDEPENDS% identifier in a 'desc' file,\n    which identifies what other package(s) a package optionally depends on\npgpsig: str\n    The attribute can be used to describe the (required) data below a %PGPSIG% identifier in a 'desc' file, which\n    identifies a package's PGP signature\nprovides: Optional[List[str]]\n    The attribute can be used to describe the (optional) data below a %PROVIDES% identifier in a 'desc' file, which\n    identifies what other package(s) a package provides\nreplaces: Optional[List[str]]\n    The attribute can be used to describe the (optional) data below a %REPLACES% identifier in a 'desc' file, which\n    identifies what other package(s) a package replaces\nschema_version: PositiveInt\n    A positive integer - 1 - identifying the schema version of the object\nsha256sum: str\n    The attribute can be used to describe the (required) data below an %SHA256SUM% identifier in a 'desc' file,\n    which identifies a package's sha256 checksum\nurl: str\n    The attribute can be used to describe the (required) data below a %URL% identifier in a 'desc' file, which\n    identifies a package's URL",
  "type": "object",
  "properties": {
    "url": {
      "title": "Url",
      "minLength": 1,
      "maxLength": 2083,
      "format": "uri",
      "type": "string"
    },
    "sha256sum": {
      "title": "Sha256Sum",
      "pattern": "^[a-f0-9]{64}$",
      "type": "string"
    },
    "schema_version": {
      "title": "Schema Version",
      "default": 1,
      "minimum": 1,
      "maximum": 1,
      "type": "integer"
    },
    "replaces": {
      "title": "Replaces",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provides": {
      "title": "Provides",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "pgpsig": {
      "title": "Pgpsig",
      "pattern": "^[0-9A-Za-z/+]+={0,2}$",
      "type": "string"
    },
    "optdepends": {
      "title": "Optdepends",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "name": {
      "title": "Name",
      "pattern": "^[a-z\\d_@+]+[a-z\\d\\-._@+]*$",
      "type": "string"
    },
    "md5sum": {
      "title": "Md5Sum",
      "pattern": "^[a-f0-9]{32}$",
      "type": "string"
    },
    "license": {
      "title": "License",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "isize": {
      "title": "Isize",
      "minimum": 0,
      "type": "integer"
    },
    "groups": {
      "title": "Groups",
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z\\d_@+]+[a-z\\d\\-._@+]*$"
      }
    },
    "filename": {
      "title": "Filename",
      "pattern": "^[a-z\\d_@+]+[a-z\\d\\-._@+]*-([1-9]+[0-9]*:|)([A-Za-z\\d]+)[_+.]?[A-Za-z\\d_+.]*-[1-9]+[0-9]*(|[.]{1}[1-9]+[0-9]*)-(aarch64|any|arm|armv6h|armv7h|i486|i686|pentium4|riscv32|riscv64|x86_64|x86_64_v2|x86_64_v3|x86_64_v4)(.pkg.tar)(|\\.bz2|\\.gz|\\.xz|\\.zst)$",
      "type": "string"
    },
    "desc": {
      "title": "Desc",
      "type": "string"
    },
    "depends": {
      "title": "Depends",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "csize": {
      "title": "Csize",
      "minimum": 0,
      "type": "integer"
    },
    "conflicts": {
      "title": "Conflicts",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "checkdepends": {
      "title": "Checkdepends",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "builddate": {
      "title": "Builddate",
      "minimum": 0,
      "type": "integer"
    },
    "backup": {
      "title": "Backup",
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[^/][\\w\\d\\s.,:;/_=#()@\\\\&$?!+%~{}<>*\\-\\\"\\'\\[\\]\\`^]+$"
      }
    },
    "arch": {
      "title": "Arch",
      "pattern": "^(aarch64|any|arm|armv6h|armv7h|i486|i686|pentium4|riscv32|riscv64|x86_64|x86_64_v2|x86_64_v3|x86_64_v4)$",
      "type": "string"
    },
    "files": {
      "$ref": "#/definitions/Files"
    }
  },
  "required": [
    "url",
    "sha256sum",
    "name",
    "md5sum",
    "license",
    "isize",
    "filename",
    "desc",
    "csize",
    "builddate",
    "arch"
  ],
  "definitions": {
    "Files": {
      "title": "Files",
      "description": "A template class to describe files in the context of 'files' files in a repository sync database\n\nThis class should not be instantiated directly, as it only provides generic instance methods for its subclasses.\n\nNOTE: The `from_dict()` classmethod is used to create one of the versioned subclasses.",
      "type": "object",
      "properties": {}
    }
  }
}

PackageDesc

This is the schema of package information found in a Desc file of a Sync Database.

Below is a list of currently understood versions of the schema.

PackageDescV1

Note

This schema represents the definition of Desc v1.

{
  "title": "PackageDescV1",
  "description": "A model describing all identifiers in a 'desc' file (version 1)\n\nAttributes\n----------\narch: str\n    The attribute can be used to describe the (required) data below an %ARCH% identifier in a 'desc' file, which\n    identifies a package's architecture\nbackup: Optional[List[str]]\n    The attribute can be used to describe the (optional) data below a %BACKUP% identifier in a 'desc' file, which\n    identifies which file(s) of a package pacman will create backups for\nbase: str\n    The attribute can be used to describe the (required) data below a %BASE% identifier in a 'desc' file, which\n    identifies a package's pkgbase\nbuilddate: int\n    The attribute can be used to describe the (required) data below a %BUILDDATE% identifier in a 'desc' file,\n    which identifies a package's build date (represented in seconds since the epoch)\ncheckdepends: Optional[List[str]]\n    The attribute can be used to describe the (optional) data below a %CHECKDEPENDS% identifier in a 'desc' file,\n    which identifies a package's checkdepends\nconflicts: Optional[List[str]]\n    The attribute can be used to describe the (optional) data below a %CONFLICTS% identifier in a 'desc' file, which\n    identifies what other package(s) a package conflicts with\ncsize: int\n    The attribute can be used to describe the (required) data below a %CSIZE% identifier in a 'desc' file, which\n    identifies a package's size\ndepends: Optional[List[str]]\n    The attribute can be used to describe the (optional) data below a %DEPENDS% identifier in a 'desc' file, which\n    identifies what other package(s) a package depends on\ndesc: str\n    The attribute can be used to describe the (required) data below a %DESC% identifier in a 'desc' file, which\n    identifies a package's description\nfilename: str\n    The attribute can be used to describe the (required) data below a %FILENAME% identifier in a 'desc' file, which\n    identifies a package's file name\ngroups: Optional[List[str]]\n    The attribute can be used to describe the (optional) data below a %GROUPS% identifier in a 'desc' file, which\n    identifies a package's groups\nisize: int\n    The attribute can be used to describe the (required) data below an %ISIZE% identifier in a 'desc' file, which\n    identifies a package's installed size\nlicense: List[str]\n    The attribute can be used to describe the (required) data below a %LICENSE% identifier in a 'desc' file, which\n    identifies a package's license(s)\nmakedepends: Optional[List[str]]\n    The attribute can be used to describe the (optional) data below a %MAKEDEPENDS% identifier in a 'desc' file,\n    which identifies a package's makedepends\nmd5sum: str\n    The attribute can be used to describe the (required) data below an %MD5SUM% identifier in a 'desc' file, which\n    identifies a package's md5 checksum\nname: str\n    The attribute can be used to describe the (required) data below a %NAME% identifier in a 'desc' file, which\n    identifies a package's name\noptdepends: Optional[List[str]]\n    The attribute can be used to describe the (optional) data below a %OPTDEPENDS% identifier in a 'desc' file,\n    which identifies what other package(s) a package optionally depends on\npackager: str\n    The attribute can be used to describe the (required) data below a %PACKAGER% identifier in a 'desc' file, which\n    identifies a package's packager\npgpsig: str\n    The attribute can be used to describe the (required) data below a %PGPSIG% identifier in a 'desc' file, which\n    identifies a package's PGP signature\nprovides: Optional[List[str]]\n    The attribute can be used to describe the (optional) data below a %PROVIDES% identifier in a 'desc' file, which\n    identifies what other package(s) a package provides\nreplaces: Optional[List[str]]\n    The attribute can be used to describe the (optional) data below a %REPLACES% identifier in a 'desc' file, which\n    identifies what other package(s) a package replaces\nschema_version: PositiveInt\n    A positive integer - 1 - identifying the schema version of the object\nsha256sum: str\n    The attribute can be used to describe the (required) data below an %SHA256SUM% identifier in a 'desc' file,\n    which identifies a package's sha256 checksum\nurl: str\n    The attribute can be used to describe the (required) data below a %URL% identifier in a 'desc' file, which\n    identifies a package's URL\nversion: str\n    The attribute can be used to describe the (required) data below a %VERSION% identifier in a 'desc' file, which\n    identifies a package's version (this is the accumulation of epoch, pkgver and pkgrel)",
  "type": "object",
  "properties": {
    "version": {
      "title": "Version",
      "pattern": "^([1-9]+[0-9]*:|)([A-Za-z\\d]+)[_+.]?[A-Za-z\\d_+.]*-[1-9]+[0-9]*(|[.]{1}[1-9]+[0-9]*)$",
      "type": "string"
    },
    "url": {
      "title": "Url",
      "minLength": 1,
      "maxLength": 2083,
      "format": "uri",
      "type": "string"
    },
    "sha256sum": {
      "title": "Sha256Sum",
      "pattern": "^[a-f0-9]{64}$",
      "type": "string"
    },
    "schema_version": {
      "title": "Schema Version",
      "default": 1,
      "minimum": 1,
      "maximum": 1,
      "type": "integer"
    },
    "replaces": {
      "title": "Replaces",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provides": {
      "title": "Provides",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "pgpsig": {
      "title": "Pgpsig",
      "pattern": "^[0-9A-Za-z/+]+={0,2}$",
      "type": "string"
    },
    "packager": {
      "title": "Packager",
      "pattern": "^[\\w\\s\\-().]+\\s<(.*)>$",
      "type": "string"
    },
    "optdepends": {
      "title": "Optdepends",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "name": {
      "title": "Name",
      "pattern": "^[a-z\\d_@+]+[a-z\\d\\-._@+]*$",
      "type": "string"
    },
    "md5sum": {
      "title": "Md5Sum",
      "pattern": "^[a-f0-9]{32}$",
      "type": "string"
    },
    "makedepends": {
      "title": "Makedepends",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "license": {
      "title": "License",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "isize": {
      "title": "Isize",
      "minimum": 0,
      "type": "integer"
    },
    "groups": {
      "title": "Groups",
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z\\d_@+]+[a-z\\d\\-._@+]*$"
      }
    },
    "filename": {
      "title": "Filename",
      "pattern": "^[a-z\\d_@+]+[a-z\\d\\-._@+]*-([1-9]+[0-9]*:|)([A-Za-z\\d]+)[_+.]?[A-Za-z\\d_+.]*-[1-9]+[0-9]*(|[.]{1}[1-9]+[0-9]*)-(aarch64|any|arm|armv6h|armv7h|i486|i686|pentium4|riscv32|riscv64|x86_64|x86_64_v2|x86_64_v3|x86_64_v4)(.pkg.tar)(|\\.bz2|\\.gz|\\.xz|\\.zst)$",
      "type": "string"
    },
    "desc": {
      "title": "Desc",
      "type": "string"
    },
    "depends": {
      "title": "Depends",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "csize": {
      "title": "Csize",
      "minimum": 0,
      "type": "integer"
    },
    "conflicts": {
      "title": "Conflicts",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "checkdepends": {
      "title": "Checkdepends",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "builddate": {
      "title": "Builddate",
      "minimum": 0,
      "type": "integer"
    },
    "base": {
      "title": "Base",
      "pattern": "^[a-z\\d_@+]+[a-z\\d\\-._@+]*$",
      "type": "string"
    },
    "backup": {
      "title": "Backup",
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[^/][\\w\\d\\s.,:;/_=#()@\\\\&$?!+%~{}<>*\\-\\\"\\'\\[\\]\\`^]+$"
      }
    },
    "arch": {
      "title": "Arch",
      "pattern": "^(aarch64|any|arm|armv6h|armv7h|i486|i686|pentium4|riscv32|riscv64|x86_64|x86_64_v2|x86_64_v3|x86_64_v4)$",
      "type": "string"
    }
  },
  "required": [
    "version",
    "url",
    "sha256sum",
    "packager",
    "name",
    "md5sum",
    "license",
    "isize",
    "filename",
    "desc",
    "csize",
    "builddate",
    "base",
    "arch"
  ]
}