[Nix-dev] Patch for module most-5.0.0

Marc Weber marco-oweber at gmx.de
Fri Apr 30 02:46:30 CEST 2010


Excerpts from Tim Horton's message of Fri Apr 30 02:27:04 +0200 2010:
> Attached is a patch for jedsofts' most pager. Any suggestions on simplifying
> it? It is pretty short, but I am wondering if there is a better way to do
> the preConfigure section.


+    preConfigure = ''
+        sed -i -e "s|-ltermcap|-ncurses|" configure
+        sed -i -e "s|/bin/cp|cp|" autoconf/Makefile.in src/Makefile.in
+        sed -i -e "s|/bin/rm|rm|" autoconf/Makefile.in src/Makefile.in
+        sed -i -e "s|/bin/sh|sh|" autoconf/Makefile.in src/Makefile.in
+    '';

you can ask sed to do multiple operations:

  sed -i autoconf/Makefile.in src/Makefile.in
    -e 's|/bin/sh|sh|' -e 's| \
    -e 's|/bin/rm|rm|' -e 's| \
    -e 's|/bin/cp|cp|' -e 's| \

or you could use a loop to remove duplication:

  for prog in sh rm cp; do
    sed -i autoconf/Makefile.in src/Makefile.in
      -e "s|/bin/$prog|$prog|" -e 's| \
  done

so you don't have to duplicate the file list.

Also /bin/sh is the only impure path which exists on NixOS.
The reason is that it's required by glibc.
So you don't have to fix that path.

Maybe even replacing '/bin/' by '' works for those files.

That's not that important.

You're missing the meta name containing license and description info.

Can you add this missing information?

Using google I found this page:

http://www.jedsoft.org/most/index.html
description:
MOST is a powerful paging program for Unix, VMS, MSDOS, and win32
systems. Unlike other well-known paging programs most supports multiple
windows and can scroll left and right. Why settle for less?

Which of those features are you missing when using either less or echo
'foo' | vim - ?

I don't know most yet. It just seems to be that less already provides
all those features - I'm not that sure about Windows support though.

I asked once about more - and I was told to use less -E or such instead.

You're welcome - Yours

Marc Weber



More information about the nix-dev mailing list