[Pkg-kde-extras] Bug#577473: krename: Skip if source and target filenames are equal

Bastian Kleineidam calvin at debian.org
Sun Apr 11 22:37:49 UTC 2010


Package: krename
Version: 4.0.3-1
Severity: normal
Tags: patch upstream

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

when renaming, moving or symlinking files, krename should check if
source and target are equal. The attached patch adds such a check.

Regards,
  Bastian


- -- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32grog20 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages krename depends on:
ii  kdebase-runtime               4:4.3.4-2  runtime components from the offici
ii  kdelibs5                      4:4.3.4-3  core libraries for all KDE 4 appli
ii  libc6                         2.10.2-6   Embedded GNU C Library: Shared lib
ii  libexiv2-6                    0.19-1     EXIF/IPTC metadata manipulation li
ii  libgcc1                       1:4.4.3-7  GCC support library
ii  libqt4-dbus                   4:4.5.3-4  Qt 4 D-Bus module
ii  libqt4-network                4:4.5.3-4  Qt 4 network module
ii  libqt4-svg                    4:4.5.3-4  Qt 4 SVG module
ii  libqt4-xml                    4:4.5.3-4  Qt 4 XML module
ii  libqtcore4                    4:4.5.3-4  Qt 4 core module
ii  libqtgui4                     4:4.5.3-4  Qt 4 GUI module
ii  libstdc++6                    4.4.3-7    The GNU Standard C++ Library v3
ii  libtag1c2a                    1.6.2-1    TagLib Audio Meta-Data Library

krename recommends no packages.

krename suggests no packages.

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkvCTzcACgkQeBwlBDLsbz6TKQCgmej1jRcMER5SgXsaxZ1PmCkv
RloAnjYmo8J0tBKg9J23jqa9QgLoH+Bn
=UtiC
-----END PGP SIGNATURE-----
-------------- next part --------------
--- src/batchrenamer.cpp.orig	2010-04-12 00:13:44.000000000 +0200
+++ src/batchrenamer.cpp	2010-04-12 00:16:36.000000000 +0200
@@ -239,6 +239,12 @@
         KIO::JobFlags flags  = (m_overwrite ? KIO::Overwrite : KIO::DefaultFlags) | KIO::HideProgressInfo;
         KIO::Job*     job    = NULL;
         const KUrl &  srcUrl =  (*m_files)[i].srcUrl();
+        if (srcUrl == dstUrl) {
+            p->error( i18n("Cannot rename: source and target filename are equal: %1", srcUrl.prettyUrl()) );
+            (*m_files)[i].setError( 1 );
+            errors++;
+            continue;
+        }
                     
         switch( m_renameMode ) 
         {


More information about the pkg-kde-extras mailing list