File: dh-exec-subst-multiarch

package info (click to toggle)
dh-exec 0.31
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 324 kB
  • sloc: ansic: 530; perl: 178; makefile: 126; sh: 67
file content (15 lines) | stat: -rwxr-xr-x 444 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#! /usr/bin/perl -wnp
##
## Akin to dh_subst_env, this one will try to expand variables within
## its input, but only certain ones, and will fall back to querying
## dpkg-architecture first, before finally giving up.

BEGIN {
        sub qarch {
                my $arch = `dpkg-architecture -q$_[0] 2>/dev/null`;
                chomp ($arch);
                return $arch;
        }
}

s#(\$\{(DEB_(HOST|BUILD)_[^\}]+)\})#qarch($2) || $1#eg;