travisgoodspeed / md380tools

Python tools and patched firmware for the TYT-MD380
804 stars 245 forks source link

MacOS dependency for circumvention for real time data dump unavailability on dmr-marc #866

Closed jcmurray closed 6 years ago

jcmurray commented 6 years ago

The circumvention for the the real time data dump no longer being available on dmr-marc doesn't work on MacOS :-)

The defect

The following line was updated in db/Makefile in commit: ec7550dd0ed6300001026aff353e15536a629264

dmrmarc.tmp:
    timeout 120 wget --no-check-certificate --wait=3 'https://dmr-marc.net/static/users.csv' -O $@

Unfortunately there is no timeout command on MacOS so the Makefile bails when updating the database ( make updatedb ).

Possible circumventions I've thought of

some_shell_command & sleep 5; kill $!

which achieves the same effect as timeout -- at least from a shell prompt. However, it doesn't work when executed as a Makefile recipe due to the way that Make launches the system commands in a rule :-(

Just some thoughts. My own temporary 'fix' is to remove the timeout for the moment.

ghost commented 6 years ago

Is the MacOS wget the GNU wget? Actually, what I'm asking is, does it support the --timeout flag that GNU wget has? If so, that seems like the best option.

jcmurray commented 6 years ago

It's the GNU wget on MacOS if you use Home-brew to install/manage it.

$ brew info wget 
wget: stable 1.19.4 (bottled), HEAD
Internet file retriever
https://www.gnu.org/software/wget/
/usr/local/Cellar/wget/1.19.1_1 (11 files, 1.6MB)
  Poured from bottle on 2017-06-05 at 19:20:41
/usr/local/Cellar/wget/1.19.2 (11 files, 1.7MB)
  Poured from bottle on 2017-10-29 at 09:29:45
/usr/local/Cellar/wget/1.19.2_1 (50 files, 3.8MB)
  Poured from bottle on 2017-12-19 at 10:25:36
/usr/local/Cellar/wget/1.19.4 (50 files, 3.7MB)
  Poured from bottle on 2018-01-22 at 18:31:42
/usr/local/Cellar/wget/1.19.4_1 (50 files, 3.7MB) *
  Poured from bottle on 2018-01-28 at 19:50:46
...
ghost commented 6 years ago

@jcmurray I tested with a friend's macbook before pushing, so I believe this solves the problem. Thanks for the bug report and recommendations!

jcmurray commented 6 years ago

@mach327 git pull'ed the updated and checked it on my MacBook Pro. Works just fine now. Thanks!