summaryrefslogtreecommitdiff
path: root/bin/poolify
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-07-02 19:29:19 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-07-02 19:29:19 -0400
commitd0e25535910ab36ac6029cbb6e89a1dab5dfbe8a (patch)
tree2446c35308147245e6e3d1b2872b9bba088db61b /bin/poolify
parent78866d966f44d4b9b7b3187e11bb5094dbff0ad0 (diff)
add mechanisms to avoid 2 of the overrides
Diffstat (limited to 'bin/poolify')
-rwxr-xr-xbin/poolify16
1 files changed, 13 insertions, 3 deletions
diff --git a/bin/poolify b/bin/poolify
index f47f2f3..6f9a109 100755
--- a/bin/poolify
+++ b/bin/poolify
@@ -14,11 +14,18 @@ main() {
shopt -s nullglob
echo '# Pass 1'
+ declare -A rewrite
+ rewrite[200109261739]=200303310700
while read -r snap name date time size; do
dirpart="${name%/*}"
filepart="${name##*/}"
- filedir=dat/pools/files/"${date//-/}${time//:/}-${name//\//_}"
+ datetime="${date//-/}${time//:/}"
+ datetime="${rewrite[$datetime]:-$datetime}"
+ filedir=dat/pools/files/"${datetime}-${name//\//_}"
snapdir=dat/pools/snaps/"${snap}-${dirpart//\//_}"
+ if [[ -d "${filedir/.OLD/}" ]]; then
+ filedir="${filedir/.OLD/}"
+ fi
mkdir -p -- "$filedir" "$snapdir"
ln -sr "$filedir/$filepart" "$snapdir"
done < "$1"
@@ -59,9 +66,7 @@ main() {
ln -sr "$filedir/$filepart" "$snapdir"
done
done < <(printf '%s\n' \
- '200303310700 PROGRAMS/CVTUTF ConvertUTF.c ConvertUTF.h harness.c' \
'200307291500 ALPHA/CVTUTF-1-1 ExpectedOutput.txt readme.txt' \
- '200412210100 PROGRAMS/CVTUTF.OLD CVTUTF7.C CVTUTF7.H' \
)
echo '# Pass 2'
@@ -75,6 +80,11 @@ main() {
fi
pools=(dat/pools/files/*-"${name//\//_}")
+ if [[ "$name" = *.OLD* ]]; then
+ pname="${name//\//_}"
+ pools+=(dat/pools/files/*-"${pname/.OLD/}")
+ readarray -t pools < <(printf '%s\n' "${pools[@]}" | sort)
+ fi
pools=("${pools[@]##*/}")
mypool=''