Changeset 20764

Show
Ignore:
Timestamp:
09/06/07 07:12:21 (1 year ago)
Author:
patrick
Message:

Avoid getting stuck in an infinite loop trying to find the package installation
directory.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/modules/gadgeteer/gadget/gadgetmain.cpp

    r20761 r20764  
    189189 
    190190         bool found(false); 
    191          while ( ! found
     191         while ( ! found && ! base_dir.empty()
    192192         { 
    193193            try 
     
    208208         } 
    209209 
    210          std::cout << base_dir.native_directory_string() << std::endl; 
    211          const fs::path data_dir = base_dir / GADGET_SHARE_DIR; 
    212  
    213          // We use the overwrite value of 0 as a way around testing whether 
    214          // the environment variables are already set. 
    215          setenv("GADGET_BASE_DIR", base_dir.native_directory_string().c_str(), 
    216                 0); 
    217          setenv("GADGET_DATA_DIR", data_dir.native_directory_string().c_str(), 
    218                 0); 
     210         if ( found ) 
     211         { 
     212            const fs::path data_dir = base_dir / GADGET_SHARE_DIR; 
     213 
     214            // We use the overwrite value of 0 as a way around testing whether 
     215            // the environment variables are already set. 
     216            setenv("GADGET_BASE_DIR", 
     217                   base_dir.native_directory_string().c_str(), 0); 
     218            setenv("GADGET_DATA_DIR", 
     219                   data_dir.native_directory_string().c_str(), 0); 
     220         } 
    219221      } 
    220222      catch (fs::filesystem_error& ex) 
  • juggler/trunk/modules/jackal/common/jccl/jcclmain.cpp

    r20760 r20764  
    189189 
    190190         bool found(false); 
    191          while ( ! found
     191         while ( ! found && ! base_dir.empty()
    192192         { 
    193193            try 
     
    208208         } 
    209209 
    210          std::cout << base_dir.native_directory_string() << std::endl; 
    211          const fs::path data_dir = base_dir / JCCL_SHARE_DIR; 
    212  
    213          // We use the overwrite value of 0 as a way around testing whether 
    214          // the environment variables are already set. 
    215          setenv("JCCL_BASE_DIR", base_dir.native_directory_string().c_str(), 
    216                 0); 
    217          setenv("JCCL_DATA_DIR", data_dir.native_directory_string().c_str(), 
    218                 0); 
     210         if ( found ) 
     211         { 
     212            const fs::path data_dir = base_dir / JCCL_SHARE_DIR; 
     213 
     214            // We use the overwrite value of 0 as a way around testing whether 
     215            // the environment variables are already set. 
     216            setenv("JCCL_BASE_DIR", 
     217                   base_dir.native_directory_string().c_str(), 0); 
     218            setenv("JCCL_DATA_DIR", 
     219                   data_dir.native_directory_string().c_str(), 0); 
     220         } 
    219221      } 
    220222      catch (fs::filesystem_error& ex) 
  • juggler/trunk/modules/sonix/snx/snxmain.cpp

    r20762 r20764  
    198198 
    199199         bool found(false); 
    200          while ( ! found
     200         while ( ! found && ! base_dir.empty()
    201201         { 
    202202            try 
     
    217217         } 
    218218 
    219          std::cout << base_dir.native_directory_string() << std::endl; 
    220          const fs::path data_dir = base_dir / SNX_SHARE_DIR; 
    221  
    222          // We use the overwrite value of 0 as a way around testing whether 
    223          // the environment variables are already set. 
    224          setenv("SNX_BASE_DIR", base_dir.native_directory_string().c_str(), 0); 
    225          setenv("SNX_DATA_DIR", data_dir.native_directory_string().c_str(), 0); 
     219         if ( found ) 
     220         { 
     221            const fs::path data_dir = base_dir / SNX_SHARE_DIR; 
     222 
     223            // We use the overwrite value of 0 as a way around testing whether 
     224            // the environment variables are already set. 
     225            setenv("SNX_BASE_DIR", base_dir.native_directory_string().c_str(), 
     226                   0); 
     227            setenv("SNX_DATA_DIR", data_dir.native_directory_string().c_str(), 
     228                   0); 
     229         } 
    226230      } 
    227231      catch (fs::filesystem_error& ex) 
  • juggler/trunk/modules/tweek/tweek/tweekmain.cpp

    r20763 r20764  
    189189 
    190190         bool found(false); 
    191          while ( ! found
     191         while ( ! found && ! base_dir.empty()
    192192         { 
    193193            try 
     
    208208         } 
    209209 
    210          std::cout << base_dir.native_directory_string() << std::endl; 
    211          const fs::path data_dir = base_dir / TWEEK_SHARE_DIR; 
    212  
    213          // We use the overwrite value of 0 as a way around testing whether 
    214          // the environment variables are already set. 
    215          setenv("TWEEK_BASE_DIR", base_dir.native_directory_string().c_str(), 
    216                 0); 
    217          setenv("TWEEK_DATA_DIR", data_dir.native_directory_string().c_str(), 
    218                 0); 
     210         if ( found ) 
     211         { 
     212            const fs::path data_dir = base_dir / TWEEK_SHARE_DIR; 
     213 
     214            // We use the overwrite value of 0 as a way around testing whether 
     215            // the environment variables are already set. 
     216            setenv("TWEEK_BASE_DIR", 
     217                   base_dir.native_directory_string().c_str(), 0); 
     218            setenv("TWEEK_DATA_DIR", 
     219                   data_dir.native_directory_string().c_str(), 0); 
     220         } 
    219221      } 
    220222      catch (fs::filesystem_error& ex) 
  • juggler/trunk/modules/vapor/vpr/vprmain.cpp

    r20758 r20764  
    167167 
    168168         bool found(false); 
    169          while ( ! found
     169         while ( ! found && ! base_dir.empty()
    170170         { 
    171171            try 
     
    186186         } 
    187187 
    188          // We use the overwrite value of 0 as a way around testing whether 
    189          // the environment variable is already set. 
    190          setenv("VPR_BASE_DIR", base_dir.native_directory_string().c_str(), 0); 
     188         if ( found ) 
     189         { 
     190            // We use the overwrite value of 0 as a way around testing whether 
     191            // the environment variable is already set. 
     192            setenv("VPR_BASE_DIR", base_dir.native_directory_string().c_str(), 
     193                   0); 
     194         } 
    191195      } 
    192196      catch (fs::filesystem_error& ex) 
  • juggler/trunk/modules/vrjuggler/vrj/vrjmain.cpp

    r20759 r20764  
    189189 
    190190         bool found(false); 
    191          while ( ! found
     191         while ( ! found && ! base_dir.empty()
    192192         { 
    193193            try 
     
    208208         } 
    209209 
    210          std::cout << base_dir.native_directory_string() << std::endl; 
    211          const fs::path data_dir = base_dir / VJ_SHARE_DIR; 
    212  
    213          // We use the overwrite value of 0 as a way around testing whether 
    214          // the environment variables are already set. 
    215          setenv("VJ_BASE_DIR", base_dir.native_directory_string().c_str(), 0); 
    216          setenv("VJ_DATA_DIR", data_dir.native_directory_string().c_str(), 0); 
     210         if ( found ) 
     211         { 
     212            const fs::path data_dir = base_dir / VJ_SHARE_DIR; 
     213 
     214            // We use the overwrite value of 0 as a way around testing whether 
     215            // the environment variables are already set. 
     216            setenv("VJ_BASE_DIR", base_dir.native_directory_string().c_str(), 
     217                   0); 
     218            setenv("VJ_DATA_DIR", data_dir.native_directory_string().c_str(), 
     219                   0); 
     220         } 
    217221      } 
    218222      catch (fs::filesystem_error& ex)