[pacman-dev] [PATCH 01/10] makepkg: undeclared local variables
Variables that are only meaningful within the function they are declared in are
now prefixed by "local".
Signed-off-by: Andres P
As check_deps is run in a subshell, exit had the same meaning as return.
Since the intention is to halt makepkg when pacman throws an error other than
127, the enclosing function has to handle error control instead.
Fixes FS#19840
Signed-off-by: Andres P
The error message that has been removed never gets to print because, given the
same condition, handle_deps throws the same error and then immediately exits
makepkg.
Signed-off-by: Andres P
ERR trap was being toggled on and off in 3 places in confusingly different
ways. One of these ocurrances went untouched after this commit. Since disabling
the ERR trap is unintuitive enough, at least it should be done in a way that is
uniform across makepkg.
Also, in check_deps the ERR trap was being disabled before needed. If
the assignments included in the range were unsuccesful because the variables
had the readonly attribute, makepkg would've exited without "unknown error"
thanks to errexit.
Signed-off-by: Andres P
Combine changelog and install file creation as in previous commits.
Signed-off-by: Andres P
During check_sanity, use regex and abstract the series of variable checks into
a list.
Also add descriptive error message to exceptions involving backup array
members, given that "invalid backup entry" isn't all that communicative.
Signed-off-by: Andres P
Signed-off-by: Andres P
If optdepends was defined with empty members; optdepends=('' '' ''), the
behaviour would've been exit later rather than now, defeating the whole point
of the aptly named check_sanity.
Fixing this required changing the regex from <atom>* to <atom>+.
Also, move the regex into a var so that it doesn't need to be escaped and use
the standard i index to avoid having a destinct local assignment for every for
loop, which are numerous in this function.
Signed-off-by: Andres P
Here's how for loops work in bash and just about any language out there. If
$var expands to nothing, `for i in $var` does *not* iterate.
Taking this in mind, wrapping the whole loop in a "[[ -n $var ]]" conditional
is unnecesary, expands the variable twice, indents the whole block for no good
reason, and shows that there's no fluency.
Signed-off-by: Andres P
Make package_$pkgname a pointer to package() if it's not a split package.
Signed-off-by: Andres P
Signed-off-by: Andres P
On 26/06/10 09:16, Andres P wrote:
Signed-off-by: Andres P
--- scripts/makepkg.sh.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 59519a6..c770c7f 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1228,7 +1228,7 @@ check_sanity() { # evaluate any bash variables used eval file=${file} if [[ ! -f $file ]]; then - error "$(gettext "%s file (%s) does not exist.")" "${i^}" "$file" + error "$(gettext "%s file (%s) does not exist.")" "$i" "$file" return 1 fi done
Signed-off-by: Allan. On my working-maint branch.
participants (2)
-
Allan McRae
-
Andres P