changeset 611:256d506d8601

pathsearch deprecated in favor of skel/.bashrc:mypath. Actually uninstall is performed on install for convenience to remove files.
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Mon, 18 Jan 2016 01:26:58 +0200
parents 92f77b6d0d99
children e3a675c53f55
files pathsearch/Makefile pathsearch/pathsearch pathsearch/pathsearch.1 pathsearch/pathsearch.bat
diffstat 4 files changed, 7 insertions(+), 136 deletions(-) [+]
line wrap: on
line diff
--- a/pathsearch/Makefile	Mon Jan 18 01:06:17 2016 +0200
+++ b/pathsearch/Makefile	Mon Jan 18 01:26:58 2016 +0200
@@ -34,21 +34,13 @@
 
 .PHONY: check
 check:
-	./pathsearch "*.exe"
-ifeq 'windows' '$(host_os)'
-	./pathsearch --delimiter=\; EMACSLOADPATH "*.el"
-endif
 
 .PHONY: install
-install:
-	[ -d $(bindir) ] || mkdir -p $(bindir)
-	install -m 755 pathsearch $(bindir)
-ifeq 'windows' '$(host_os)'
-	install -m 755 pathsearch $(bindir)/pathsearch.sh
-	install -m 755 pathsearch.bat $(bindir)
-endif
-	[ -d $(man1dir) ] || mkdir -p $(man1dir)
-	install -m 644 pathsearch.1 $(man1dir)
+install: install-warn uninstall
+
+.PHONY: install-warn
+install-warn:
+	echo '"utils/pathsearch"' is deprecated. '"install"' target actually perform '"uninstall"' for convenience.
 
 INSTALLED_FILES = $(bindir)/pathsearch $(man1dir)/pathsearch.1 $(bindir)/pathsearch.sh $(bindir)/pathsearch.bat
 
--- a/pathsearch/pathsearch	Mon Jan 18 01:06:17 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-#!/bin/sh
-
-unset _delim
-unset _pattern
-unset _var
-
-while [ -n "$1" ]; do
-  case "$1" in
-    -d|--delimiter*)
-      _delim=${1#--delimiter=}
-      if [ -z "$_delim" ]; then
-        shift
-        _delim="$1"
-      fi
-      ;;
-    -h|--help)
-      echo "Usage:"
-      echo "  pathsearch [-d DELIM] [VARIABLE] PATTERN"
-      echo ""
-      echo "Search for PATTERN in value of env VARIABLE (default is PATH). Options:"
-      echo "    -d, --delimiter=DELIM   use DELIM enstead of colon for path delimiter"
-      echo "    -h, --help              print this help"
-      exit 0
-      ;;
-    -*)
-      echo "Unknow option: $1"
-      exit 1
-      ;;
-    *)
-      [ -n "$_pattern" ] && _var="$_pattern"
-      _pattern="$1"
-  esac
-  shift
-done
-
-if [ -z "$_pattern" ]; then
-  echo "Where is _pattern? Try pathsearch --help."
-  exit 1
-fi
-
-[ -z "$_var" ] && _var=PATH
-[ -z "$_delim" ] && _delim=":"
-
-tokens=`eval echo '$'$_var`
-
-IFS="$_delim"
-
-find=no
-for token in $tokens; do
-  if [ -e "$token/$_pattern" ]; then
-    find=yes
-    echo "$token/$_pattern"
-    continue
-  fi
-  if ls "$token"/$_pattern 2>/dev/null; then
-    find=yes
-  fi
-done
-
-[ $find = yes ] && exit 0 || exit 1
--- a/pathsearch/pathsearch.1	Mon Jan 18 01:06:17 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-.\" Process this file with
-.\"   $ groff -man -Tascii pathsearch.1
-.\" or see by
-.\"   $ man ./pathsearch.1
-.\"
-.TH PATHSEARCH 1 2009-10-17 "pathsearch utility 0.1" "User Manuals"
-.SH NAME
-pathsearch \- search for PATTERN in value of env VARIABLE (default is PATH).
-.SH SYNOPSIS
-pathsearch [-d \fIDELIM\fR] [\fIVARIABLE\fR] \fIPATTERN\fR
-.SH DESCRIPTION
-Typical use of
-.B pathsearch
-is searching for file that match PATTERN in PATH (for example then you forget
-utility name, but remember some part of name).
-.SH OPTIONS
-.IP "\fB-d\fR \fIDELIM\fR" 4
-.PD 0
-.IP "\fB--delimiter\fR=\fIDELIM\fR" 4
-Use DELIM enstead of colon for path delimiter.
-.IP "\fB-h\fR"
-.PD 0
-.IP "\fB--help\fR"
-Print help.
-.SH EXAMPLES
-To search all .exe files in PATH under Windows use (from CMD.exe):
-.PP
-.Vb 1
-\&        sh -c "pathsearch '*.exe'"
-.Ve
-.PP
-To search Emacs lisp library files under Windows use (from CMD.exe):
-.PP
-.Vb 1
-\&        sh -c "pathsearch -d \; EMACSLOADPATH '*.el'"
-.Ve
-.PP
-To search cyrillic related files under your LaTeX distribution use (under
-UNIX):
-.PP
-.Vb 1
-\&        pathsearch TEXINPUTS "*cyr*"
-.Ve
-.PP
-To search 'windows*' files in Microsoft like path from INCLUDE under Cygwin:
-.PP
-.Vb 1
-\&        VAR=`cygpath -p '$INCLUDE'` pathsearch VAR "windows*"
-.Ve
-.PP
-\" .SH FILES
-\" .SH ENVIRONMENT
-\" .SH DIAGNOSTICS
-\" .SH HISTORY
-.SH COPYRIGHT
-pathsearch utility is placed on public domain.
-.SH "SEE ALSO"
-.BR which(1),
-.BR locate(1)
-.SH AUTHOR
-Oleksandr Gavenko <gavenkoa@gmail.com>.
-.SH BUGS
-Send all bugs to <gavenkoa@gmail.com>.
--- a/pathsearch/pathsearch.bat	Mon Jan 18 01:06:17 2016 +0200
+++ b/pathsearch/pathsearch.bat	Mon Jan 18 01:26:58 2016 +0200
@@ -1,5 +1,7 @@
 @echo off
 
+rem This file depricated. I rest it as example of BATCH file magic.
+
 set currdir=%CD%
 if x%1 == x goto search_in_pathext