The configure step naturally depends on Makefile.am and *.in files. However,
the automake process also generates Makefile.in files: exclude those from *.in.
This fixes spurious unnecessary rebuilds: especially when libosmocore had
modifications, it often rebuilt *twice* after this (causing all of the other
source trees to rebuild as well).
Change-Id: Ia6f48ac9a8b300440d23c9b495fb39b5e40b59d8
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 looks like the following now:
$ ./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, and use the stale config files
* Hit ^C and run 'make regen' to regenerate your configs
Change-Id: If225e094619a07a228e0e2f337153ee18cdb420c
Allow using "make regen" in the net dir to regenerate the configs, just
like it is possible to type "make regen" in the make dir.
This is a minor usability improvement, so one does not need to remember
to type ../fill_config.py in the net dir.
Change-Id: I8b23f8ae1f1d6ade597a30a222dfc82ea890d207
If there are multiple ${foo()} commands expanded in one iteration, there would
be offset mismatches because the changed string was used with regex offsets
from before the match. Re-run the regex after each change.
Change-Id: I69de60d840ff3ba115c37d1ede7ccbc8879c82eb
git has an internal concept of a branch's upstream branch, and the remote need
not be 'origin', and also, the upstream branch name may differ completely. So,
use git's {u} keyword to obtain the upstream branch name.
This removes all 'origin' strings from gits. Also, git_branch_exists() is no
longer needed, drop it.
Also remove a couple of default arguments which aren't ever used because we
always pass arguments anyway.
In the case of git_ahead_behind(), we would have use for a default
branch_upstream=None to imply calling git_branch_upstream(), but then during
rebase, if no upstream exists, we would invoke it twice to get None a second
time. So just call the function explicitly. I thought about returning an empty
string instead of None, but it's too convoluted.
In git_output(), pipe STDERR to STDOUT, because every time we parse a remote
ref (git ref-parse --abbrev-ref '%s{u}') and there is no remote branch, git
prints 'Fatal: there is no remote bla bla' on stdout, and that error is
expected / ok to happen, so it just clutters the 'gits' output. The easiest way
to achieve silence then is to pipe to STDOUT, IIUC otherwise we'd have to use
Popen() and communicate()... In the case of error, subprocess raises an
exception and we see that an error happens. In the ref-parse case we can simply
catch the exception and be quiet.
Change-Id: Ife146903ae1323a4e568587ccfd4018725e9d719
Ignore all files and folders that get created when following the README
and net/README instructions.
Change-Id: I62277f973cc8f1ee61c5244c9d8cc75775c7cfd9
Use 'git diff' instead of 'git diff-index'. The latter does not look at
the content. It listed a file with an updated timestap as modified
(indicated in gits with "MODS"), whereas 'git diff' and 'git status'
did not (and we want this behavior, not marking it as modified).
This was a regression from b93f50 ("gits: use git plumbing commands").
Change-Id: I6726190912a1b3eb865cda77fbea6bf58a635d6e
It's useful to include common parts in numerous cfg files, using the
${include(path)} command. So far they were called common_* and stored outside
of the templates dir (e.g. for logging). So far all files in a templates dir
are seen as templates, so the common files had to be stored in a different dir,
which is a bit senseless.
Allow storing them in the same dir with the templates: ignore all files
starting with 'common_'.
Change-Id: I74446dc0a7f51d4f231e8758a691abb675e87483
This patch indicates that we should rather use a proper templating python
library instead of re-inventing this stuff. But now that we're here...
Add a construct
${foreach(BTS)}
bts ${BTSn}
location_area_code ${BTSn_LAC}
${foreach_end}
that repeats for each BTS<nr> variable found, e.g.
BTS0_LAC=23
BTS1_LAC=24
BTS2_LAC=25
would result in three blocks of the above.
I am using this to avoid copy-pasting for configuring N BTSes for 35c3.
Change-Id: Ie1139a017f42cea5bf7ebbbe457bbc3bfe06944c
Instead of 'git status' and 'git branch', which change their output
depending on the git version and locale, use the low-level plumbing
commands.
'gits status' output is exactly the same, 'gits rebase' output is
a bit less redundant now (that was easier to implement).
Change-Id: I42544313d14db126c99e2d9a02b8f63031944947
I keep re-using this functionality in completely unrelated realms, and decided
to unify the oddly named scripts in a single 'gits' meta-repos tool, so I can
just symlink this script into my ~/bin and use it everywhere.
Change-Id: I579e7af26d76d5c5d83b2349695456bc7b54f5a2
osmo-trx shouldn't run with address sanitizer. But omitting --enable-sanitize
from osmo-trx breaks 'make check', so then the whole top-level makefile will
end in error with sanitize.opts.
A user wanting to build osmo-trx can just uncomment that line.
Change-Id: I589f49652f8fa4e5becc7d7e63e6e4bc1a8b33bb
Kamailio is a SIP server, that is relatively easy to configure, in
contrary to asterisk it only has one config file. The config file
here is based on the example config provided in the wiki:
<http://osmocom.org/projects/osmo-sip-conector/wiki/Howto>
To enable the osmo-sip-connector, build it, install kamailio and
then set SIPCON_ENABLE=true in your copy of config_2g_3g.
Change-Id: Ia5c4e9992eab390bc6d26ada7564223ff41a01b2
Allow all config files to use a new NET_DIR variable, which always
points to the network folder with the generated configs. We can use
this to place all temporary files (sockets, pid files, ...) there.
Change-Id: Idbdf478ebb9f0b2fcd860e5eff3c414a0a459561
That way one can view the MGCP traffic in wireshark without changing
the MGCP port. We are using a different IP for the two MGWs already, so
they won't conflict even if they use the same port.
Change-Id: I2c73df138642bc3fd52eea493fcab5261e5bc5c8