
Reads PKGBUILD into an array and replaces the pkgver and pkgrel with bash parameter substitution, then uses shell redirection to write to to the file. Because shell redirection follows symlinks, this accomplishes the same thing as the previous default of using the GNU-specific --follow-symlinks sed flag. Removes SEDPATH and SEDINPLACEFLAGS from the build systems as they are not used elsewhere. Signed-off-by: Ethan Sommer <e5ten.arch@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
28 lines
821 B
Bash
28 lines
821 B
Bash
#!@BASH@
|
|
|
|
input=$1
|
|
output=$2
|
|
mode=$3
|
|
|
|
"@SED@" \
|
|
-e "s|@rootdir[@]|@ROOTDIR@|g" \
|
|
-e "s|@localedir[@]|@LOCALEDIR@|g" \
|
|
-e "s|@sysconfdir[@]|@sysconfdir@|g" \
|
|
-e "s|@localstatedir[@]|@localstatedir@|g" \
|
|
-e "s|@libmakepkgdir[@]|@LIBMAKEPKGDIR@|g" \
|
|
-e "s|@pkgdatadir[@]|@PKGDATADIR@|g" \
|
|
-e "s|@prefix[@]|@PREFIX@|g" \
|
|
-e "1s|#!/bin/bash|#!@BASH@|g" \
|
|
-e "s|@PACKAGE_VERSION[@]|@PACKAGE_VERSION@|g" \
|
|
-e "s|@PACKAGE_NAME[@]|@PACKAGE_NAME@|g" \
|
|
-e "s|@BUILDSCRIPT[@]|@BUILDSCRIPT@|g" \
|
|
-e "s|@TEMPLATE_DIR[@]|@TEMPLATE_DIR@|g" \
|
|
-e "s|@DEBUGSUFFIX[@]|@DEBUGSUFFIX@|g" \
|
|
-e "s|@INODECMD[@]|@INODECMD@|g" \
|
|
-e "s|@FILECMD[@]|@FILECMD@|g" \
|
|
-e "s|@configure_input[@]|Generated from ${input##*/}; do not edit by hand.|g" \
|
|
"$input" >"$output"
|
|
|
|
if [[ $mode ]]; then
|
|
chmod "$mode" "$output"
|
|
fi
|