On Wed, 5 Sep 2018 10:42:04 +0200
"E.Pasma" <[email protected]> wrote:
> John Found wrote:
> > In order to write an autoupdater, I need to download the latest SQLite
> > amalgamation.
> > Is there a permanent link to the subject, or the only way is to parse the
> > download page
> > for links to "sqlite-amalgamation-*.zip" or to build it from the fossil
> > checkout?
>
> The apsw installer, setup.py, can parse the download page. This has likely
> been tested very well:
>
> # work out the version
> if self.version is None:
> write(" Getting download page to work out current SQLite
> version")
> page=self.download("https://sqlite.org/download.html", text=True,
> checksum=False)
>
> match=re.search(r'sqlite-amalgamation-3([0-9][0-9])([0-9][0-9])([0-9][0-9])\.zip',
> page)
> if match:
> self.version="3.%d.%d.%d" % tuple([int(match.group(n)) for n
> in range(1,4)])
> if self.version.endswith(".0"):
> self.version=self.version[:-len(".0")]
> else:
> write("Unable to determine current SQLite version. Use
> --version=VERSION", sys.stderr)
>
>
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Well, IMHO every solution that parses the html page in order to extract the
links is bad solution by definition.
I would prefer another workaround - compiling from source - much more reliable
IMHO:
echo "Downloading latest SQLite source archive..."
{ wget -q -O -
https://www.sqlite.org/cgi/src/tarball/sqlite3.tar.gz?r=release | tar -xz 2>
/dev/null; } || { echo >&2 "Error: Can't download SQLite sources."; exit 2;}
cd ./sqlite3
echo "Building the amalgamation sqlite3.c ..."
./configure > /dev/null 2>&1 || { echo >&2 "Error: Can't configure SQLite
sources"; exit 4; }
make sqlite3.c > /dev/null 2>&1 || { echo >&2 "Error: Can't make
sqlite3.c"; exit 4; }
cd ..
cp ./sqlite3/sqlite3.c ./
rm -rf ./sqlite3/ &
Unfortunately this process is pretty slow, especially on my low-end machine...
That is why I asked about permanent link that needs much less CPU cycles and
network bandwidth.
Regards
--
John Found <[email protected]>
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users