From 8d49e75a0b57c1ff61e48cbfcefe7857bcb8c628 Mon Sep 17 00:00:00 2001 From: kxtzownsu Date: Fri, 21 Mar 2025 02:28:17 -0400 Subject: [PATCH] fix create_out pulling the older PKIMetadata instead of the new one Signed-off-by: kxtzownsu --- scripts/create_out.sh | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/scripts/create_out.sh b/scripts/create_out.sh index 37f32c3..6747995 100755 --- a/scripts/create_out.sh +++ b/scripts/create_out.sh @@ -21,29 +21,31 @@ then "$CHROME" chrome://components # &> /dev/null & exit 0 fi -HIGHESTVERSIONAPPARENTLY=$(find "$HOME/.config/$CHROME/PKIMetadata/" -maxdepth 1 -mindepth 1 -type d| head -n 1) -if [ -z ${HIGHESTVERSIONAPPARENTLY} ]; then - echo "Failed to find PKIMetadata directory" - exit 1 +HIGHESTVERSIONAPPARENTLY=$(find "$HOME/.config/$CHROME/PKIMetadata/" -maxdepth 1 -mindepth 1 -type d \ + | sort -V | tail -n 1) + +if [ -z "$HIGHESTVERSIONAPPARENTLY" ]; then + echo "Failed to find PKIMetadata directory" + exit 1 fi -mkdir -p original/PKIMetadata/9999 +mkdir -p "${SCRIPT_DIR}/../original/PKIMetadata/9999" if [ "$HIGHESTVERSIONAPPARENTLY" != "" ]; then - cp -rvf "$HIGHESTVERSIONAPPARENTLY"/. original/PKIMetadata/9999 + cp -rvf "$HIGHESTVERSIONAPPARENTLY"/. "${SCRIPT_DIR}/../original/PKIMetadata/9999" else echo "Variable HIGHESTVERSIONAPPARENTLY returned empty, failing." exit 1 fi -rm -rvf original/PKIMetadata/9999/_metadata -rm -rvf original/PKIMetadata/9999/manifest.fingerprint +#rm -rvf "${SCRIPT_DIR}/../original/PKIMetadata/9999/_metadata" +#rm -rvf "${SCRIPT_DIR}/../original/PKIMetadata/9999/manifest.fingerprint" # Copy all directories, and will be modified by future calls -rm -rvf "${SCRIPT_DIR}"/../out +#rm -rvf "${SCRIPT_DIR}"/../out mkdir "${SCRIPT_DIR}"/../out mkdir -p "${SCRIPT_DIR}"/../out/PKIMetadata/. cp -rvf "${SCRIPT_DIR}"/../original/PKIMetadata/9999/. "${SCRIPT_DIR}"/../out/PKIMetadata -rm -rvf "${SCRIPT_DIR}"/../out/PKIMetadata/_metadata # verified contents not necessary -rm -rvf "${SCRIPT_DIR}/../out/PKIMetadata/"*.fingerprint +#rm -rvf "${SCRIPT_DIR}"/../out/PKIMetadata/_metadata # verified contents not necessary +#rm -rvf "${SCRIPT_DIR}/../out/PKIMetadata/"*.fingerprint python3 ./src/root_store_gen/generate_new_pbs.py "${SCRIPT_DIR}/../original/PKIMetadata/9999/crs.pb" "$@" "${SCRIPT_DIR}/../out/PKIMetadata/crs.pb" # Modify version in manifest @@ -58,4 +60,4 @@ x = json.loads(dat) x['version'] = "9999" print(json.dumps(x)) newfile.write_text(json.dumps(x)) -EOF \ No newline at end of file +EOF