mirror of
https://github.com/oasislinux/oasis.git
synced 2025-12-14 20:35:43 +01:00
Use our own pax for extracting archives
This reduces dependencies and variability in pax implementations.
This commit is contained in:
@@ -392,12 +392,16 @@ end
|
||||
|
||||
function fetch(method)
|
||||
local script
|
||||
local deps = {'|', '$dir/ver', script}
|
||||
if method == 'local' then
|
||||
script = '$dir/fetch.sh'
|
||||
else
|
||||
script = '$basedir/scripts/fetch-'..method..'.sh'
|
||||
if method == 'curl' then
|
||||
table.insert(deps, '$builddir/pkg/pax/host/pax')
|
||||
end
|
||||
end
|
||||
build('fetch', '$dir/fetch', {'|', '$dir/ver', script}, {script=script})
|
||||
build('fetch', '$dir/fetch', deps, {script=script})
|
||||
if basedir ~= '.' then
|
||||
build('phony', '$gendir/fetch', '$dir/fetch')
|
||||
end
|
||||
|
||||
@@ -125,7 +125,7 @@ rule fspec-tar
|
||||
command = $builddir/pkg/fspec-sync/host/fspec-tar <$in | zstd >$out
|
||||
|
||||
rule fetch
|
||||
command = cd $basedir && sh $$OLDPWD/$script $gendir && touch $$OLDPWD/$out
|
||||
command = cd $basedir && PAX=$$OLDPWD/$builddir/pkg/pax/host/pax sh $$OLDPWD/$script $gendir && touch $$OLDPWD/$out
|
||||
description = FETCH $gendir
|
||||
restat = 1
|
||||
generator = 1
|
||||
|
||||
@@ -8,11 +8,4 @@ case $file in
|
||||
*) exit 0
|
||||
esac
|
||||
|
||||
if command -v bsdtar >/dev/null; then
|
||||
exec bsdtar -xf "$file" "$@"
|
||||
elif command -v pax >/dev/null; then
|
||||
"$tool" -d -c "$file" | pax -r "$@"
|
||||
else
|
||||
printf '%s: bsdtar or pax is required' "$0" >&2
|
||||
exit 1
|
||||
fi
|
||||
"$tool" -d -c "$file" | "$PAX" -r "$@"
|
||||
|
||||
@@ -20,7 +20,7 @@ if ! sh "$OLDPWD/scripts/checksum.sh" -c sha256 2>/dev/null ; then
|
||||
fi
|
||||
|
||||
while read -r _ archive ; do
|
||||
sh "$OLDPWD/scripts/extract.sh" "$archive" -s ',^[^/]*,src,' '*/*'
|
||||
sh "$OLDPWD/scripts/extract.sh" "$archive" -s ',^[^/]*,src,'
|
||||
done <sha256
|
||||
|
||||
if [ -d patch ] ; then
|
||||
|
||||
Reference in New Issue
Block a user