zopencommunity / zopencommunity/patchport

patch converts 1047 tagged file to 88591

Open
#4 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Groovy
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

I am running with this env:

export _BPXK_AUTOCVT=ON
export _CEE_RUNOPTS="FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"

And when I patch a 1047-tagged file, it ends up tagged as ISO8859-1 with ISO8859-1 content.

WASTST1@BOSS0152:~/SRC/2.4.x/ebtest (event-accept-loop) $ cat ebcdic.txt patch.txt
a
b
c
d
--- ebcdic.txt	Tue Nov 21 09:37:21 2023
+++ ebcdic.txt	Tue Nov 21 09:37:31 2023
@@ -1,4 +1 @@
 a
-b
-c
-d
WASTST1@BOSS0152:~/SRC/2.4.x/ebtest (event-accept-loop) $ ls -T *
t IBM-1047    T=on  ebcdic.txt
t IBM-1047    T=on  patch.txt
WASTST1@BOSS0152:~/SRC/2.4.x/ebtest (event-accept-loop) $ cat ebcdic.txt patch.txt
a
b
c
d
--- ebcdic.txt	Tue Nov 21 09:37:21 2023
+++ ebcdic.txt	Tue Nov 21 09:37:31 2023
@@ -1,4 +1 @@
 a
-b
-c
-d
WASTST1@BOSS0152:~/SRC/2.4.x/ebtest (event-accept-loop) $ which patch
/u/WASTST1/zopen-dt/usr/bin/patch
WASTST1@BOSS0152:~/SRC/2.4.x/ebtest (event-accept-loop) $ patch --version
GNU patch 2.7
Copyright (C) 2003, 2009-2012 Free Software Foundation, Inc.
Copyright (C) 1988 Larry Wall

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Larry Wall and Paul Eggert
WASTST1@BOSS0152:~/SRC/2.4.x/ebtest (event-accept-loop) $ patch -p0 < patch.txt
patching file ebcdic.txt
WASTST1@BOSS0152:~/SRC/2.4.x/ebtest (event-accept-loop) $ ls -T *
t ISO8859-1   T=on  ebcdic.txt
t IBM-1047    T=on  patch.txt
WASTST1@BOSS0152:~/SRC/2.4.x/ebtest (event-accept-loop) $ cat ebcdic.txt
a

While the content is right (as in ascii, matching the tagging) and will work OK with most ported tools, if it's in a gi repo git will bark about git-attributes.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the shown _BPXK_AUTOCVT and _CEE_RUNOPTS settings, the IBM-1047 file, and the patch command. Trace how the patch tool reads and rewrites file tags; done means applying the patch preserves the original IBM-1047 tag while retaining the correct content.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.