diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/archive | 10 |
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 } |