<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>174776</bug_id>
          
          <creation_ts>2007-04-16 09:42 0000</creation_ts>
          <short_desc>app-text/dos2unix-3.1-r1: rename() fails with errno = EXDEV</short_desc>
          <delta_ts>2007-05-01 17:01:19 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>toralf.foerster@gmx.de</reporter>
          <assigned_to>shell-tools@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>toralf.foerster@gmx.de</who>
            <bug_when>2007-04-16 09:42:08 0000</bug_when>
            <thetext>Today I got:

tfoerste@n22 ~/tmp $ dos2unix /mnt/D/tlm/BlueBaseAll.csv
dos2unix: converting file /mnt/D/tlm/BlueBaseAll.csv to UNIX format ...
dos2unix: problems renaming &apos;./u2dtmp7YQkeu&apos; to &apos;/mnt/D/tlm/BlueBaseAll.csv&apos;
          output file remains in &apos;./u2dtmp7YQkeu&apos;
dos2unix: problems converting file /mnt/D/tlm/BlueBaseAll.csv


The filesystem . is of type ext3 whereas /mnt/D/ is a mounted FAT file system.


Reproducible: Always




tfoerste@n22 ~/tmp $ emerge --info
Portage 2.1.2.2 (default-linux/x86/2006.1, gcc-3.4.6, glibc-2.5-r0, 2.6.19-gentoo-r5 i686)
=================================================================
System uname: 2.6.19-gentoo-r5 i686 Intel(R) Pentium(R) M processor 1700MHz
Gentoo Base System release 1.12.9
Timestamp of tree: Mon, 16 Apr 2007 06:20:01 +0000
ccache version 2.4 [enabled]
dev-java/java-config: 1.3.7, 2.0.31-r5
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r6
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.15-r1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS=&quot;x86&quot;
AUTOCLEAN=&quot;yes&quot;
CBUILD=&quot;i686-pc-linux-gnu&quot;
CFLAGS=&quot;-O2 -march=pentium-m -fomit-frame-pointer -pipe&quot;
CHOST=&quot;i686-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config&quot;
CONFIG_PROTECT_MASK=&quot;/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/php/apache1-php5/ext-active/ /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo&quot;
CXXFLAGS=&quot;-O2 -march=pentium-m -fomit-frame-pointer -pipe&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict&quot;
GENTOO_MIRRORS=&quot;http://85.25.128.62 http://gentoo.mneisen.org/ http://gentoo.prz.rzeszow.pl http://194.117.143.72/&quot;
LINGUAS=&quot;de en&quot;
MAKEOPTS=&quot;-j2&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_RSYNC_OPTS=&quot;--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
PORTDIR_OVERLAY=&quot;/usr/local/portage&quot;
SYNC=&quot;rsync://rsync.de.gentoo.org/gentoo-portage&quot;
USE=&quot;X aac acpi alsa apache2 arts asf berkdb bitmap-fonts bluetooth bzip2 cairo cddb clamav cli cracklib crypt css cups dri dvd dvdr dvdread dynamicplugin exif fam fastbuild fortran gd gdbm gif gpm gtk gtk2 hdaps i8x0 iconv ipv6 isdnlog jai java javascript jimi jpeg libg++ logrotate madwifi mbox midi mikmod mmx mmxext mp3 mp4 mysql ncurses nls no-seamonkey nptl nptlonly nsplugin opengl pam pcre pdf perl png ppds pppd python rdesktop readline real reflection rtc samba session spl sse sse2 ssl subversion svg tcpd tiff truetype truetype-fonts type1-fonts unicode userlocales win32codecs x86 xml xorg xpm zlib&quot; ALSA_CARDS=&quot;intel8x0 intel8x0m&quot; ALSA_PCM_PLUGINS=&quot;adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol&quot; CAMERAS=&quot;sonydscw50 ptp2&quot; ELIBC=&quot;glibc&quot; INPUT_DEVICES=&quot;keyboard mouse joystick evdev&quot; KERNEL=&quot;linux&quot; LCD_DEVICES=&quot;bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text&quot; LINGUAS=&quot;de en&quot; USERLAND=&quot;GNU&quot; VIDEO_CARDS=&quot;vga radeon&quot;
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>pva@gentoo.org</who>
            <bug_when>2007-04-16 20:09:08 0000</bug_when>
            <thetext>Although it&apos;s possible to write patch (I&apos;ve already did that ;) ) for the problem which will handle case of errno == EXDEV and copy contents of ./u2dtmp7YQkeu into /mnt/D/tlm/BlueBaseAll.csv is that actually necessary? cd /mnt/D/tlm/ &amp;&amp; dos2unix BlueBaseAll.csv will better fix the problem... vapier, what do you think about this?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>pva@gentoo.org</who>
            <bug_when>2007-04-17 18:33:13 0000</bug_when>
            <thetext>Created an attachment (id=116540)
Patch to fix the problem.

I decided on simpler solution. This patch just mkstem file based on initial file name and thus it resides in the same device and hence rename works. Toralf, try this patch.

If there will be no objections from shell-tools, I&apos;ll commit patch this weekend.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>toralf.foerster@gmx.de</who>
            <bug_when>2007-04-18 09:07:49 0000</bug_when>
            <thetext>works fine :-)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>pva@gentoo.org</who>
            <bug_when>2007-05-01 17:01:19 0000</bug_when>
            <thetext>fixed in dos2unix-3.1-r2.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>116540</attachid>
            <date>2007-04-17 18:33 0000</date>
            <desc>Patch to fix the problem.</desc>
            <filename>dos2unix-3.1-workaround-rename-EXDEV.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIC4vZG9zMnVuaXguYy5vcmlnCTIwMDctMDQtMTcgMTE6MTY6MzIuMDAwMDAwMDAwICswNDAw
CisrKyAuL2RvczJ1bml4LmMJMjAwNy0wNC0xNyAxMjo0MTowMS4wMDAwMDAwMDAgKzA0MDAKQEAg
LTI3OSw3ICsyNzksNyBAQAogICBpbnQgUmV0VmFsID0gMDsKICAgRklMRSAqSW5GID0gTlVMTDsK
ICAgRklMRSAqVGVtcEYgPSBOVUxMOwotICBjaGFyIFRlbXBQYXRoWzE2XTsKKyAgY2hhciAqVGVt
cFBhdGggP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