Commit 4d0af232da7df8c4a33b9f2e44933f1f3d2527bc

Authored by Riyad Preukschas
1 parent a213d4b9

Make method names clearer in check.rake

Showing 1 changed file with 8 additions and 9 deletions   Show diff stats
lib/tasks/gitlab/check.rake
... ... @@ -317,7 +317,7 @@ namespace :gitlab do
317 317 gitolite_ssh_user = Gitlab.config.gitolite.ssh_user
318 318 print "Has no \"-e\" in ~#{gitolite_ssh_user}/.profile ... "
319 319  
320   - profile_file = File.join(gitolite_home, ".profile")
  320 + profile_file = File.join(gitolite_user_home, ".profile")
321 321  
322 322 unless File.read(profile_file) =~ /^-e PATH/
323 323 puts "yes".green
... ... @@ -475,7 +475,7 @@ namespace :gitlab do
475 475 def check_dot_gitolite_exists
476 476 print "Config directory exists? ... "
477 477  
478   - gitolite_config_path = File.join(gitolite_home, ".gitolite")
  478 + gitolite_config_path = File.join(gitolite_user_home, ".gitolite")
479 479  
480 480 if File.directory?(gitolite_config_path)
481 481 puts "yes".green
... ... @@ -496,7 +496,7 @@ namespace :gitlab do
496 496 def check_dot_gitolite_permissions
497 497 print "Config directory access is drwxr-x---? ... "
498 498  
499   - gitolite_config_path = File.join(gitolite_home, ".gitolite")
  499 + gitolite_config_path = File.join(gitolite_user_home, ".gitolite")
500 500 unless File.exists?(gitolite_config_path)
501 501 puts "can't check because of previous errors".magenta
502 502 return
... ... @@ -520,7 +520,7 @@ namespace :gitlab do
520 520 gitolite_ssh_user = Gitlab.config.gitolite.ssh_user
521 521 print "Config directory owned by #{gitolite_ssh_user}:#{gitolite_ssh_user} ... "
522 522  
523   - gitolite_config_path = File.join(gitolite_home, ".gitolite")
  523 + gitolite_config_path = File.join(gitolite_user_home, ".gitolite")
524 524 unless File.exists?(gitolite_config_path)
525 525 puts "can't check because of previous errors".magenta
526 526 return
... ... @@ -559,7 +559,7 @@ namespace :gitlab do
559 559 end
560 560  
561 561 def check_gitoliterc_git_config_keys
562   - gitoliterc_path = File.join(gitolite_home, ".gitolite.rc")
  562 + gitoliterc_path = File.join(gitolite_user_home, ".gitolite.rc")
563 563  
564 564 print "Allow all Git config keys in .gitolite.rc ... "
565 565 option_name = if has_gitolite3?
... ... @@ -588,7 +588,7 @@ namespace :gitlab do
588 588 end
589 589  
590 590 def check_gitoliterc_repo_umask
591   - gitoliterc_path = File.join(gitolite_home, ".gitolite.rc")
  591 + gitoliterc_path = File.join(gitolite_user_home, ".gitolite.rc")
592 592  
593 593 print "Repo umask is 0007 in .gitolite.rc? ... "
594 594 option_name = if has_gitolite3?
... ... @@ -726,7 +726,6 @@ namespace :gitlab do
726 726 puts "yes".green
727 727 else
728 728 puts "no".red
729   - puts "#{repo_base_path} is not writable".red
730 729 try_fixing_it(
731 730 "sudo chmod -R ug+rwXs,o-rwx #{repo_base_path}"
732 731 )
... ... @@ -852,12 +851,12 @@ namespace :gitlab do
852 851 # Helper methods
853 852 ########################
854 853  
855   - def gitolite_home
  854 + def gitolite_user_home
856 855 File.expand_path("~#{Gitlab.config.gitolite.ssh_user}")
857 856 end
858 857  
859 858 def gitolite_version
860   - gitolite_version_file = "#{gitolite_home}/gitolite/src/VERSION"
  859 + gitolite_version_file = "#{gitolite_user_home}/gitolite/src/VERSION"
861 860 if File.readable?(gitolite_version_file)
862 861 File.read(gitolite_version_file)
863 862 end
... ...