#!/bin/sh echo "*** GET SYSLINUX BEGIN ***" global SRC_DIR := $[pwd] # Grab everything after the '=' character. global DOWNLOAD_URL := $[grep -i ^SYSLINUX_SOURCE_URL .config | cut -f2 -d'=] # Grab everything after the last '/' character. global ARCHIVE_FILE := $(DOWNLOAD_URL##*/) # Read the 'USE_LOCAL_SOURCE' property from '.config' global USE_LOCAL_SOURCE := $[grep -i ^USE_LOCAL_SOURCE .config | cut -f2 -d'=] if test $USE_LOCAL_SOURCE = "true" -a ! -f $SRC_DIR/source/$ARCHIVE_FILE { echo "Source bundle $SRC_DIR/source/$ARCHIVE_FILE is missing and will be downloaded." global USE_LOCAL_SOURCE := '"false'" } cd source if test ! $USE_LOCAL_SOURCE = "true" { # Downloading SYSLINUX source bundle file. The '-c' option allows the download to resume. echo "Downloading SYSLINUX source bundle from $DOWNLOAD_URL" wget -c $DOWNLOAD_URL } else { echo "Using local SYSLINUX source bundle $SRC_DIR/source/$ARCHIVE_FILE" } # Delete folder with previously extracted Syslinux. echo "Removing SYSLINUX work area. This may take a while..." rm -rf ../work/syslinux mkdir ../work/syslinux # Extract Syslinux to folder 'work/syslinux'. # Full path will be something like 'work/syslinux/syslinux-6.03'. tar -xvf $ARCHIVE_FILE -C ../work/syslinux cd $SRC_DIR echo "*** GET SYSLINUX END ***" (CommandList children: [ (C {(echo)} {(DQ ("*** GET SYSLINUX BEGIN ***"))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SRC_DIR) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(pwd)})]) left_token: spids: [12 14] ) } spids: [11] ) ] spids: [11] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:DOWNLOAD_URL) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(grep)} {(-i)} {(Lit_Other "^") (SYSLINUX_SOURCE_URL)} {(.config)}) (C {(cut)} {(-f2)} {(-d) (SQ <"=">)}) ] negated: False ) ] ) left_token: spids: [21 41] ) } spids: [20] ) ] spids: [20] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ARCHIVE_FILE) op: Equal rhs: { (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_DPound arg_word:{("*") (Lit_Slash /)}) spids: [48 53] ) } spids: [47] ) ] spids: [47] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:USE_LOCAL_SOURCE) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(grep)} {(-i)} {(Lit_Other "^") (USE_LOCAL_SOURCE)} {(.config)}) (C {(cut)} {(-f2)} {(-d) (SQ <"=">)}) ] negated: False ) ] ) left_token: spids: [61 81] ) ) } spids: [59] ) ] spids: [59] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$USE_LOCAL_SOURCE"))} {(Lit_Other "=")} {(DQ (true))} {(-a)} {(KW_Bang "!")} {(-f)} {($ VSub_Name "$SRC_DIR") (/source/) ($ VSub_Name "$ARCHIVE_FILE")} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(echo)} { (DQ ("Source bundle ") ($ VSub_Name "$SRC_DIR") (/source/) ($ VSub_Name "$ARCHIVE_FILE") (" is missing and will be downloaded.") ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:USE_LOCAL_SOURCE) op: Equal rhs: {(DQ (false))} spids: [127] ) ] spids: [127] ) ] spids: [-1 113] ) ] spids: [-1 132] ) (C {(cd)} {(source)}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(KW_Bang "!")} {(DQ ($ VSub_Name "$USE_LOCAL_SOURCE"))} {(Lit_Other "=")} {(DQ (true))} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(echo)} {(DQ ("Downloading SYSLINUX source bundle from ") ($ VSub_Name "$DOWNLOAD_URL"))} ) (C {(wget)} {(-c)} {($ VSub_Name "$DOWNLOAD_URL")}) ] spids: [-1 160] ) ] else_action: [ (C {(echo)} { (DQ ("Using local SYSLINUX source bundle ") ($ VSub_Name "$SRC_DIR") (/source/) ($ VSub_Name "$ARCHIVE_FILE") ) } ) ] spids: [181 193] ) (C {(echo)} {(DQ ("Removing SYSLINUX work area. This may take a while..."))}) (C {(rm)} {(-rf)} {(../work/syslinux)}) (C {(mkdir)} {(../work/syslinux)}) (C {(tar)} {(-xvf)} {($ VSub_Name "$ARCHIVE_FILE")} {(-C)} {(../work/syslinux)}) (C {(cd)} {($ VSub_Name "$SRC_DIR")}) (C {(echo)} {(DQ ("*** GET SYSLINUX END ***"))}) ] )