Added function - contract-path

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Added function - contract-path

lahavav
Hi all,

I've added a function (A make function) named contract-path to the 3.80 sources.
It takes a path with garbage like 'dir/..' or 'dir1//2/' or 'dir/./dir2' and
contracts it as much as possible, e.g.:

a/b/..    ==> a
a/./.     ==> a
a\b\\c/d  ==> a/b/c/d

I found it very useful when I see up-and-down paths used in my makefiles.
Please let me know if anybody else is interested in it, and if desired I'll
commit it to the repository.

Bye,
- Aviad Lahav




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



_______________________________________________
Bug-make mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|

Re: Added function - contract-path

Paul Smith-20
%% [hidden email] writes:

  l> I've added a function (A make function) named contract-path to the
  l> 3.80 sources.  It takes a path with garbage like 'dir/..' or
  l> 'dir1//2/' or 'dir/./dir2' and contracts it as much as possible,

There are two functions added to the next version of GNU make, abspath
and realpath, which do much of what you appear to want.

--
-------------------------------------------------------------------------------
 Paul D. Smith <[hidden email]>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


_______________________________________________
Bug-make mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/bug-make