]> xenbits.xensource.com Git - people/dariof/xen-tools.git/commitdiff
Fix export of environment variables (dash vs underscore)
authorAxel Beckert <abe@deuxchevaux.org>
Wed, 13 Mar 2013 22:29:52 +0000 (23:29 +0100)
committerAxel Beckert <abe@deuxchevaux.org>
Wed, 13 Mar 2013 22:29:52 +0000 (23:29 +0100)
Previously they could contain dashes and then were only accessible
from within Perl, but not from within Bash.

From now on potential dashes in environment variable names are
converted to underscores ("_") before being exported. May affect some
hook or role scripts.

bin/xen-create-image
bin/xt-create-xen-config
debian/NEWS
debian/changelog

index df84fad00d085d236506b6df2774e053d954834e..6417a5b1253161c8a3783a360d3833b98ced26cd 100755 (executable)
@@ -3529,6 +3529,7 @@ sub exportEnvironment
 
     foreach my $key ( keys %CONFIG )
     {
+        $key =~ s/-/_/g;
         if ( defined( $CONFIG{ $key } ) )
         {
             $ENV{ $key } = $CONFIG{ $key };
index 1c7e8ddc4a6598a153ac590148f481dc9d59d7ba..5e82a62618ea02cd82e86f6c8a8492c6354529b9 100755 (executable)
@@ -398,13 +398,13 @@ sub createXenConfig
         $ENV{ 'image_suffix' } = '';
         importPartitionsFromEnvironment();
     }
-    elsif ( $ENV{ 'image-dev' } )
+    elsif ( $ENV{ 'image_dev' } )
     {
-        $ENV{ 'image_vbd' } = "phy:$ENV{'image-dev'}";
+        $ENV{ 'image_vbd' } = "phy:$ENV{'image_dev'}";
 
-        if ( $ENV{ 'swap-dev' } )
+        if ( $ENV{ 'swap_dev' } )
         {
-            $ENV{ 'swap_vbd' } = "phy:$ENV{'swap-dev'}";
+            $ENV{ 'swap_vbd' } = "phy:$ENV{'swap_dev'}";
         }
         else
         {
index 810622268809651f8aca1d5a196972cee0f6df80..b0805805bfbb4d7567fbaad83061ec75c9f04b48 100644 (file)
@@ -1,3 +1,11 @@
+xen-tools (4.4~dev-1) UNRELEASED; urgency=low
+
+  * Exported environment variables no more contain dashes ("-"). Dashes in
+    environment variable names are from now on converted to underscores
+    ("_") before being exported. May affect some hook or role scripts.
+
+ -- Axel Beckert <abe@debian.org>  Wed, 13 Mar 2013 23:22:20 +0100
+
 xen-tools (4.2~rc1-1) unstable; urgency=low
 
   By default, xen-create-image now generates a random root password and
index bb7db7b4176c58cb422fd756024b21ffad9f315d..da998d3272a7d7294b257013907d29cb722d6250 100644 (file)
@@ -38,6 +38,9 @@ xen-tools (4.4~dev-1) UNRELEASED; urgency=low
     - Fix filesystem tools installation in 91-install-fs-tools (which was
       broken since 4.3~rc1-1) by merging 91-install-fs-tools back into
       90-make-fstab. Also supports RPM-based distributions now.
+    - Fix export of environment variables. Previously they could contain
+      dashes and then were only accessible from within Perl, but not from
+      within Bash.
   * Add debian/gbp.conf to be able to to build xen-tools with
     git-buildpackage.
   * Clean up debian/rules: