From b4314a05875dfa32cf807717dc53722beca02bed Mon Sep 17 00:00:00 2001 From: zyphlar Date: Sun, 26 Oct 2025 00:53:21 -0700 Subject: [PATCH] Go back to sane path fix for subways; pull latest repos as needed Signed-off-by: zyphlar --- .forgejo/workflows/map-generator.yml | 24 ++++++++++++++++++------ tools/unix/maps/generate_subways.sh | 17 +++++++---------- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/.forgejo/workflows/map-generator.yml b/.forgejo/workflows/map-generator.yml index 369304fdd..874306e42 100644 --- a/.forgejo/workflows/map-generator.yml +++ b/.forgejo/workflows/map-generator.yml @@ -105,12 +105,14 @@ jobs: run: | apt-get update -y apt-get install -y jq curl wget wget2 rustc cargo git ca-certificates - - name: Clone wikiparser if necessary + - name: Clone/update wikiparser if necessary shell: bash run: | if [ ! -d /media/4tbexternal/wikiparser ]; then cd /media/4tbexternal git clone https://codeberg.org/comaps/wikiparser.git + else + cd wikiparser && git pull origin main fi - name: Check for planet file shell: bash @@ -190,13 +192,15 @@ jobs: zlib1g-dev rm -f /usr/lib/python*/EXTERNALLY-MANAGED pip3 install "protobuf<4" - - name: Clone main repo if necessary + - name: Clone or update main repo if necessary shell: bash run: | if [ ! -d /media/4tbexternal/comaps-init ]; then apt-get update -qq && apt-get install -y --no-install-recommends git cd /media/4tbexternal git clone --recurse-submodules --shallow-submodules -b rebase-generator-pastk-wb251014 --single-branch https://codeberg.org/comaps/comaps.git comaps-init + else + cd comaps-init && git pull origin rebase-generator-pastk-wb251014 fi - name: Update Isolines shell: bash @@ -232,19 +236,23 @@ jobs: apt-get update -qq && apt-get install -y --no-install-recommends curl osmctools osmium-tool python3-venv ca-certificates git python3-pip rm -f /usr/lib/python*/EXTERNALLY-MANAGED pip3 install "protobuf<4" - - name: Clone subways if necessary + - name: Clone/update subways repo if necessary shell: bash run: | if [ ! -d /media/4tbexternal/subways ]; then cd /media/4tbexternal git clone https://codeberg.org/comaps/subways.git + else + cd subways && git pull origin master fi - - name: Clone main repo if necessary + - name: Clone or update main repo if necessary shell: bash run: | if [ ! -d /media/4tbexternal/comaps-init ]; then cd /media/4tbexternal git clone --recurse-submodules --shallow-submodules -b rebase-generator-pastk-wb251014 --single-branch https://codeberg.org/comaps/comaps.git comaps-init + else + cd comaps-init && git pull origin rebase-generator-pastk-wb251014 fi - name: Update Subways shell: bash @@ -297,12 +305,14 @@ jobs: wget2 rm -f /usr/lib/python*/EXTERNALLY-MANAGED pip3 install "protobuf<4" - - name: Clone main repo if necessary + - name: Clone or update main repo if necessary shell: bash run: | if [ ! -d /media/4tbexternal/comaps-init ]; then cd /media/4tbexternal git clone --recurse-submodules --shallow-submodules -b rebase-generator-pastk-wb251014 --single-branch https://codeberg.org/comaps/comaps.git comaps-init + else + cd comaps-init && git pull origin rebase-generator-pastk-wb251014 fi - name: Build address_parser shell: bash @@ -372,12 +382,14 @@ jobs: libxcursor-dev \ libxi-dev \ zlib1g-dev - - name: Clone repo if necessary + - name: Clone or update main repo if necessary shell: bash run: | if [ ! -d /media/4tbexternal/comaps-init ]; then cd /media/4tbexternal git clone --recurse-submodules --shallow-submodules -b rebase-generator-pastk-wb251014 --single-branch https://codeberg.org/comaps/comaps.git comaps-init + else + cd comaps-init && git pull origin rebase-generator-pastk-wb251014 fi - name: Make output folders if necessary shell: bash diff --git a/tools/unix/maps/generate_subways.sh b/tools/unix/maps/generate_subways.sh index c2d7a76f5..99c555655 100755 --- a/tools/unix/maps/generate_subways.sh +++ b/tools/unix/maps/generate_subways.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -e -u -o pipefail -echo "1" + # Generate subways.transit.json file consumed by the maps generator. # Inputs: # - OSM planet in pbf format @@ -11,7 +11,7 @@ echo "1" source "$(dirname "$0")/helper_settings.sh" source "$REPO_PATH/tools/unix/helper_python.sh" -echo "2" + # Parameters for the process_subways.sh script: export PLANET="$PLANET_PBF" export SKIP_PLANET_UPDATE="1" @@ -30,22 +30,19 @@ export DUMP="$SUBWAYS_VALIDATOR_PATH" export GEOJSON="$SUBWAYS_VALIDATOR_PATH" export DUMP_CITY_LIST="$SUBWAYS_VALIDATOR_PATH/cities.txt" -export CITIES_INFO_FILE="$SUBWAYS_REPO_PATH/source_data/Rapid.csv" -ls -al "$SUBWAYS_REPO_PATH/source_data" +# cd to subways repo so relative paths work in the script pushd "$SUBWAYS_REPO_PATH" -#2>&1 | tee "$SUBWAYS_LOG" -./scripts/process_subways.sh +./scripts/process_subways.sh # 2>&1 | tee "$SUBWAYS_LOG" popd -echo "3" + # Make render.html available for map visualization on the web cp -r "$SUBWAYS_REPO_PATH"/render/* "$SUBWAYS_VALIDATOR_PATH/" TRANSIT_TOOL_PATH="$REPO_PATH/tools/python/transit" SUBWAYS_GRAPH_FILE="$SUBWAYS_PATH/subways.transit.json" -echo "4" + activate_venv_at_path "$TRANSIT_TOOL_PATH" -"$PYTHON" "$TRANSIT_TOOL_PATH/transit_graph_generator.py" "$MAPSME" "$SUBWAYS_GRAPH_FILE" -# 2>&1 | tee -a "$SUBWAYS_LOG" +"$PYTHON" "$TRANSIT_TOOL_PATH/transit_graph_generator.py" "$MAPSME" "$SUBWAYS_GRAPH_FILE" # 2>&1 | tee -a "$SUBWAYS_LOG" deactivate echo "Generated subways transit graph file:"