Commit Graph

16 Commits

Author SHA1 Message Date
Eli Schwartz 8f5a02b23d
Don't rely on $0 to determine script names.
Programs can freely define the value of argv0 and thus it means nothing.
Instead, use the bash-specific variable explicitly designed to safely
and accurately reference the name of the currently sourced file.

This also fixes the case where simple debugging mechanisms like using
"bash -x foo" tried to treat "foo" as the unqualified $0 and therefore
broke horribly due to lack of pathnames.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2019-08-09 19:41:51 +02:00
Erich Eckner 321e998020
fix whitespace/indentation errors
Some lines are indented by spaces, while adjacent lines are indentet by tabs.
We should use tabs on both.

Signed-off-by: Erich Eckner <git@eckner.net>
2019-04-20 17:58:55 +02:00
Jelle van der Waa 23f248ccfb find-libdeps: fix indentation in case
Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl>
2019-03-16 18:27:13 +01:00
Levente Polyak 799376904d
find-libdeps: in functions use return instead of continue to abort
Even if continue would work, it does exactly the same as a return
in the way this function is being used.
2019-01-22 03:32:50 +01:00
Luke Shumaker a396a69081
Make slightly more involved changes to make shellcheck happy.
- Use `read -r` instead of other forms of read or looping
 - Use arrays instead of strings with whitespaces.
 - In one instance, use ${var%%.*} instead of $(echo $var|cut -f. -d1)
2017-07-05 18:21:56 +02:00
Luke Shumaker 78fabcfa06
Quote strings that shellcheck warns about.
These changes are all strictly "slap some double-quotes in there".
Anything more than that is not included in this commit.
2017-07-05 18:21:56 +02:00
Luke Shumaker 3f72579b28
Make purely stylistic changes to make shellcheck happier.
These are purely stylistic changes that make shellcheck complain less.

This does NOT include things like quoting currently unquoted variables.
2017-07-05 18:21:55 +02:00
Luke Shumaker 14d5e1c21b
Add a "License:" tag to all code files.
In cases where there is no license specified, the file is tagged as
"License: Unspecified".  Obviously, that is not ideal, but it
highlights the fact, and I hope that it encourages whoever has the
authority to specify the license to do so.

On that note, to anyone who may have the authority to specify the
license of files in devtools: the current licence of many files is
GPLv2 with no option for later versions; I impore you to re-license
them to have the "or any later version" option.
2017-04-05 22:10:03 +02:00
Dave Reisner f743f58682 find-libdeps: cleanup some quoting/array concerns 2014-10-25 11:36:21 -04:00
Dave Reisner be3c71fa81 avoid injecting code into the format string
Now that die() properly forwards arguments to error(), we can expect
that the first arg is a format string and not the entirety of the
output.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-08-08 21:28:10 +02:00
Florian Pritz c5893672a6 find-libdeps: fix extraction of soname
libperl.so results in soname="libperl.so.so" which is wrong.

This returns the correct string: "libperl.so"

Fix-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-03-04 22:25:22 +01:00
Florian Pritz 4d4ffb5d8f find-libdeps: fix syntax error
The problem has been introduced in commit
56d4dec19f

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-01-18 11:06:52 +01:00
Lukas Fleischer 56d4dec19f Use double brackets everywhere
We already fixed a couple of these in previous patches - this one should
replace all remaining uses of single brackets ("[") by double brackets.
Also, use arithmetic evaluation instead of conditional expressions where
appropriate and make use of "-z" and "-n" instead of comparing variables
to empty strings.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-12-04 18:00:57 +01:00
Eric Bélanger 42d821ef7b Capitalize output messages
Some of the output/error messages were capitalized, some were
not. This patch capitalize everything for consistency sake. Other
minor changes were done to the messages like removing the superfluous
"error:" from die messages and adding a final period to messages that
were complete sentences as appropriate.

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-11-04 19:33:29 +01:00
Pierre Schmitz aaa68e49e8 Move common functions to a shared file
* common.sh is included on build time
* most functions are copied from makepkg
2011-11-01 15:33:08 +01:00
Florian Pritz 7c78599a61 add libdepends script
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-10-31 22:57:12 +01:00