wok-next rev 19432

syslinux/taziso: parse include files
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Oct 02 15:02:56 2016 +0200 (2016-10-02)
parents 6ee34149411d
children a24fec94f0a8
files syslinux/stuff/iso2exe/taziso
line diff
     1.1 --- a/syslinux/stuff/iso2exe/taziso	Sun Oct 02 13:16:24 2016 +0100
     1.2 +++ b/syslinux/stuff/iso2exe/taziso	Sun Oct 02 15:02:56 2016 +0200
     1.3 @@ -591,7 +591,7 @@
     1.4  md5()
     1.5  {
     1.6  	dotwait "Checking files"
     1.7 -	( cd $media ; ${md5sum:-md5sum -c md5sum*} | sort ) > /tmp/data
     1.8 +	( cd $media ; ${md5sum:-md5sum -c md5sum*} 2>&1 | sort ) > /tmp/data
     1.9  	unset md5sum
    1.10  	rm -f /tmp/wait
    1.11  	if [ "$1" ]; then
    1.12 @@ -1204,7 +1204,7 @@
    1.13  floppyset()
    1.14  {
    1.15  	gotcdfile 'isolinux.cfg'
    1.16 -	parse_isolinux < $file > /tmp/var$$
    1.17 +	$0 include $file | parse_isolinux > /tmp/var$$
    1.18  	. /tmp/var$$
    1.19  	[ -z "$KERNEL" ] && echo "Can't parse isolinux.cfg" && return
    1.20  	for i in $media/$KERNEL $(dirname $file)/$KERNEL $media/$(locase $KERNEL) \
    1.21 @@ -1325,6 +1325,11 @@
    1.22  		-c %y $media/.|sed 's/ .*//')  $(basename "$ISO")"
    1.23  }
    1.24  
    1.25 +if [ "$1" == "include" ]; then
    1.26 +	[ -s "$2" ] && cd $(dirname "$2") && awk -v exe=$0 \
    1.27 +	'{ if ($1 == "include") system(exe " include " $2); else print }' <"$2"
    1.28 +	exit
    1.29 +fi
    1.30  ISO="${1:-/dev/null}"
    1.31  [ -z "$(isiso 2> /dev/null)" ] && echo "Usage : $0 file.iso" && exit 1
    1.32  media=/tmp/media$$