Apologies, I sent this to the package maintainer's email address instead of to 
the address for this bug.

Jack Grahl



----- Forwarded Message ----
> From: Jack Grahl <jack.gr...@yahoo.co.uk>
> To: lam...@debian.org
> Sent: Sunday, 27 July, 2008 22:52:52
> Subject: util-linux patch - add option to whereis
> 
> Dear LaMont,
> 
> I hope you are well.
> 
> The below suggested patch to files in the 'lenny' util-linux package source 
> directory adds a useful piece of functionality to the 'whereis' utility. It 
> adds 
> an option '-q' (for quiet) to whereis which removes the initial name of 
> package 
> from each output line. So the output with and without the -q option is shown:
> 
> m...@sonja-debian:~/c/util-linux-2.13.1.1$ whereis gunzip
> gunzip: /bin/gunzip /usr/share/man/man1/gunzip.1.gz
> m...@sonja-debian:~/c/util-linux-2.13.1.1$ whereis -q gunzip
> /bin/gunzip /usr/share/man/man1/gunzip.1.gz
> 
> This allows the output of 'whereis' to be more easily used in backtick 
> substitution, for example in the command lines of 'ls' 'file', etc.
> 
> m...@sonja-debian:~/c/util-linux-2.13.1.1$ file `whereis -b gunzip`
> gunzip::     ERROR: cannot open `gunzip:' (No such file or directory)
> /bin/gunzip: POSIX shell script text executable
> m...@sonja-debian:~/c/util-linux-2.13.1.1$ file `whereis -bq gunzip`
> /bin/gunzip: POSIX shell script text executable
> 
> I hope that you find the patch acceptable to be applied to the Debian package 
> sources. I have checked that the patch works against the 'etch' package 
> version 
> 2.12r, based on the changelog it should also work for the most recent 
> version. 
> If there are any changes which you like me to make before accepting the 
> patch, 
> please let me know.
> 
> I am not sure if there is an upstream maintainer for this file, it seems that 
> this source code is from BSD UNIX. If you are aware of any maintainer I would 
> be 
> happy to contact them.
> 
> Best wishes,
> Jack Grahl
> 
> --- util-linux-2.13.1.1.orig/misc-utils/whereis.c    2008-07-27 
> 21:08:43.000000000 +0000
> +++ util-linux-2.13.1.1/misc-utils/whereis.c    2008-07-27 21:22:01.000000000 
> +0000
> @@ -140,6 +140,7 @@
> char    **Mflag;
> int    Mcnt;
> char    uflag;
> +char    qflag = 0;
> /*
>   * whereis name
>   * look for source, documentation and binaries
> @@ -190,6 +191,10 @@
>                  bflag++;
>                  continue;
> 
> +            case 'q':
> +              qflag++;
> +              continue;
> +            
>              case 'm':
>                  zerof();
>                  mflag++;
> @@ -248,7 +253,7 @@
>      } else
>          print = 1;
> again:
> -    if (print)
> +    if (print && !qflag)
>          printf("%s:", cp);
>      if (sflag) {
>          looksrc(cp);
> 
> 
> --- util-linux-2.13.1.1.orig/misc-utils/whereis.1    2008-07-27 
> 21:08:43.000000000 +0000
> +++ util-linux-2.13.1.1/misc-utils/whereis.1    2008-07-27 21:23:02.000000000 
> +0000
> @@ -108,6 +108,13 @@
> or
> .B \-S
> options are used.
> +.TP
> +.B \-q
> +Don't print the name searched for at the start of each line.
> +This is so that the output from
> +.B whereis
> +can be backtick substituted into the command line of programs such as
> +.BR ls .
> .SH EXAMPLE
> Find all files in
> .B /usr/bin
> 
> 
>       __________________________________________________________
> Not happy with your email address?.
> Get the one you really want - millions of new email addresses available now 
> at 
> Yahoo! http://uk.docs.yahoo.com/ymail/new.html







--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to