diff --git a/src/configuration/cms_default_setup.e b/src/configuration/cms_default_setup.e
index 1bf8f6a..9f3b42e 100644
--- a/src/configuration/cms_default_setup.e
+++ b/src/configuration/cms_default_setup.e
@@ -42,6 +42,8 @@ feature {NONE} -- Initialization
local
l_url: like site_url
do
+ site_location := environment.path
+
--| Site id, used to identified a site, this could be set to a uuid, or else
site_id := text_item_or_default ("site.id", "_EWF_CMS_NO_ID_")
@@ -169,4 +171,7 @@ feature -- Theme: Compute location
theme_location := themes_location.extended (theme_name)
end
+note
+ copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
+ license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end
diff --git a/src/configuration/cms_setup.e b/src/configuration/cms_setup.e
index 7537e47..cfe7584 100644
--- a/src/configuration/cms_setup.e
+++ b/src/configuration/cms_setup.e
@@ -92,6 +92,9 @@ feature -- Query
feature -- Access: Theme
+ site_location: PATH
+ -- Path to CMS site root dir.
+
modules_location: PATH
-- Path to modules.
@@ -186,4 +189,7 @@ feature -- Element change
module_registered: module_registered (m)
end
+note
+ copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
+ license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end
diff --git a/src/modules/cms_debug_module.e b/src/modules/cms_debug_module.e
index 3a25a35..b0938c7 100644
--- a/src/modules/cms_debug_module.e
+++ b/src/modules/cms_debug_module.e
@@ -28,12 +28,15 @@ feature {NONE} -- Initialization
make
do
- name := "debug"
version := "1.0"
description := "Debug"
package := "cms"
end
+feature -- Access
+
+ name: STRING = "debug"
+
feature -- Router
setup_router (a_router: WSF_ROUTER; a_api: CMS_API)
@@ -134,7 +137,7 @@ feature -- Handler
end
note
- copyright: "Copyright (c) 1984-2013, Eiffel Software and others"
+ copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
diff --git a/src/service/cms_api.e b/src/service/cms_api.e
index 697c5d0..0933765 100644
--- a/src/service/cms_api.e
+++ b/src/service/cms_api.e
@@ -319,6 +319,12 @@ feature {NONE}-- Implemenation
feature -- Environment/ theme
+ site_location: PATH
+ -- CMS site location.
+ do
+ Result := setup.site_location
+ end
+
theme_location: PATH
-- Active theme location.
do
@@ -349,6 +355,7 @@ feature -- Environment/ module
else
l_name := a_name
end
+ p := setup.environment.config_path
p := module_location_by_name (a_module_name).extended ("config").extended (l_name)
@@ -393,7 +400,14 @@ feature -- Environment/ module
-- Location of resource `a_resource' for `a_module'.
do
--| site/modules/$modname/$a_name.json
- Result := module_location (a_module).extended_path (a_resource)
+ Result := module_resource_location_by_name (a_module.name, a_resource)
+ end
+
+ module_resource_location_by_name (a_module_name: READABLE_STRING_GENERAL; a_resource: PATH): PATH
+ -- Location of resource `a_resource' for `a_module'.
+ do
+ --| site/modules/$modname/$a_name.json
+ Result := module_location_by_name (a_module_name).extended_path (a_resource)
end
feature -- Environment/ modules and theme
@@ -419,10 +433,37 @@ feature -- Environment/ modules and theme
end
end
+ module_theme_resource_location_by_name (a_module_name: READABLE_STRING_GENERAL; a_resource: PATH): detachable PATH
+ -- Theme resource location of `a_resource' for module named `a_module_name', if exists.
+ -- By default, located under the module location folder, but could be overriden
+ -- from files located under modules subfolder of active `theme_location'.
+ --| First search in themes/$theme/modules/$a_module.name/$a_resource,
+ --| and if not found then search in
+ --| modules/$a_module_name/$a_resource.
+ local
+ ut: FILE_UTILITIES
+ do
+ -- Check first in selected theme folder.
+ Result := module_theme_location_by_name (a_module_name).extended_path (a_resource)
+ if not ut.file_path_exists (Result) then
+ -- And if not found, look into site/modules/$a_module.name/.... folders.
+ Result := module_resource_location_by_name (a_module_name, a_resource)
+ if not ut.file_path_exists (Result) then
+ Result := Void
+ end
+ end
+ end
+
module_theme_location (a_module: CMS_MODULE): PATH
-- Location for overriden files associated with `a_module_name'.
do
- Result := theme_location.extended ("modules").extended (a_module.name)
+ Result := module_theme_location_by_name (a_module.name)
+ end
+
+ module_theme_location_by_name (a_module_name: READABLE_STRING_GENERAL): PATH
+ -- Location for overriden files associated with `a_module_name'.
+ do
+ Result := theme_location.extended ("modules").extended (a_module_name)
end
module_configuration (a_module: CMS_MODULE; a_name: detachable READABLE_STRING_GENERAL): detachable CONFIG_READER
@@ -430,5 +471,8 @@ feature -- Environment/ modules and theme
Result := module_configuration_by_name (a_module.name, a_name)
end
+note
+ copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
+ license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end
diff --git a/src/service/cms_module.e b/src/service/cms_module.e
index 1988de0..0c46a25 100644
--- a/src/service/cms_module.e
+++ b/src/service/cms_module.e
@@ -16,6 +16,8 @@ feature -- Access
name: STRING
-- Name of the module.
+ deferred
+ end
description: STRING
-- Description of the module.
@@ -132,4 +134,7 @@ feature -- Hooks
create Result.make_empty
end
+note
+ copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
+ license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end
diff --git a/tools/roc/application.e b/tools/roc/application.e
index 2e18c36..d6bf2df 100644
--- a/tools/roc/application.e
+++ b/tools/roc/application.e
@@ -14,7 +14,7 @@ note
scripts
themes
running
- roc instal blog
+ roc install blog
will look for a module blog in the modules directory starting at the current directory.
]"
date: "$Date$"
@@ -26,8 +26,20 @@ class
inherit
SHARED_EXECUTION_ENVIRONMENT
+ rename
+ print as ascii_print
+ end
- ARGUMENTS
+ ARGUMENTS_32
+ rename
+ print as ascii_print
+ end
+
+ LOCALIZED_PRINTER
+ rename
+ print as ascii_print,
+ localized_print as print
+ end
create
make
@@ -36,252 +48,75 @@ feature {NONE} -- Initialization
make
-- Initialize tool.
+ local
+ cmd_args: like command_arguments
do
-- TODO add support to other commands.
if argument_count = 0 then
- print ("Use: roc install [--module|-m ] [(--dir|-d ) | ]")
- elseif argument (1).starts_with ("install") then
- execute_install
- else
- print ("Wrong command")
- print ("%NUse: roc install [--module|-m ] -cap ")
- end
- end
-
-feature {NONE} -- Install
-
- execute_install
- -- Install a new module.
- local
- i: INTEGER
- error: BOOLEAN
- optional_module: BOOLEAN
- cms_path: BOOLEAN
- do
- if is_valid_install_cmd then
- do_execute_install
- end
- end
-
- do_execute_install
- -- Install a module into a cms application.
- -- Pattern
- -- app/site/modules/module_name/config/....
- -- app/site/modules/module_name/scripts/....
- -- app/site/modules/module_name/themes/....
- local
- l_module_path: PATH
- l_config: PATH
- l_site_dir: DIRECTORY
- l_modules_dir: DIRECTORY
- l_dest_dir: DIRECTORY
- l_file: FILE
- do
- if attached install_cms_path as l_cms_path then
- l_module_path := install_module_path
- --Install configuration files.
- if attached l_module_path.entry as l_entry then
- create l_site_dir.make_with_path (l_cms_path.extended ("site"))
- create l_modules_dir.make_with_path (l_cms_path.extended ("site").extended ("modules"))
-
- if
- l_site_dir.exists and then
- l_modules_dir.exists
- then
- create l_dest_dir.make_with_path (l_cms_path.extended ("site").extended ("modules").extended (l_entry.name))
- if not l_dest_dir.exists then
- l_dest_dir.create_dir
- end
- install_module_elements (l_module_path, l_dest_dir.path, Config_dir)
- install_module_elements (l_module_path, l_dest_dir.path, Scripts_dir)
- install_module_elements (l_module_path, l_dest_dir.path, Themes_dir)
- print ("Module ")
- print ( l_entry)
- print ( " was successfuly installed to the cms Application located ")
- print (l_cms_path.name)
- print ("%NCheck the module elements at ")
- print (l_dest_dir.path.name)
- else
- print ("The CMS Application located at does not have the site or modules folders")
- end
+ print_usage
+ elseif attached commands.item (argument (1)) as cmd then
+ cmd_args := command_arguments
+ if cmd.is_valid (cmd_args) then
+ cmd.execute (cmd_args)
else
- print ("Error not possible to retrieve module name.")
+ print_command_usage (cmd)
end
else
- print ("%NWrong path to CMS application")
+ print ("Wrong command %"" + argument (1) + "%".%N")
+ print_usage
end
end
- install_module_elements (a_module_path: PATH; a_cms_path: PATH; a_element: STRING)
- -- Install module configuration files from `a_module_path' to cms application `a_cms_path' to the element `a_element'.
+ commands: STRING_TABLE [ROC_COMMAND]
local
- l_config: PATH
- l_dest_dir: DIRECTORY
- l_src_dir: DIRECTORY
- l_file: FILE
- do
- if attached a_module_path.entry as l_entry then
- l_config := a_module_path.extended ("site").extended (a_element)
-
- create l_src_dir.make_with_path (l_config)
- -- Create the element
- create l_dest_dir.make_with_path (a_cms_path.extended(a_element))
- if not l_dest_dir.exists then
- l_dest_dir.create_dir
- end
- copy_elements (l_src_dir, l_dest_dir)
- else
- print ("Error not possible to retrieve module name.")
- end
+ cmd: ROC_COMMAND
+ once
+ create Result.make (1)
+ create {ROC_INSTALL_COMMAND} cmd.make ("install")
+ Result.force (cmd, cmd.name)
end
-
- copy_elements (a_src_dir: DIRECTORY; a_dest_dir: DIRECTORY)
- -- Copy all elements from a_src_dir to a_dest_dir.
+ command_arguments: ARRAY [READABLE_STRING_32]
local
- l_dir: DIRECTORY
- l_new_dir: DIRECTORY
- entry: PATH
- l_file: FILE
+ i,n: INTEGER
do
- across
- a_src_dir.entries as ic
+ create Result.make_empty
+ Result.rebase (0)
+ Result.force (argument (0), 0)
+ from
+ i := 2 -- skip first arg which is command name
+ n := argument_count
+ until
+ i > n
loop
- entry := ic.item
- if not (entry.is_current_symbol or else entry.is_parent_symbol) then
- create {RAW_FILE} l_file.make_with_path (a_src_dir.path.extended_path (ic.item))
- if not l_file.is_directory then
- copy_file (l_file, a_dest_dir.path)
- else
- create l_dir.make_with_path (a_src_dir.path.extended_path (entry))
- create l_new_dir.make_with_path (a_dest_dir.path.extended_path (entry))
- if not l_new_dir.exists then
- l_new_dir.create_dir
- end
- if l_dir.exists then
- copy_elements (l_dir, l_new_dir)
- end
- end
- end
+ Result.force (argument (i), i - 1)
+ i := i + 1
end
end
+feature -- Usage
-feature {NONE} -- Copy File
-
- copy_file (a_file: FILE; a_dir: PATH)
- --Copy file `a_file' to dir `a_dir'.
- local
- l_dest: RAW_FILE
- l_path: PATH
+ print_usage
do
- if attached a_file.path.entry as l_name then
- l_path := a_dir.absolute_path.extended (l_name.name)
- create l_dest.make_with_path (l_path)
- l_dest.create_read_write
- a_file.open_read
- -- Copy file source to destination
- if l_dest.exists and then l_dest.is_writable and then a_file.exists and then a_file.is_readable then
- a_file.copy_to (l_dest)
- a_file.close
- l_dest.close
- end
- else
+ print ("Usage:%N")
+ across
+ commands as ic
+ loop
+ print_command_usage (ic.item)
end
end
-feature {NONE} -- Command Validator
-
- install_module_path: PATH
- -- Path to the module to install.
+ print_command_usage (cmd: ROC_COMMAND)
do
- if attached separate_word_option_value ("m") as l_m then
- create Result.make_from_string (l_m)
- elseif attached separate_word_option_value ("-module") as l_m then
- create Result.make_from_string (l_m)
- else
- Result := Execution_environment.current_working_path
- end
+ print ("roc ")
+ print (cmd.name)
+ print (" ")
+ print (cmd.help)
+ print ("%N")
end
- install_cms_path: PATH
- -- Path to the cms application to install a module.
- local
- l_dir: DIRECTORY
- do
- if attached separate_word_option_value ("d") as l_m then
- create Result.make_from_string (l_m)
- elseif attached separate_word_option_value ("-dir") as l_m then
- create Result.make_from_string (l_m)
- else
- Result := Execution_environment.current_working_path.extended ("modules")
- end
- end
-
- is_valid_install_cmd: BOOLEAN
- -- Is the submitted install command valid?
- -- install [--module|-m %MODULE_PATH%] -cap %CMS_PATH%
- local
- i: INTEGER
- error: BOOLEAN
- optional_module: BOOLEAN
- cms_path: BOOLEAN
- do
- -- TODO add error reporting.
- if argument_count >= 2 and then argument_count <= 5 then
- from
- i := 2
- until
- i > argument_count
- loop
- if option_word_equal (argument (i), "m") then
- optional_module := True
- elseif option_word_equal (argument (i), "-module") then
- optional_module := True
- elseif option_word_equal (argument (i), "d") then
- cms_path := True
- elseif option_word_equal (argument (i), "-dir") then
- cms_path := True
- end
- i := i + 1
- end
- if argument_count = 5 then
- if (cms_path and optional_module) then
- -- valid command
- Result := True
- else
- print ("Error check the optional argument --module|-m and --dir|-d")
- end
- elseif argument_count = 3 then
- if (cms_path and not optional_module) then
- Result := True
- else
- print ("Error missing value for dir")
- Result := False
- end
- else
- Result := True
- end
- else
- Result := False
- if argument_count > 5 then
- print ("Too many arguments")
- end
- if argument_count < 2 then
- print ("Too few argumetns")
- end
- end
- end
-
-feature -- Constants
-
- Config_dir: STRING = "config"
- -- Configuration dir.
-
- Scripts_dir: STRING = "scripts"
- -- Scripts dir.
-
- Themes_dir: STRING = "themes"
- -- Themes dir.
+note
+ copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
+ license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end
diff --git a/tools/roc/license.lic b/tools/roc/license.lic
new file mode 100644
index 0000000..3e50931
--- /dev/null
+++ b/tools/roc/license.lic
@@ -0,0 +1,3 @@
+${NOTE_KEYWORD}
+ copyright: "2011-${YEAR}, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
+ license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
diff --git a/tools/roc/roc.ecf b/tools/roc/roc.ecf
index 33a4fad..e38b269 100644
--- a/tools/roc/roc.ecf
+++ b/tools/roc/roc.ecf
@@ -1,13 +1,13 @@
-
+
-
+ /EIFGENs$
diff --git a/tools/roc/roc_command.e b/tools/roc/roc_command.e
new file mode 100644
index 0000000..28c3c81
--- /dev/null
+++ b/tools/roc/roc_command.e
@@ -0,0 +1,53 @@
+note
+ description: "Abstraction of roc command."
+ date: "$Date$"
+ revision: "$Revision$"
+
+deferred class
+ ROC_COMMAND
+
+inherit
+ SHARED_EXECUTION_ENVIRONMENT
+ rename
+ print as ascii_print
+ end
+
+ LOCALIZED_PRINTER
+ rename
+ print as ascii_print,
+ localized_print as print
+ end
+
+feature {NONE} -- Initialization
+
+ make (a_name: READABLE_STRING_8)
+ do
+ create name.make_from_string (a_name)
+ end
+
+feature -- Access
+
+ name: IMMUTABLE_STRING_8
+
+ help: STRING_32
+ deferred
+ end
+
+feature -- Status report
+
+ is_valid (args: ARRAY [READABLE_STRING_32]): BOOLEAN
+ deferred
+ end
+
+feature -- Execution
+
+ execute (args: ARRAY [READABLE_STRING_32])
+ require
+ args.lower = 0 -- Prog name at index 0, args at index 1, ...
+ deferred
+ end
+
+note
+ copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
+ license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
+end
diff --git a/tools/roc/roc_install_command.e b/tools/roc/roc_install_command.e
new file mode 100644
index 0000000..df15f07
--- /dev/null
+++ b/tools/roc/roc_install_command.e
@@ -0,0 +1,285 @@
+note
+ description: "Installation command."
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ ROC_INSTALL_COMMAND
+
+inherit
+ ROC_COMMAND
+
+create
+ make
+
+feature -- Access
+
+ help: STRING_32
+ once
+ Result := "[--module|-m ] [(--dir|-d ) | ] [--site-dir ]"
+ end
+
+feature -- Status report
+
+ is_valid (args: ARRAY [READABLE_STRING_32]): BOOLEAN
+ -- Is the submitted install command valid?
+ local
+ i, n: INTEGER
+ optional_module: BOOLEAN
+ cms_path: BOOLEAN
+ do
+ n := args.upper
+ -- TODO add error reporting.
+ if n >= 1 and then n <= 4 then
+ from
+ i := 1
+ until
+ i > n
+ loop
+ if args [i].same_string ("-m") then
+ optional_module := True
+ elseif args [i].same_string ("--module") then
+ optional_module := True
+ elseif args [i].same_string ("-d") then
+ cms_path := True
+ elseif args [i].same_string ("--dir") then
+ cms_path := True
+ end
+ i := i + 1
+ end
+ if n = 4 then
+ if (cms_path and optional_module) then
+ -- valid command
+ Result := True
+ else
+ print ("Error check the optional argument --module|-m and --dir|-d")
+ end
+ elseif n = 2 then
+ if (cms_path and not optional_module) then
+ Result := True
+ else
+ print ("Error missing value for dir")
+ Result := False
+ end
+ else
+ Result := True
+ end
+ else
+ Result := False
+ if n > 4 then
+ print ("Too many arguments")
+ end
+ if n < 1 then
+ print ("Too few argumetns")
+ end
+ end
+ end
+
+feature -- Helpers
+
+ module_name (a_path: PATH): STRING_32
+ do
+ -- FIXME: better implementation needed. Either based on "a" new module.info file, or parsing the .ecf
+ if attached a_path.entry as e then
+ Result := e.name
+ else
+ Result := a_path.name
+ end
+ end
+
+feature -- Execution
+
+ execute (args: ARRAY [READABLE_STRING_32])
+ -- Install a module into a cms application.
+ -- Pattern: module_src/site/* => cms/site/modules/$module_name/*
+ local
+ l_site_path, l_cms_path, l_module_source_path: detachable PATH
+ l_site_dir: DIRECTORY
+ l_modules_dir: DIRECTORY
+ l_dest_dir: DIRECTORY
+ i,n: INTEGER
+ do
+ from
+ i := 1
+ n := args.upper
+ until
+ i > n
+ loop
+ if attached args[i] as arg then
+ if
+ arg.same_string ("-d")
+ or arg.same_string ("--dir")
+ then
+ i := i + 1
+ if i <= n then
+ create l_cms_path.make_from_string (args[i])
+ end
+ elseif
+ arg.same_string ("--site-dir")
+ then
+ i := i + 1
+ if i <= n then
+ create l_site_path.make_from_string (args[i])
+ end
+ elseif
+ arg.same_string ("-m")
+ or arg.same_string ("--module")
+ then
+ i := i + 1
+ if i <= n then
+ create l_module_source_path.make_from_string (args[i])
+ end
+ end
+ end
+ i := i + 1
+ end
+ if l_module_source_path = Void then
+ l_module_source_path := Execution_environment.current_working_path
+ end
+ if l_cms_path = Void then
+ l_cms_path := Execution_environment.current_working_path.extended ("modules")
+ end
+ if l_cms_path /= Void and l_module_source_path /= Void then
+ -- If l_site_path is not set; initialize it to $cms_path/site.
+ if l_site_path = Void then
+ l_site_path := l_cms_path.extended ("site")
+ end
+
+ -- Install configuration files.
+ if attached module_name (l_module_source_path) as l_mod_name then
+ create l_site_dir.make_with_path (l_site_path)
+
+ if l_site_dir.exists then
+ create l_modules_dir.make_with_path (l_site_path.extended ("modules"))
+ if not l_modules_dir.exists then
+ l_modules_dir.create_dir
+ end
+
+ create l_dest_dir.make_with_path (l_modules_dir.path.extended (l_mod_name))
+ if not l_dest_dir.exists then
+ l_dest_dir.create_dir
+ end
+ install_module_elements (l_module_source_path, l_dest_dir.path, Void)
+-- install_module_elements (l_module_source_path, l_dest_dir.path, Config_dir)
+-- install_module_elements (l_module_source_path, l_dest_dir.path, Scripts_dir)
+-- install_module_elements (l_module_source_path, l_dest_dir.path, Themes_dir)
+ print ("Module ")
+ print (l_mod_name)
+ print (" was successfuly installed to the CMS Application location ")
+ print (l_cms_path.name)
+ print ("%NCheck the module elements at ")
+ print (l_dest_dir.path.name)
+ print (".%N")
+ else
+ print ({STRING_32} "The CMS Application located at " + l_cms_path.name + "does not have the site or modules folders.%N")
+ end
+ else
+ print ("Error: not possible to retrieve module name.%N")
+ end
+ else
+ print ("Error: wrong path to CMS application.%N")
+ end
+ end
+
+ install_module_elements (a_module_source_path: PATH; a_cms_module_target_path: PATH; a_element: detachable READABLE_STRING_GENERAL)
+ -- Install module site files from `a_module_source_path' to cms application `a_cms_module_target_path' under expected modules folder.
+ -- If `a_element' is set, take into account only sub folder `a_element'.
+ local
+ l_path: PATH
+ l_dest_dir: DIRECTORY
+ l_src_dir: DIRECTORY
+ do
+ l_path := a_module_source_path.extended ("site")
+ if a_element /= Void then
+ -- Copy all files under "site/$a_element" into "site/modules/$module_name/$a_element" location.
+ create l_src_dir.make_with_path (l_path.extended (a_element))
+ create l_dest_dir.make_with_path (a_cms_module_target_path.extended (a_element))
+ else
+ -- Copy all files under "site" into "site/modules/$module_name/" location.
+ create l_src_dir.make_with_path (l_path)
+ create l_dest_dir.make_with_path (a_cms_module_target_path)
+ end
+ if not l_dest_dir.exists then
+ l_dest_dir.create_dir
+ end
+ copy_directory (l_src_dir, l_dest_dir, True)
+ end
+
+feature {NONE} -- System/copy files
+
+ copy_directory (a_src: DIRECTORY; a_dest: DIRECTORY; is_recursive: BOOLEAN)
+ -- Copy all elements from `a_src' to `a_dest'.
+ local
+ l_dir: DIRECTORY
+ l_new_dir: DIRECTORY
+ entry: PATH
+ l_path: PATH
+ l_file: FILE
+ ut: FILE_UTILITIES
+ do
+ across
+ a_src.entries as ic
+ loop
+ entry := ic.item
+ if not (entry.is_current_symbol or else entry.is_parent_symbol) then
+ l_path := a_src.path.extended_path (entry)
+ create {RAW_FILE} l_file.make_with_path (l_path)
+ if not l_file.is_directory then
+ copy_file_in_directory (l_file, a_dest.path)
+ elseif is_recursive then
+ create l_dir.make_with_path (l_path)
+ create l_new_dir.make_with_path (a_dest.path.extended_path (entry))
+ ut.create_directory_path (l_new_dir.path)
+ if l_dir.exists then
+ copy_directory (l_dir, l_new_dir, is_recursive)
+ end
+ end
+ end
+ end
+ end
+
+ copy_file_in_directory (a_file: FILE; a_dir: PATH)
+ -- Copy file `a_file' to dir `a_dir'.
+ local
+ retried: BOOLEAN
+ l_dest: RAW_FILE
+ do
+ if not retried then
+ if attached a_file.path.entry as e then
+ create l_dest.make_with_path (a_dir.extended_path (e))
+ l_dest.create_read_write
+ a_file.open_read
+ -- Copy file source to destination
+ if
+ l_dest.exists and then
+ l_dest.is_writable and then
+ a_file.exists and then
+ a_file.is_readable
+ then
+ a_file.copy_to (l_dest)
+ a_file.close
+ l_dest.close
+ end
+ end
+ end
+ rescue
+ retried := True
+ retry
+ end
+
+--feature -- Constants
+
+-- Config_dir: STRING = "config"
+-- -- Configuration dir.
+
+-- Scripts_dir: STRING = "scripts"
+-- -- Scripts dir.
+
+-- Themes_dir: STRING = "themes"
+-- -- Themes dir.
+
+
+note
+ copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
+ license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
+end