bacman: use globbing to get local package db path
The original code- pkg_dir="$(echo $pac_db/$pkg_name-[0-9]*)" is
problematic in several ways:
- $pac_db and $pkg_name should be quoted, obviously.
- It assumes pkgver always starts with an integer, while in fact
it just can't contain ':' and '-'.
Counterexample: the code breaks on lshw B.02.15-1.
- It assumes there are no more than one directory matching the
pattern. While this should be the case if everything works
perfectly, it certainly relies on external conditions.
Counterexample: if the local db contains two packages named
foo and foo-3g, even if everything else is perfect, the code
will match two directories.
Don't make assumptions, use what is known.
Signed-off-by: lolilolicon <lolilolicon@gmail.com>
0 files changed, 0 insertions, 0 deletions