diff options
author | lolilolicon <lolilolicon@gmail.com> | 2011-10-06 14:14:46 +0800 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-10-06 02:10:25 -0500 |
commit | 22abe27bfa4f4e6c3ce3dfc345bb45a1f0666ab8 (patch) | |
tree | f78a3b5281058bf9e3a49f2b2a0be928a02ecb62 /test/util/pacsorttest.sh | |
parent | 4928f9edc371a4e4f90f329c9908f00cdbfe5bfb (diff) | |
download | pacman-22abe27bfa4f4e6c3ce3dfc345bb45a1f0666ab8.tar.xz |
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>
Diffstat (limited to 'test/util/pacsorttest.sh')
0 files changed, 0 insertions, 0 deletions