From 0a933dec1967679ab9992d9895cfabcdfbfc920b Mon Sep 17 00:00:00 2001 From: David Thurstenson Date: Tue, 24 Jan 2017 10:44:24 -0600 Subject: [PATCH] Drop both empty and commented lines before parsing config. Correct vim modeline. Add src sums --- PKGBUILD | 7 ++++--- tl-makepkg | 8 +++++--- tl-makepkg.conf | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 83f420d..37583c2 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,16 +1,17 @@ # Maintainer: David Thurstenson 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 diff --git a/tl-makepkg b/tl-makepkg index 2336ae7..1bf6e6d 100644 --- a/tl-makepkg +++ b/tl-makepkg @@ -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() { diff --git a/tl-makepkg.conf b/tl-makepkg.conf index d0441b1..f06a8d1 100644 --- a/tl-makepkg.conf +++ b/tl-makepkg.conf @@ -12,4 +12,4 @@ REPOSE_OPTS=--verbose --files --xz MAKEPKG_OPTS= -# vim: set ft=dosini +# vim: set ft=dosini: