Thinned out unnecessary complications to config_parse. Removed repose_run()
This commit is contained in:
parent
7df9f7b920
commit
2b693c3ebb
8
PKGBUILD
8
PKGBUILD
|
@ -1,17 +1,17 @@
|
||||||
# Maintainer: David Thurstenson <thurstylark@gmail.com>
|
# Maintainer: David Thurstenson <thurstylark@gmail.com>
|
||||||
pkgname=tl-makepkg
|
pkgname=tl-makepkg
|
||||||
pkgver=0.4
|
pkgver=0.5
|
||||||
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')
|
||||||
url="https://git.thurstylark.com/tl-makepkg.git/"
|
url="https://git.thurstylark.com/tl-makepkg.git/"
|
||||||
license=('GPL')
|
license=('GPL')
|
||||||
depends=('repose' 'pacutils')
|
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=('6f1d3fa62e88d68ab683bc4ee8755737'
|
md5sums=('bdaea613965516d9fbab7f688d75c859'
|
||||||
'bd876524e71c61fd6682041351a192c4')
|
'938de8daea15f68500e969df422fd7fa')
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
install -Dm755 tl-makepkg ${pkgdir}/usr/bin/tl-makepkg
|
install -Dm755 tl-makepkg ${pkgdir}/usr/bin/tl-makepkg
|
||||||
|
|
14
tl-makepkg
14
tl-makepkg
|
@ -3,7 +3,7 @@
|
||||||
declare -A config
|
declare -A config
|
||||||
|
|
||||||
errmsg() {
|
errmsg() {
|
||||||
echo "Error in ${FUNCNAME[1]}: $1" >&2
|
printf "Error in %s: %s\n" "${FUNCNAME[1]}" "$1" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
config_parse() { # Usage: config_parse <CONFIG_FILE>
|
config_parse() { # Usage: config_parse <CONFIG_FILE>
|
||||||
|
@ -12,11 +12,9 @@ config_parse() { # Usage: config_parse <CONFIG_FILE>
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while IFS='' read -r line || [[ -n "$line" ]]; do
|
while IFS== read -r option value <(pacini "$1"); do
|
||||||
local option=${line%%= *}
|
|
||||||
local value=${line##* =} # ref: http://wiki.bash-hackers.org/syntax/pe#substring_removal
|
|
||||||
config["$option"]=$value
|
config["$option"]=$value
|
||||||
done < <(pacini "$1") # Thanks to alad for showing me pacini
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
makepkg_run() { # Usage: makepkg_run <RepoDir> <MakepkgOpts>
|
makepkg_run() { # Usage: makepkg_run <RepoDir> <MakepkgOpts>
|
||||||
|
@ -25,14 +23,10 @@ makepkg_run() { # Usage: makepkg_run <RepoDir> <MakepkgOpts>
|
||||||
makepkg "$@"
|
makepkg "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
repose_run() { # Usage: repose_run <ReposeOpts> <RepoDir> <DBFile>
|
|
||||||
repose $1 --root "$2" --pool "$2" "$3"
|
|
||||||
}
|
|
||||||
|
|
||||||
# If not running interactively, don't do anything
|
# If not running interactively, don't do anything
|
||||||
# Allows for using these functions as commands by sourcing this script
|
# Allows for using these functions as commands by sourcing this script
|
||||||
[[ $- != *i* ]] && return
|
[[ $- != *i* ]] && return
|
||||||
|
|
||||||
config_parse "${CONFIG_FILE:-/etc/tl-makepkg.conf}"
|
config_parse "${CONFIG_FILE:-/etc/tl-makepkg.conf}"
|
||||||
makepkg_run "${config[RepoDir]}" "${config[MakepkgOpts]} $@"
|
makepkg_run "${config[RepoDir]}" "${config[MakepkgOpts]} $@"
|
||||||
repose_run "${config[ReposeOpts]}" "${config[RepoDir]}" "${config[DBFile]}"
|
repose "${config[ReposeOpts]}" --root "${config[MakepkgOpts]}" --pool "${config[MakepkgOpts]}" "${config[DBFile]}"
|
||||||
|
|
Loading…
Reference in New Issue