diff options
author | Daniel Baumann <daniel@debian.org> | 2007-09-23 10:05:12 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 18:22:25 +0100 |
commit | fdef63e60c2e68226da2fe92d6cc393c1af2b801 (patch) | |
tree | a066f2620ba741d786b628d1f9d56bcf38cbd8ea /functions | |
parent | 504c05c3a63de0af4fd0e876274afc039c5c0ed1 (diff) | |
download | live-build-fdef63e60c2e68226da2fe92d6cc393c1af2b801.zip live-build-fdef63e60c2e68226da2fe92d6cc393c1af2b801.tar.gz |
Adding live-helper 1.0~a16-1.
Diffstat (limited to 'functions')
-rwxr-xr-x | functions/common.sh | 2 | ||||
-rwxr-xr-x | functions/packagelists.sh | 42 |
2 files changed, 43 insertions, 1 deletions
diff --git a/functions/common.sh b/functions/common.sh index 71011bd..2c30117 100755 --- a/functions/common.sh +++ b/functions/common.sh @@ -10,4 +10,4 @@ set -e PROGRAM="`basename ${0}`" -VERSION="1.0~a15" +VERSION="1.0~a16" diff --git a/functions/packagelists.sh b/functions/packagelists.sh new file mode 100755 index 0000000..f25b5fb --- /dev/null +++ b/functions/packagelists.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +# packagelists.sh - expands package list includes +# Copyright (C) 2006-2007 Daniel Baumann <daniel@debian.org> +# +# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING. +# This is free software, and you are welcome to redistribute it +# under certain conditions; see COPYING for details. + +set -e + +Expand_packagelist () +{ + # ${1} List name + # ${2} Default path to search + # ${3} Fallback path to search (optional) + + # Does list exist in default path? + if [ -e "${2}/${1}" ]; + then + Expand_packagelist_file "${2}/${1}" "${@}" + else + # If list exists in fallback, include it. + if [ -n "${3}" ] && [ -e "${3}/${1}" ] + then + Expand_packagelist_file "${3}/${1}" "${@}" + fi + fi +} + +Expand_packagelist_file () +{ + local FILE="${1}" + shift + shift + + for INCLUDE in `sed -ne 's/^#<include> \(.*\)/\1/gp' "${FILE}"`; + do + Expand_packagelist "${INCLUDE}" "${@}" + done + sed -ne 's/^\([^#].*\)/\1\n/gp' "${FILE}" +} |