File: test-dpkg-path

package info (click to toggle)
apt 3.1.12
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 22,736 kB
  • sloc: cpp: 71,048; sh: 31,750; xml: 5,553; perl: 217; python: 197; ansic: 191; makefile: 41
file content (35 lines) | stat: -rwxr-xr-x 847 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
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
set -e

TESTDIR="$(readlink -f "$(dirname "$0")")"
. "$TESTDIR/framework"

setupenvironment
configarchitecture 'native'
configdpkgnoopchroot

# create a bunch of test pkgs
createtestpkg() {
	setupsimplenativepackage "testpkg-$1" 'native' '1.0' 'unstable'
	BUILDDIR="incoming/testpkg-$1-1.0"
	echo '#!/bin/sh
echo PATH=$PATH' > "${BUILDDIR}/debian/preinst"
	buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
	rm -rf "$BUILDDIR"
}

createtestpkg 'one'
createtestpkg 'two'

setupaptarchive


# Inherit from environment
testsuccess aptget install testpkg-one -y -o DPkg::Path=""
cp rootdir/tmp/testsuccess.output apt.log
testsuccess grep "PATH=$PATH" apt.log

# Set a custom value
testsuccess aptget install testpkg-two -y -o DPkg::Path="foobar:$PATH"
cp rootdir/tmp/testsuccess.output apt.log
testsuccess grep "PATH=foobar:$PATH" apt.log