osmith has uploaded this change for review. ( https://gerrit.osmocom.org/12733


Change subject: More userfriendly "stale configs" message
......................................................................

More userfriendly "stale configs" message

Make the message easy to understand at first glance, print what needs to
be done to regenerate the configs. Add an empty line before listing the
stale file that has been found, so it stands out from the (at this
point) less relevant path listings. It now looks like the following:

$ ./run.sh
using config file '/home/user/code/osmo-dev/net/config_2g3g_osmith'
on templates '/home/user/code/osmo-dev/net/tmpl_std'
with NET_DIR '/home/user/code/osmo-dev/net/osmith'

Stale: '/home/user/code/osmo-dev/net/tmpl_std/run.sh' is newer than 'run.sh'

WARNING: STALE CONFIGS - your net configs are older than the templates they 
should be based on!
 * Hit enter to continue
 * Hit ^C and run 'make regen' to regenerate your configs

Change-Id: If225e094619a07a228e0e2f337153ee18cdb420c
---
M net/fill_config.py
M net/tmpl_std/run.sh
2 files changed, 9 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/33/12733/1

diff --git a/net/fill_config.py b/net/fill_config.py
index e97dab7..5374d62 100755
--- a/net/fill_config.py
+++ b/net/fill_config.py
@@ -96,6 +96,7 @@

 def check_stale(src_path, target_path):
   if file_newer(src_path, target_path):
+    print()
     print('Stale: %r is newer than %r' % (src_path, target_path))
     exit(1)

diff --git a/net/tmpl_std/run.sh b/net/tmpl_std/run.sh
index f31330b..2bc7308 100755
--- a/net/tmpl_std/run.sh
+++ b/net/tmpl_std/run.sh
@@ -1,5 +1,12 @@
 #!/usr/bin/env bash
-../fill_config.py --check-stale || ( echo "STALE CONFIGS. Hit enter to 
continue anyway."; read enter_to_continue )
+
+if ! ../fill_config.py --check-stale; then
+       echo
+       echo "WARNING: STALE CONFIGS - your net configs are older than the 
templates they should be based on!"
+       echo " * Hit enter to continue"
+       echo " * Hit ^C and run 'make regen' to regenerate your configs"
+       read enter_to_continue
+fi

 dev="${ETH_DEV}"
 ip2="${PUBLIC_IP2}"

--
To view, visit https://gerrit.osmocom.org/12733
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If225e094619a07a228e0e2f337153ee18cdb420c
Gerrit-Change-Number: 12733
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>

Reply via email to