From 6867aa8ef0f56bdba8d88c3c45f5f49fe12716e7 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Sat, 18 May 2013 05:56:30 +0200 Subject: [PATCH] rpm: force offline mode if installing inside of chroot --- templates.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates.spec b/templates.spec index e9bfaf3..2590f63 100644 --- a/templates.spec +++ b/templates.spec @@ -98,7 +98,12 @@ if [ "$1" = 1 ] ; then qvm-add-template --rpm %{template_name} fi -qvm-template-commit %{template_name} +# If running inside of chroot (means - from anaconda), force offline mode +if [ "`stat -c %d:%i /`" != "`stat -c %d:%i /proc/1/root/.`" ]; then + qvm-template-commit --offline-mode %{template_name} +else + qvm-template-commit %{template_name} +fi %preun if [ "$1" = 0 ] ; then