biapy-downloader is a script created to automate the downloading of software’s latest versions. It find the URL of the latest version of the software, download its content 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:

  • 0.0.2

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/biapy-downloader' \
    --quiet --no-check-certificate --output-document='/usr/local/bin/biapy-downloader'
${cmdProxy} chmod +x '/usr/local/bin/biapy-downloader'

Automatic updates

Configure biapy-updater automatic updates to check for newer versions of the software:

command grep --quiet 'biapy-downloader' '/etc/biapy-updater.conf' \
    || ${cmdProxy} tee -a '/etc/biapy-updater.conf' <<< 'biapy-downloader'

Usage
Usage examples

Display the tool help:

command biapy-downloader --help

Download from github

Download a release (“COPS” for this example) from any website (“github.com/seblucas/cops/releases” for this example):

command biapy-downloader \
    --forge='github' \
    --output-path="/var/www/cops.domain.com" \
    --extract='zip' \
    --file-template='cops-VERSION.zip' \
    'seblucas/cops'

The arguments are:

  • –forge= : Set the forge from where to download the file (here, github.com).
  • –output-path= : set the path where the downloaded file is extracted.
  • –extract= : Trigger the extraction, and force the format of the downloaded file (here, zip).
  • –file-template= : the file name template used to detect the newest version.
  • ‘seblucas/cops’ : The github user and repository name.

The command print the –install-path option value which contain the extracted download.

Download from sourceforge.net

Download a project (“xmlrpc-c” for this example) from sourceforge.net:

command biapy-downloader --forge='sourceforge' --extract --file-template='xmlrpc-c-VERSION.tgz' 'xmlrpc-c'

The arguments are:

  • –forge= : Set the forge from where to download the file (here, sourceforge.net).
  • –extract : Extract the downloaded tar.gz file.
  • –file-template= : the file name template used to detect the newest version.
  • ‘xmlrpc-c’ : the sourceforge.net project name.

The command print a path containing the extracted download.

Categories: Software

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.