File: pre_install_foreign_architecture

package info (click to toggle)
piuparts 1.6.0
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 72,532 kB
  • sloc: python: 8,240; sh: 4,367; makefile: 171
file content (24 lines) | stat: -rwxr-xr-x 467 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
#!/bin/sh
set -e

test "$PIUPARTS_PHASE" = "install" || exit 0

case "$PIUPARTS_DISTRIBUTION" in
	lenny*|squeeze*|wheezy*) exit 0 ;;
esac

FOREIGN=

case ${PIUPARTS_OBJECTS%%=*} in
	nvidia-driver|\
	nvidia-legacy-*xx-driver|\
	lib*cuda1)
		FOREIGN="i386"
		;;
esac

if [ -n "$FOREIGN" ] && [ "$FOREIGN" != "$(dpkg --print-architecture)" ]; then
	echo "Enabling foreign architecture $FOREIGN for $PIUPARTS_OBJECTS"
	dpkg --add-architecture $FOREIGN
	apt-get update
fi