Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/elfmz/far2l.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelfmz <fenix1905@tut.by>2020-06-06 23:53:42 +0300
committerelfmz <fenix1905@tut.by>2020-06-06 23:53:42 +0300
commit8390ef46417123ec66e1da324aa03b03da0d3888 (patch)
treef2d292466fe5b77a1f1c00bcd9b1b88a063f893f
parenta2e368b3ca4f88a7afe44f8a5e1106d7edb39fe0 (diff)
NetRocks: added option <Smart symlinks copying> that is ON by default and that allows disabling too smart behaviour when copying symbolic links (close #705)alpha-14jun20
-rw-r--r--NetRocks/configs/plug/eng.lng3
-rw-r--r--NetRocks/configs/plug/helpe.hlf1
-rw-r--r--NetRocks/configs/plug/rus.lng1
-rw-r--r--NetRocks/src/Op/OpXfer.cpp10
-rw-r--r--NetRocks/src/Op/OpXfer.h3
-rw-r--r--NetRocks/src/UI/Settings/ConfigurePlugin.cpp7
-rw-r--r--NetRocks/src/lng.h1
7 files changed, 21 insertions, 5 deletions
diff --git a/NetRocks/configs/plug/eng.lng b/NetRocks/configs/plug/eng.lng
index be8006bc..ffa4c06c 100644
--- a/NetRocks/configs/plug/eng.lng
+++ b/NetRocks/configs/plug/eng.lng
@@ -11,6 +11,7 @@
"NetRocks options"
"Enable desktop &notifications"
"<&ENTER> to execute files remotely when possible"
+"Smart &symlinks copying"
"Copy attributes that override &umask"
"Connections pool e&xpiration (seconds):"
"Connect using &proxy (requires tsocks library)"
@@ -245,7 +246,7 @@
"Server &codepage"
"&Passive mode"
"Use &MLSD/MLST if possible"
-"Enable commands &pipelining"
+"Enable commands pipe&lining"
"En&sure data connection peer matches server"
"Enable &TCP_NODELAY option"
"Enable TCP_&QUICKACK option"
diff --git a/NetRocks/configs/plug/helpe.hlf b/NetRocks/configs/plug/helpe.hlf
index 820f0607..dbe872dc 100644
--- a/NetRocks/configs/plug/helpe.hlf
+++ b/NetRocks/configs/plug/helpe.hlf
@@ -54,6 +54,7 @@ $^#Configuration menu#
Here you can change some plugin-wide options:
#Enable desktop notifications# this options controls if NetRocks will use desktop environment notifications on operation completions or errors. Note that behaviour of this notifications partially controlled by FAR.
#<ENTER> to execute files remotely when possible# if enabled then pressing <ENTER> on remote executable file will execute it remotely instead of download and run locally. Note that this option only works for protocols that support it (like SFTP/SCP) and doesnt affect non-executable files, like documents, - they will be still downloaded and opened locally.
+ #Smart symlinks copying# if (by default) enabled then NetRocks will translate symlinks pathes to refer file that copied in same copy operation, or, if symlinks refer file that is not being copied - then such symlink will be converted to plain file. If disabled then NetRocks will just copy symlinks as is, without any efforts to ensure their validity in the new location.
#Copy attributes that override umask# enable this options if want to have copied files modes to be exactly same as on source files, even in target system umask prevents some mode bits from being set.
#Connections pool expiration# when exiting from some remote FS navigation NetRocks will keep actuall connection active for specified amount of time and if same server connection will be established before expiration - it will use preserved connection instead of establishing new.
#Connect using proxy# enable this option to enable protocol-invariant proxy server tunneling. This options uses tsocks library and thus can be enabled only if it installed. Also you will need to edit its configuration file to adjust it to your needs.
diff --git a/NetRocks/configs/plug/rus.lng b/NetRocks/configs/plug/rus.lng
index 9523d464..55225709 100644
--- a/NetRocks/configs/plug/rus.lng
+++ b/NetRocks/configs/plug/rus.lng
@@ -11,6 +11,7 @@
"Настройки NetRocks"
"Включить уведомления рабочего стола"
"<&ENTER> исполняет файлы на сервере если возможно"
+"Умное копирование символических &cсылок"
"Копировать аттрибуты противоречащие &umask"
"Таймаут неиспользуемых соединений (сек.):"
"Подключаться через прокси (требует tsocks)"
diff --git a/NetRocks/src/Op/OpXfer.cpp b/NetRocks/src/Op/OpXfer.cpp
index 34920b8d..fe28b664 100644
--- a/NetRocks/src/Op/OpXfer.cpp
+++ b/NetRocks/src/Op/OpXfer.cpp
@@ -25,9 +25,10 @@ OpXfer::OpXfer(int op_mode, std::shared_ptr<IHost> &base_host, const std::string
_dst_dir(dst_dir),
_kind(kind),
_direction(direction),
- _io_buf(BUFFER_SIZE_INITIAL, BUFFER_SIZE_GRANULARITY, BUFFER_SIZE_LIMIT)
+ _io_buf(BUFFER_SIZE_INITIAL, BUFFER_SIZE_GRANULARITY, BUFFER_SIZE_LIMIT),
+ _smart_symlinks_copy(G.GetGlobalConfigBool("SmartSymlinksCopy", true)),
+ _umask_override(G.GetGlobalConfigBool("UMaskOverride", false))
{
- _umask_override = G.GetGlobalConfigBool("UMaskOverride", false);
_enumer = std::make_shared<Enumer>(_entries, _base_host, _base_dir, items, items_count, true, _state, _wea_state);
_diffname_suffix = ".NetRocks@";
@@ -629,7 +630,10 @@ bool OpXfer::SymlinkCopy(const std::string &path_src, const std::string &path_ds
std::string orig_symlink_target = symlink_target;
- if (symlink_target[0] == '/') {
+ if (!_smart_symlinks_copy) {
+ ;
+
+ } else if (symlink_target[0] == '/') {
if (_entries.find(symlink_target) == _entries.end()) {
fprintf(stderr, "NetRocks: SymlinkCopy dismiss '%s' [%s]\n",
path_src.c_str(), orig_symlink_target.c_str());
diff --git a/NetRocks/src/Op/OpXfer.h b/NetRocks/src/Op/OpXfer.h
index a40f4eec..0c7b26ec 100644
--- a/NetRocks/src/Op/OpXfer.h
+++ b/NetRocks/src/Op/OpXfer.h
@@ -16,8 +16,9 @@ class OpXfer : protected OpBase, public IBackgroundTask
XferKind _kind;
XferDirection _direction;
IOBuffer _io_buf;
+ bool _smart_symlinks_copy;
+ bool _umask_override;
bool _on_site_move = false;
- bool _umask_override = false;
virtual void Process();
diff --git a/NetRocks/src/UI/Settings/ConfigurePlugin.cpp b/NetRocks/src/UI/Settings/ConfigurePlugin.cpp
index db902061..0758fadb 100644
--- a/NetRocks/src/UI/Settings/ConfigurePlugin.cpp
+++ b/NetRocks/src/UI/Settings/ConfigurePlugin.cpp
@@ -12,6 +12,7 @@
=============== NetRocks global options ====================
| [x] Enable desktop notifications |
| [x] <ENTER> to execute files remotely when possible |
+| [x] Smart symlinks copying |
| [ ] Copy attributes that overrides umask |
| Connections pool expiration (seconds): [ ] |
| [ ] Connect using proxy (requires tsocks library) |
@@ -55,6 +56,7 @@ class ConfigurePlugin : protected BaseDialog
{
int _i_enable_desktop_notifications = -1;
int _i_enter_exec_remotely = -1;
+ int _i_smart_symlinks_copy = -1;
int _i_umask_override = -1;
int _i_conn_pool_expiration = -1;
int _i_use_proxy = -1, _i_edit_tsocks_config = -1;
@@ -101,6 +103,9 @@ public:
_i_enter_exec_remotely = _di.AddAtLine(DI_CHECKBOX, 5,62, 0, MEnterExecRemotely);
_di.NextLine();
+ _i_smart_symlinks_copy = _di.AddAtLine(DI_CHECKBOX, 5,62, 0, MSmartSymlinksCopy);
+
+ _di.NextLine();
_i_umask_override = _di.AddAtLine(DI_CHECKBOX, 5,62, 0, MUMaskOverride);
_di.NextLine();
@@ -129,6 +134,7 @@ public:
{
SetCheckedDialogControl( _i_enable_desktop_notifications, G.GetGlobalConfigBool("EnableDesktopNotifications", true) );
SetCheckedDialogControl( _i_enter_exec_remotely, G.GetGlobalConfigBool("EnterExecRemotely", true) );
+ SetCheckedDialogControl( _i_smart_symlinks_copy, G.GetGlobalConfigBool("SmartSymlinksCopy", true) );
SetCheckedDialogControl( _i_umask_override, G.GetGlobalConfigBool("UMaskOverride", false) );
LongLongToDialogControl( _i_conn_pool_expiration, G.GetGlobalConfigInt("ConnectionsPoolExpiration", 30) );
SetCheckedDialogControl( _i_use_proxy, G.GetGlobalConfigBool("UseProxy", false) );
@@ -137,6 +143,7 @@ public:
auto gcw = G.GetGlobalConfigWriter();
gcw.PutBool("EnableDesktopNotifications", IsCheckedDialogControl(_i_enable_desktop_notifications) );
gcw.PutBool("EnterExecRemotely", IsCheckedDialogControl(_i_enter_exec_remotely) );
+ gcw.PutBool("SmartSymlinksCopy", IsCheckedDialogControl(_i_smart_symlinks_copy) );
gcw.PutBool("UMaskOverride", IsCheckedDialogControl(_i_umask_override) );
gcw.PutInt("ConnectionsPoolExpiration", LongLongFromDialogControl( _i_conn_pool_expiration) );
gcw.PutBool("UseProxy", IsCheckedDialogControl(_i_use_proxy) );
diff --git a/NetRocks/src/lng.h b/NetRocks/src/lng.h
index db142429..a9f98cb6 100644
--- a/NetRocks/src/lng.h
+++ b/NetRocks/src/lng.h
@@ -13,6 +13,7 @@ enum LanguageID
MPluginOptionsTitle,
MEnableDesktopNotifications,
MEnterExecRemotely,
+ MSmartSymlinksCopy,
MUMaskOverride,
MConnPoolExpiration,
MConnectUsingProxy,