git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/gen
blob: 6729b728088035923c6d21ae8a02ae5ffa23cbf5 (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
# vim:tabstop=4:syntax=sh
# export SHELLCHECK_OPTS='--exclude=SC2128,SC2164'

# define things

# location of isohdpfx.bin:
PFXB="/usr/lib/ISOLINUX/isohdpfx.bin"

# script from here

RETVAL=0
DIRS=( $(find . -maxdepth 1 -mindepth 1 -type d|grep -vP '/diff[^/]*'|awk -F/ '{print $NF}') )
# shellcheck disable=SC2128
[ -z "$DIRS" ]&&exit 1

for i in "${DIRS[@]}";do
	ISOVERSTR="$(echo "$i"|sed 's/debian/Debian/;s/-//')"
	# shellcheck disable=SC2128,SC2164
	(
		cd "$i/src" 2>/dev/null
		[ "$?" -ne 0 ]&&printf "%b not accessible!\n" "$i/src" >&2&&exit 2
		xorriso -as mkisofs -r -J -joliet-long -l -cache-inodes -isohybrid-mbr "$PFXB"\
			-partition_offset 16 -A "$ISOVERSTR" -b isolinux/isolinux.bin -c isolinux/boot.cat\
			-no-emul-boot -boot-load-size 4 -boot-info-table -o "$i"-serial-install.iso ../src/
		case "$?" in
			0);;
			*) printf "Creation of %b failed!" "$i-serial-install.iso" >&2;exit 4;;
		esac
		mv -v "$i"-serial-install.iso ../dst/
		case "$?" in
			0);;
			*) printf "Move of %b failed!" "$i-serial-install.iso" >&2;exit 8;;
		esac
	);LRV="$?"
	case "$LRV" in
		0);;
		*)
			case "$RETVAL" in
				0) RETVAL="$((100+LRV))";;
				*) RETVAL=$((RETVAL+LRV));;
			esac
		;;
	esac
done

exit "$RETVAL"