[Users] [PATCH 5/6] fedora/config/install-post: do not abort if YUM_REPO is unset

Kir Kolyshkin kir at openvz.org
Wed Dec 17 15:24:59 EST 2008


It looks like a proper check if $YUM_REPO is set is present, but in fact
due to 'set -o nounset' we will get the following fatal error:

  YUM_REPO: unbound variable

Fix that by using bash feature of substiting some value if variable is unset.
Apparently in this case it doesn't complain about unbound variable.

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 templates/fedora/config/install-post |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/templates/fedora/config/install-post b/templates/fedora/config/install-post
index 5be68e2..31d132b 100755
--- a/templates/fedora/config/install-post
+++ b/templates/fedora/config/install-post
@@ -7,7 +7,7 @@ set -o nounset
 
 read_vzpkg_conf
 
-if test -n "$YUM_REPO"; then
+if test -n "${$YUM_REPO:-}"; then
 	for repo in $VE_ROOT/etc/yum.repos.d/*.repo; do
 		mv $repo $repo.disabled
 	done
-- 
1.5.6.5



More information about the Users mailing list