bugGNU patch - Bugs: bug #37642, patch --dry-run cannot be used on...


bug #37642: patch --dry-run cannot be used on read-only fs since it tries to create tmp files in patch directory

Submitted by:  Cesar Garcia <codestation>
Submitted on:  Sat 27 Oct 2012 07:48:22 PM UTC  
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Tue 30 Jul 2013 11:10:06 AM UTC, comment #2:

Commit afdfa9ec now changes that to only create temporary files in the final output diretory when not in --dry-run mode.

This will make Debian bug 717799 go away as a side effect even though I do agree with Christoph Berg that changing directory mtimes would be acceptable behavior.

Andreas Gruenbacher <agruen>
Project Administrator
Sat 27 Jul 2013 01:28:36 PM UTC, comment #1:

Debian Bug #717799 is about a similar topic: Since 2.7, patch --dry-run will modify the mtime of the directory which it didn't do previously.


(My personal opinion is that this might not be a bug at all since directory mtimes do not really need to be stable, though I do see a point here. I'll leave it to the patch maintainers to decide if this is a bug or just some artifact of using the filesystem for tempfiles.)

Christoph Berg <myon>
Sat 27 Oct 2012 07:48:22 PM UTC, original submission:

As the title says, when i tried to run patch --dry-run in 2.6.1 it worked correctly on read only file systems but now in 2.7.1 it fails.

For example, in 2.6.1:

patch -p1 -R --dry-run -d /usr/src/linux < /usr/portage/sys-fs/aufs3/files/aufs3-standalone-6.patch
patching file fs/file_table.c
patching file fs/inode.c
patching file fs/namespace.c
patching file fs/notify/group.c
patching file fs/notify/mark.c
patching file fs/open.c
patching file fs/splice.c
patching file security/commoncap.c
patching file security/device_cgroup.c
patching file security/security.c

And now in 2.7.1:

patch -p1 -R --dry-run -d /usr/src/linux < /usr/portage/sys-fs/aufs3/files/aufs3-standalone-6.patch
File fs/file_table.c is read-only; trying to patch anyway
patch: **** Can't create temporary file fs/file_table.c.ocTXR1r : Read-only file system

--read-only=ignore only dismisses the warning message:
patch -p1 -R --dry-run --read-only=ignore -d /usr/src/linux < /usr/portage/sys-fs/aufs3/files/aufs3-standalone-6.patch
patch: **** Can't create temporary file fs/file_table.c.orCzrj9 : Read-only file system

Cesar Garcia <codestation>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by agruen (Posted a comment)
  • -email is unavailable- added by myon (Posted a comment)
  • -email is unavailable- added by codestation (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-07-30 agruen StatusNone => Fixed
        Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.3