File: configure-help-replace.sh

package info (click to toggle)
pmacct 1.7.8-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,904 kB
  • sloc: ansic: 110,430; sh: 4,794; cpp: 4,375; python: 3,632; makefile: 525
file content (25 lines) | stat: -rwxr-xr-x 620 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash
#
# This script is meant to be called by autogen.sh from the parent directory.
#

# Silence on
exec 1>/dev/null 2>/dev/null

# Vars
HEAD="^Some influential environment variables:$"
TAIL="^Use these variables to override the choices made by \`configure' or to help"
FILE_ORIGINAL="configure"
FILE_REPLACE="bin/configure-help-replace.txt"
FILE_TMP="bin/configure-output.tmp"

# Code
sed --posix -e "/$HEAD/,/$TAIL/{ /$HEAD/{p; r $FILE_REPLACE
	}; /$TAIL/p; d }" $FILE_ORIGINAL > $FILE_TMP

if [ $? = 0 ]; then
        chmod 755 $FILE_TMP
        mv -f $FILE_TMP $FILE_ORIGINAL
else
	rm -f $FILE_TMP
fi