summaryrefslogtreecommitdiffstats
path: root/core/modules/distro-logo/module.build
blob: 4e30667ffab8ad6728bac9584e3f12bf8453080e (plain) (blame)
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
#!/bin/bash
fetch_source() {
	:
}

build() {
	:
}

post_copy() {
	# Try to fetch distro logo
	if [ ! -s "$TARGET_BUILD_DIR/etc/distro.png" ]; then
		local DIST=$(lsb_release -si)
		if [ -n "$DIST" ]; then
			[ -z "$CFG_DISTLOGO_URL" ] && CFG_DISTLOGO_URL='http://mltk-services.ruf.uni-freiburg.de/distro_logo.php?distro='
			wget -t 3 -T 3 -O "$TARGET_BUILD_DIR/etc/distro.png" "${CFG_DISTLOGO_URL}${DIST}"
			if [ ! -s "$TARGET_BUILD_DIR/etc/distro.png" ]; then
				rm -f "$TARGET_BUILD_DIR/etc/distro.png"
				pwarning "Could not download distro-logo"
			fi
		else
			pwarning "Could not determine distribution"
		fi
	fi
}