sf-downloader is a script created to automate the downloading of software’s latest versions (from sourceforge.net initially). It find the correct download link for the software, and then download it and, if needed, extract it. This guide describe its installation on Debian.
This howto is tested on:
- Debian 10.0 Buster
This howto is tested with these versions of the software:
- 1.3.7
Requirements
This howto recommends :
Installation
Detect if sudo is available (“command” is used if not):
cmdProxy='command'
command type -f 'sudo' &>'/dev/null' && cmdProxy='sudo'
Install the software’s requirements:
${cmdProxy} apt install 'tar' 'gzip' 'bzip2' 'unzip' 'wget'
Install the software:
${cmdProxy} wget 'https://raw.github.com/biapy/howto.biapy.com/master/various/sf-downloader' \
--quiet --no-check-certificate --output-document='/usr/local/bin/sf-downloader'
${cmdProxy} chmod +x '/usr/local/bin/sf-downloader'
Automatic updates
Configure biapy-updater automatic updates to check for newer versions of the software:
${cmdProxy} tee -a '/etc/biapy-updater.conf' <<< 'sf-downloader'
Usage examples
Display the tool help:
${cmdProxy} sf-downloader --help
Download from sourceforge.net
Download a project (“xmlrpc-c” for this example) from sourceforge.net:
command sf-downloader --tgz 'xmlrpc-c' 'xmlrpc-c-VERSION.tgz'
The arguments are:
- –tgz : Extract the downloaded tar.gz file.
- ‘xmlrpc-c’: the sourceforge.net project name.
- ‘xmlrpc-c-VERSION.tgz’: the downloaded file name template used to detect the newest version.
The command print a path containing the extracted download.
Download from any website
Download a release (“COPS” for this example) from any website (“github.com/seblucas/cops/releases” for this example):
command sf-downloader \
--output-directory="/var/www/cops.domain.com" \
--generic='https://github.com/seblucas/cops/releases' \
--zip 'cops' 'cops-VERSION.zip'
The arguments are:
- –output-directory=: set the path where the downloaded file is extracted.
- –generic=: Set the URL were the link to the downloaded file is shown. Used to detect the latest version of the downloaded file.
- –zip : Extract the downloaded ZIP file.
- ‘cops’: The project name. Unused value when the download does not come from sourceforge.
- ‘cops-VERSION.zip’: the downloaded file name template used to detect the newest version.
The command print the –install-path option value which contain the extracted download.
0 Comments