summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2009-04-26 12:58:04 +0200
committerDan McGee <dan@archlinux.org>2009-04-26 16:22:23 +0200
commitc27904661ef96cb2e7c729ce82b527146529c768 (patch)
tree41c3d407ecab07f9dffd477ab133dd18fcf66456 /scripts
parent10584ec8eab873ffb4b03dd8e4a4703dabed8955 (diff)
downloadpacman-c27904661ef96cb2e7c729ce82b527146529c768.tar.gz
pacman-c27904661ef96cb2e7c729ce82b527146529c768.tar.xz
makepkg: make in-place sed portable
Do a sed replacement in-place is not very portable. On Mac OSX and BSDs, the syntax is "sed -i ''" where as with GNU sed the command is "sed -i''" or just "sed -i". This patch detects which command should be used during configure. Credit to Kevin Barry who researched this issue and provided a patch to work around this using temporary backup files. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.am1
-rw-r--r--scripts/makepkg.sh.in4
2 files changed, 3 insertions, 2 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 5a2b780c..5d656534 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -41,6 +41,7 @@ edit = sed \
-e 's|@DBEXT[@]|$(DBEXT)|g' \
-e 's|@BUILDSCRIPT[@]|$(BUILDSCRIPT)|g' \
-e 's|@SIZECMD[@]|$(SIZECMD)|g' \
+ -e 's|@SEDINPLACE[@]|$(SEDINPLACE)|g' \
-e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
## All the scripts depend on Makefile so that they are rebuilt when the
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 97acfb49..b8e09f50 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1172,8 +1172,8 @@ devel_update() {
if [ -n "$newpkgver" ]; then
if [ "$newpkgver" != "$pkgver" ]; then
if [ -f "./$BUILDSCRIPT" ]; then
- sed -i "s/^pkgver=[^ ]*/pkgver=$newpkgver/" "./$BUILDSCRIPT"
- sed -i "s/^pkgrel=[^ ]*/pkgrel=1/" "./$BUILDSCRIPT"
+ @SEDINPLACE@ "s/^pkgver=[^ ]*/pkgver=$newpkgver/" "./$BUILDSCRIPT"
+ @SEDINPLACE@ "s/^pkgrel=[^ ]*/pkgrel=1/" "./$BUILDSCRIPT"
source "$BUILDSCRIPT"
fi
fi