Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#7745 closed defect (fixed)

Can not build with new GNU patch; refuse to patch read-only files

Reported by: ledwards@… Owned by: developers
Priority: high Milestone: Backfire 10.03.1
Component: packages Version: Trunk
Keywords: patch ncurses read-only Cc:


Building Backfire branch (or trunk) with openSUSE 11.3 (using GNU patch Version on ixp4xx, I get the following error while compiling ncurses:

make[3]: Entering directory `/home/openwrt/ixp4xx/trunk/package/ncurses'
WARNING: skipping libncurses -- package not selected
gzip -dc /home/openwrt/ixp4xx/trunk/dl/ncurses-5.7.tar.gz | /bin/tar -C /home/openwrt/ixp4xx/trunk/build_dir/target-armeb_v5te_uClibc- -xf - 

Applying ./patches/100-ncurses-5.6-20080112-urxvt.patch using plaintext: 
File misc/terminfo.src is read-only; refusing to patch
1 out of 1 hunk ignored -- saving rejects to file misc/terminfo.src.rej
Patch failed!  Please fix ./patches/100-ncurses-5.6-20080112-urxvt.patch!
make[3]: *** [/home/openwrt/ixp4xx/trunk/build_dir/target-armeb_v5te_uClibc-] Error 1
make[3]: Leaving directory `/home/openwrt/ixp4xx/trunk/package/ncurses'
make[2]: *** [package/ncurses/compile] Error 2
make[2]: Leaving directory `/home/openwrt/ixp4xx/trunk'
make[1]: *** [/home/openwrt/ixp4xx/trunk/staging_dir/target-armeb_v5te_uClibc-] Error 2
make[1]: Leaving directory `/home/openwrt/ixp4xx/trunk'
make: *** [world] Error 2

It appears that GNU patch was recently updated (Version to refuse to patch read-only files:

# - Version
#   + Support for most features of the "diff --git" format: renames  
#     and copies, permission changes, symlink diffs.  (Binary diffs  
#     are not supported yet; patch will complain and skip them.)  
#   + Support for double-quoted filenames: when a filename in a  
#     context diff starts with a double quote, it is interpreted as  
#     a C string literal.  The escape sequences \\, \", \a, \b, \f, \n,  
#     \r, \t, \v, and \ooo (a three-digit octal number between 0 and  
#     255) are recognized.  
#   + Refuse to patch read-only files by default, or at least warn  
#     when patching such files with --force or --batch.  
#   + Refuse to apply a normal patch to a symlink.  (Previous  
#     versions of patch were wrongly replacing the symlink with a  
#     regular file.)  
#   + When a timestamp specifies a time zone, honor that instead of  
#     assuming the local time zone (--set-date) or Universal  
#     Coordinated Time (--set-utc).  
#   + Support for nanosecond precision timestamps.  
#   + Many portability and bug fixes.

The files in the ncurses tarball are read-only, so they can't be patched and the build fails. I think one solution for this would be to execute patch with --force or --batch for ncurses (or all packages - any tarballs that contain read-only files)... but there may be a better solution.

Also see OpenWrt Forum topic:

Attachments (0)

Change History (6)

comment:1 Changed 7 years ago by strzol@…

Same happens with AR71xx and BRCM63xx.

comment:2 Changed 7 years ago by anonymous

that bug is connected not only with ncurses (probably gettext also has this same issue)

simply resolution is adding in scripts/ -f to patch parameters.

comment:3 Changed 7 years ago by jow

  • Resolution set to fixed
  • Status changed from new to closed

Should be fixed by r23314

comment:4 Changed 7 years ago by Sergey Vlasov <vsu@…>

Would this fix be backported to the backfire branch?

comment:5 Changed 7 years ago by jow

See r23814

comment:6 Changed 7 years ago by jow

Sorry, r23841

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.