[EGIT] [efm2] 01/01: remove some more debug printfs
This is an automated email from the git hooks/post-receive script. git pushed a commit to branch master in repository efm2. View the commit online. commit 887f89748c37833ff614475f8a961371b0cd4868 Author: Carsten Haitzler (Rasterman) AuthorDate: Mon Apr 29 19:24:30 2024 +0100 remove some more debug printfs --- src/backends/default/fs.c | 5 - 1 file changed, 5 deletions(-) diff --git a/src/backends/default/fs.c b/src/backends/default/fs.c index 5902111..53d19d0 100644 --- a/src/backends/default/fs.c +++ b/src/backends/default/fs.c @@ -431,11 +431,6 @@ err_unlink: utimes(dst, times); err: umask(old_umask); - if (!res) -{ - fprintf(stderr, "MV: ERROR!\n"); - fflush(stderr); -} return res; } -- To stop receiving notification emails like this one, please contact the administrator of this repository.
[EGIT] [efm2] 01/01: remove some more comments
This is an automated email from the git hooks/post-receive script. git pushed a commit to branch master in repository efm2. View the commit online. commit 90f0005bcdef85ecd8952fcb5bfc83d1a59d5ed9 Author: Carsten Haitzler (Rasterman) AuthorDate: Mon Apr 29 19:23:42 2024 +0100 remove some more comments --- src/backends/default/fs.c | 37 - 1 file changed, 37 deletions(-) diff --git a/src/backends/default/fs.c b/src/backends/default/fs.c index 593fef3..5902111 100644 --- a/src/backends/default/fs.c +++ b/src/backends/default/fs.c @@ -151,43 +151,6 @@ Eina_Bool fs_cp_rm(const char *src, const char *dst, Eina_Bool report_err, Eina_Bool cp, Eina_Bool rm) { // cp_rm /path/to/src/filename /path/to/dst/filename - // XXX: ecore_file_mv() ? <- look at it - // XXX: utime()/utimes() -> utimensat() - // - // if src is dir - // fs_mkdir(dst) - // for all files in src - // fs_cp_rm(src/file, dst/file, report_err) - // fs_utimes(src, dst) - // fs_chmod(src, dst) - // fs_chown(src, dst) - // fs_utimes(src, dst) - // fs_chmod(src, dst) - // fs_chown(src, dst) - // fs_rmdir(src) - // else - // if (src is file) - // fs_cp(src, dst, report_err) - // fs_cp_xattr(src, dst) - // else if (src is symlink) - // fs_ln(src, dst) - // else if (src is fifo) - // fs_mkfifo(dst) - // else if (src is socket) - // fs_touch(dst) - // else if (src is chrdev) - // fs_chrdevdup(src, dst) - // else if (src is blkdev) - // fs_blkdevdup(src, dst) - // fs_utimes(src, dst) - // fs_chmod(src, dst) - // fs_chown(src, dst) - // fs_rm(src) - // fs_cp(src_meta, dst_meta) - // fs_utimes(src_meta, dst_meta) - // fs_chmod(src_meta, dst_meta) - // fs_chown(src_meta, dst_meta) - // fs_rm(src_meta) Eina_Bool res = EINA_TRUE; Eina_Iterator *it; const char*s; -- To stop receiving notification emails like this one, please contact the administrator of this repository.
[EGIT] [efm2] 01/01: remove debug/comments not needed
This is an automated email from the git hooks/post-receive script. git pushed a commit to branch master in repository efm2. View the commit online. commit cfac7a7e4bc355595aaffc4713a2429832d2ef62 Author: Carsten Haitzler (Rasterman) AuthorDate: Mon Apr 29 19:22:25 2024 +0100 remove debug/comments not needed --- src/backends/default/mv.c | 21 ++--- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/src/backends/default/mv.c b/src/backends/default/mv.c index 08004a3..3cfe971 100644 --- a/src/backends/default/mv.c +++ b/src/backends/default/mv.c @@ -31,9 +31,6 @@ main(int argc, char **argv) ecore_init(); efreet_init(); - fprintf(stderr, "MV: [%s] -> [%s]\n", src, dst); - fflush(stderr); - config_dir = getenv("E_HOME_DIR"); home_dir = getenv("HOME"); if (!home_dir) return 77; // no $HOME? definitely an error! @@ -46,18 +43,6 @@ main(int argc, char **argv) } meta_init(config_dir); - // src = "" - // dst = DDIR/ - // - // mv SDIR/SFILE DDIR/SFILE - // if errno == EXDEV - // cpSDIR/SFILE DDIR/SFILE - // rmSDIR/SFILE - // else if errno == 0 - // if exists SDIR/.efm/SFILE.efm - // mkdir DDIR/.efm - // mv SDIR/.efm/SFILE.efm DDIR/.efm/SFILE.efm - fname = ecore_file_file_get(src); if (!fname) goto err; buf = eina_strbuf_new(); @@ -94,10 +79,8 @@ main(int argc, char **argv) free(src_meta); free(dst_meta); } - else -{ - status_end(); -} + else status_end(); + err: if (buf) eina_strbuf_free(buf); status_end(); -- To stop receiving notification emails like this one, please contact the administrator of this repository.
[EGIT] [efm2] 01/01: move fs working code into fs.c and make it also do rm and cp
This is an automated email from the git hooks/post-receive script. git pushed a commit to branch master in repository efm2. View the commit online. commit 575fbfa026df5575e0d68132c3f92450c49c7bdf Author: Carsten Haitzler (Rasterman) AuthorDate: Mon Apr 29 19:14:25 2024 +0100 move fs working code into fs.c and make it also do rm and cp --- src/backends/default/{mv.c => fs.c} | 379 +- src/backends/default/fs.h | 10 + src/backends/default/meson.build| 1 + src/backends/default/mv.c | 447 +--- 4 files changed, 175 insertions(+), 662 deletions(-) diff --git a/src/backends/default/mv.c b/src/backends/default/fs.c similarity index 57% copy from src/backends/default/mv.c copy to src/backends/default/fs.c index 740357e..593fef3 100644 --- a/src/backends/default/mv.c +++ b/src/backends/default/fs.c @@ -1,16 +1,10 @@ // for copy_file_range() -#include #define _GNU_SOURCE #define _FILE_OFFSET_BITS 64 #include -#include #include -#include -#include -#include -#include #include #include #include @@ -18,10 +12,8 @@ #include #include -#include "meta.h" #include "status.h" - -static const char *config_dir = NULL; +#include "fs.h" // generic error handler. special case handling all errnos for everything is // pretty insane - so handle non-errors in switches and otherwise pass to @@ -107,7 +99,7 @@ _error_handle(const char *src, const char *dst, int errno_in) // not be 100% right as the fs can change while the scan happens and after // so any move that devolves into a cp + rm isn't going to be atomic and // handle a changing fs while it works anyway -static Eina_Bool +Eina_Bool fs_scan(const char *src) { Eina_Bool res = EINA_TRUE; @@ -150,14 +142,14 @@ fs_scan(const char *src) // or a char or block device etc. status_count(1, ecore_file_file_get(src)); // in addition each byte in the file count as a progress item too - if (st.st_size > 0) -status_count(st.st_size, ecore_file_file_get(src)); + if (st.st_size > 0) status_count(st.st_size, ecore_file_file_get(src)); } return res; } -static Eina_Bool -fs_cp_rm(const char *src, const char *dst, Eina_Bool report_err) +Eina_Bool +fs_cp_rm(const char *src, const char *dst, Eina_Bool report_err, Eina_Bool cp, + Eina_Bool rm) { // cp_rm /path/to/src/filename /path/to/dst/filename // XXX: ecore_file_mv() ? <- look at it // XXX: utime()/utimes() -> utimensat() @@ -196,7 +188,7 @@ fs_cp_rm(const char *src, const char *dst, Eina_Bool report_err) // fs_chmod(src_meta, dst_meta) // fs_chown(src_meta, dst_meta) // fs_rm(src_meta) - Eina_Bool res = EINA_TRUE; + Eina_Bool res = EINA_TRUE; Eina_Iterator *it; const char*s; struct statst; @@ -225,16 +217,19 @@ fs_cp_rm(const char *src, const char *dst, Eina_Bool report_err) old_umask = umask(0); if (S_ISDIR(st.st_mode)) { // it's a dir - scan this recursively - if (mkdir(dst, st.st_mode) != 0) + if (cp) { - switch (errno) + if (mkdir(dst, st.st_mode) != 0) { -case EEXIST: // ignore - mv would mv over this anyway - break; -default: // WAT - _error_handle(NULL, dst, errno); - res = EINA_FALSE; - goto err; + switch (errno) +{ +case EEXIST: // ignore - mv would mv over this anyway + break; +default: // WAT + _error_handle(NULL, dst, errno); + res = EINA_FALSE; + goto err; +} } } it = eina_file_ls(src); @@ -243,7 +238,7 @@ fs_cp_rm(const char *src, const char *dst, Eina_Bool report_err) EINA_ITERATOR_FOREACH(it, s) { Eina_Strbuf *buf = eina_strbuf_new(); -const char *fs = ecore_file_file_get(s); +const char *fs = ecore_file_file_get(s); if (buf) { @@ -252,7 +247,8 @@ fs_cp_rm(const char *src, const char *dst, Eina_Bool report_err) eina_strbuf_append(buf, dst); eina_strbuf_append(buf, "/"); eina_strbuf_append(buf, fs); -if (!fs_cp_rm(s, eina_strbuf_string_get(buf), report_err)) +if (!fs_cp_rm(s, eina_strbuf_string_get(buf), report_err, + cp, rm)) res = EINA_FALSE; } eina_strbuf_free(buf); @@ -261,149 +257,194 @@ fs_cp_rm(const char *src, const char *dst, Eina_Bool report_err) } eina_iterator_free(it); } - if (res) rmdir(src); + if ((rm) && (res)) +{ + if (rmdir(src) != 0) +{ + switch (errno) +{ +case