Ticket #2625: mc-4.7.5.5-sshutime.patch
File mc-4.7.5.5-sshutime.patch, 5.1 KB (added by sergem, 13 years ago) |
---|
-
lib/fileloc.h
diff -urN mc-4.7.5.5.orig/lib/fileloc.h mc-4.7.5.5/lib/fileloc.h
old new 38 38 #define FISH_UNLINK_FILE "unlink" 39 39 #define FISH_CHOWN_FILE "chown" 40 40 #define FISH_CHMOD_FILE "chmod" 41 #define FISH_UTIME_FILE "utime" 41 42 #define FISH_RMDIR_FILE "rmdir" 42 43 #define FISH_LN_FILE "ln" 43 44 #define FISH_MV_FILE "mv" -
lib/vfs/mc-vfs/fish.c
diff -urN mc-4.7.5.5.orig/lib/vfs/mc-vfs/fish.c mc-4.7.5.5/lib/vfs/mc-vfs/fish.c
old new 275 275 g_free (SUP.scr_unlink); 276 276 g_free (SUP.scr_chown); 277 277 g_free (SUP.scr_chmod); 278 g_free (SUP.scr_utime); 278 279 g_free (SUP.scr_rmdir); 279 280 g_free (SUP.scr_ln); 280 281 g_free (SUP.scr_mv); … … 575 576 SUP.scr_unlink = fish_load_script_from_file (host, FISH_UNLINK_FILE, FISH_UNLINK_DEF_CONTENT); 576 577 SUP.scr_chown = fish_load_script_from_file (host, FISH_CHOWN_FILE, FISH_CHOWN_DEF_CONTENT); 577 578 SUP.scr_chmod = fish_load_script_from_file (host, FISH_CHMOD_FILE, FISH_CHMOD_DEF_CONTENT); 579 SUP.scr_utime = fish_load_script_from_file (host, FISH_UTIME_FILE, FISH_UTIME_DEF_CONTENT); 578 580 SUP.scr_rmdir = fish_load_script_from_file (host, FISH_RMDIR_FILE, FISH_RMDIR_DEF_CONTENT); 579 581 SUP.scr_ln = fish_load_script_from_file (host, FISH_LN_FILE, FISH_LN_DEF_CONTENT); 580 582 SUP.scr_mv = fish_load_script_from_file (host, FISH_MV_FILE, FISH_MV_DEF_CONTENT); … … 1272 1274 /* --------------------------------------------------------------------------------------------- */ 1273 1275 1274 1276 static int 1277 fish_utime (struct vfs_class *me, const char *path, struct utimbuf *times) 1278 { 1279 gchar *shell_commands = NULL; 1280 char utcmtime[16], utcatime[16]; 1281 struct tm *gmt; 1282 1283 PREFIX; 1284 1285 gmt = gmtime(×->modtime); 1286 g_snprintf (utcmtime, sizeof (utcmtime), "%04d%02d%02d%02d%02d.%02d", 1287 gmt->tm_year+1900, gmt->tm_mon+1, gmt->tm_mday, 1288 gmt->tm_hour, gmt->tm_min, gmt->tm_sec); 1289 1290 gmt = gmtime(×->actime); 1291 g_snprintf (utcatime, sizeof (utcatime), "%04d%02d%02d%02d%02d.%02d", 1292 gmt->tm_year+1900, gmt->tm_mon+1, gmt->tm_mday, 1293 gmt->tm_hour, gmt->tm_min, gmt->tm_sec); 1294 1295 shell_commands = g_strconcat (SUP.scr_env, "FISH_FILENAME=%s FISH_FILEMTIME=%s FISH_FILEATIME=%s;\n", 1296 SUP.scr_utime, (char *) NULL); 1297 g_snprintf (buf, sizeof (buf), shell_commands, rpath, utcmtime, utcatime); 1298 g_free (shell_commands); 1299 g_free (rpath); 1300 return fish_send_command (me, super, buf, OPT_FLUSH); 1301 } 1302 1303 /* --------------------------------------------------------------------------------------------- */ 1304 1305 static int 1275 1306 fish_unlink (struct vfs_class *me, const char *path) 1276 1307 { 1277 1308 gchar *shell_commands = NULL; … … 1458 1489 vfs_fish_ops.fill_names = fish_fill_names; 1459 1490 vfs_fish_ops.chmod = fish_chmod; 1460 1491 vfs_fish_ops.chown = fish_chown; 1492 vfs_fish_ops.utime = fish_utime; 1461 1493 vfs_fish_ops.open = fish_open; 1462 1494 vfs_fish_ops.symlink = fish_symlink; 1463 1495 vfs_fish_ops.link = fish_link; -
lib/vfs/mc-vfs/fishdef.h
diff -urN mc-4.7.5.5.orig/lib/vfs/mc-vfs/fishdef.h mc-4.7.5.5/lib/vfs/mc-vfs/fishdef.h
old new 74 74 " echo \"### 500\"\n" \ 75 75 "fi\n" 76 76 77 /* default 'utime' script */ 78 #define FISH_UTIME_DEF_CONTENT "" \ 79 "#UTIME $FISH_FILEMTIME $FISH_FILEATIME $FISH_FILENAME\n" \ 80 "if TZ=UTC touch -m -t $FISH_FILEMTIME \"/${FISH_FILENAME}\" 2>/dev/null; then\n" \ 81 " if TZ=UTC touch -a -t $FISH_FILEATIME \"/${FISH_FILENAME}\" 2>/dev/null; then\n" \ 82 " echo \"### 000\"\n" \ 83 " else\n" \ 84 " echo \"### 500\"\n" \ 85 " fi\n" \ 86 "else\n" \ 87 " echo \"### 500\"\n" \ 88 "fi\n" 89 77 90 /* default 'rmdir' script */ 78 91 #define FISH_RMDIR_DEF_CONTENT "" \ 79 92 "#RMD $FISH_FILENAME\n" \ -
lib/vfs/mc-vfs/xdirentry.h
diff -urN mc-4.7.5.5.orig/lib/vfs/mc-vfs/xdirentry.h mc-4.7.5.5/lib/vfs/mc-vfs/xdirentry.h
old new 72 72 int flags; 73 73 char *scr_ls; 74 74 char *scr_chmod; 75 char *scr_utime; 75 76 char *scr_exists; 76 77 char *scr_mkdir; 77 78 char *scr_unlink;