aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2019-12-21 12:58:00 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2019-12-21 12:58:00 -0800
commit750a479f1c4d546e271fe29e1e3d67f9801523a7 (patch)
treeb0c05701899369aba11676fa8c37cc1d24a204dc
parentsnapshots-create.sh: change back to manual creation of new tarball (diff)
downloadmastermirror-scripts-750a479f1c4d546e271fe29e1e3d67f9801523a7.tar.gz
mastermirror-scripts-750a479f1c4d546e271fe29e1e3d67f9801523a7.tar.bz2
mastermirror-scripts-750a479f1c4d546e271fe29e1e3d67f9801523a7.zip
snapshots-create.sh: shellcheck cleanups
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-xsnapshots-create.sh38
1 files changed, 19 insertions, 19 deletions
diff --git a/snapshots-create.sh b/snapshots-create.sh
index 3ab7e28..cf2948a 100755
--- a/snapshots-create.sh
+++ b/snapshots-create.sh
@@ -106,8 +106,8 @@ write_time_log "END TARBALL(prep) $(date -u)"
# 1b) Create the tarball
COMMON_TAR_OPTIONS=(
# Force a small block size
- --blocking-factor=1
- --record-size=512
+ '--blocking-factor=1'
+ '--record-size=512'
# Tar format rationale:
# ---------------------
# Longest directory prefix, 94 chars:
@@ -127,38 +127,38 @@ COMMON_TAR_OPTIONS=(
# tarball.
# The differ/bdelta toolchain is also confirmed to work on posix tar
# format.
- --format=gnu
+ '--format=gnu'
# Sorting by name produces consistent ordering and helps compression of
# related content. Custom ordering might further improve ordering in future
# (eg all metadata.xml first)
- --sort=name
+ '--sort=name'
# Force ownership of content:
- --owner=portage
- --group=portage
+ '--owner=portage'
+ '--group=portage'
# Excluded content:
- --no-wildcards
- --exclude-from "${EXCLUSION_LIST}"
+ '--no-wildcards'
+ "--exclude-from='${EXCLUSION_LIST}'"
# Do not capture any xattr/acl info at all.
- --no-acls
- --no-xattrs
- --no-selinux
+ '--no-acls'
+ '--no-xattrs'
+ '--no-selinux'
# Include a volume ID for tracing
# volume header is NOT supported by:
# - Docker https://bugs.gentoo.org/631644
# - tarsync https://bugs.gentoo.org/631616
- #-V "${FILENAME%.bz2}"
+ #"--label='${FILENAME%.bz2}'"
# do everything relative to the destination
- -C "${MASTER}"
+ "--directory='${MASTER}'"
)
# create the tarball and move it to the right location
write_time_log "START TARBALL(tar,old) $(date -u)"
if [ ! -f "${FILENAME%.bz2}" ]; then
OLD_TARBALL_OPTIONS=(
# The . needs to match the file argument
- --transform='s,^\.,portage,g'
+ "--transform='s,^\\.,portage,g'"
# The operation, destination, source arguments
- --create
- --file ${FILENAME%.bz2}
+ '--create'
+ "--file='${FILENAME%.bz2}'"
.
)
tar \
@@ -203,10 +203,10 @@ if [ ! -f "${FILENAME_NEW%.xz}" ]; then
NEW_TARBALL_OPTIONS=(
# The . needs to match the file argument
- --transform="s,^\.,${FILENAME_NEW%%.*},g"
+ "--transform='s,^\\.,${FILENAME_NEW%%.*},g'"
# The operation, destination, source arguments
- --create
- --file ${FILENAME_NEW%.xz}
+ '--create'
+ "--file='${FILENAME_NEW%.xz}'"
.
)
tar \