File: pkg-varsubsts

package info (click to toggle)
cmdliner 0.9.4-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 504 kB
  • ctags: 312
  • sloc: ml: 1,373; sh: 145; makefile: 28
file content (24 lines) | stat: -rwxr-xr-x 513 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

# To add other variable substitutions already predefine $VARSUBST in
# config.

set -e
LOC=`dirname $0`

SED=${SED:="sed"}

VARSUBSTS="$VARSUBST s|%%NAME%%|$NAME|g; \
           s|%%VERSION%%|$VERSION|g; \
           s|%%MAINTAINER%%|$MAINTAINER|g;"

for file in `git ls-files`; do
    if [ ! -x "$file" ]; then                # skip scripts
        $SED "$VARSUBSTS" $file > $file.tmp
        mv -f $file.tmp $file
    fi
done

if [ -f $LOC/hook-pkg-varsubsts ]; then
    . $LOC/hook-pkg-varsubsts
fi