.SRCINFO: Difference between revisions

From ArchWiki
m (there is no translation yet (this was copy-pasted from other page right when the page was created))
(→‎Syntax: merge comment by User:Quequotion from https://wiki.archlinux.org/index.php?title=Talk:.SRCINFO&curid=23238&diff=425424&oldid=424491 in a proper Expansion template)
(One intermediate revision by the same user not shown)
Line 14: Line 14:
{{ic|.SRCINFO}} files contain package metadata in a simple, unambiguous format, so that tools such as the [[AUR]]'s Web back-end or [[AUR helpers]] may retrieve a package's metadata without parsing the [[PKGBUILD]] directly. See {{Bug|25210}}, {{Bug|15043}}, and {{Bug|16394}} for examples of the sorts of issues that may arise from attempting to parse shell scripts.
{{ic|.SRCINFO}} files contain package metadata in a simple, unambiguous format, so that tools such as the [[AUR]]'s Web back-end or [[AUR helpers]] may retrieve a package's metadata without parsing the [[PKGBUILD]] directly. See {{Bug|25210}}, {{Bug|15043}}, and {{Bug|16394}} for examples of the sorts of issues that may arise from attempting to parse shell scripts.


{{Warning|Changes to {{ic|PKGBUILD}} metadata, such as {{ic|pkgver}} updates, do not automatically propagate to {{ic|.SRCINFO}}. Pushing an edited {{ic|PKGBUILD}} to the AUR without also updating its {{ic|.SRCINFO}} will cause the AUR to serve stale metadata.}}
{{Warning|Changes to {{ic|PKGBUILD}} metadata, such as [[PKGBUILD#pkgver|pkgver()]] updates, do not automatically propagate to {{ic|.SRCINFO}}. Pushing an edited {{ic|PKGBUILD}} to the AUR without also updating its {{ic|.SRCINFO}} will cause the AUR to serve stale metadata.}}


== Generation ==
== Generation ==
Line 22: Line 22:
  $ makepkg --printsrcinfo > .SRCINFO
  $ makepkg --printsrcinfo > .SRCINFO


== Specification ==
== Syntax ==


{{ic|SRCINFO}} files are lists of {{ic|key = value}} pairs, separated into sections.
{{ic|.SRCINFO}} files are lists of {{ic|key = value}} pairs, separated into sections.


Keys take their names and meanings from [https://www.archlinux.org/pacman/PKGBUILD.5.html#_options_and_directives PKGBUILD variables]. Neither keys nor values are quoted. Data that, in a {{ic|PKGBUILD}}, would be represented by an array is instead specified multiple times. For instance, the following are equivalent.
Keys take their names and meanings from [https://www.archlinux.org/pacman/PKGBUILD.5.html#_options_and_directives PKGBUILD variables]. Neither keys nor values are quoted. Data that, in a {{ic|PKGBUILD}}, would be represented by an array is instead specified multiple times. For instance, the following are equivalent.
Line 31: Line 31:
  arch=(i686 x86_64)
  arch=(i686 x86_64)


  # SRCINFO
  # .SRCINFO
  arch = i686
  arch = i686
  arch = x86_64
  arch = x86_64


The main section of the file is headed by a {{ic|pkgbase}} declaration, and contains data applicable to the package as a whole. In a standard {{ic|PKGBUILD}} describing a single package, this will be the only section, followed by a {{ic|pkgname}} declaration containing the same value as the preceding pkgbase.
The main section of the file is headed by a [[PKGBUILD#pkgbase|pkgbase]] declaration, and contains data applicable to the package as a whole. In a standard {{ic|PKGBUILD}} describing a single package, this will be the only section, followed by a [[PKGBUILD#pkgname|pkgname]] declaration containing the same value as the preceding pkgbase.


  pkgbase = foo
  pkgbase = foo
Line 46: Line 46:
In a split {{ic|PKGBUILD}}, each section is headed by a {{ic|pkgname}}, followed by any data specific to that package.
In a split {{ic|PKGBUILD}}, each section is headed by a {{ic|pkgname}}, followed by any data specific to that package.


The following fields may appear only once in each {{ic|SRCINFO}} file, in the {{ic|pkgbase}} section:
{{Expansion|Some users could deduce enough to serve their needs from the section above, below is a verbose list of parameters; split these up to improve readability. More in-wiki links to PKGBUILD specifics. Still looking for ways to simplify. [[PKGBUILD]] is too big to merge.}}
 
== Specification ==
 
The following fields may appear only once in each {{ic|.SRCINFO}} file, in the {{ic|pkgbase}} section:


* {{ic|pkgver}}, {{ic|pkgrel}}, {{ic|epoch}}
* {{ic|pkgver}}, {{ic|pkgrel}}, {{ic|epoch}}
Line 68: Line 72:
* {{ic|md5sums, sha1sums, sha224sums, sha256sums, sha384sums, sha512sums}}
* {{ic|md5sums, sha1sums, sha224sums, sha256sums, sha384sums, sha512sums}}


The following fields may optionally be specified multiple times, differentiated by architecture as in the example below.
The following fields may optionally be specified multiple times, differentiated by [[PKGBUILD#arch|architecture]] as in the example below.


  source_x86_64 = https://foo.bar/file.tar.gz
  source''_x86_64'' = https://foo.bar/file.tar.gz
  source_i686 = https://foo.bar/file_i686_patch.tar.gz
  source''_i686'' = https://foo.bar/file_i686_patch.tar.gz


* {{ic|source}}
* {{ic|source}}

Revision as of 02:07, 13 March 2016

.SRCINFO files contain package metadata in a simple, unambiguous format, so that tools such as the AUR's Web back-end or AUR helpers may retrieve a package's metadata without parsing the PKGBUILD directly. See FS#25210, FS#15043, and FS#16394 for examples of the sorts of issues that may arise from attempting to parse shell scripts.

Warning: Changes to PKGBUILD metadata, such as pkgver() updates, do not automatically propagate to .SRCINFO. Pushing an edited PKGBUILD to the AUR without also updating its .SRCINFO will cause the AUR to serve stale metadata.

Generation

.SRCINFO files may be generated using makepkg, or by running mksrcinfo from pkgbuild-introspection.

$ makepkg --printsrcinfo > .SRCINFO

Syntax

.SRCINFO files are lists of key = value pairs, separated into sections.

Keys take their names and meanings from PKGBUILD variables. Neither keys nor values are quoted. Data that, in a PKGBUILD, would be represented by an array is instead specified multiple times. For instance, the following are equivalent.

# PKGBUILD
arch=(i686 x86_64)
# .SRCINFO
arch = i686
arch = x86_64

The main section of the file is headed by a pkgbase declaration, and contains data applicable to the package as a whole. In a standard PKGBUILD describing a single package, this will be the only section, followed by a pkgname declaration containing the same value as the preceding pkgbase.

pkgbase = foo
	pkgdesc = An example package.
	[...]
	md5sums = SKIP

pkgname = foo

In a split PKGBUILD, each section is headed by a pkgname, followed by any data specific to that package.

This article or section needs expansion.

Reason: Some users could deduce enough to serve their needs from the section above, below is a verbose list of parameters; split these up to improve readability. More in-wiki links to PKGBUILD specifics. Still looking for ways to simplify. PKGBUILD is too big to merge. (Discuss in Talk:.SRCINFO)

Specification

The following fields may appear only once in each .SRCINFO file, in the pkgbase section:

  • pkgver, pkgrel, epoch

The following fields may appear up to once in each section.

  • pkgdesc, url, install, changelog

The following fields may be repeated within a section to specify multiple values:

  • arch
  • groups
  • license
  • depends, checkdepends, makedepends, optdepends
  • provides, conflicts, replaces
  • noextract
  • options
  • backup
  • source
  • validpgpkeys
  • md5sums, sha1sums, sha224sums, sha256sums, sha384sums, sha512sums

The following fields may optionally be specified multiple times, differentiated by architecture as in the example below.

source_x86_64 = https://foo.bar/file.tar.gz
source_i686 = https://foo.bar/file_i686_patch.tar.gz
  • source
  • provides, conflicts, replaces
  • depends, checkdepends, makedepends, optdepends
  • md5sums, sha1sums, sha224sums, sha256sums, sha384sums, sha512sums

Fields with other names are ignored. Blank lines and comment lines beginning with a hash sign (#) are also ignored. Lines may be indented.