Bug#744365: lb config does not create "config" directory
Package: live-build
Version: 4.0~alpha33-1
Tags: patch
Hello,
running "lb config" from the current unstable live-build package
(4.0~alpha33-1, identical to current git as of commit
145418141e4965691dad1757c6fbdffa4a96290c) in an empty directory
results in
P: Creating config tree for a debian/wheezy/amd64 system
/usr/lib/live/build/config: 892: /usr/lib/live/build/config: cannot create config/common: Directory nonexistent
The code fragment responsible for this is:
884 if [ ! -e config ]
885 then
886 Echo_message "Creating config tree for a ${LB_MODE}/${LB_DISTRIBUTION}/${LIVE_IMAGE_ARCHITECTURE} system"
887 else
888 Echo_message "Updating config tree for a ${LB_MODE}/${LB_DISTRIBUTION}/${LIVE_IMAGE_ARCHITECTURE} system"
889 fi
890
891 # Creating live-build configuration
892 cat > config/common << EOF
The "if" clause in line 884 checks for the existence of the config
directory, but does not create it when missing, so trying to
create config/common in line 892 fails when running "lb config"
without an existing config directory. The following one-line
patch fixes that.
diff --git a/scripts/build/config b/scripts/build/config
index 5261c65..9430c5e 100755
--- a/scripts/build/config
+++ b/scripts/build/config
@@ -884,6 +884,7 @@ Check_defaults
if [ ! -e config ]
then
Echo_message "Creating config tree for a ${LB_MODE}/${LB_DISTRIBUTION}/${LIVE_IMAGE_ARCHITECTURE} system"
+ mkdir -p config
else
Echo_message "Updating config tree for a ${LB_MODE}/${LB_DISTRIBUTION}/${LIVE_IMAGE_ARCHITECTURE} system"
fi
Regards,
Karsten
--
Gem. Par. 28 Abs. 4 Bundesdatenschutzgesetz widerspreche ich der Nutzung
sowie der Weitergabe meiner personenbezogenen Daten für Zwecke der
Werbung sowie der Markt- oder Meinungsforschung.
Reply to: