Revert "build-system: configurable number directory components to be strip"

This reverts commit 58f6a2ed4e.
This commit is contained in:
2024-04-16 15:53:05 +02:00
parent 58f6a2ed4e
commit 396dc70bcc
3 changed files with 10 additions and 29 deletions
-3
View File
@@ -17,9 +17,6 @@
* Option '--clean-install' added. If this option is set, the
module is removed before building, if the module already
exist. (issue #247)
* The number of directory components to be removed while
un-taring can now be configured in the YAML configuration
file. If not specified, 1 is used as default. (issue #251)
## Version 1.1.18
### modulecmd
+9 -17
View File
@@ -18,7 +18,6 @@ declare -r _DOCDIR='share/doc'
declare -a SOURCE_URLS=()
declare -a SOURCE_SHA256_SUMS=()
declare -a SOURCE_NAMES=()
declare -a SOURCE_STRIP_DIRS=()
declare -A SOURCE_UNPACK_DIRS=()
declare -a CONFIGURE_ARGS=()
declare -a PATCH_FILES=()
@@ -399,6 +398,11 @@ pbuild::set_download_url() {
std::info \
"Using ${FUNCNAME} is deprecated with YAML module configuration files."
fi
pbuild.set_urls "$@"
}
readonly -f pbuild::set_download_url
pbuild.set_urls(){
local -i _i=${#SOURCE_URLS[@]}
SOURCE_URLS[_i]=$1
if (( $# > 1 )); then
@@ -406,15 +410,6 @@ pbuild::set_download_url() {
else
SOURCE_NAMES[$_i]="${1##*/}"
fi
SOURCE_STRIP_DIRS[_i]='1'
}
readonly -f pbuild::set_download_url
pbuild.set_urls(){
local -i _i=${#SOURCE_URLS[@]}
SOURCE_URLS[_i]="$1"
SOURCE_NAMES[$_i]="$2"
SOURCE_STRIP_DIRS[_i]="$3"
}
#..............................................................................
@@ -500,8 +495,7 @@ readonly -f pbuild::set_default_patch_strip
pbuild::unpack(){
local -r file="$1"
local -r dir="${2:-${SRC_DIR}}"
local -r strip="${3:-1}"
${tar} --directory="${dir}" -xv --strip-components "${strip}" -f "${file}"
${tar} --directory="${dir}" -xv --strip-components 1 -f "${file}"
}
#..............................................................................
@@ -607,11 +601,10 @@ pbuild::prep() {
unpack() {
local -r file="$1"
local -r dir="$2"
local -r strip="$3"
local -r dir="${2:-${SRC_DIR}}"
{
mkdir -p "${dir}"
pbuild::unpack "${file}" "${dir}" "${strip}"
pbuild::unpack "${file}" "${dir}"
} || {
${rm} -f "${file}"
std::die 4 \
@@ -664,8 +657,7 @@ pbuild::prep() {
else
dir="${SRC_DIR}"
fi
local strip_dirs="${SOURCE_STRIP_DIRS[i]}"
unpack "${source_fname}" "${dir}" "${strip_dirs}"
unpack "${source_fname}" "${dir}"
done
patch_sources
# create build directory
+1 -9
View File
@@ -1143,7 +1143,6 @@ build_modules_yaml_v1(){
std::die 3 "error parsing YAML configuration"
local url=''
local fname=''
local strip_dirs=''
while read key value; do
key=${key:0:-1}
case "${key}" in
@@ -1153,10 +1152,6 @@ build_modules_yaml_v1(){
name )
fname=$(envsubst <<<"${value}")
;;
strip_dirs )
strip_dirs="${value}"
# :FIXME: add check for unsigned int!
;;
* )
std::die 3 "Invalid key in list of URLs -- ${key}"
;;
@@ -1165,10 +1160,7 @@ build_modules_yaml_v1(){
std::die 3 "URL missing!"
fi
done <<<"${url_yaml}"
[[ -z "${url}" ]] && std::die 3 "url missing in:\n${yaml}"
[[ -z "${fname}" ]] && fname="${url##*/}"
[[ -z "${strip_dirs}" ]] && strip_dirs=1
pbuild.set_urls "${url}" "${fname}" "${strip_dirs}"
pbuild.set_urls "${url}" "${fname}"
done
}