Bug#287515: xutils: [lndir] [patch] create symlinks to directories instead of building tree
Package: xutils
Version: 4.3.0.dfsg.1-8
Severity: wishlist
Tags: patch
This patch adds an option '-ignoredirs' (like '-ignorelinks') that creates
a symlink even if the target is a directory. This may not be useful for X, but
since the lndir program is usually in the search path, I think you should also
allow a patch which makes the program more useful in general. (I often need to
create a shadow of the dotfiles and dotdirs in my home directory to make a
backup of my settings, and this tool seems to be the best way to achieve this.)
If you intend to apply the patch, I will fix the indentation and update the
documentation.
-- System Information:
Debian Release: 3.1
APT prefers testing
APT policy: (990, 'testing'), (200, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.9
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1)
Versions of packages xutils depends on:
ii cpp 4:3.3.4-2 The GNU C preprocessor (cpp)
ii libc6 2.3.2.ds1-18 GNU C Library: Shared libraries an
ii libncurses5 5.4-4 Shared libraries for terminal hand
ii xfree86-common 4.3.0.dfsg.1-8 X Window System (XFree86) infrastr
ii zlib1g 1:1.2.2-3 compression library - runtime
-- no debconf information
--- lndir.c.old 2004-12-28 13:32:46.000000000 +0100
+++ lndir.c 2004-12-28 13:44:12.000000000 +0100
@@ -77,6 +77,7 @@
int silent = 0; /* -silent */
int ignore_links = 0; /* -ignorelinks */
+int ignore_dirs = 0; /* -ignoredirs */
int with_revinfo = 0; /* -withrevinfo */
char *rcurdir;
@@ -211,6 +212,7 @@
(dp->d_name[1] == '\0' || (dp->d_name[1] == '.' &&
dp->d_name[2] == '\0')))
continue;
+ if (!ignore_dirs) {
if (!with_revinfo) {
if (!strcmp (dp->d_name, "RCS"))
continue;
@@ -249,6 +251,7 @@
quiterr (1, "..");
curdir = rcurdir = ocurdir;
continue;
+ }
}
}
@@ -341,6 +344,8 @@
silent = 1;
else if (strcmp(*av, "-ignorelinks") == 0)
ignore_links = 1;
+ else if (strcmp(*av, "-ignoredirs") == 0)
+ ignore_dirs = 1;
else if (strcmp(*av, "-withrevinfo") == 0)
with_revinfo = 1;
else if (strcmp(*av, "--") == 0) {
@@ -352,7 +357,7 @@
}
if (ac < 1 || ac > 2)
- quit (1, "usage: %s [-silent] [-ignorelinks] fromdir [todir]",
+ quit (1, "usage: %s [-silent] [-ignorelinks] [-ignoredirs] fromdir [todir]",
prog_name);
fn = av[0];
Reply to: