[pacman-dev] [PATCH 1/6] libmakepkg: move functions for extracting pkgbuild attributes
Also rename some functions for clarity: funcgrep -> grep_function extract_global_var -> extract_global_variable extract_function_var -> extract_function_variable pkgbuild_get_attribute -> get_pkgbuild_attribute Signed-off-by: Allan McRae <allan@archlinux.org> --- scripts/Makefile.am | 3 +- scripts/libmakepkg/util/pkgbuild.sh | 111 ++++++++++++++++++++++++++++++++ scripts/makepkg.sh.in | 122 +++++------------------------------- 3 files changed, 130 insertions(+), 106 deletions(-) create mode 100644 scripts/libmakepkg/util/pkgbuild.sh diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 57468f9..3dfd903 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -47,7 +47,8 @@ LIBMAKEPKGDIRS = \ LIBMAKEPKG = \ libmakepkg/util/message.sh \ - libmakepkg/util/option.sh + libmakepkg/util/option.sh \ + libmakepkg/util/pkgbuild.sh LIBMAKEPKG_IN = \ libmakepkg/lint_package.sh \ diff --git a/scripts/libmakepkg/util/pkgbuild.sh b/scripts/libmakepkg/util/pkgbuild.sh new file mode 100644 index 0000000..2e97e4d --- /dev/null +++ b/scripts/libmakepkg/util/pkgbuild.sh @@ -0,0 +1,111 @@ +#!/bin/bash +# +# pkgbuild.sh - functions to extract information from PKGBUILD files +# +# Copyright (c) 2014-2015 Pacman Development Team <pacman-dev@archlinux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +[ -n "$LIBMAKEPKG_UTIL_PKGBUILD_SH" ] && return +LIBMAKEPKG_UTIL_PKGBUILD_SH=1 + + +have_function() { + declare -f "$1" >/dev/null +} + +grep_function() { + { declare -f "$1" || declare -f package; } 2>/dev/null | grep -E "$2" +} + +array_build() { + local dest=$1 src=$2 i keys values + + # it's an error to try to copy a value which doesn't exist. + declare -p "$2" &>/dev/null || return 1 + + # Build an array of the indicies of the source array. + eval "keys=(\"\${!$2[@]}\")" + + # Clear the destination array + eval "$dest=()" + + # Read values indirectly via their index. This approach gives us support + # for associative arrays, sparse arrays, and empty strings as elements. + for i in "${keys[@]}"; do + values+=("printf -v '$dest[$i]' %s \"\${$src[$i]}\";") + done + + eval "${values[*]}" +} + +extract_global_variable() { + # $1: variable name + # $2: multivalued + # $3: name of output var + + local attr=$1 isarray=$2 outputvar=$3 ref + + if (( isarray )); then + array_build ref "$attr" + [[ ${ref[@]} ]] && array_build "$outputvar" "$attr" + else + [[ ${!attr} ]] && printf -v "$outputvar" %s "${!attr}" + fi +} + +extract_function_variable() { + # $1: function name + # $2: variable name + # $3: multivalued + # $4: name of output var + + local funcname=$1 attr=$2 isarray=$3 outputvar=$4 attr_regex= decl= r=1 + + if (( isarray )); then + printf -v attr_regex '^[[:space:]]* %s\+?=\(' "$2" + else + printf -v attr_regex '^[[:space:]]* %s\+?=[^(]' "$2" + fi + + while read -r; do + # strip leading whitespace and any usage of declare + decl=${REPLY##*([[:space:]])} + eval "${decl/#$attr/$outputvar}" + + # entering this loop at all means we found a match, so notify the caller. + r=0 + done < <(grep_function "$funcname" "$attr_regex") + + return $r +} + +get_pkgbuild_attribute() { + # $1: package name + # $2: attribute name + # $3: multivalued + # $4: name of output var + + local pkgname=$1 attrname=$2 isarray=$3 outputvar=$4 + + printf -v "$outputvar" %s '' + + if [[ $pkgname ]]; then + extract_global_variable "$attrname" "$isarray" "$outputvar" + extract_function_variable "package_$pkgname" "$attrname" "$isarray" "$outputvar" + else + extract_global_variable "$attrname" "$isarray" "$outputvar" + fi +} diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index fb1ef20..a6e37ee 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -879,7 +879,7 @@ get_pkg_arch() { fi else local arch_override - pkgbuild_get_attribute "$1" arch 1 arch_override + get_pkgbuild_attribute "$1" arch 1 arch_override (( ${#arch_override[@]} == 0 )) && arch_override=("${arch[@]}") if [[ $arch_override = "any" ]]; then printf "%s\n" "any" @@ -1759,7 +1759,7 @@ pkgbuild_extract_to_srcinfo() { local pkgname=$1 attrname=$2 isarray=$3 outvalue= - if pkgbuild_get_attribute "$pkgname" "$attrname" "$isarray" 'outvalue'; then + if get_pkgbuild_attribute "$pkgname" "$attrname" "$isarray" 'outvalue'; then srcinfo_write_attr "$attrname" "${outvalue[@]}" fi } @@ -1778,7 +1778,7 @@ srcinfo_write_section_details() { pkgbuild_extract_to_srcinfo "$1" "$attr" 1 done - pkgbuild_get_attribute "$1" 'arch' 1 'package_arch' + get_pkgbuild_attribute "$1" 'arch' 1 'package_arch' for a in "${package_arch[@]}"; do # 'any' is special. there's no support for, e.g. depends_any. [[ $a = any ]] && continue @@ -2062,7 +2062,7 @@ create_srcpackage() { [[ ${!i} ]] && files+=("${!i}") for name in "${pkgname[@]}"; do - if extract_function_var "package_$name" "$i" 0 file; then + if extract_function_variable "package_$name" "$i" 0 file; then files+=("$file") fi done @@ -2149,94 +2149,6 @@ install_package() { fi } -have_function() { - declare -f "$1" >/dev/null -} - -array_build() { - local dest=$1 src=$2 i keys values - - # it's an error to try to copy a value which doesn't exist. - declare -p "$2" &>/dev/null || return 1 - - # Build an array of the indicies of the source array. - eval "keys=(\"\${!$2[@]}\")" - - # Clear the destination array - eval "$dest=()" - - # Read values indirectly via their index. This approach gives us support - # for associative arrays, sparse arrays, and empty strings as elements. - for i in "${keys[@]}"; do - values+=("printf -v '$dest[$i]' %s \"\${$src[$i]}\";") - done - - eval "${values[*]}" -} - -funcgrep() { - { declare -f "$1" || declare -f package; } 2>/dev/null | grep -E "$2" -} - -extract_global_var() { - # $1: variable name - # $2: multivalued - # $3: name of output var - - local attr=$1 isarray=$2 outputvar=$3 ref - - if (( isarray )); then - array_build ref "$attr" - [[ ${ref[@]} ]] && array_build "$outputvar" "$attr" - else - [[ ${!attr} ]] && printf -v "$outputvar" %s "${!attr}" - fi -} - -extract_function_var() { - # $1: function name - # $2: variable name - # $3: multivalued - # $4: name of output var - - local funcname=$1 attr=$2 isarray=$3 outputvar=$4 attr_regex= decl= r=1 - - if (( isarray )); then - printf -v attr_regex '^[[:space:]]* %s\+?=\(' "$2" - else - printf -v attr_regex '^[[:space:]]* %s\+?=[^(]' "$2" - fi - - while read -r; do - # strip leading whitespace and any usage of declare - decl=${REPLY##*([[:space:]])} - eval "${decl/#$attr/$outputvar}" - - # entering this loop at all means we found a match, so notify the caller. - r=0 - done < <(funcgrep "$funcname" "$attr_regex") - - return $r -} - -pkgbuild_get_attribute() { - # $1: package name - # $2: attribute name - # $3: multivalued - # $4: name of output var - - local pkgname=$1 attrname=$2 isarray=$3 outputvar=$4 - - printf -v "$outputvar" %s '' - - if [[ $pkgname ]]; then - extract_global_var "$attrname" "$isarray" "$outputvar" - extract_function_var "package_$pkgname" "$attrname" "$isarray" "$outputvar" - else - extract_global_var "$attrname" "$isarray" "$outputvar" - fi -} - lint_pkgbase() { if [[ ${pkgbase:0:1} = "-" ]]; then error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname" @@ -2322,7 +2234,7 @@ lint_arch() { fi for name in "${pkgname[@]}"; do - pkgbuild_get_attribute "$name" 'arch' 1 list + get_pkgbuild_attribute "$name" 'arch' 1 list if [[ $list && $list != 'any' ]] && ! in_array $CARCH "${list[@]}"; then if (( ! IGNOREARCH )); then error "$(gettext "%s is not available for the '%s' architecture.")" "$name" "$CARCH" @@ -2342,12 +2254,12 @@ lint_provides() { done for name in "${pkgname[@]}"; do - if extract_function_var "package_$name" provides 1 list; then + if extract_function_variable "package_$name" provides 1 list; then provides_list+=("${list[@]}") fi for a in "${arch[@]}"; do - if extract_function_var "package_$name" "provides_$a" 1 list; then + if extract_function_variable "package_$name" "provides_$a" 1 list; then provides_list+=("${list[@]}") fi done @@ -2368,7 +2280,7 @@ lint_backup() { backup_list=("${backup[@]}") for name in "${pkgname[@]}"; do - if extract_function_var "package_$name" backup 1 list; then + if extract_function_variable "package_$name" backup 1 list; then backup_list+=("${list[@]}") fi done @@ -2393,12 +2305,12 @@ lint_optdepends() { done for name in "${pkgname[@]}"; do - if extract_function_var "package_$name" optdepends 1 list; then + if extract_function_variable "package_$name" optdepends 1 list; then optdepends_list+=("${list[@]}") fi for a in "${arch[@]}"; do - if extract_function_var "package_$name" "optdepends_$a" 1 list; then + if extract_function_variable "package_$name" "optdepends_$a" 1 list; then optdepends_list+=("${list[@]}") fi done @@ -2435,7 +2347,7 @@ lint_install() { install_list=("${install[@]}") for name in "${pkgname[@]}"; do - extract_function_var "package_$name" install 0 file + extract_function_variable "package_$name" install 0 file install_list+=("$file") done @@ -2447,7 +2359,7 @@ lint_changelog() { changelog_list=("${changelog[@]}") for name in "${pkgname[@]}"; do - if extract_function_var "package_$name" changelog 0 file; then + if extract_function_variable "package_$name" changelog 0 file; then changelog_list+=("$file") fi done @@ -2460,7 +2372,7 @@ lint_options() { options_list=("${options[@]}") for name in "${pkgname[@]}"; do - if extract_function_var "package_$name" options 1 list; then + if extract_function_variable "package_$name" options 1 list; then options_list+=("${list[@]}") fi done @@ -2606,10 +2518,10 @@ check_vcs_software() { # we currently only use global depends/makedepends arrays for --syncdeps for attr in depends makedepends; do - pkgbuild_get_attribute "$pkg" "$attr" 1 'deps' + get_pkgbuild_attribute "$pkg" "$attr" 1 'deps' all_deps+=("${deps[@]}") - pkgbuild_get_attribute "$pkg" "${attr}_$CARCH" 1 'deps' + get_pkgbuild_attribute "$pkg" "${attr}_$CARCH" 1 'deps' all_deps+=("${deps[@]}") done @@ -2838,8 +2750,8 @@ print_all_package_names() { local version=$(get_full_version) local architecture pkg opts a for pkg in ${pkgname[@]}; do - pkgbuild_get_attribute "$pkg" 'arch' 1 architecture - pkgbuild_get_attribute "$pkg" 'options' 1 opts + get_pkgbuild_attribute "$pkg" 'arch' 1 architecture + get_pkgbuild_attribute "$pkg" 'options' 1 opts for a in ${architecture[@]}; do printf "%s-%s-%s\n" "$pkg" "$version" "$a" if in_opt_array "debug" ${opts[@]} && in_opt_array "strip" ${opts[@]}; then -- 2.4.0
--- scripts/Makefile.am | 3 ++- scripts/libmakepkg/.gitignore | 2 +- scripts/libmakepkg/util/util.sh | 38 ++++++++++++++++++++++++++++++++++++++ scripts/makepkg.sh.in | 14 -------------- 4 files changed, 41 insertions(+), 16 deletions(-) create mode 100644 scripts/libmakepkg/util/util.sh diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 3dfd903..4a54b8d 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -48,7 +48,8 @@ LIBMAKEPKGDIRS = \ LIBMAKEPKG = \ libmakepkg/util/message.sh \ libmakepkg/util/option.sh \ - libmakepkg/util/pkgbuild.sh + libmakepkg/util/pkgbuild.sh \ + libmakepkg/util/util.sh LIBMAKEPKG_IN = \ libmakepkg/lint_package.sh \ diff --git a/scripts/libmakepkg/.gitignore b/scripts/libmakepkg/.gitignore index 6101db4..46d8fc1 100644 --- a/scripts/libmakepkg/.gitignore +++ b/scripts/libmakepkg/.gitignore @@ -11,4 +11,4 @@ tidy/staticlibs.sh tidy/strip.sh tidy/upx.sh tidy/zipman.sh -util.sh +/util.sh diff --git a/scripts/libmakepkg/util/util.sh b/scripts/libmakepkg/util/util.sh new file mode 100644 index 0000000..307464e --- /dev/null +++ b/scripts/libmakepkg/util/util.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# +# util.sh - general utility functions +# +# Copyright (c) 2006-2015 Pacman Development Team <pacman-dev@archlinux.org> +# Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +[ -n "$LIBMAKEPKG_UTIL_UTIL_SH" ] && return +LIBMAKEPKG_UTIL_UTIL_SH=1 + + +## +# usage : in_array( $needle, $haystack ) +# return : 0 - found +# 1 - not found +## +in_array() { + local needle=$1; shift + local item + for item in "$@"; do + [[ $item = "$needle" ]] && return 0 # Found + done + return 1 # Not Found +} diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index a6e37ee..a00e8a4 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -889,20 +889,6 @@ get_pkg_arch() { fi } -## -# usage : in_array( $needle, $haystack ) -# return : 0 - found -# 1 - not found -## -in_array() { - local needle=$1; shift - local item - for item in "$@"; do - [[ $item = "$needle" ]] && return 0 # Found - done - return 1 # Not Found -} - source_has_signatures() { local file all_sources -- 2.4.0
Signed-off-by: Allan McRae <allan@archlinux.org> --- scripts/Makefile.am | 18 ++ scripts/libmakepkg/.gitignore | 2 + scripts/libmakepkg/lint_pkgbuild.sh.in | 46 +++ scripts/libmakepkg/lint_pkgbuild/arch.sh.in | 64 ++++ scripts/libmakepkg/lint_pkgbuild/backup.sh.in | 51 ++++ scripts/libmakepkg/lint_pkgbuild/changelog.sh.in | 45 +++ scripts/libmakepkg/lint_pkgbuild/epoch.sh.in | 37 +++ scripts/libmakepkg/lint_pkgbuild/install.sh.in | 44 +++ scripts/libmakepkg/lint_pkgbuild/optdepends.sh.in | 64 ++++ scripts/libmakepkg/lint_pkgbuild/options.sh.in | 57 ++++ .../lint_pkgbuild/package_function.sh.in | 51 ++++ scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in | 37 +++ scripts/libmakepkg/lint_pkgbuild/pkglist.sh.in | 44 +++ scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in | 57 ++++ scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in | 42 +++ scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in | 55 ++++ scripts/libmakepkg/lint_pkgbuild/provides.sh.in | 62 ++++ scripts/libmakepkg/lint_pkgbuild/source.sh.in | 39 +++ scripts/libmakepkg/lint_pkgbuild/util.sh.in | 41 +++ scripts/makepkg.sh.in | 334 +-------------------- scripts/po/POTFILES.in | 17 ++ 21 files changed, 874 insertions(+), 333 deletions(-) create mode 100644 scripts/libmakepkg/lint_pkgbuild.sh.in create mode 100644 scripts/libmakepkg/lint_pkgbuild/arch.sh.in create mode 100644 scripts/libmakepkg/lint_pkgbuild/backup.sh.in create mode 100644 scripts/libmakepkg/lint_pkgbuild/changelog.sh.in create mode 100644 scripts/libmakepkg/lint_pkgbuild/epoch.sh.in create mode 100644 scripts/libmakepkg/lint_pkgbuild/install.sh.in create mode 100644 scripts/libmakepkg/lint_pkgbuild/optdepends.sh.in create mode 100644 scripts/libmakepkg/lint_pkgbuild/options.sh.in create mode 100644 scripts/libmakepkg/lint_pkgbuild/package_function.sh.in create mode 100644 scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in create mode 100644 scripts/libmakepkg/lint_pkgbuild/pkglist.sh.in create mode 100644 scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in create mode 100644 scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in create mode 100644 scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in create mode 100644 scripts/libmakepkg/lint_pkgbuild/provides.sh.in create mode 100644 scripts/libmakepkg/lint_pkgbuild/source.sh.in create mode 100644 scripts/libmakepkg/lint_pkgbuild/util.sh.in diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 4a54b8d..fb32f16 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -42,6 +42,7 @@ libmakepkgdir = $(datarootdir)/makepkg LIBMAKEPKGDIRS = \ lint_package \ + lint_pkgbuild \ tidy \ util @@ -55,6 +56,23 @@ LIBMAKEPKG_IN = \ libmakepkg/lint_package.sh \ libmakepkg/lint_package/build_references.sh \ libmakepkg/lint_package/missing_backup.sh \ + libmakepkg/lint_pkgbuild.sh \ + libmakepkg/lint_pkgbuild/arch.sh \ + libmakepkg/lint_pkgbuild/backup.sh \ + libmakepkg/lint_pkgbuild/changelog.sh \ + libmakepkg/lint_pkgbuild/epoch.sh \ + libmakepkg/lint_pkgbuild/install.sh \ + libmakepkg/lint_pkgbuild/optdepends.sh \ + libmakepkg/lint_pkgbuild/options.sh \ + libmakepkg/lint_pkgbuild/package_function.sh \ + libmakepkg/lint_pkgbuild/pkgbase.sh \ + libmakepkg/lint_pkgbuild/pkglist.sh \ + libmakepkg/lint_pkgbuild/pkgname.sh \ + libmakepkg/lint_pkgbuild/pkgrel.sh \ + libmakepkg/lint_pkgbuild/pkgver.sh \ + libmakepkg/lint_pkgbuild/provides.sh \ + libmakepkg/lint_pkgbuild/source.sh \ + libmakepkg/lint_pkgbuild/util.sh \ libmakepkg/tidy.sh \ libmakepkg/tidy/docs.sh \ libmakepkg/tidy/emptydirs.sh \ diff --git a/scripts/libmakepkg/.gitignore b/scripts/libmakepkg/.gitignore index 46d8fc1..e5a6995 100644 --- a/scripts/libmakepkg/.gitignore +++ b/scripts/libmakepkg/.gitignore @@ -1,6 +1,8 @@ lint_package.sh lint_package/build_references.sh lint_package/missing_backup.sh +lint_pkgbuild.sh +lint_pkgbuild/*.sh tidy.sh tidy/docs.sh tidy/emptydirs.sh diff --git a/scripts/libmakepkg/lint_pkgbuild.sh.in b/scripts/libmakepkg/lint_pkgbuild.sh.in new file mode 100644 index 0000000..a792d5b --- /dev/null +++ b/scripts/libmakepkg/lint_pkgbuild.sh.in @@ -0,0 +1,46 @@ +#!/bin/bash +# +# lint_pkgbuild.sh - functions for detecting PKGBUILD errors +# +# Copyright (c) 2015 Pacman Development Team <pacman-dev@archlinux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_SH" ]] && return +LIBMAKEPKG_LINT_PKGBUILD_SH=1 + +LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + +source "$LIBRARY/util/message.sh" + + +declare -a lint_pkgbuild_functions + +for lib in "$LIBRARY/lint_pkgbuild/"*.sh; do + source "$lib" +done + +readonly -a lint_pkgbuild_functions + + +lint_pkgbuild() { + local ret=0 + + for func in ${lint_pkgbuild_functions[@]}; do + $func || ret=1 + done + + return $ret +} diff --git a/scripts/libmakepkg/lint_pkgbuild/arch.sh.in b/scripts/libmakepkg/lint_pkgbuild/arch.sh.in new file mode 100644 index 0000000..547d5fc --- /dev/null +++ b/scripts/libmakepkg/lint_pkgbuild/arch.sh.in @@ -0,0 +1,64 @@ +#!/bin/bash +# +# arch.sh - Check the 'arch' array conforms to requirements. +# +# Copyright (c) 2014-2015 Pacman Development Team <pacman-dev@archlinux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_ARCH_SH" ]] && return +LIBMAKEPKG_LINT_PKGBUILD_ARCH_SH=1 + +LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + +source "$LIBRARY/util/message.sh" +source "$LIBRARY/util/pkgbuild.sh" + + +lint_pkgbuild_functions+=('lint_arch') + + +lint_arch() { + local a name list + + if [[ $arch == 'any' ]]; then + return 0 + fi + + for a in "${arch[@]}"; do + if [[ $a = *[![:alnum:]_]* ]]; then + error "$(gettext "%s contains invalid characters: '%s'")" \ + 'arch' "${a//[[:alnum:]_]}" + ret=1 + fi + done + + if (( ! IGNOREARCH )) && ! in_array "$CARCH" "${arch[@]}"; then + error "$(gettext "%s is not available for the '%s' architecture.")" "$pkgbase" "$CARCH" + plain "$(gettext "Note that many packages may need a line added to their %s")" "$BUILDSCRIPT" + plain "$(gettext "such as %s.")" "arch=('$CARCH')" + return 1 + fi + + for name in "${pkgname[@]}"; do + get_pkgbuild_attribute "$name" 'arch' 1 list + if [[ $list && $list != 'any' ]] && ! in_array $CARCH "${list[@]}"; then + if (( ! IGNOREARCH )); then + error "$(gettext "%s is not available for the '%s' architecture.")" "$name" "$CARCH" + ret=1 + fi + fi + done +} diff --git a/scripts/libmakepkg/lint_pkgbuild/backup.sh.in b/scripts/libmakepkg/lint_pkgbuild/backup.sh.in new file mode 100644 index 0000000..c128d33 --- /dev/null +++ b/scripts/libmakepkg/lint_pkgbuild/backup.sh.in @@ -0,0 +1,51 @@ +#!/bin/bash +# +# backup.sh - Check the 'backup' array conforms to requirements. +# +# Copyright (c) 2014-2015 Pacman Development Team <pacman-dev@archlinux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_BACKUP_SH" ]] && return +LIBMAKEPKG_LINT_PKGBUILD_BACKUP_SH=1 + +LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + +source "$LIBRARY/util/message.sh" +source "$LIBRARY/util/pkgbuild.sh" + + +lint_pkgbuild_functions+=('lint_backup') + + +lint_backup() { + local list name backup_list ret=0 + + backup_list=("${backup[@]}") + for name in "${pkgname[@]}"; do + if extract_function_variable "package_$name" backup 1 list; then + backup_list+=("${list[@]}") + fi + done + + for name in "${backup_list[@]}"; do + if [[ ${name:0:1} = "/" ]]; then + error "$(gettext "%s entry should not contain leading slash : %s")" "backup" "$name" + ret=1 + fi + done + + return $ret +} diff --git a/scripts/libmakepkg/lint_pkgbuild/changelog.sh.in b/scripts/libmakepkg/lint_pkgbuild/changelog.sh.in new file mode 100644 index 0000000..2dac5db --- /dev/null +++ b/scripts/libmakepkg/lint_pkgbuild/changelog.sh.in @@ -0,0 +1,45 @@ +#!/bin/bash +# +# changelog.sh - Check the files in the 'changelog' array exist. +# +# Copyright (c) 2014-2015 Pacman Development Team <pacman-dev@archlinux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_CHANGELOG_SH" ]] && return +LIBMAKEPKG_LINT_PKGBUILD_CHANGELOG_SH=1 + +LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + +source "$LIBRARY/util/message.sh" +source "$LIBRARY/util/pkgbuild.sh" +source "$LIBRARY/lint_pkgbuild/util.sh" + + +lint_pkgbuild_functions+=('lint_changelog') + + +lint_changelog() { + local list name file changelog_list ret=0 + + changelog_list=("${changelog[@]}") + for name in "${pkgname[@]}"; do + if extract_function_variable "package_$name" changelog 0 file; then + changelog_list+=("$file") + fi + done + + check_files_exist 'changelog' "${changelog_list[@]}" +} diff --git a/scripts/libmakepkg/lint_pkgbuild/epoch.sh.in b/scripts/libmakepkg/lint_pkgbuild/epoch.sh.in new file mode 100644 index 0000000..93b51b8 --- /dev/null +++ b/scripts/libmakepkg/lint_pkgbuild/epoch.sh.in @@ -0,0 +1,37 @@ +#!/bin/bash +# +# epoch.sh - Check the 'epoch' variable conforms to requirements. +# +# Copyright (c) 2014-2015 Pacman Development Team <pacman-dev@archlinux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_EPOCH_SH" ]] && return +LIBMAKEPKG_LINT_PKGBUILD_EPOCH_SH=1 + +LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + +source "$LIBRARY/util/message.sh" + + +lint_pkgbuild_functions+=('lint_epoch') + + +lint_epoch() { + if [[ $epoch != *([[:digit:]]) ]]; then + error "$(gettext "%s must be an integer, not %s.")" "epoch" "$epoch" + return 1 + fi +} diff --git a/scripts/libmakepkg/lint_pkgbuild/install.sh.in b/scripts/libmakepkg/lint_pkgbuild/install.sh.in new file mode 100644 index 0000000..21e0bfb --- /dev/null +++ b/scripts/libmakepkg/lint_pkgbuild/install.sh.in @@ -0,0 +1,44 @@ +#!/bin/bash +# +# install.sh - Check the files in the 'install' array exist. +# +# Copyright (c) 2014-2015 Pacman Development Team <pacman-dev@archlinux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_INSTALL_SH" ]] && return +LIBMAKEPKG_LINT_PKGBUILD_INSTALL_SH=1 + +LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + +source "$LIBRARY/util/message.sh" +source "$LIBRARY/util/pkgbuild.sh" +source "$LIBRARY/lint_pkgbuild/util.sh" + + +lint_pkgbuild_functions+=('lint_install') + + +lint_install() { + local list file name install_list ret=0 + + install_list=("${install[@]}") + for name in "${pkgname[@]}"; do + extract_function_variable "package_$name" install 0 file + install_list+=("$file") + done + + check_files_exist 'install' "${install_list[@]}" +} diff --git a/scripts/libmakepkg/lint_pkgbuild/optdepends.sh.in b/scripts/libmakepkg/lint_pkgbuild/optdepends.sh.in new file mode 100644 index 0000000..6e66e0d --- /dev/null +++ b/scripts/libmakepkg/lint_pkgbuild/optdepends.sh.in @@ -0,0 +1,64 @@ +#!/bin/bash +# +# optdepends.sh - Check the 'optdepends' array conforms to requirements. +# +# Copyright (c) 2014-2015 Pacman Development Team <pacman-dev@archlinux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_OPTDEPENDS_SH" ]] && return +LIBMAKEPKG_LINT_PKGBUILD_OPTDEPENDS_SH=1 + +LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + +source "$LIBRARY/util/message.sh" +source "$LIBRARY/util/pkgbuild.sh" + + +lint_pkgbuild_functions+=('lint_optdepends') + + +lint_optdepends() { + local a list name optdepends_list ret=0 + + optdepends_list=("${optdepends[@]}") + for a in "${arch[@]}"; do + array_build list "optdepends_$a" + optdepends_list+=("${list[@]}") + done + + for name in "${pkgname[@]}"; do + if extract_function_variable "package_$name" optdepends 1 list; then + optdepends_list+=("${list[@]}") + fi + + for a in "${arch[@]}"; do + if extract_function_variable "package_$name" "optdepends_$a" 1 list; then + optdepends_list+=("${list[@]}") + fi + done + done + + for name in "${optdepends_list[@]}"; do + local pkg=${name%%:[[:space:]]*} + # the '-' character _must_ be first or last in the character range + if [[ $pkg != +([-[:alnum:]><=.+_:]) ]]; then + error "$(gettext "Invalid syntax for %s: '%s'")" "optdepend" "$name" + ret=1 + fi + done + + return $ret +} diff --git a/scripts/libmakepkg/lint_pkgbuild/options.sh.in b/scripts/libmakepkg/lint_pkgbuild/options.sh.in new file mode 100644 index 0000000..4423d26 --- /dev/null +++ b/scripts/libmakepkg/lint_pkgbuild/options.sh.in @@ -0,0 +1,57 @@ +#!/bin/bash +# +# options.sh - Check the 'options' array conforms to requirements. +# +# Copyright (c) 2014-2015 Pacman Development Team <pacman-dev@archlinux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_OPTIONS_SH" ]] && return +LIBMAKEPKG_LINT_PKGBUILD_OPTIONS_SH=1 + +LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + +source "$LIBRARY/util/message.sh" +source "$LIBRARY/util/pkgbuild.sh" + + +lint_pkgbuild_functions+=('lint_options') + + +lint_options() { + local ret=0 list name kopt options_list + + options_list=("${options[@]}") + for name in "${pkgname[@]}"; do + if extract_function_variable "package_$name" options 1 list; then + options_list+=("${list[@]}") + fi + done + + for i in "${options_list[@]}"; do + # check if option matches a known option or its inverse + for kopt in "${packaging_options[@]}" "${build_options[@]}"; do + if [[ $i = "$kopt" || $i = "!$kopt" ]]; then + # continue to the next $i + continue 2 + fi + done + + error "$(gettext "%s array contains unknown option '%s'")" "options" "$i" + ret=1 + done + + return $ret +} diff --git a/scripts/libmakepkg/lint_pkgbuild/package_function.sh.in b/scripts/libmakepkg/lint_pkgbuild/package_function.sh.in new file mode 100644 index 0000000..c2ed837 --- /dev/null +++ b/scripts/libmakepkg/lint_pkgbuild/package_function.sh.in @@ -0,0 +1,51 @@ +#!/bin/bash +# +# package_function.sh - Check that required package functions exist. +# +# Copyright (c) 2014-2015 Pacman Development Team <pacman-dev@archlinux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PACKAGE_FUNCTION_SH" ]] && return +LIBMAKEPKG_LINT_PKGBUILD_PACKAGE_FUNCTION_SH=1 + +LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + +source "$LIBRARY/util/message.sh" +source "$LIBRARY/util/pkgbuild.sh" + + +lint_pkgbuild_functions+=('lint_package_function') + + +lint_package_function() { + local i ret=0 + + if (( ${#pkgname[@]} == 1 )); then + if have_function 'build' && ! { have_function 'package' || have_function "package_$pkgname"; }; then + error "$(gettext "Missing %s function in %s")" "package()" "$BUILDFILE" + ret=1 + fi + else + for i in "${pkgname[@]}"; do + if ! have_function "package_$i"; then + error "$(gettext "Missing %s function for split package '%s'")" "package_$i()" "$i" + ret=1 + fi + done + fi + + return $ret +} diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in new file mode 100644 index 0000000..abb40e0 --- /dev/null +++ b/scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in @@ -0,0 +1,37 @@ +#!/bin/bash +# +# pkgbase.sh - Check the 'pkgbase' variable conforms to requirements. +# +# Copyright (c) 2014-2015 Pacman Development Team <pacman-dev@archlinux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PKGBASE_SH" ]] && return +LIBMAKEPKG_LINT_PKGBUILD_PKGBASE_SH=1 + +LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + +source "$LIBRARY/util/message.sh" + + +lint_pkgbuild_functions+=('lint_pkgbase') + + +lint_pkgbase() { + if [[ ${pkgbase:0:1} = "-" ]]; then + error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname" + return 1 + fi +} diff --git a/scripts/libmakepkg/lint_pkgbuild/pkglist.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkglist.sh.in new file mode 100644 index 0000000..26a8ac0 --- /dev/null +++ b/scripts/libmakepkg/lint_pkgbuild/pkglist.sh.in @@ -0,0 +1,44 @@ +#!/bin/bash +# +# pkglist.sh - Check the packages selected to build exist. +# +# Copyright (c) 2014-2015 Pacman Development Team <pacman-dev@archlinux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PKGLIST_SH" ]] && return +LIBMAKEPKG_LINT_PKGBUILD_PKGLIST_SH=1 + +LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + +source "$LIBRARY/util/message.sh" +source "$LIBRARY/util/util.sh" + + +lint_pkgbuild_functions+=('lint_pkglist') + + +lint_pkglist() { + local i ret=0 + + for i in "${PKGLIST[@]}"; do + if ! in_array "$i" "${pkgname[@]}"; then + error "$(gettext "Requested package %s is not provided in %s")" "$i" "$BUILDFILE" + ret=1 + fi + done + + return $ret +} diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in new file mode 100644 index 0000000..e5e2f26 --- /dev/null +++ b/scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in @@ -0,0 +1,57 @@ +#!/bin/bash +# +# pkgname.sh - Check the 'pkgname' variable conforms to requirements. +# +# Copyright (c) 2014-2015 Pacman Development Team <pacman-dev@archlinux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PKGNAME_SH" ]] && return +LIBMAKEPKG_LINT_PKGBUILD_PKGNAME_SH=1 + +LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + +source "$LIBRARY/util/message.sh" + + +lint_pkgbuild_functions+=('lint_pkgname') + + +lint_pkgname() { + local ret=0 i + + for i in "${pkgname[@]}"; do + if [[ -z $i ]]; then + error "$(gettext "%s is not allowed to be empty.")" "pkgname" + ret=1 + continue + fi + if [[ ${i:0:1} = "-" ]]; then + error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname" + ret=1 + fi + if [[ ${i:0:1} = "." ]]; then + error "$(gettext "%s is not allowed to start with a dot.")" "pkgname" + ret=1 + fi + if [[ $i = *[^[:alnum:]+_.@-]* ]]; then + error "$(gettext "%s contains invalid characters: '%s'")" \ + 'pkgname' "${i//[[:alnum:]+_.@-]}" + ret=1 + fi + done + + return $ret +} diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in new file mode 100644 index 0000000..371e6a1 --- /dev/null +++ b/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in @@ -0,0 +1,42 @@ +#!/bin/bash +# +# pkgrel.sh - Check the 'pkgrel' variable conforms to requirements. +# +# Copyright (c) 2014-2015 Pacman Development Team <pacman-dev@archlinux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PKGREL_SH" ]] && return +LIBMAKEPKG_LINT_PKGBUILD_PKGREL_SH=1 + +LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + +source "$LIBRARY/util/message.sh" + + +lint_pkgbuild_functions+=('lint_pkgrel') + + +lint_pkgrel() { + if [[ -z $pkgrel ]]; then + error "$(gettext "%s is not allowed to be empty.")" "pkgrel" + return 1 + fi + + if [[ $pkgrel != +([0-9])?(.+([0-9])) ]]; then + error "$(gettext "%s must be a decimal, not %s.")" "pkgrel" "$pkgrel" + return 1 + fi +} diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in new file mode 100644 index 0000000..d23f704 --- /dev/null +++ b/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in @@ -0,0 +1,55 @@ +#!/bin/bash +# +# pkgver.sh - Check the 'pkgver' variable conforms to requirements. +# +# Copyright (c) 2014-2015 Pacman Development Team <pacman-dev@archlinux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PKGVER_SH" ]] && return +LIBMAKEPKG_LINT_PKGBUILD_PKGVER_SH=1 + +LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + +source "$LIBRARY/util/message.sh" + + +lint_pkgbuild_functions+=('lint_pkgver') + + +validate_pkgver() { + if [[ $1 = *[[:space:]:-]* ]]; then + error "$(gettext "%s is not allowed to contain colons, hyphens or whitespace.")" "pkgver" + return 1 + fi +} + +check_pkgver() { + if [[ -z ${pkgver} ]]; then + error "$(gettext "%s is not allowed to be empty.")" "pkgver" + return 1 + fi + + validate_pkgver "$pkgver" +} + +lint_pkgver() { + if (( PKGVERFUNC )); then + # defer check to after getting version from pkgver function + return 0 + fi + + check_pkgver +} diff --git a/scripts/libmakepkg/lint_pkgbuild/provides.sh.in b/scripts/libmakepkg/lint_pkgbuild/provides.sh.in new file mode 100644 index 0000000..668cf56 --- /dev/null +++ b/scripts/libmakepkg/lint_pkgbuild/provides.sh.in @@ -0,0 +1,62 @@ +#!/bin/bash +# +# provides.sh - Check the 'provides' array conforms to requirements. +# +# Copyright (c) 2014-2015 Pacman Development Team <pacman-dev@archlinux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PROVIDES_SH" ]] && return +LIBMAKEPKG_LINT_PKGBUILD_PROVIDES_SH=1 + +LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + +source "$LIBRARY/util/message.sh" +source "$LIBRARY/util/pkgbuild.sh" + + +lint_pkgbuild_functions+=('lint_provides') + + +lint_provides() { + local a list name provides_list ret=0 + + provides_list=("${provides[@]}") + for a in "${arch[@]}"; do + array_build list "provides_$a" + provides_list+=("${list[@]}") + done + + for name in "${pkgname[@]}"; do + if extract_function_variable "package_$name" provides 1 list; then + provides_list+=("${list[@]}") + fi + + for a in "${arch[@]}"; do + if extract_function_variable "package_$name" "provides_$a" 1 list; then + provides_list+=("${list[@]}") + fi + done + done + + for provide in "${provides_list[@]}"; do + if [[ $provide == *['<>']* ]]; then + error "$(gettext "%s array cannot contain comparison (< or >) operators.")" "provides" + ret=1 + fi + done + + return $ret +} diff --git a/scripts/libmakepkg/lint_pkgbuild/source.sh.in b/scripts/libmakepkg/lint_pkgbuild/source.sh.in new file mode 100644 index 0000000..c327299 --- /dev/null +++ b/scripts/libmakepkg/lint_pkgbuild/source.sh.in @@ -0,0 +1,39 @@ +#!/bin/bash +# +# source.sh - Check the 'source' array is not sparse. +# +# Copyright (c) 2014-2015 Pacman Development Team <pacman-dev@archlinux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_SOURCE_SH" ]] && return +LIBMAKEPKG_LINT_PKGBUILD_SOURCE_SH=1 + +LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + +source "$LIBRARY/util/message.sh" + + +lint_pkgbuild_functions+=('lint_source') + + +lint_source() { + local idx=("${!source[@]}") + + if (( ${#source[*]} > 0 && (idx[-1] + 1) != ${#source[*]} )); then + error "$(gettext "Sparse arrays are not allowed for source")" + return 1 + fi +} diff --git a/scripts/libmakepkg/lint_pkgbuild/util.sh.in b/scripts/libmakepkg/lint_pkgbuild/util.sh.in new file mode 100644 index 0000000..448abc8 --- /dev/null +++ b/scripts/libmakepkg/lint_pkgbuild/util.sh.in @@ -0,0 +1,41 @@ +#!/bin/bash +# +# util.sh - utility functions for pkgbuild linting. +# +# Copyright (c) 2014-2015 Pacman Development Team <pacman-dev@archlinux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_UTIL_SH" ]] && return +LIBMAKEPKG_LINT_PKGBUILD_UTIL_SH=1 + +LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + +source "$LIBRARY/util/message.sh" + + +check_files_exist() { + local kind=$1 files=("${@:2}") file ret + + for file in "${files[@]}"; do + if [[ $file && ! -f $file ]]; then + error "$(gettext "%s file (%s) does not exist or is not a regular file.")" \ + "$kind" "$file" + ret=1 + fi + done + + return $ret +} diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index a00e8a4..4885341 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -2135,338 +2135,6 @@ install_package() { fi } -lint_pkgbase() { - if [[ ${pkgbase:0:1} = "-" ]]; then - error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname" - return 1 - fi -} - -lint_pkgname() { - local ret=0 i - - for i in "${pkgname[@]}"; do - if [[ -z $i ]]; then - error "$(gettext "%s is not allowed to be empty.")" "pkgname" - ret=1 - continue - fi - if [[ ${i:0:1} = "-" ]]; then - error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname" - ret=1 - fi - if [[ ${i:0:1} = "." ]]; then - error "$(gettext "%s is not allowed to start with a dot.")" "pkgname" - ret=1 - fi - if [[ $i = *[^[:alnum:]+_.@-]* ]]; then - error "$(gettext "%s contains invalid characters: '%s'")" \ - 'pkgname' "${i//[[:alnum:]+_.@-]}" - ret=1 - fi - done - - return $ret -} - -lint_pkgrel() { - if [[ -z $pkgrel ]]; then - error "$(gettext "%s is not allowed to be empty.")" "pkgrel" - return 1 - fi - - if [[ $pkgrel != +([0-9])?(.+([0-9])) ]]; then - error "$(gettext "%s must be a decimal, not %s.")" "pkgrel" "$pkgrel" - return 1 - fi -} - -lint_pkgver() { - if (( PKGVERFUNC )); then - # defer check to after getting version from pkgver function - return 0 - fi - - check_pkgver -} - -lint_epoch() { - if [[ $epoch != *([[:digit:]]) ]]; then - error "$(gettext "%s must be an integer, not %s.")" "epoch" "$epoch" - return 1 - fi -} - -lint_arch() { - local a name list - - if [[ $arch == 'any' ]]; then - return 0 - fi - - for a in "${arch[@]}"; do - if [[ $a = *[![:alnum:]_]* ]]; then - error "$(gettext "%s contains invalid characters: '%s'")" \ - 'arch' "${a//[[:alnum:]_]}" - ret=1 - fi - done - - if (( ! IGNOREARCH )) && ! in_array "$CARCH" "${arch[@]}"; then - error "$(gettext "%s is not available for the '%s' architecture.")" "$pkgbase" "$CARCH" - plain "$(gettext "Note that many packages may need a line added to their %s")" "$BUILDSCRIPT" - plain "$(gettext "such as %s.")" "arch=('$CARCH')" - return 1 - fi - - for name in "${pkgname[@]}"; do - get_pkgbuild_attribute "$name" 'arch' 1 list - if [[ $list && $list != 'any' ]] && ! in_array $CARCH "${list[@]}"; then - if (( ! IGNOREARCH )); then - error "$(gettext "%s is not available for the '%s' architecture.")" "$name" "$CARCH" - ret=1 - fi - fi - done -} - -lint_provides() { - local a list name provides_list ret=0 - - provides_list=("${provides[@]}") - for a in "${arch[@]}"; do - array_build list "provides_$a" - provides_list+=("${list[@]}") - done - - for name in "${pkgname[@]}"; do - if extract_function_variable "package_$name" provides 1 list; then - provides_list+=("${list[@]}") - fi - - for a in "${arch[@]}"; do - if extract_function_variable "package_$name" "provides_$a" 1 list; then - provides_list+=("${list[@]}") - fi - done - done - - for provide in "${provides_list[@]}"; do - if [[ $provide == *['<>']* ]]; then - error "$(gettext "%s array cannot contain comparison (< or >) operators.")" "provides" - ret=1 - fi - done - - return $ret -} - -lint_backup() { - local list name backup_list ret=0 - - backup_list=("${backup[@]}") - for name in "${pkgname[@]}"; do - if extract_function_variable "package_$name" backup 1 list; then - backup_list+=("${list[@]}") - fi - done - - for name in "${backup_list[@]}"; do - if [[ ${name:0:1} = "/" ]]; then - error "$(gettext "%s entry should not contain leading slash : %s")" "backup" "$name" - ret=1 - fi - done - - return $ret -} - -lint_optdepends() { - local a list name optdepends_list ret=0 - - optdepends_list=("${optdepends[@]}") - for a in "${arch[@]}"; do - array_build list "optdepends_$a" - optdepends_list+=("${list[@]}") - done - - for name in "${pkgname[@]}"; do - if extract_function_variable "package_$name" optdepends 1 list; then - optdepends_list+=("${list[@]}") - fi - - for a in "${arch[@]}"; do - if extract_function_variable "package_$name" "optdepends_$a" 1 list; then - optdepends_list+=("${list[@]}") - fi - done - done - - for name in "${optdepends_list[@]}"; do - local pkg=${name%%:[[:space:]]*} - # the '-' character _must_ be first or last in the character range - if [[ $pkg != +([-[:alnum:]><=.+_:]) ]]; then - error "$(gettext "Invalid syntax for %s: '%s'")" "optdepend" "$name" - ret=1 - fi - done - - return $ret -} - -check_files_exist() { - local kind=$1 files=("${@:2}") file ret - - for file in "${files[@]}"; do - if [[ $file && ! -f $file ]]; then - error "$(gettext "%s file (%s) does not exist or is not a regular file.")" \ - "$kind" "$file" - ret=1 - fi - done - - return $ret -} - -lint_install() { - local list file name install_list ret=0 - - install_list=("${install[@]}") - for name in "${pkgname[@]}"; do - extract_function_variable "package_$name" install 0 file - install_list+=("$file") - done - - check_files_exist 'install' "${install_list[@]}" -} - -lint_changelog() { - local list name file changelog_list ret=0 - - changelog_list=("${changelog[@]}") - for name in "${pkgname[@]}"; do - if extract_function_variable "package_$name" changelog 0 file; then - changelog_list+=("$file") - fi - done - - check_files_exist 'changelog' "${changelog_list[@]}" -} - -lint_options() { - local ret=0 list name kopt options_list - - options_list=("${options[@]}") - for name in "${pkgname[@]}"; do - if extract_function_variable "package_$name" options 1 list; then - options_list+=("${list[@]}") - fi - done - - for i in "${options_list[@]}"; do - # check if option matches a known option or its inverse - for kopt in "${packaging_options[@]}" "${build_options[@]}"; do - if [[ $i = "$kopt" || $i = "!$kopt" ]]; then - # continue to the next $i - continue 2 - fi - done - - error "$(gettext "%s array contains unknown option '%s'")" "options" "$i" - ret=1 - done - - return $ret -} - -lint_source() { - local idx=("${!source[@]}") - - if (( ${#source[*]} > 0 && (idx[-1] + 1) != ${#source[*]} )); then - error "$(gettext "Sparse arrays are not allowed for source")" - return 1 - fi -} - -lint_pkglist() { - local i ret=0 - - for i in "${PKGLIST[@]}"; do - if ! in_array "$i" "${pkgname[@]}"; then - error "$(gettext "Requested package %s is not provided in %s")" "$i" "$BUILDFILE" - ret=1 - fi - done - - return $ret -} - -lint_packagefn() { - local i ret=0 - - if (( ${#pkgname[@]} == 1 )); then - if have_function 'build' && ! { have_function 'package' || have_function "package_$pkgname"; }; then - error "$(gettext "Missing %s function in %s")" "package()" "$BUILDFILE" - ret=1 - fi - else - for i in "${pkgname[@]}"; do - if ! have_function "package_$i"; then - error "$(gettext "Missing %s function for split package '%s'")" "package_$i()" "$i" - ret=1 - fi - done - fi - - return $ret -} - -check_sanity() { - # check for no-no's in the build script - local ret=0 - local lintfn lint_functions - - lint_functions=( - lint_pkgbase - lint_pkgname - lint_pkgver - lint_pkgrel - lint_epoch - lint_arch - lint_provides - lint_backup - lint_optdepends - lint_changelog - lint_install - lint_options - lint_packagefn - lint_pkglist - lint_source - ) - - for lintfn in "${lint_functions[@]}"; do - "$lintfn" || ret=1 - done - - return $ret -} - -validate_pkgver() { - if [[ $1 = *[[:space:]:-]* ]]; then - error "$(gettext "%s is not allowed to contain colons, hyphens or whitespace.")" "pkgver" - return 1 - fi -} - -check_pkgver() { - if [[ -z ${pkgver} ]]; then - error "$(gettext "%s is not allowed to be empty.")" "pkgver" - return 1 - fi - - validate_pkgver "$pkgver" -} - get_vcsclient() { local proto=${1%%+*} @@ -3130,7 +2798,7 @@ if have_function pkgver; then fi # check the PKGBUILD for some basic requirements -check_sanity || exit 1 +lint_pkgbuild || exit 1 # check we have the software required to process the PKGBUILD check_software || exit 1 diff --git a/scripts/po/POTFILES.in b/scripts/po/POTFILES.in index b25e53b..43916c0 100644 --- a/scripts/po/POTFILES.in +++ b/scripts/po/POTFILES.in @@ -11,6 +11,23 @@ scripts/repo-add.sh.in scripts/libmakepkg/lint_package.sh.in scripts/libmakepkg/lint_package/build_references.sh.in scripts/libmakepkg/lint_package/missing_backup.sh.in +scripts/libmakepkg/lint_pkgbuild.sh.in +scripts/libmakepkg/lint_pkgbuild/arch.sh.in +scripts/libmakepkg/lint_pkgbuild/backup.sh.in +scripts/libmakepkg/lint_pkgbuild/changelog.sh.in +scripts/libmakepkg/lint_pkgbuild/epoch.sh.in +scripts/libmakepkg/lint_pkgbuild/install.sh.in +scripts/libmakepkg/lint_pkgbuild/optdepends.sh.in +scripts/libmakepkg/lint_pkgbuild/options.sh.in +scripts/libmakepkg/lint_pkgbuild/package_function.sh.in +scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in +scripts/libmakepkg/lint_pkgbuild/pkglist.sh.in +scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in +scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in +scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in +scripts/libmakepkg/lint_pkgbuild/provides.sh.in +scripts/libmakepkg/lint_pkgbuild/source.sh.in +scripts/libmakepkg/lint_pkgbuild/util.sh.in scripts/libmakepkg/tidy.sh.in scripts/libmakepkg/tidy/docs.sh.in scripts/libmakepkg/tidy/emptydirs.sh.in -- 2.4.0
The check that pkgver is non-empty done in check_pkgver should also be performed after running the pkgver() function. Merge validate_pkgver into check_pkgver and run check_pkgver after updating pkgver. Signed-off-by: Allan McRae <allan@archlinux.org> --- scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in | 12 ++++-------- scripts/makepkg.sh.in | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in index d23f704..3fa4ff7 100644 --- a/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in +++ b/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in @@ -29,20 +29,16 @@ source "$LIBRARY/util/message.sh" lint_pkgbuild_functions+=('lint_pkgver') -validate_pkgver() { - if [[ $1 = *[[:space:]:-]* ]]; then - error "$(gettext "%s is not allowed to contain colons, hyphens or whitespace.")" "pkgver" - return 1 - fi -} - check_pkgver() { if [[ -z ${pkgver} ]]; then error "$(gettext "%s is not allowed to be empty.")" "pkgver" return 1 fi - validate_pkgver "$pkgver" + if [[ $1 = *[[:space:]:-]* ]]; then + error "$(gettext "%s is not allowed to contain colons, hyphens or whitespace.")" "pkgver" + return 1 + fi } lint_pkgver() { diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 4885341..11e6459 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -824,7 +824,7 @@ download_sources() { # Re-sources the PKGBUILD afterwards to allow for other variables that use $pkgver update_pkgver() { newpkgver=$(run_function_safe pkgver) - if ! validate_pkgver "$newpkgver"; then + if ! check_pkgver "$newpkgver"; then error "$(gettext "pkgver() generated an invalid version: %s")" "$newpkgver" exit 1 fi -- 2.4.0
pkgbase should be subject to the same restrictions as pkgver Signed-off-by: Allan McRae <allan@archlinux.org> --- doc/PKGBUILD.5.txt | 6 ++++-- scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index bc278f2..62ae5c7 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -407,8 +407,10 @@ An optional global directive is available when building a split package: *pkgbase*:: The name used to refer to the group of packages in the output of makepkg and in the naming of source-only tarballs. If not specified, the first - element in the `pkgname` array is used. The variable is not allowed to - begin with a hyphen. + element in the `pkgname` array is used. Valid characters for members of + this variable are alphanumerics, and any of the following characters: + ```@ . _ + -`''. Additionally, the variable is not allowed to start with + hyphens or dots. Install/Upgrade/Remove Scripting diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in index abb40e0..0d4361c 100644 --- a/scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in +++ b/scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in @@ -34,4 +34,13 @@ lint_pkgbase() { error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname" return 1 fi + if [[ ${pkgbase:0:1} = "." ]]; then + error "$(gettext "%s is not allowed to start with a dot.")" "pkgbase" + ret=1 + fi + if [[ $pkgbase = *[^[:alnum:]+_.@-]* ]]; then + error "$(gettext "%s contains invalid characters: '%s'")" \ + 'pkgbase' "${i//[[:alnum:]+_.@-]}" + ret=1 + fi } -- 2.4.0
On 13/05/15 00:02, Allan McRae wrote:
pkgbase should be subject to the same restrictions as pkgver
Signed-off-by: Allan McRae <allan@archlinux.org> --- doc/PKGBUILD.5.txt | 6 ++++-- scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index bc278f2..62ae5c7 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -407,8 +407,10 @@ An optional global directive is available when building a split package: *pkgbase*:: The name used to refer to the group of packages in the output of makepkg and in the naming of source-only tarballs. If not specified, the first - element in the `pkgname` array is used. The variable is not allowed to - begin with a hyphen. + element in the `pkgname` array is used. Valid characters for members of
s/for members of//
+ this variable are alphanumerics, and any of the following characters: + ```@ . _ + -`''. Additionally, the variable is not allowed to start with + hyphens or dots.
Install/Upgrade/Remove Scripting diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in index abb40e0..0d4361c 100644 --- a/scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in +++ b/scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in @@ -34,4 +34,13 @@ lint_pkgbase() { error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname" return 1 fi + if [[ ${pkgbase:0:1} = "." ]]; then + error "$(gettext "%s is not allowed to start with a dot.")" "pkgbase" + ret=1 + fi + if [[ $pkgbase = *[^[:alnum:]+_.@-]* ]]; then + error "$(gettext "%s contains invalid characters: '%s'")" \ + 'pkgbase' "${i//[[:alnum:]+_.@-]}" + ret=1 + fi }
On 05/13/15 at 12:02am, Allan McRae wrote:
pkgbase should be subject to the same restrictions as pkgver
s/pkgver/pkgname/ ?
Signed-off-by: Allan McRae <allan@archlinux.org> --- doc/PKGBUILD.5.txt | 6 ++++-- scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index bc278f2..62ae5c7 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -407,8 +407,10 @@ An optional global directive is available when building a split package: *pkgbase*:: The name used to refer to the group of packages in the output of makepkg and in the naming of source-only tarballs. If not specified, the first - element in the `pkgname` array is used. The variable is not allowed to - begin with a hyphen. + element in the `pkgname` array is used. Valid characters for members of + this variable are alphanumerics, and any of the following characters: + ```@ . _ + -`''. Additionally, the variable is not allowed to start with + hyphens or dots.
Install/Upgrade/Remove Scripting diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in index abb40e0..0d4361c 100644 --- a/scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in +++ b/scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in @@ -34,4 +34,13 @@ lint_pkgbase() { error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname" return 1 fi + if [[ ${pkgbase:0:1} = "." ]]; then + error "$(gettext "%s is not allowed to start with a dot.")" "pkgbase" + ret=1 + fi + if [[ $pkgbase = *[^[:alnum:]+_.@-]* ]]; then + error "$(gettext "%s contains invalid characters: '%s'")" \ + 'pkgbase' "${i//[[:alnum:]+_.@-]}" + ret=1 + fi } -- 2.4.0
--- scripts/libmakepkg/.gitignore | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/scripts/libmakepkg/.gitignore b/scripts/libmakepkg/.gitignore index e5a6995..0b8f88f 100644 --- a/scripts/libmakepkg/.gitignore +++ b/scripts/libmakepkg/.gitignore @@ -1,16 +1,7 @@ lint_package.sh -lint_package/build_references.sh -lint_package/missing_backup.sh +lint_package/*.sh lint_pkgbuild.sh lint_pkgbuild/*.sh tidy.sh -tidy/docs.sh -tidy/emptydirs.sh -tidy/libtool.sh -tidy/optipng.sh -tidy/purge.sh -tidy/staticlibs.sh -tidy/strip.sh -tidy/upx.sh -tidy/zipman.sh +tidy/*.sh /util.sh -- 2.4.0
participants (2)
-
Allan McRae
-
Andrew Gregory