Remove config_parse() because it was causing trouble. Might as well just run pacini every time I want to fetch an option.

This commit is contained in:
David Thurstenson 2017-02-07 09:22:51 -06:00
parent 70b459b4e7
commit 94ca0038f5
2 changed files with 7 additions and 17 deletions

View File

@ -1,6 +1,6 @@
# Maintainer: David Thurstenson <thurstylark@gmail.com> # Maintainer: David Thurstenson <thurstylark@gmail.com>
pkgname=tl-makepkg pkgname=tl-makepkg
pkgver=0.6 pkgver=0.7
pkgrel=1 pkgrel=1
pkgdesc="Small utility for running makepkg, then repose to add a local non-AUR package to a custom repo" pkgdesc="Small utility for running makepkg, then repose to add a local non-AUR package to a custom repo"
arch=('any') arch=('any')
@ -10,7 +10,7 @@ depends=('repose' 'pacutils')
backup=('etc/tl-makepkg.conf') backup=('etc/tl-makepkg.conf')
source=('tl-makepkg' source=('tl-makepkg'
'tl-makepkg.conf') 'tl-makepkg.conf')
md5sums=('a241835872805ff68ffc4e0bc687d778' md5sums=('db3a09f25da6e05d53e19b20c1e563ce'
'938de8daea15f68500e969df422fd7fa') '938de8daea15f68500e969df422fd7fa')
package() { package() {

View File

@ -2,27 +2,17 @@
declare -A config declare -A config
conf="${CONFIG_FILE:-/etc/tl-makepkg.conf}"
errmsg() { errmsg() {
printf "Error in %s: %s\n" "${FUNCNAME[1]}" "$1" >&2 printf "Error in %s: %s\n" "${FUNCNAME[1]}" "$1" >&2
} }
config_parse() { # Usage: config_parse <CONFIG_FILE>
if [[ ! -f "$1" ]]; then
errmsg "config file '$1' doesn't exist"
exit 1
fi
while IFS== read -r option value <(pacini "$1"); do
config["$option"]=$value
done
}
makepkg_run() { # Usage: makepkg_run <RepoDir> <MakepkgOpts> makepkg_run() { # Usage: makepkg_run <RepoDir> <MakepkgOpts>
PKGDEST="$1" PKGDEST="$1"
shift 1 shift 1
makepkg "$@" makepkg $@
} }
config_parse "${CONFIG_FILE:-/etc/tl-makepkg.conf}" PKGDEST=$(pacini $conf RepoDir) makepkg $@ $(pacini $conf MakepkgOpts)
makepkg_run "${config[RepoDir]}" "${config[MakepkgOpts]} $@" repose $(pacini $conf ReposeOpts) --root $(pacini $conf RepoDir) --pool $(pacini $conf RepoDir) $(pacini $conf DBFile)
repose "${config[ReposeOpts]}" --root "${config[MakepkgOpts]}" --pool "${config[MakepkgOpts]}" "${config[DBFile]}"