Drop both empty and commented lines before parsing config. Correct vim modeline. Add src sums

This commit is contained in:
David Thurstenson 2017-01-24 10:44:24 -06:00
parent 25c3f6c848
commit 0a933dec19
3 changed files with 10 additions and 7 deletions

View File

@ -1,16 +1,17 @@
# Maintainer: David Thurstenson <thurstylark@gmail.com>
pkgname=tl-makepkg
pkgver=0.1
pkgver=0.2
pkgrel=1
pkgdesc="Small utility for running makepkg, then repose to add a local non-AUR package to a custom repo"
arch=('any')
url="https://git.thurstylark.com/tl-makepkg.git/"
license=('GPL')
depends=('makepkg' 'repose')
depends=('repose')
backup=(etc/tl-makepkg.conf)
source=('tl-makepkg'
'tl-makepkg.conf')
md5sums=()
md5sums=('786357e6ade3773b04a3999bd1ebeecd'
'90f485bc5e44599a2e2e7b8c49a140fc')
package() {
install -Dm755 tl-makepkg ${pkgdir}/usr/bin/tl-makepkg

View File

@ -13,9 +13,11 @@ config_parse() {
exit 1
fi
while IFS='' read -r line || [[ -n "$line" ]]; do
[[ "$line" =~ ^#.*$ ]] && continue # Skip lines that start with '#'
config[${line%%=*}]=${line##*=} # ref: http://wiki.bash-hackers.org/syntax/pe#substring_removal
done < "$1"
#[[ "$line" =~ ^#.*$ ]] && continue # Skip lines that start with '#'
local option=${line%%=*}
local value=${line##*=} # ref: http://wiki.bash-hackers.org/syntax/pe#substring_removal
config["$option"]=$value
done < <(sed '/^$/d;/^#.*$/d' "$1")
}
makepkg_run() {

View File

@ -12,4 +12,4 @@ REPOSE_OPTS=--verbose --files --xz
MAKEPKG_OPTS=
# vim: set ft=dosini
# vim: set ft=dosini: