[PATCH 1/7] Drop unused support for output to stdout
Signed-off-by: Loïc Minier <lool@debian.org>
---
functions | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/functions b/functions
index 582564e..57cdd40 100644
--- a/functions
+++ b/functions
@@ -172,23 +172,19 @@ parse_sib_conf() {
# Generating
# Output a variable to a preseed file if the variable has a value
-# $1 = file name (stdout if this is empty)
+# $1 = file name
# $2 = debconf variable name
# $3 = debconf variable type
# $4 = variable
add() {
if [ -n "$4" -o "$3" = "note" ]; then
- if [ -n "$1" ]; then
- echo "d-i $2 $3 $4" | sed 's/ *$//' >> "$1"
- else
- echo "d-i $2 $3 $4" | sed 's/ *$//'
- fi
+ echo "d-i $2 $3 $4" | sed 's/ *$//' >> "$1"
fi
}
# Output a variable to a preseed file or, iv the variable is empty, mark
# the debconf variable as seen.
-# $1 = file name (stdout if this is empty)
+# $1 = file name
# $2 = debconf variable name
# $3 = debconf variable type
# $4 = variable
@@ -201,7 +197,7 @@ add_or_set_seen() {
}
# Write a static network configuration to the preseed file
-# $1 = file name (stdout if this is empty)
+# $1 = file name
write_static_network() {
add "$1" "netcfg/get_ipaddress" "string" "$IPADDRESS"
add_or_set_seen "$1" "netcfg/get_netmask" "string" "$NETMASK"
@@ -213,7 +209,7 @@ write_static_network() {
}
# Fall back to a static address if DHCP fails
-# $1 = file name (stdout if this is empty)
+# $1 = file name
dhcp_fallback() {
add "$1" "netcfg/dhcp_failed" "note"
add "$1" "netcfg/dhcp_options" "select" "Configure network manually"
--
1.7.5.4
Reply to: