projects
/
carnet-tools-cn.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r36: s/cp_db_get_wrap/cp_db_get/g
[carnet-tools-cn.git]
/
functions.sh
diff --git
a/functions.sh
b/functions.sh
index
3141959
..
70c914c
100644
(file)
--- a/
functions.sh
+++ b/
functions.sh
@@
-264,7
+264,7
@@
cp_yes_no () {
# check to prevent user from using this when debconf is active
# (it would break communication with its backend - uses stdin/out)
if [ "$DEBCONF_REDIR" ]; then
# check to prevent user from using this when debconf is active
# (it would break communication with its backend - uses stdin/out)
if [ "$DEBCONF_REDIR" ]; then
- echo "cn_yes_no: debconf redirection detected" >&2
+ echo "cp_yes_no: debconf redirection detected" >&2
return 1
fi
return 1
fi
@@
-295,9
+295,17
@@
cp_yes_no () {
# --> that's why we wrap the db_get call to return unset RET variable
# instead of some gibberish error message that our script does
# not expect
# --> that's why we wrap the db_get call to return unset RET variable
# instead of some gibberish error message that our script does
# not expect
-cp_db_get_wrap() {
+cp_db_get() {
local var
var="$1"
local var
var="$1"
+
+ # check to prevent user from using this before activating debconf
+ # confmodule needs to be loaded before accessing db_* functions
+ if [ -z "$DEBCONF_REDIR" ]; then
+ echo "cp_db_get: debconf not activated!" >&2
+ return 1
+ fi
+
if ! db_get "$var"; then
case "$RET" in
*doesn\'t\ exist)
if ! db_get "$var"; then
case "$RET" in
*doesn\'t\ exist)