From aaaea1edc5783fc30906ecd17ef7d4a4f3cc00cd Mon Sep 17 00:00:00 2001 From: "R. J. Mathar" Date: Mon, 22 Nov 2021 14:09:38 -0500 Subject: [PATCH] Update {astro,mpcorb}2edb.pl Perl scripts to HTTPS --- GUI/xephem/auxil/astorb2edb.pl | 35 +++++++++++++++++++++------------- GUI/xephem/auxil/mpcorb2edb.pl | 14 +++++++------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/GUI/xephem/auxil/astorb2edb.pl b/GUI/xephem/auxil/astorb2edb.pl index 164e7e5..1c6754b 100755 --- a/GUI/xephem/auxil/astorb2edb.pl +++ b/GUI/xephem/auxil/astorb2edb.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl # convert astorb.txt to 2 .edb files. # Usage: [-f] -# if -f then use ftp to get the script from lowell, else read it from stdin. +# if -f then use curl to get the script from lowell, else read it from stdin. # is a prefix used in naming the generated .edb files. # Two files are created: # .edb contains only those asteroids which might ever be brighter @@ -9,7 +9,7 @@ # _dim.edb contains the remaining asteroids. # # astorb is a set of elements for 30k+ asteroids maintained by Lowell -# Observatory. See ftp://ftp.lowell.edu/pub/elgb/astorb.html. From the +# Observatory. See https://ftp.lowell.edu/pub/elgb/astorb.html. From the # Acknowledgments section of same: # The research and computing needed to generate astorb.dat were funded # principally by NASA grant NAGW-1470, and in part by the Lowell Observatory @@ -18,7 +18,7 @@ # made. # # grab RCS version -my $ver = '$Revision: 1.1 $'; +my $ver = '$Revision: 1.2 $'; $ver =~ s/\$//g; my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst, $me); my $XCN=<> 8; + if ($curl_return != 0) { + print "trying $cmd_v2\n"; + $curl_return = system "$cmd_v2"; + $curl_return = $curl_return >> 8; + } + if ($curl_return != 0) { + die "curl failed\n"; + } # explode print "Decompressing $ORBGZFILE ...\n"; @@ -246,4 +256,3 @@ sub fetch # flag $fetchok = 1; } - diff --git a/GUI/xephem/auxil/mpcorb2edb.pl b/GUI/xephem/auxil/mpcorb2edb.pl index aa4a04c..d761a16 100755 --- a/GUI/xephem/auxil/mpcorb2edb.pl +++ b/GUI/xephem/auxil/mpcorb2edb.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl # convert MPCORB.DAT to 2 .edb files. # Usage: [-f] -# if -f then use ftp to get the script from harvard, else read it from stdin. +# if -f then use curl to get the script from harvard, else read it from stdin. # is a prefix used in naming the generated .edb files. # Two files are created: # .edb contains only those asteroids which might ever be brighter @@ -9,7 +9,7 @@ # _dim.edb contains the remaining asteroids. # # mpcorb.dat is a service of the Minor Planet Center, -# http://cfa-www.harvard.edu/cfa/ps/mpc.html. +# https://www.minorplanetcenter.net/iau/MPCORB # # Copyright (c) 2000 Elwood Downey # 16 Mar 1999: first draft @@ -20,6 +20,7 @@ # 24 Sep 2004: only remove files if downloaded fresh # 1 Nov 2012: change from ftp to curl for better error handling. # 4 Jul 2014: change download site +# 12 Oct 2021: access to https: (R. J. Mathar) # grab RCS version my $ver = '$Revision: 1.3 $'; @@ -33,7 +34,7 @@ my $XCN=<