Re: [pacman-dev] [PATCH v2] doc: Add a man page describing PKGINFO

2019-06-29 Thread Eli Schwartz
On 6/28/19 2:55 PM, Jelle van der Waa wrote:
> From: Jelle van der Waa 
> 
> Describe the PKGINFO format which resides in a package produced makepkg.
As mentioned on IRC, there's a lot of duplication with the PKGBUILD
fields, so I'd feel better if we could somehow document just a list of
fields and say that their contents are derived from the PKGBUILD(5) meaning.

The PKGINFO manpage should just describe the format of the file (as
given in the suggested synopsis) and pointers to where the relevant
metadata comes from.

Some PKGINFO keys are specific to the built package, e.g. size,
builddate, or mean something different, like arch/pkgver -- we should
document why and how they differ.

-- 
Eli Schwartz
Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature


Re: [pacman-dev] [PATCH] src/pacman/po/de.po: Missing whitespace

2019-06-29 Thread Eli Schwartz
> src/pacman/po/de.po: Missing whitespace
> 
> German translation for "installing x breaks dependency y required by z"
> is missing a whitespace character.
> 
> Signed-off-by: Florian Knodt 

This is not a git-formatted patch and therefore cannot be applied.

Note, however, that translations are currently handled via Transifex,
not via patches. Updates are worked on there, and only the final
versions are added to git, synced as a batch right before release.

See http://www.transifex.com/projects/p/archlinux-pacman/

-- 
Eli Schwartz
Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature


[pacman-dev] [PATCH] src/pacman/po/de.po: Missing whitespace

2019-06-29 Thread Florian Knodt via pacman-dev
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

src/pacman/po/de.po: Missing whitespace

German translation for "installing x breaks dependency y required by z"
is missing a whitespace character.

Signed-off-by: Florian Knodt 
- ---
 src/pacman/po/de.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pacman/po/de.po b/src/pacman/po/de.po
index 24cc413f..074176ee 100644
- --- a/src/pacman/po/de.po
+++ b/src/pacman/po/de.po
@@ -1550,7 +1550,7 @@ msgstr "Unerfüllbare Abhängigkeit '%s', benötigt von %s\n"
 #: src/pacman/sync.c:724
 #, c-format
 msgid "installing %s (%s) breaks dependency '%s' required by %s\n"
- -msgstr "Installation von%s (%s) verletzt Abhängigkeit '%s', benötigt von 
%s\n"
+msgstr "Installation von %s (%s) verletzt Abhängigkeit '%s', benötigt von %s\n"

 #: src/pacman/sync.c:728
 #, c-format
- -- 
2.22.0
-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEEriS8bvu0c2IMqvEEfjx1LSYH85UFAl0X6AAACgkQfjx1LSYH
85VgqAgAjyeQLxB4VkJ0p50KqtDTHP+mehkuE156YrN5ympxCyA8ZTFqhHCDLV5k
bN0p4iJD6ZEZYN9WZWVx/MBw+egh+kjnI5J0skwwEGGAbWUChQ1WwBxMjnitSxUS
FZC1JWT7Lhs69SoXwvgeN/4Zeg+/HnuScYBrr6YVWYDTzqLS8iN+/hW5JtBqDrKW
5A1HqmT8tzOPD3enHIZhEphDedcyNsw2Um1aMFCQyjlxu1vPoB5XBgu/ZQJX3B/u
uF2F0MaW3OwbknDgxelKH2pdKMIRccniW3DTUBKCtpd40hricmifwMk8RD8VasxK
iYM15zbv/8L+HzqpGuHpc1U+HpndIw==
=iJ0l
-END PGP SIGNATURE-


Re: [pacman-dev] [PATCH v2] doc: Add a man page describing PKGINFO

