From 44a13b526fe81bea945f5f28a56f63f5adbe3be6 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Sun, 12 Mar 2023 20:31:36 +0100 Subject: [PATCH] update readme --- README.md | 2 +- tests-ng/compare.sh | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4e37aa1..0129cf1 100644 --- a/README.md +++ b/README.md @@ -255,7 +255,7 @@ Each line contains the following fields: * **indexed_at**: when this entry was indexed * **maccess**: the entry modification date/time * **md5**: the entry checksum (if any) -* **nbfiles**: the number of children (empty for not storage or directory nodes) +* **nbfiles**: the number of children (empty for nodes that are not storage or directory) * **free_space**: free space (empty for not storage nodes) * **total_space**: total space (empty for not storage nodes) * **meta**: meta information (empty for not storage nodes) diff --git a/tests-ng/compare.sh b/tests-ng/compare.sh index ba33d66..32e383c 100755 --- a/tests-ng/compare.sh +++ b/tests-ng/compare.sh @@ -50,12 +50,14 @@ catalog="${tmpd}/catalog" # index ${bin} -B index -c --catalog="${catalog}" github .github +ls -laR .github +cat "${catalog}" #cat "${catalog}" echo "" # compare keys -echo "compare keys" +echo "[+] compare keys" src="tests-ng/assets/github.catalog.json" src_keys="${tmpd}/src-keys" dst_keys="${tmpd}/dst-keys" @@ -69,7 +71,7 @@ diff "${src_keys}" "${dst_keys}" echo "ok!" # compare children 1 -echo "compare children 1" +echo "[+] compare children 1" src_keys="${tmpd}/src-child1" dst_keys="${tmpd}/dst-child1" cat "${src}" | jq '. | select(.type=="top") | .children | .[].name' | sort > "${src_keys}" @@ -82,7 +84,7 @@ diff "${src_keys}" "${dst_keys}" echo "ok!" # compare children 2 -echo "compare children 2" +echo "[+] compare children 2" src_keys="${tmpd}/src-child2" dst_keys="${tmpd}/dst-child2" cat "${src}" | jq '. | select(.type=="top") | .children | .[] | select(.name=="github") | .children | .[].name' | sort > "${src_keys}" @@ -95,7 +97,7 @@ diff "${src_keys}" "${dst_keys}" echo "ok!" # compare children 3 -echo "compare children 3" +echo "[+] compare children 3" src_keys="${tmpd}/src-child3" dst_keys="${tmpd}/dst-child3" cat "${src}" | jq '. | select(.type=="top") | .children | .[] | select(.name=="github") | .children | .[] | select(.name=="workflows") | .children | .[].name' | sort > "${src_keys}" @@ -108,21 +110,21 @@ diff "${src_keys}" "${dst_keys}" echo "ok!" # native -echo "compare native output" +echo "[+] compare native output" native="${tmpd}/native.txt" ${bin} -B ls -s -r --format=native --catalog="${catalog}" > "${native}" mod="${tmpd}/native.mod.txt" cat "${native}" | sed -e 's/free:.*%/free:0.0%/g' \ -e 's/date:....-..-.. ..:..:../date:2023-03-09 16:20:59/g' \ -e 's#du:[^|]* |#du:0/0 |#g' > "${mod}" -if command -v delta; then +if command -v delta >/dev/null; then delta -s "tests-ng/assets/github.catalog.native.txt" "${mod}" fi diff --color=always "tests-ng/assets/github.catalog.native.txt" "${mod}" echo "ok!" # csv -echo "compare csv output" +echo "[+] compare csv output" csv="${tmpd}/csv.txt" ${bin} -B ls -s -r --format=csv --catalog="${catalog}" > "${csv}" # modify created csv @@ -134,7 +136,7 @@ ori="${tmpd}/ori.mod.txt" cat "tests-ng/assets/github.catalog.csv.txt" | \ sed 's/....-..-.. ..:..:..//g' | \ sed 's/"2","[^"]*","[^"]*",""/"2","0","0",""/g' > "${ori}" -if command -v delta; then +if command -v delta >/dev/null; then delta -s "${ori}" "${mod}" fi diff "${ori}" "${mod}"