summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-02-16 11:20:58 (EST)
committer P. J. McDermott <pjm@nac.net>2012-02-16 11:21:26 (EST)
commitab03bed726f4460276dd2c51a71dc99a39daa12d (patch)
treee6d8273d398bb24c44e3080ccce4d0e09a7e3a34 /lib
parentb308b59abcf8b37433335e2915a2ab5c6679847e (diff)
Fix source archive matching.
There were three things wrong: * '-', not '_', separates package name and version. * Double quotes seem to prevent pathname expansion. * ${OH_PKGVER} includes the package revision, if any.
Diffstat (limited to 'lib')
-rw-r--r--lib/archive10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/archive b/lib/archive
index 90cec3a..ed1de85 100644
--- a/lib/archive
+++ b/lib/archive
@@ -21,9 +21,9 @@
oh_archive_extract_source()
{
- _matches="../${OH_SRCPKG}_${OH_PKGVER}.tar.*"
+ _matches=$(echo ../${OH_SRCPKG}-${OH_PKGVER%-*}.tar.*)
- if [ "${_matches}" = ../${OH_SRCPKG}_${OH_PKGVER}.tar.\* ]; then
+ if [ "${_matches}" = ../${OH_SRCPKG}-${OH_PKGVER%-*}.tar.\* ]; then
# No archive found.
return 1
fi
@@ -37,7 +37,7 @@ oh_archive_extract_source()
# Note: dpkg's source format version 3 supports gzip, bzip2, LZMA, and XZ.
# We support gzip, bzip2, LZMA, and compress, since these are the formats
# supported by BusyBox tar.
- z_ext=${_matches#"../${OH_SRCPKG}_${OH_PKGVER}.tar."}
+ z_ext=${_matches#"../${OH_SRCPKG}-${OH_PKGVER%-*}.tar."}
case ${_z_ext} in
gz)
_z=z
@@ -56,7 +56,7 @@ oh_archive_extract_source()
;;
esac
- _files=$(tar -t${_z}f ../${OH_SRCPKG}_${OH_PKGVER}.tar.${_z_ext} | \
+ _files=$(tar -t${_z}f ../${OH_SRCPKG}-${OH_PKGVER%-*}.tar.${_z_ext} | \
grep -v '^./$')
if [ -z "$(echo "${_files}" | grep '/$')" ]; then
@@ -66,7 +66,7 @@ oh_archive_extract_source()
return 5
fi
- tar -x${_z}f ../${OH_SRCPKG}_${OH_PKGVER}.tar.${_z_ext} || return 6
+ tar -x${_z}f ../${OH_SRCPKG}-${OH_PKGVER%-*}.tar.${_z_ext} || return 6
mv "${_files}" src || return 7
}