* sed and configure scripts @ 2000-05-29 1:59 Ville Herva 2000-05-29 9:47 ` Ville Herva 0 siblings, 1 reply; 5+ messages in thread From: Ville Herva @ 2000-05-29 1:59 UTC (permalink / raw) To: cygwin I must be doing something wrong here. Basicly, it seems like sed would always intepret its input as binary. I'm trying to run zsh-3.1.6 configure script. All is fine until configure does something like cat > c.sed << EOF s/ristiina/parkano/g s/oulu/turku/g EOF sed -n -f c.sed < naantali > hollola Now, c.sed contains dos newlines (0x0d), and sed barfs: sed: file conftest.frag line 1: Unknown option to 's' (option 'g^M'...) my mounts are textmode, but the situation did not change with binary either. The configure script (the cat > ... and the following lines in particular) has no ^M's. CYGWIN=binmode is _not_ set. cygwin1.ddl snapshot 15052000, newest sed from net. I understand somebody (Earnie?) already compiled zsh? Is there anything else to watch out? s/__CYGWIN/__CYGWIN__/, but where? Hmm. I wish the Amol Deshpande's native zsh would work 'right' with cygwin. Not only, because I can't seem to compile zsh, but the native zsh has some neat features... -- v -- v@iki.fi -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe@sourceware.cygnus.com ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sed and configure scripts 2000-05-29 1:59 sed and configure scripts Ville Herva @ 2000-05-29 9:47 ` Ville Herva 2000-05-29 9:56 ` Chris Faylor 0 siblings, 1 reply; 5+ messages in thread From: Ville Herva @ 2000-05-29 9:47 UTC (permalink / raw) To: cygwin On Mon, May 29, 2000 at 11:59:11AM +0300, you [Ville Herva] claimed: > I must be doing something wrong here. Basicly, it seems like sed would > always intepret its input as binary. > > I'm trying to run zsh-3.1.6 configure script. All is fine until configure > does something like > > cat > c.sed << EOF > s/ristiina/parkano/g > s/oulu/turku/g > EOF > sed -n -f c.sed < naantali > hollola > > Now, c.sed contains dos newlines (0x0d), and sed barfs: > > sed: file conftest.frag line 1: Unknown option to 's' > > (option 'g^M'...) > > my mounts are textmode, but the situation did not change with binary > either. The configure script (the cat > ... and the following lines in > particular) has no ^M's. CYGWIN=binmode is _not_ set. > > cygwin1.ddl snapshot 15052000, newest sed from net. This is a problem with sed. I tried to recompile sed but its configure script failed the same way! How do you people get configure scripts run? I couldn't even figure out any bearable work-around. Sed uses mmap to read executed file: sed.c::main(): case 'f': the_program = compile_file(the_program, optarg); break; compile.c:.compile_file(): if (cmdfile[0] != '-' || cmdfile[1] != '\0') prog.file = ck_fopen(cmdfile, "r"); if (map_file(prog.file, &prog.base, &len)) util.c::cd_fopen(): if ( ! (fp = fopen(name, mode)) ) sed.c::map_file(): nbase = VCAST(VOID *)mmap(NULL, CAST(size_t)s.st_size, PROT_READ, MAP_PRIVATE, fileno(fp), CAST(off_t)0); I assume CR/LF translation is not done for mmap? Am I missing something obvious? -- v -- v@iki.fi -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe@sourceware.cygnus.com ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sed and configure scripts 2000-05-29 9:47 ` Ville Herva @ 2000-05-29 9:56 ` Chris Faylor 2000-05-29 23:49 ` Ville Herva 2000-05-29 23:51 ` Ville Herva 0 siblings, 2 replies; 5+ messages in thread From: Chris Faylor @ 2000-05-29 9:56 UTC (permalink / raw) To: cygwin On Mon, May 29, 2000 at 07:46:57PM +0300, Ville Herva wrote: >On Mon, May 29, 2000 at 11:59:11AM +0300, you [Ville Herva] claimed: >> I must be doing something wrong here. Basicly, it seems like sed would >> always intepret its input as binary. >> >> I'm trying to run zsh-3.1.6 configure script. All is fine until configure >> does something like >> >> cat > c.sed << EOF >> s/ristiina/parkano/g >> s/oulu/turku/g >> EOF >> sed -n -f c.sed < naantali > hollola >> >> Now, c.sed contains dos newlines (0x0d), and sed barfs: >> >> sed: file conftest.frag line 1: Unknown option to 's' >> >> (option 'g^M'...) >> >> my mounts are textmode, but the situation did not change with binary >> either. The configure script (the cat > ... and the following lines in >> particular) has no ^M's. CYGWIN=binmode is _not_ set. >> >> cygwin1.ddl snapshot 15052000, newest sed from net. > >This is a problem with sed. I tried to recompile sed but its configure >script failed the same way! How do you people get configure scripts run? I >couldn't even figure out any bearable work-around. > >Sed uses mmap to read executed file: > >sed.c::main(): > case 'f': > the_program = compile_file(the_program, optarg); > break; > >compile.c:.compile_file(): > if (cmdfile[0] != '-' || cmdfile[1] != '\0') > prog.file = ck_fopen(cmdfile, "r"); > if (map_file(prog.file, &prog.base, &len)) > > >util.c::cd_fopen(): > if ( ! (fp = fopen(name, mode)) ) > > >sed.c::map_file(): > nbase = VCAST(VOID *)mmap(NULL, CAST(size_t)s.st_size, PROT_READ, > MAP_PRIVATE, fileno(fp), CAST(off_t)0); > > >I assume CR/LF translation is not done for mmap? > >Am I missing something obvious? Nope. Patches are gratefully accepted. Until then, endure the horror of removing \r endings from your sed files. cgf -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe@sourceware.cygnus.com ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sed and configure scripts 2000-05-29 9:56 ` Chris Faylor @ 2000-05-29 23:49 ` Ville Herva 2000-05-29 23:51 ` Ville Herva 1 sibling, 0 replies; 5+ messages in thread From: Ville Herva @ 2000-05-29 23:49 UTC (permalink / raw) To: cygwin On Mon, May 29, 2000 at 12:56:16PM -0400, you [Chris Faylor] claimed: > > Nope. Patches are gratefully accepted. Patching doesn't seem to be impossible even for me -- it seems the mmap could just be disabled so that sed falls back to ordinary file handling. The problem however is that I can't compile sed, because sed does not work... Bummer. > Until then, endure the horror of removing \r endings from your sed files. Ugh. -- v -- v@iki.fi -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe@sourceware.cygnus.com ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sed and configure scripts 2000-05-29 9:56 ` Chris Faylor 2000-05-29 23:49 ` Ville Herva @ 2000-05-29 23:51 ` Ville Herva 1 sibling, 0 replies; 5+ messages in thread From: Ville Herva @ 2000-05-29 23:51 UTC (permalink / raw) To: cygwin > Nope. Patches are gratefully accepted. Yep. Moving from 20000515 snapshot to 20000525 snapshot fixed the problem. (0526 and 0527 snapshots were broken.) -- v -- v@iki.fi -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe@sourceware.cygnus.com ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2000-05-29 23:51 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2000-05-29 1:59 sed and configure scripts Ville Herva 2000-05-29 9:47 ` Ville Herva 2000-05-29 9:56 ` Chris Faylor 2000-05-29 23:49 ` Ville Herva 2000-05-29 23:51 ` Ville Herva
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).