mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-28 18:29:39 +02:00
API function pbuild::unpack() added
This commit is contained in:
+12
-1
@@ -416,6 +416,14 @@ pbuild::set_default_patch_strip() {
|
||||
}
|
||||
readonly -f pbuild::set_default_patch_strip
|
||||
|
||||
#..............................................................................
|
||||
#
|
||||
pbuild::unpack(){
|
||||
local -r file="$1"
|
||||
local -r dir="${2:-${SRC_DIR}}"
|
||||
${tar} --directory="${dir}" -xv --strip-components 1 -f "${file}"
|
||||
}
|
||||
|
||||
#..............................................................................
|
||||
#
|
||||
# extract sources. For the time being only tar-files are supported.
|
||||
@@ -510,7 +518,10 @@ pbuild::prep() {
|
||||
unpack() {
|
||||
local -r file="$1"
|
||||
local -r dir="${2:-${SRC_DIR}}"
|
||||
${tar} --directory="${dir}" -xv --strip-components 1 -f "${file}" || {
|
||||
{
|
||||
mkdir -p "${dir}"
|
||||
pbuild::unpack "${file}" "${dir}"
|
||||
} || {
|
||||
${rm} -f "${file}"
|
||||
std::die 4 \
|
||||
"%s " \
|
||||
|
||||
Reference in New Issue
Block a user