[pacman-dev] [PATCH 0/3] Make documentation and PKGBUILD linting more consistent
Make the documentation a little more explicit about allowed characters for arch and pkgver. Also fix linting of pkgver which was broken if pkgver contained whitespace. Rikard Falkeborn (3): PKGBUILD.5: Mention valid characters for arch PKGBUILD.5: Mention that pkgver can't contain whitespace Fix linting of whitespace in pkgver doc/PKGBUILD.5.txt | 6 ++++-- scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) -- 2.16.2
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> --- doc/PKGBUILD.5.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index 18bc2a19..3b8c2ed1 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -168,7 +168,8 @@ contain whitespace characters. *arch (array)*:: Defines on which architectures the given package is available (e.g., `arch=('i686' 'x86_64')`). Packages that contain no architecture specific - files should use `arch=('any')`. + files should use `arch=('any')`. Valid characters for members of this array + are alphanumerics and ```_`''. *backup (array)*:: An array of file names, without preceding slashes, that -- 2.16.2
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> --- doc/PKGBUILD.5.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index 3b8c2ed1..cbd02e88 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -48,7 +48,8 @@ similar to `$_basekernver`. *pkgver*:: The version of the software as released from the author (e.g., '2.7.1'). - The variable is not allowed to contain colons, forward slashes or hyphens. + The variable is not allowed to contain colons, forward slashes, hyphens + or whitespace. + The `pkgver` variable can be automatically updated by providing a `pkgver()` function in the PKGBUILD that outputs the new package version. -- 2.16.2
On 21/02/18 06:52, Rikard Falkeborn wrote:
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> --- doc/PKGBUILD.5.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index 3b8c2ed1..cbd02e88 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -48,7 +48,8 @@ similar to `$_basekernver`.
*pkgver*:: The version of the software as released from the author (e.g., '2.7.1'). - The variable is not allowed to contain colons, forward slashes or hyphens. + The variable is not allowed to contain colons, forward slashes, hyphens + or whitespace. + The `pkgver` variable can be automatically updated by providing a `pkgver()` function in the PKGBUILD that outputs the new package version.
Thanks, A
In order to detect if pkgver contains whitespace, we need to quote it. Previously, only the characters up to the first whitespace was checked. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> --- scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in index 0ec6584c..2325b1f5 100644 --- a/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in +++ b/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in @@ -47,5 +47,5 @@ lint_pkgver() { return 0 fi - check_pkgver $pkgver + check_pkgver "$pkgver" } -- 2.16.2
On 21/02/18 06:52, Rikard Falkeborn wrote:
In order to detect if pkgver contains whitespace, we need to quote it. Previously, only the characters up to the first whitespace was checked.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> --- scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in index 0ec6584c..2325b1f5 100644 --- a/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in +++ b/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in @@ -47,5 +47,5 @@ lint_pkgver() { return 0 fi
- check_pkgver $pkgver + check_pkgver "$pkgver" }
Good catch. Applied, A
participants (2)
-
Allan McRae
-
Rikard Falkeborn