diff options
author | Lucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de> | 2017-11-20 21:45:21 +0000 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de> | 2017-11-21 00:51:43 +0000 |
commit | c27beab66023847435fb88cd5cc75916dca37057 (patch) | |
tree | c43c23133f5b837925785d5501aa4cff14980415 /subr/pkg_fetch_extract.subr | |
parent | d01c0269b8e5e467f82cd28392579c4c43fe63bc (diff) | |
download | midipix_build-c27beab66023847435fb88cd5cc75916dca37057.tar.bz2 midipix_build-c27beab66023847435fb88cd5cc75916dca37057.tar.xz |
Refactors build steps along the sequence {setup,fetch,configure,build,install}.
subr/mode_check_updates.subr: seperated into check_updates.sh.
subr/post_{copy_etc,sha256sums,tarballs}.subr: absorbed into `dist' target.
Diffstat (limited to 'subr/pkg_fetch_extract.subr')
-rw-r--r-- | subr/pkg_fetch_extract.subr | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/subr/pkg_fetch_extract.subr b/subr/pkg_fetch_extract.subr new file mode 100644 index 00000000..71155b44 --- /dev/null +++ b/subr/pkg_fetch_extract.subr @@ -0,0 +1,27 @@ +# +# set -o errexit -o noglob are assumed. +# + +pkg_fetch_extract() { + if [ -n "${PKG_URL}" ]\ + && [ "${PKG_URL_TYPE:-wget}" = wget ]; then + build_fileop rm "${PKG_BASE_DIR}/${PKG_SUBDIR}"; + if [ "${PKG_FNAME##*.tar.}" = "bz2" ]; then + bunzip2 -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; + elif [ "${PKG_FNAME##*.tar.}" = "gz" ]; then + gunzip -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; + elif [ "${PKG_FNAME##*.tar.}" = "xz" ]; then + xz -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; + elif [ "${PKG_FNAME##*.t}" = "bz2" ]; then + bunzip2 -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; + elif [ "${PKG_FNAME##*.t}" = "gz" ]; then + gunzip -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; + elif [ "${PKG_FNAME##*.t}" = "xz" ]; then + xz -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; + else + tar -C "${PKG_BASE_DIR}" -xf "${DLCACHEDIR}/${PKG_FNAME}"; + fi; + fi; +}; + +# vim:filetype=sh |