1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00
pacman/scripts
Dave Reisner 6029a77ac0 makepkg: introduce .SRCINFO files for source packages
Similar to .PKGINFO, .SRCINFO provides structured metadata from the
PKGBUILD to be included with source packages.

The format is structured such that it contains a "pkgbase" and one to
many "pkgname" sections.  Each "pkgname" section represents an "output
package", and inherits all of the attributes of the "pkgbase" section,
and then can define their own additive fields.

For example, a simple PKGBUILD:

  pkgbase=ponies
  pkgname=('applejack' 'pinkiepie')
  pkgver=1.2.3
  pkgrel=1
  arch=('x86_64' 'i686')
  depends=('friendship' 'magic')

  build() { ...; }

  package_applejack() {
    provides=('courage')

    ...;
  }

  package_pinkiepie() {
    provides=('laughter')

    ...;
  }

Would yield the following .SRCINFO file:

  pkgbase = ponies
  	pkgdesc = friendship is magic
  	pkgver = 1.2.3
  	pkgrel = 1
  	arch = x86_64
  	arch = i686
  	depends = friendship
  	depends = magic

  pkgname = applejack
  	provides = courage

  pkgname = pinkiepie
  	provides = laughter

The code to generate this new file is taken a project which I've been
incubating[0] under the guise of 'mkaurball', which creates .AURINFO
files for the AUR. AURINFO is the exactly same file as .SRCINFO, but
named as such to make it clear that this is specific to the AUR.

Because we're parsing shell in the packaging functions rather than
executing it, there *are* some limitations, but these only really crop
up in more "exotic" PKGBUILDs. Smoketesting[1] for accuracy in the Arch
repos yields 100% accuracy for [core] and [extra]. [community] clocks in
at ~98% accuracy (.3% difference per PKGBUILD), largely due to silly
haskell packages calling pacman from inside the PKGBUILD to determine
dependencies. [multilib] currently shows about 92% accuracy -- a
statistic which can be largely improved by utilizing the recently merged
arch-specific attribute work. This is also a smaller repo so the numbers
are somewhat inflated. In reality, this is only a .8% variance per
PKGBUILD.

Together, we can make PKGBUILD better.

[0] https://github.com/falconindy/pkgbuild-introspection
[1] https://github.com/falconindy/pkgbuild-introspection/blob/master/test/smoketest

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-11-09 15:41:50 +10:00
..
library Consistently use 'directory' instead of 'folder' 2014-01-28 21:37:00 +10:00
po Do not remove source code references in PO/POT files 2014-02-02 16:32:55 +10:00
.gitignore makepkg: run locally with libtool style wrapper 2013-10-14 13:01:03 +10:00
Makefile.am replace --reference on chmod/chown commands 2014-09-23 21:43:16 +10:00
makepkg-template.pl.in Update copyright years for 2014 2014-01-06 14:38:50 +10:00
makepkg-wrapper.sh.in Update copyright years for 2014 2014-01-06 14:38:50 +10:00
makepkg.sh.in makepkg: introduce .SRCINFO files for source packages 2014-11-09 15:41:50 +10:00
pacman-db-upgrade.sh.in pacman-db-upgrade: fix --config option typo 2014-11-04 20:11:18 +10:00
pacman-key.sh.in pacman-key: stricter parsing for -verify 2014-08-09 17:29:08 +10:00
pacman-optimize.sh.in replace --reference on chmod/chown commands 2014-09-23 21:43:16 +10:00
pkgdelta.sh.in Remove ts and sw from vim modeline when noet is set 2014-01-28 20:19:25 +10:00
repo-add.sh.in repo-add: declare pkgbase as local 2014-03-27 15:46:07 +10:00