[DRE-commits] [tdiary] 05/10: Create symbolic link:{theme,js}
Taku YASUI
tach at debian.org
Sat Aug 17 12:10:00 UTC 2013
This is an automated email from the git hooks/post-receive script.
tach pushed a commit to branch feature/gem-transition-4.0.0
in repository tdiary.
commit 36ac999f5969c41505334c03aaa2ac7ab6f3f020
Author: Youhei SASAKI <uwabami at gfd-dennou.org>
Date: Mon Aug 12 05:07:39 2013 +0900
Create symbolic link:{theme,js}
Signed-off-by: Youhei SASAKI <uwabami at gfd-dennou.org>
---
debian/tdiary-setup.rb | 62 ++++++++++++++++++++++++++----------------------
1 file changed, 33 insertions(+), 29 deletions(-)
diff --git a/debian/tdiary-setup.rb b/debian/tdiary-setup.rb
index f1ecadf..25ddb49 100644
--- a/debian/tdiary-setup.rb
+++ b/debian/tdiary-setup.rb
@@ -4,11 +4,11 @@
# tdiary-setup --- tDiary Setup Tool
# Author: Daigo Moriwaki <daigo at debian dot org>
# Copyright (c) 2004-2011 Daigo Moriwaki
-# License: GPL version 2 or later
+# License: GPL version 2 or later
#
require 'fileutils'
-require 'webrick/httpauth/htpasswd'
+require 'webrick/httpauth/htpasswd'
require 'debian'
#
@@ -19,18 +19,18 @@ class WEBrick::HTTPAuth::Htpasswd
@path
end
end
-
+
module TDiarySetup
# Directory where tdiary is installed on Debian
TDIARY_DIR = "/usr/share/tdiary"
#
- # Hold parameters to be used on installation.
+ # Hold parameters to be used on installation.
#
class Parameters
attr_accessor :user, :home, :data_path, :language
- def initialize(user = ENV['USER'], home = ENV['HOME'])
+ def initialize(user = ENV['USER'], home = ENV['HOME'])
@user = user
@home = home
@language = "E"
@@ -64,7 +64,7 @@ module TDiarySetup
end
end # Parameters
-
+
#
# Interact with a user on console.
#
@@ -74,7 +74,7 @@ module TDiarySetup
end
def print(s)
- $stdout.print s
+ $stdout.print s
end
def read_with_default(default)
@@ -82,7 +82,7 @@ module TDiarySetup
return r == "" ? default : r
end
end
-
+
#
# Ask a user to input parameters.
#
@@ -137,9 +137,9 @@ module TDiarySetup
#
# Install .htpasswd file with id and password.
#
- class Installhtpasswd
+ class Installhtpasswd
include Ask
-
+
def initialize(params, htpasswdOfWEBrick)
@params = params
@htpasswd = htpasswdOfWEBrick
@@ -160,7 +160,7 @@ module TDiarySetup
create_entry(@params.user, first)
return first
end
-
+
def user_exists?(user)
return true & @htpasswd.get_passwd("", user, false)
end
@@ -172,7 +172,7 @@ module TDiarySetup
end
end # Htpasswd
-
+
#
# Install tDiary files.
#
@@ -185,7 +185,7 @@ module TDiarySetup
if !File.directory?(dir)
FileUtils.mkdir_p dir
FileUtils.chmod(mode, dir)
- end
+ end
end
def hasPluginPackage?
@@ -196,7 +196,7 @@ module TDiarySetup
$stdout.print "#{s}\n"
end
end
-
+
#
# 'Default' mode
#
@@ -206,7 +206,7 @@ module TDiarySetup
mkdir(0701, @params.target)
mkdir(0701, @params.image_dir)
setup_base()
- if hasPluginPackage?
+ if hasPluginPackage?
setup_with_plugin_package()
install_makerss
end
@@ -215,6 +215,8 @@ module TDiarySetup
def setup_base
puts "Install tdiary files into #{@params.target}."
install_files( ["index", "update"] )
+ FileUtils.ln_sf "#{TDIARY_DIR}/js", "#{@params.target}/"
+ FileUtils.ln_sf "#{TDIARY_DIR}/theme", "#{@params.target}/"
end
def setup_with_plugin_package
@@ -250,10 +252,12 @@ module TDiarySetup
def setup_base
puts "Make symlinks into #{@params.target}."
- FileUtils.ln_sf "#{TDIARY_DIR}/index.rb", "#{@params.target}/"
- FileUtils.ln_sf "#{TDIARY_DIR}/index.fcgi","#{@params.target}/"
- FileUtils.ln_sf "#{TDIARY_DIR}/js", "#{@params.target}/"
- FileUtils.ln_sf "#{TDIARY_DIR}/update.rb", "#{@params.target}/"
+ FileUtils.ln_sf "#{TDIARY_DIR}/index.rb", "#{@params.target}/"
+ FileUtils.ln_sf "#{TDIARY_DIR}/index.fcgi", "#{@params.target}/"
+ FileUtils.ln_sf "#{TDIARY_DIR}/js", "#{@params.target}/"
+ FileUtils.ln_sf "#{TDIARY_DIR}/theme", "#{@params.target}/"
+ FileUtils.ln_sf "#{TDIARY_DIR}/update.rb", "#{@params.target}/"
+ FileUtils.ln_sf "#{TDIARY_DIR}/update.fcgi", "#{@params.target}/"
end
def setup_with_plugin_package
@@ -279,8 +283,8 @@ module TDiarySetup
FileUtils.cp_r Dir.glob("#{TDIARY_DIR}/*"), "#{@params.target}/"
end
end
-
-
+
+
#
# Install a config file.
#
@@ -308,7 +312,7 @@ module TDiarySetup
raise "Not implemented yet."
end
end
-
+
#
# Install /usr/share/tdiary/dot.htaccess to the target directory.
#
@@ -382,7 +386,7 @@ module TDiarySetup
if !FileTest.exist?(@index)
raise "#{@index} file not found. Is it really the installed directory?"
end
-
+
if symlink?
return :symlink
elsif copy?
@@ -419,7 +423,7 @@ def usage
Usage: #{$0} {default|symlink|copy|update} directory
example) #{$0} default /home/#{ENV['USER']}/public_html/diary
-directory is an absolute path where CGI files of tDiary will be put.
+directory is an absolute path where CGI files of tDiary will be put.
If you set up tDiary for the fist time, select
* default if your httpd runs under suEXEC mode, or
@@ -442,7 +446,7 @@ def first_install(params, setup)
htaccess = TDiarySetup::Installhtaccess.new(params)
htaccess.install
tdiaryconf = TDiarySetup::Installtdiaryconf.new(params)
- tdiaryconf.install
+ tdiaryconf.install
end
def update(params)
@@ -463,13 +467,13 @@ def check_args(args)
if args.length != 2
usage()
exit 1
- end
+ end
end
def main(args)
check_args(args)
mode, target = args[0], args[1]
-
+
params = TDiarySetup::Parameters.new()
params.target = target
case mode
@@ -484,9 +488,9 @@ def main(args)
else
usage()
exit 1
- end
+ end
end
-if __FILE__ == $0
+if __FILE__ == $0
main(ARGV)
end
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/tdiary.git
More information about the Pkg-ruby-extras-commits
mailing list