Skip to content

Commit e26e71b

Browse files
committed
move old compat layer to a hidden suffixed dir
1 parent 525c914 commit e26e71b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scripts/ingest-tarball.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,13 @@ function ingest_compat_tarball() {
222222
then
223223
echo_yellow "Compatibility layer for version ${version}, OS ${os}, and architecture ${arch} already exists!"
224224
${cvmfs_server} transaction "${cvmfs_repo}"
225-
last_suffix=$((ls -1d ${compat_layer_path}-* | tail -n 1 | xargs basename | cut -d- -f2) 2> /dev/null)
225+
# hide the last dir in the path by prepending it with a dot
226+
hidden_compat_layer_path="$(dirname ${compat_layer_path})/.$(basename ${compat_layer_path})"
227+
last_suffix=$((ls -1d ${hidden_compat_layer_path}-* | tail -n 1 | xargs basename | cut -d- -f2) 2> /dev/null)
226228
new_suffix=$(printf '%03d\n' $((${last_suffix:-0} + 1)))
227-
old_layer_suffixed_path="${compat_layer_path}-${new_suffix}"
228-
echo_yellow "Moving the existing compat layer from ${compat_layer_path} to ${old_layer_suffixed_path}..."
229-
mv ${compat_layer_path} ${old_layer_suffixed_path}
229+
old_layer_hidden_suffixed_path="${hidden_compat_layer_path}-${new_suffix}"
230+
echo_yellow "Moving the existing compat layer from ${compat_layer_path} to ${old_layer_hidden_suffixed_path}..."
231+
mv ${compat_layer_path} ${old_layer_hidden_suffixed_path}
230232
tar -C "${CVMFS_ROOT}/${cvmfs_repo}/${basedir}/" -xzf "${tar_file}"
231233
${cvmfs_server} publish -m "updated compat layer for ${version}, ${os}, ${arch}" "${cvmfs_repo}"
232234
ec=$?

0 commit comments

Comments
 (0)