dirdiff: Doesn't work if directory name specified in command line ends with '/'

Edgar Lakis edgar.lakis at gmail.com
Mon Nov 12 15:50:27 UTC 2007


Subject: dirdiff: Doesn't work if directory name specified in command
line ends with '/'
Package: dirdiff
Version: 2.1-1
Severity: normal


Bug affects users who pass names of directories to be compared through
command line. If specified path to dirrectory ends with trailing slash
('/'), dirdiff processes it as empty directory.

Example:
        $ dirdiff /tmp/test1/ /tmp/test2/
Will show no diff's in dirs, though
        $ dirdiff /tmp/test1 /tmp/test2
would handle directories properly.


The problem is not very important then it is known. But it was very
confusing over wise. Bash completion ends names of directories with '/'
automatically, and it appears that any directories contain no
differences.


Here's the patch that worked for me:
----------------------------------
--- /usr/bin/dirdiff.orig     2007-11-12 17:01:11.000000000 +0200
+++ /usr/bin/dirdiff    2007-11-12 16:45:15.000000000 +0200
@@ -4700,6 +4700,8 @@
                }
            }
        } elseif {$arg != {}} {
+           # remove trailing '/'
+           regsub {/+$} $arg "" arg
            lappend dirs $arg
        }
     }
----------------------------------

regards,
Edgar Lakis



-- System Information:
Debian Release: lenny/sid
  APT prefers gutsy-updates
  APT policy: (500, 'gutsy-updates'), (500, 'gutsy-security'), (500,
'gutsy'), (401, 'gutsy-proposed'), (400, 'gutsy-backports')
Architecture: i386 (i686)

Kernel: Linux 2.6.22-14-generic (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dirdiff depends on:
ii  libc6                    2.6.1-1ubuntu10 GNU C Library: Shared libraries
ii  tcl8.4                   8.4.15-1build1  Tcl (the Tool Command Language) v8
ii  tk8.4                    8.4.15-1ubuntu1 Tk toolkit for Tcl and X11, v8.4 -

dirdiff recommends no packages.

-- no debconf information




More information about the ubuntu-users mailing list