[asl-commit] ActiveSambaLdap r19:

kou at cozmixng.org kou at cozmixng.org
Fri Aug 3 22:32:00 EDT 2007


retro	2007-08-04 11:31:58 +0900 (Sat, 04 Aug 2007)

  New Revision: 19

  Added files:
    trunk/lib/active_samba_ldap/post-setup.rb
  Modified directories:
    trunk/lib/active_samba_ldap/
  Modified files:
    trunk/lib/active_samba_ldap/command.rb

  Log:


  Modified: trunk/lib/active_samba_ldap/

  Added: trunk/lib/active_samba_ldap/post-setup.rb (+5 -0)
===================================================================
--- trunk/lib/active_samba_ldap/post-setup.rb	2006-11-14 11:27:31 +09:00 (rev 18)
+++ trunk/lib/active_samba_ldap/post-setup.rb	2007-08-04 11:31:58 +09:00 (rev 19)
@@ -0,0 +1,5 @@
+File.open("configuration_files", "w") do |f|
+  %w(config.yaml bind.yaml).each do |file|
+    f.puts(File.join(config("sysconfdir"), "activesambaldap", file))
+  end
+end

  Modified: trunk/lib/active_samba_ldap/command.rb (+16 -6)
===================================================================
--- trunk/lib/active_samba_ldap/command.rb	2006-11-14 11:27:31 +09:00 (rev 18)
+++ trunk/lib/active_samba_ldap/command.rb	2007-08-04 11:31:58 +09:00 (rev 19)
@@ -45,14 +45,24 @@
     end
 
     def default_configuration_files
-      files = [
-        "/etc/activesambaldap/config.rb",
-        "/etc/activesambaldap/bind.rb",
-      ]
+      configuration_files = File.join(File.dirname(__FILE__),
+                                      "configuration_files")
+      if File.exists?(configuration_files)
+        files = File.readlines(configuration_files).collect do |line|
+          line.strip
+        end.reject do |line|
+          line.empty? or /^#/ =~ line
+        end
+      else
+        files = [
+          "/etc/activesambaldap/config.yaml",
+          "/etc/activesambaldap/bind.yaml",
+        ]
+      end
       begin
         configuration_files_for_user = [
-          File.expand_path("~/.activesambaldap.conf"),
-          File.expand_path("~/.activesambaldap.bind")
+          File.expand_path(File.join("~", ".activesambaldap.conf")),
+          File.expand_path(File.join("~", ".activesambaldap.bind")),
         ]
         files.concat(configuration_files_for_user)
       rescue ArgumentError

  Property changed: trunk/lib/active_samba_ldap (+0 -0)
___________________________________________________________________
Name: svn:ignore
   + configuration_files




More information about the asl-commit mailing list