mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
tools/mkrelease: don't include directories themselves
They are no case of empty directory we would need to keep.
This commit is contained in:
committed by
Frans de Jonge
parent
9b434f0d97
commit
e18ea6c821
@@ -15,14 +15,12 @@ OPTIONS:
|
||||
-o OPTS, --options OPTS forward options to compressor
|
||||
"
|
||||
|
||||
# Note: we ignore directories (entries with no CRC).
|
||||
# shellcheck disable=SC2016
|
||||
declare -r AWK_HELPERS='
|
||||
function print_entry(path, size, crc) {
|
||||
sub("/$", "", path)
|
||||
if (crc != "")
|
||||
print path, size, crc
|
||||
else
|
||||
print path"/"
|
||||
}
|
||||
function reverse_entry() {
|
||||
$0 = $3" "$2" "$1;
|
||||
@@ -200,13 +198,9 @@ fi
|
||||
|
||||
# Don't forget the archive's internal manifest, if requested.
|
||||
if [[ -n "${manifest}" ]]; then
|
||||
manifest_path=("${manifest}")
|
||||
while [[ "${manifest_path[0]}" = */*[^/] ]]; do
|
||||
manifest_path=("${manifest_path[0]%/*}/" "${manifest_path[@]}")
|
||||
done
|
||||
{
|
||||
cat "${tmpdir}/paths"
|
||||
printf '%s\n' "${manifest_path[@]}"
|
||||
printf '%s\n' "${manifest}"
|
||||
} | sort -u -o "${tmpdir}/paths_with_manifest"
|
||||
install --mode=0644 -D "${tmpdir}/paths_with_manifest" "${tmpdir}/contents/${manifest}"
|
||||
if [[ -n "${manifest_transform}" ]]; then
|
||||
@@ -261,7 +255,6 @@ fi
|
||||
|
||||
# Make a copy of everything so we can later patch timestamps and
|
||||
# fix permissions to ensure reproducibility.
|
||||
# Note: We want to keep "empty" (with ignored files) directories.
|
||||
"${TAR}" --create --dereference --hard-dereference --no-recursion \
|
||||
--verbatim-files-from --files-from="${tmpdir}/paths" |
|
||||
"${TAR}" --extract --directory="${tmpdir}/contents"
|
||||
|
||||
Reference in New Issue
Block a user