From 510d76b6c87c4779a60519a94a5b0938809c1cb7 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 22 Dec 2018 00:32:04 -0500 Subject: libopkbuild: Use shpp --- diff --git a/Makefile.am b/Makefile.am index 3d90e4e..8d38943 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,6 +27,13 @@ include $(top_srcdir)/tests/local.mk MANUAL = Distribution Build System +SHPPFLAGS = \ + -DPKGLIBDIR="$(pkgdatadir)" \ + -DDATADIR="$(datadir)" \ + -DLOCALEDIR="$(localedir)" \ + -DSYSCONFDIR="$(sysconfdir)" \ + -DMETADATA="$(METADATA)" + bin_SCRIPTS = $(bin_sources:.sh=) pkgdata_SCRIPTS = $(pkgdata_sources:.sh=.sm) pkgdatapackage_SCRIPTS = $(pkgdatapackage_sources:.sh=.sm) @@ -162,7 +169,8 @@ test: .sh.sm: $(AM_V_GEN)$(MKDIR_P) "$$(dirname $@)" - $(AM_V_at)$(do_subst) $< >$@ + $(AM_V_at)$(SH) -n $< + $(AM_V_at)'$(srcdir)/tools/shpp.sh' $(SHPPFLAGS) $< $@ .1in.1: $(AM_V_GEN)$(MKDIR_P) "$$(dirname $@)" diff --git a/lib/load.sh b/lib/load.sh index 2bf77bc..9f52766 100644 --- a/lib/load.sh +++ b/lib/load.sh @@ -22,7 +22,7 @@ _OB_LOAD_SM=1 # The "common" module is used by this and all other modules. # We have to manually load the "common" module so we can use it in ob_use. -. '@@PKGLIBDIR@@/common.sm' +. "${PKGLIBDIR}/common.sm" ob_use() { @@ -34,7 +34,7 @@ ob_use() return 125 fi - module='@@PKGLIBDIR@@'"/${module}.sm" + module="${PKGLIBDIR}/${module}.sm" if [ -r "${module}" ]; then . "${module}" else diff --git a/lib/locale.sh b/lib/locale.sh index 50f3644..b2fe329 100644 --- a/lib/locale.sh +++ b/lib/locale.sh @@ -25,7 +25,7 @@ ob_use output _OB_DEFAULT_LOCALE='en_US' _OB_INTERNAL_TEXT_DOMAIN='libopkbuild_1' _OB_TEXT_DOMAIN= -_OB_LOCALE_PATH='@@LOCALEDIR@@/%s/LC_MESSAGES/%s.ms' +_OB_LOCALE_PATH="${LOCALEDIR}/%s/LC_MESSAGES/%s.ms" ob_get_text_domain() { diff --git a/lib/metadata.sh b/lib/metadata.sh index 89dc264..5bd56da 100644 --- a/lib/metadata.sh +++ b/lib/metadata.sh @@ -20,7 +20,7 @@ [ x"${_OB_METADATA_SM+set}" = x'set' ] && return 0 _OB_METADATA_SM=1 -ob_use 'metadata/@@METADATA@@' +ob_use "metadata/${METADATA}" ob_validate_source_name() { @@ -312,7 +312,7 @@ _ob_metadata_do() func="${1}" shift 1 - "_ob_${func}_@@METADATA@@" "${@}" + "_ob_${func}_${METADATA}" "${@}" return ${?} } diff --git a/lib/metadata/proteanos.sh b/lib/metadata/proteanos.sh index 82713f1..bb07b6b 100644 --- a/lib/metadata/proteanos.sh +++ b/lib/metadata/proteanos.sh @@ -104,14 +104,14 @@ _ob_get_distrev_proteanos() _ob_get_system_arch_proteanos() { - cat '@@SYSCONFDIR@@/proteanos_arch' + cat "${SYSCONFDIR}/proteanos_arch" return 0 } _ob_get_system_plat_proteanos() { - cat '@@SYSCONFDIR@@/proteanos_plat' + cat "${SYSCONFDIR}/proteanos_plat" return 0 } @@ -144,7 +144,7 @@ _ob_get_system_path_proteanos() 'buildflags') # arch if [ ${#} -eq 1 ]; then - printf '@@DATADIR@@/opkbuild/buildflags/%s' "${1}" + printf "${DATADIR}/opkbuild/buildflags/%s" "${1}" else return 125 fi @@ -153,8 +153,8 @@ _ob_get_system_path_proteanos() # source version plat if [ ${#} -eq 3 ]; then ob_parse_version -u 'pkgver' "${2}" - printf '@@DATADIR@@/platconf/%s/%s\n' "${3}" "${1}" - printf '@@DATADIR@@/platconf/%s/%s_%s\n' "${3}" "${1}" \ + printf "${DATADIR}/platconf/%s/%s\n" "${3}" "${1}" + printf "${DATADIR}/platconf/%s/%s_%s\n" "${3}" "${1}" \ "${pkgver}" else return 125 -- cgit v0.9.1