]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
Merge branch 'PR/hardlink-nftw-imrovements' of https://github.com/karelzak/util-linux...
authorKarel Zak <kzak@redhat.com>
Tue, 5 Nov 2024 09:59:13 +0000 (10:59 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 5 Nov 2024 09:59:13 +0000 (10:59 +0100)
* 'PR/hardlink-nftw-imrovements' of https://github.com/karelzak/util-linux-work:
  hardlink: implement --mount
  hardlink: add missing verbose messages and unify them
  hardlink: implement --exclude-subtree

1  2 
bash-completion/hardlink
misc-utils/hardlink.1.adoc
misc-utils/hardlink.c

Simple merge
Simple merge
index e996f53b5e98b73cd5d1d92074849a084ef9fb89,2d3861c98ef5f627067e9a301402814a9c9e2294..899c0d63537eeb2f44fdd446413094742f5c3628
@@@ -189,8 -195,7 +195,9 @@@ static struct options 
        unsigned int keep_oldest:1;
        unsigned int prio_trees:1;
        unsigned int dry_run:1;
 +      unsigned int list_duplicates:1;
 +      char line_delim;
+       unsigned int within_mount:1;
        uintmax_t min_size;
        uintmax_t max_size;
        size_t io_size;
@@@ -841,9 -850,19 +848,18 @@@ static int inserter(const char *fpath, 
        int included;
        int excluded;
  
 -      if (handle_interrupt())
 -              return 1;
 +      handle_interrupt();
        if (typeflag == FTW_DNR || typeflag == FTW_NS)
                warn(_("cannot read %s"), fpath);
+ #ifdef USE_SKIP_SUBTREE
+       if (opts.exclude_subtree
+           && typeflag == FTW_D
+           && match_any_regex(opts.exclude_subtree, fpath)) {
+               jlog(JLOG_VERBOSE1,
+                       _("Skipped (excluded subtree) %s"), fpath);
+               return FTW_SKIP_SUBTREE;
+       }
+ #endif
        if (typeflag != FTW_F || !S_ISREG(sb->st_mode))
                return 0;
  
@@@ -1222,9 -1244,11 +1245,11 @@@ static int parse_options(int argc, cha
  {
        enum {
                OPT_REFLINK = CHAR_MAX + 1,
-               OPT_SKIP_RELINKS
+               OPT_SKIP_RELINKS,
+               OPT_EXCLUDE_SUBTREE,
+               OPT_MOUNT
        };
 -      static const char optstr[] = "VhvndfpotXcmMFOx:y:i:r:S:s:b:q";
 +      static const char optstr[] = "VhvndfpotXcmMFOlzx:y:i:r:S:s:b:q";
        static const struct option long_options[] = {
                {"version", no_argument, NULL, 'V'},
                {"help", no_argument, NULL, 'h'},