From 57b1604dcb232a26ff7d9b8ec78313f7840f0d57 Mon Sep 17 00:00:00 2001 From: Alon Swartz Date: Wed, 15 Feb 2017 11:32:26 +0200 Subject: [PATCH] added bin/parse-appname-version with corresponding test example usage:: appver="core-14.2-jessie-amd64" parsed_appname_version=$($BT/bin/parse-appname-version $appver) read appname appversion codename arch <<< "$parsed_appname_version" echo "appname: $appname" echo "appversion: $appversion" echo "codename: $codename" echo "arch: $arch" --- bin/parse-appname-version | 54 +++++++++++++++++++++++++++++++++++++++ tests/appname-version | 48 ++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100755 bin/parse-appname-version create mode 100755 tests/appname-version diff --git a/bin/parse-appname-version b/bin/parse-appname-version new file mode 100755 index 0000000..5dc6d22 --- /dev/null +++ b/bin/parse-appname-version @@ -0,0 +1,54 @@ +#!/bin/bash -e +# Copyright (c) 2011-2017 TurnKey GNU/Linux - http://www.turnkeylinux.org +# +# This file is part of buildtasks. +# +# Buildtasks is free software; you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as published by the +# Free Software Foundation; either version 3 of the License, or (at your +# option) any later version. + + +fatal() { echo -e "FATAL [$(basename $0)]: $@" 1>&2; exit 1; } + +usage() { +cat<&2; exit 1; } +info() { echo "INFO [$(basename $0)]: $@"; } + +usage() { +cat<