2019-06-29 Thread Andrew Gregory
On 06/28/19 at 08:55pm, Jelle van der Waa wrote:
> From: Jelle van der Waa 
> 
> Describe the PKGINFO format which resides in a package produced makepkg.
> ---
>  doc/Makefile.am|  4 +-
>  doc/PKGINFO.5.asciidoc | 87 ++
>  doc/meson.build|  1 +
>  3 files changed, 91 insertions(+), 1 deletion(-)
>  create mode 100644 doc/PKGINFO.5.asciidoc
> 
> diff --git a/doc/Makefile.am b/doc/Makefile.am
> index 5c575832..634388e8 100644
> --- a/doc/Makefile.am
> +++ b/doc/Makefile.am
> @@ -16,7 +16,8 @@ MANPAGES = \
>   pacman.conf.5 \
>   libalpm.3 \
>   BUILDINFO.5 \
> - pacman-conf.8
> + pacman-conf.8 \
> + PKGINFO.5
>  
>  DOXYGEN_MANS = $(wildcard man3/*.3)
>  
> @@ -47,6 +48,7 @@ EXTRA_DIST = \
>   makepkg.conf.5.asciidoc \
>   pacman.conf.5.asciidoc \
>   BUILDINFO.5.asciidoc \
> + PKGINFO.5.asciidoc \
>   libalpm.3.asciidoc \
>   footer.asciidoc \
>   index.asciidoc \
> diff --git a/doc/PKGINFO.5.asciidoc b/doc/PKGINFO.5.asciidoc
> new file mode 100644
> index ..101ba34c
> --- /dev/null
> +++ b/doc/PKGINFO.5.asciidoc
> @@ -0,0 +1,87 @@
> +/
> +vim:set ts=4 sw=4 syntax=asciidoc noet spell spelllang=en_us:
> +/

A few have sneaked in since the removal, but we don't include vim
modelines anymore.

> +PKGINFO(5)
> +==
> +
> +Name
> +
> +PKGINFO - package information file
> +
> +
> +Synopsis
> +
> +This manual page describes the format of a PKGINFO file found in the root of
> +a package created by makepkg. The file contains a description of the 
> package's
> +information. The information is formatted in key-value pairs separated by
> +a '=', one value per line. Arrays are represented multiple keys with the same
> +value.

Key-value pairs are separated by " = ", not "=".

Arrays are represented by repeating the same key multiple times, each
line presumably has a different value, not the same one.

Empty lines and lines beginning with "#" are ignored.

> +
> +
> +Description
> +---
> +
> +*pkgname*::
> + The name of the package.
> +
> +*pkgbase*::
> + The base name of a package, usually the same as the pkgname except for
> + split packages.
> +
> +*pkgver*::
> + The version of the package including pkgrel and epoch.

This should include the actual format.

> +*pkgdesc*::
> + A description of the software contained in the package.
> +
> +*url*::
> + The upstream url of the package.

packaged software.

> +*builddate*::
> + The build date of the package in epoch.
> +
> +*packager*::
> + The packager of the package formatted "Name ".

Neither makepkg nor libalpm says anything about the format of this
field, neither should this documentation.

> +*size*::
> + The size of the package in bytes.

"installation size" or "packaged files", it is not the size of the
package itself.

> +*arch*::
> + The architecture of the package.
> +
> +*license*::
> + The license of the package.

License is an array.

> +*replaces (array)*::
> + An array of packages that this package should replace.
> +
> +*group (array)*::
> + An array of names that represent groups of packages.

Groups to which this package belongs.

> +*conflict (array)*::
> + An array of packages that will conflict with this package.
> +
> +*provides (array)*::
> + An array of "virtual provisions" this package provides.
> +
> +*backup (array)*::
> + An array of file names, which should be backed up if the package is 
> removed
> + or upgraded.
> +
> +*depend (array)*::
> + The dependencies of the package.
> +
> +*optdepend (array)*::
> + The optional dependencies of the package.
> +
> +*makedepend (array)*::
> + The make dependencies of the package.
> +
> +*checkdepend (array)*::
> + The check dependencies of the package.

This should document the format for dependency values.

> +See Also
> +
> +linkman:makepkg[8], linkman:pkgbuild[5]
> +
> +include::footer.asciidoc[]
> diff --git a/doc/meson.build b/doc/meson.build
> index a5bcd5b3..2f966616 100644
> --- a/doc/meson.build
> +++ b/doc/meson.build
> @@ -12,6 +12,7 @@ manpages = [
>{ 'name': 'libalpm.3' },
>{ 'name': 'BUILDINFO.5' },
>{ 'name': 'pacman-conf.8' },
> +  { 'name': 'PKGINFO.5' },
>  ]
>  
>  sitepages = [
> -- 
> 2.22.0


[pacman-dev] [PATCH 2/4] meson: port over checks for types used from sys/types.h

2019-06-29 Thread Dave Reisner
These are defined by a POSIX standard, and we should assert that we have
them, or define sane fallbacks (as per sys_types.h(0P)).
---
 meson.build | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/meson.build b/meson.build
index c2ed707a..ec94a44a 100644
--- a/meson.build
+++ b/meson.build
@@ -185,6 +185,21 @@ foreach member : [
   conf.set('HAVE_' + '_'.join([member[0], 
member[1]]).underscorify().to_upper(), have)
 endforeach
 
+foreach type : [
+# type   # program prefix  # fallback
+['mode_t',   '''#include ''', 'unsigned int'],
+['uid_t','''#include ''', 'unsigned int'],
+['off_t','''#include ''', 'signed int'],
+['pid_t','''#include ''', 'signed int'],
+['size_t',   '''#include ''', 'unsigned int'],
+['ssize_t',  '''#include ''', 'signed int'],
+['int64_t',  '''#include ''','signed long int'],
+  ]
+  if not cc.has_type(type[0], prefix: type[1])
+conf.set(type[0], type[2])
+  endif
+endforeach
+
 if conf.has('HAVE_STRUCT_STATVFS_F_FLAG')
   conf.set('FSSTATSTYPE', 'struct statvfs')
 elif conf.has('HAVE_STRUCT_STATFS_F_FLAGS')
-- 
2.22.0


[pacman-dev] [PATCH 3/4] meson: remove tap-driver.py, use meson's TAP protocol

2019-06-29 Thread Dave Reisner
This includes a patch from Andrew to fix pactest's TAP output for
subtests. Original TAP support in meson was added in 0.50, but 0.51
contains a bugfix that ensures the test still work with the --verbose
flag passed to meson test, so let's depend on that.
---
I'm aware this has a merge conflict with one of Eli's meson patches,
which also bumps the meson version requirement.

 build-aux/tap-driver.py  | 296 -
 meson.build  |   2 +-
 test/pacman/meson.build  | 675 +++
 test/pacman/tap.py   |   3 +-
 test/scripts/meson.build |   3 +-
 5 files changed, 336 insertions(+), 643 deletions(-)
 delete mode 100644 build-aux/tap-driver.py

diff --git a/build-aux/tap-driver.py b/build-aux/tap-driver.py
deleted file mode 100644
index c231caec..
--- a/build-aux/tap-driver.py
+++ /dev/null
@@ -1,296 +0,0 @@
-#!/usr/bin/env python3
-# Adapted from tappy copyright (c) 2016, Matt Layman
-# MIT license
-# https://github.com/python-tap/tappy
-
-import io
-import re
-import subprocess
-import sys
-
-
-class Directive(object):
-"""A representation of a result line directive."""
-
-skip_pattern = re.compile(
-r"""^SKIP\S*
-(?P\s*) # Optional whitespace.
-(?P.*)  # Slurp up the rest.""",
-re.IGNORECASE | re.VERBOSE)
-todo_pattern = re.compile(
-r"""^TODO\b # The directive name
-(?P\s*) # Immediately following must be whitespace.
-(?P.*)  # Slurp up the rest.""",
-re.IGNORECASE | re.VERBOSE)
-
-def __init__(self, text):
-"""Initialize the directive by parsing the text.
-The text is assumed to be everything after a '#\s*' on a result line.
-"""
-self._text = text
-self._skip = False
-self._todo = False
-self._reason = None
-
-match = self.skip_pattern.match(text)
-if match:
-self._skip = True
-self._reason = match.group('reason')
-
-match = self.todo_pattern.match(text)
-if match:
-if match.group('whitespace'):
-self._todo = True
-else:
-# Catch the case where the directive has no descriptive text.
-if match.group('reason') == '':
-self._todo = True
-self._reason = match.group('reason')
-
-@property
-def text(self):
-"""Get the entire text."""
-return self._text
-
-@property
-def skip(self):
-"""Check if the directive is a SKIP type."""
-return self._skip
-
-@property
-def todo(self):
-"""Check if the directive is a TODO type."""
-return self._todo
-
-@property
-def reason(self):
-"""Get the reason for the directive."""
-return self._reason
-
-
-class Parser(object):
-"""A parser for TAP files and lines."""
-
-# ok and not ok share most of the same characteristics.
-result_base = r"""
-\s*# Optional whitespace.
-(?P\d*)# Optional test number.
-\s*# Optional whitespace.
-(?P[^#]*) # Optional description before #.
-\#?# Optional directive marker.
-\s*# Optional whitespace.
-(?P.*)  # Optional directive text.
-"""
-ok = re.compile(r'^ok' + result_base, re.VERBOSE)
-not_ok = re.compile(r'^not\ ok' + result_base, re.VERBOSE)
-plan = re.compile(r"""
-^1..(?P\d+) # Match the plan details.
-[^#]* # Consume any non-hash character to confirm only
-  # directives appear with the plan details.
-\#?   # Optional directive marker.
-\s*   # Optional whitespace.
-(?P.*) # Optional directive text.
-""", re.VERBOSE)
-diagnostic = re.compile(r'^#')
-bail = re.compile(r"""
-^Bail\ out!
-\s*# Optional whitespace.
-(?P.*) # Optional reason.
-""", re.VERBOSE)
-version = re.compile(r'^TAP version (?P\d+)$')
-
-TAP_MINIMUM_DECLARED_VERSION = 13
-
-def parse(self, fh):
-"""Generate tap.line.Line objects, given a file-like object `fh`.
-`fh` may be any object that implements both the iterator and
-context management protocol (i.e. it can be used in both a
-"with" statement and a "for...in" statement.)
-Trailing whitespace and newline characters will be automatically
-stripped from the input lines.
-"""
-with fh:
-for line in fh:
-yield self.parse_line(line.rstrip())
-
-def parse_line(self, text):
-"""Parse a line into whatever TAP category it belongs."""
-match = self.ok.match(text)
-if match:
-return self._parse_result(True, match)
-
-match = self.not_ok.match(text)
-  

[pacman-dev] [PATCH 4/4] build-aux: detect build dir based on build.ninja

2019-06-29 Thread Dave Reisner
.ninja.log is only present after building (successful or otherwise) the
project, but build.ninja is output as soon as the build dir is setup.
---
 build-aux/update-po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build-aux/update-po b/build-aux/update-po
index ce1ad4be..bf8d7cfc 100755
--- a/build-aux/update-po
+++ b/build-aux/update-po
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 find_build_directory() {
-  local build_dirs=(*/.ninja_log)
+  local build_dirs=(*/build.ninja)
 
   if [[ ! -e ${build_dirs[0]} ]]; then
 echo "error: No build directory found. Have you run 'meson build' yet?" >&2
