Skip to content
Snippets Groups Projects
Select Git revision
  • e909d45ab06e1bcd03e504d344a79b180728036f
  • experimental default protected
  • v2023.2.5-ffs
  • nrb/ex400-remove-wps
  • nrb/airmax-test
  • v2023.2.4-ffs
  • nrb/ar9344-reset-sequence
  • autinerd/experimental-openwrt-24.10
  • v2023.2.3-ffs
  • v2023.2.2-ffs
  • v2023.2-ffs
  • v2023.1-ffs
  • v2022.1.4-ffs
  • feature/addMikrotikwAP
  • v2022.1.3-ffs
  • v2021.1.2-ffs
  • v2022.1.1-ffs
  • master protected
  • v2021.1.1-ffs
  • nrb/gluon-master-cpe510
  • v2021.1-ffs
  • experimental-2025-07-04
  • experimental-2025-07-04-base
  • experimental-2025-07-01
  • experimental-2025-07-01-base
  • experimental-2025-06-25
  • experimental-2025-06-25-base
  • experimental-2025-06-24
  • experimental-2025-06-24-base
  • experimental-2025-06-22
  • experimental-2025-06-22-base
  • v2023.2.5-ffs0.1
  • experimental-2025-06-08
  • experimental-2025-06-08-base
  • experimental-2025-06-06
  • experimental-2025-06-06-base
  • experimental-2025-05-27
  • experimental-2025-05-27-base
  • experimental-2025-05-18
  • experimental-2025-05-18-base
  • experimental-2025-05-15
41 results

clean_output.sh

Blame
  • module_check.sh 1.33 KiB
    #!/usr/bin/env bash
    
    set -e
    
    . scripts/modules.sh
    
    GLUONDIR="$(pwd)"
    
    if [ ! -d "$GLUONDIR/openwrt" ]; then
    	echo "You don't seem to have obtained the external repositories needed by Gluon; please call \`make update\` first!"
    	exit 1
    fi
    
    need_sync=false
    
    for module in $GLUON_MODULES; do
    	echo "Checking module '$module'"
    	var=${module//\//_}
    	_remote_commit=${var^^}_COMMIT
    	commit_expected=${!_remote_commit}
    
    	prefix=invalid
    	cd "$GLUONDIR/$module" 2>/dev/null && prefix="$(git rev-parse --show-prefix 2>/dev/null)"
    	if [ "$prefix" ]; then
    		echo "*** No Git repository found at '$module'."
    		need_sync=true
    		continue
    	fi
    
    	commit_actual="$(git rev-parse heads/base 2>/dev/null)"
    	if [ -z "$commit_actual" ]; then
    		echo "*** No base branch found at '$module'."
    		need_sync=true
    		continue
    	fi
    
    	if [ "$commit_expected" != "$commit_actual" ]; then
    		echo "*** base branch at '$module' did not match module file (expected: ${commit_expected}, actual: ${commit_actual})"
    		need_sync=true
    		continue
    	fi
    
    	# Use git status instead of git diff -q, as the latter doesn't
    	# check for untracked files
    	if [ "$(git status --porcelain 2>/dev/null | wc -l)" -ne 0 ]; then
    		echo "*** Module '$module' has uncommitted changes:"
    		git status --short
    	fi
    done
    
    if $need_sync; then
    	echo
    	# shellcheck disable=SC2016
    	echo 'Run `make update` to sync dependencies.'
    	echo
    fi