-- 
2.22.0


[pacman-dev] [PATCH 1/4] meson: drop checks for things we don't use

2019-06-29 Thread Dave Reisner
This was ported over from the AC_CHECK_{FUNCS,HEADERS} lists in
configure.ac, but I never actually checked if the resulting CPP defines
are used. Turns out, lots of symbols, not a lot of define usage.
---
 meson.build | 25 -
 1 file changed, 25 deletions(-)

diff --git a/meson.build b/meson.build
index 91f05031..c2ed707a 100644
--- a/meson.build
+++ b/meson.build
@@ -163,38 +163,13 @@ foreach header : [
 endforeach
 
 foreach sym : [
-'dup2',
-'fork',
-'getcwd',
 'getmntent',
 'getmntinfo',
-'gettimeofday',
-'memmove',
-'memset',
-'mkdir',
-'realpath',
-'regcomp',
-'rmdir',
-'setenv',
-'setlocale',
-'strcasecmp',
-'strchr',
-'strcspn',
-'strdup',
-'strerror',
 'strndup',
 'strnlen',
-'strnlen',
-'strrchr',
-'strsep',
 'strsep',
-'strstr',
-'strtol',
 'swprintf',
 'tcflush',
-'tcflush',
-'uname',
-'wcwidth',
   ]
   have = cc.has_function(sym, args : '-D_GNU_SOURCE')
   conf.set10('HAVE_' + sym.to_upper(), have)
-- 
2.22.0