public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: How to check cygwin version?
@ 2020-07-02 16:13 KARL BOTTS
  0 siblings, 0 replies; 7+ messages in thread
From: KARL BOTTS @ 2020-07-02 16:13 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 70 bytes --]


Hack the attached at will...

---
Karl Botts, kdbotts@usa.net


[-- Attachment #2: cygver --]
[-- Type: application/octet-stream, Size: 2493 bytes --]

#!/bin/bash

function EmitHelp() {
expand -t4 << __End_of_Help__

Emits various info about the cygwin installation.

By default, just emits the main version number on one short line,
then quits.  (For many purposes, that is sufficient.)

With -v (verbose) does the following stuff, too:

Then emits a couple of envars of interest, and the timestamps of a few files.

Then runs 'cygcheck -csv' into a temp file, and greps the output to display the
version and status of various cygwin packages that Karl considers "interesting".

With -t FILENAME, uses the arg as the temp file, and does not delete it.

With -r, gives cygcheck the options that make it dig around in the Windows
Registry looking for extra stuff about cygwin.  Slow, and rarely needed.

__End_of_Help__
}
test "$1" == '--help' && { EmitHelp; exit; }


declare ExtraCygcheckOpts=
declare TempFn=
declare VerboseFlag=
while getopts 'vrt:' Opt
do
	case "$Opt" in
	v) VerboseFlag=1	;;
	r) ExtraCygcheckOpts+=" -r"; VerboseFlag=1	;;	# This is slow!
	t) TempFn="$OPTARG"; VerboseFlag=1	;;
	*) echo "$0: see --help" 1>&2; exit 1	;;
	esac
done
shift $((OPTIND -1))

declare UnameR=$(uname -r)
echo ${UnameR%%(*}
test "$VerboseFlag" || exit 0


echo
echo -n 'uname -a: '
uname -a
echo "CYGWIN=$CYGWIN"
echo "TMPDIR=$TMPDIR"

# Emit the last modstamp, for a few files that always get updated when cygwin is updated.
for Fn in /etc/setup/setup.rc /etc/setup/timestamp /bin/cygwin1.dll
do
	echo -n "$Fn: "
	stat -c %y "$Fn" | cut -d' ' -f1
done

echo

# Run cygcheck -c into a temp file, and grep some interesting stuff out of it.
if ! test "$TempFn"
then
	declare TempFn=$(mktemp -t cygver.XXXXXX)
	trap "rm $TempFn" EXIT
fi

cygcheck -csv $ExtraCygcheckOpts > $TempFn 2>&1

egrep -e 'Key: .* Path: .*$' $TempFn | sed -E 's/^[[:blank:]]*//'
egrep -e '^cygdrive prefix ' $TempFn
egrep -e '^Last downloaded files from: ' $TempFn

echo

# Packages:  I do this with several greps, basically to form groups: most interesting first.
# Note the trailing whitespace: it is intentional, for packages that have several sub-packages, to pick the main one.
egrep -e '^(cygwin |windows-)' $TempFn
echo

{
egrep -e '^(bash |subversion |git |mintty |vim )' $TempFn
egrep -e '^(less |perl |python[0-9]* |ruby |gawk |sed )' $TempFn
egrep -e '^(gcc|binutils |make )' $TempFn
egrep -e '^(diffutils |coreutils |findutils |cygutils|inetutils)' $TempFn
egrep -e '^(curl |file |grep |pcre |pcre2 |iperf )' $TempFn
egrep -e '^(glib|openss|zip)' $TempFn
} | sort


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to check cygwin version?
  2020-07-02  5:20 ` Brian Inglis
@ 2020-07-02 15:34   ` Norton Allen
  0 siblings, 0 replies; 7+ messages in thread
From: Norton Allen @ 2020-07-02 15:34 UTC (permalink / raw)
  To: cygwin

On 7/2/2020 1:20 AM, Brian Inglis wrote:
> On 2020-07-01 07:36, Jeffrey Walton via Cygwin wrote:
>> I think the documentation leaves a lot to be desired... I'm trying to
>> tell someone what version of Cygwin I am using.
>>
>> There's a FAQ item at
>> https://cygwin.com/faq/faq.html#faq.what.version. It gives this
>> useless advice:
>>
>>     To find the version of the Cygwin DLL installed, you can use uname
>>     as on Linux or cygcheck. Refer to each command's --help output and
>>     the Cygwin User's Guide for more information.
>>
>> OK, let's try it:
>>
>> $ cygcheck -v
>> Usage: cygcheck [-v] [-h] PROGRAM
>>         cygcheck -c [-d] [PACKAGE]
>>         cygcheck -s [-r] [-v] [-h]
>>         cygcheck -k
>>         ...
>>
>> OK, -v is what we need:
>>
>> $ cygcheck -v cygwin
>> cygcheck: could not find 'cygwin'
>>
>> OK, another failure.
>>
>> RTFM does not work. Why the hell don't you just state how to check the
>> god damn version?
> Do you think it would help if this FAQ entry were changed to read:
>
> 1.5. What version of Cygwin is this, anyway?
>       To find the version of the Cygwin DLL installed, you can use any of the
> Cygwin commands uname -a, uname -srvm, head /proc/version as on Linux, or
> cygcheck -V. Refer to each command's --help output or the Cygwin User's Guide
> for more information.
>
> and please make any further comments, feedback, or suggestions you think would
> help with this entry.
>
> Running the suggested commands with their --help options would have shown you:
>
> $ uname --help
> Usage: uname [OPTION]...
> Print certain system information.  With no OPTION, same as -s.
>
>    -a, --all                print all information, in the following order,
>                               except omit -p and -i if unknown:
>    -s, --kernel-name        print the kernel name
>    -n, --nodename           print the network node hostname
>    -r, --kernel-release     print the kernel release
>    -v, --kernel-version     print the kernel version
>    -m, --machine            print the machine hardware name
>    -p, --processor          print the processor type (non-portable)
>    -i, --hardware-platform  print the hardware platform (non-portable)
>    -o, --operating-system   print the operating system
>        --help     display this help and exit
>        --version  output version information and exit
>
> GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
> Full documentation at: <http://www.gnu.org/software/coreutils/uname>
> or available locally via: info '(coreutils) uname invocation'
>
> $ cygcheck --help
> Usage: cygcheck [-v] [-h] PROGRAM
>         cygcheck -c [-d] [PACKAGE]
>         cygcheck -s [-r] [-v] [-h]
>         cygcheck -k
>         cygcheck -f FILE [FILE]...
>         cygcheck -l [PACKAGE]...
>         cygcheck -p REGEXP
>         cygcheck --delete-orphaned-installation-keys
>         cygcheck -h
>
> List system information, check installed packages, or query package database.
>
> At least one command option or a PROGRAM is required, as shown above.
>
>    PROGRAM              list library (DLL) dependencies of PROGRAM
>    -c, --check-setup    show installed version of PACKAGE and verify integrity
>                         (or for all installed packages if none specified)
>    -d, --dump-only      just list packages, do not verify (with -c)
>    -s, --sysinfo        produce diagnostic system information (implies -c)
>    -r, --registry       also scan registry for Cygwin settings (with -s)
>    -k, --keycheck       perform a keyboard check session (must be run from a
>                         plain console only, not from a pty/rxvt/xterm)
>    -f, --find-package   find the package to which FILE belongs
>    -l, --list-package   list contents of PACKAGE (or all packages if none given)
>    -p, --package-query  search for REGEXP in the entire cygwin.com package
>                         repository (requires internet connectivity)
>    --delete-orphaned-installation-keys
>                         Delete installation keys of old, now unused
>                         installations from the registry.  Requires the right
>                         to change the registry.
>    -v, --verbose        produce more verbose output
>    -h, --help           annotate output with explanatory comments when given
>                         with another command, otherwise print this help
>    -V, --version        print the version of cygcheck and exit
>
> Note: -c, -f, and -l only report on packages that are currently installed. To
>    search all official Cygwin packages use -p instead.  The -p REGEXP matches
>    package names, descriptions, and names of files/paths within all packages.
>
I think what is missing in all these suggestions is a clear statement 
that for Cygwin's purposes, the cygwin DLL is considered to be the 
'kernel', so looking for the 'kernel release' gives you the DLL version. 
I think that leap is totally non-obvious.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to check cygwin version?
  2020-07-01 13:36 Jeffrey Walton
                   ` (2 preceding siblings ...)
  2020-07-01 15:58 ` Phill Ramsden
@ 2020-07-02  5:20 ` Brian Inglis
  2020-07-02 15:34   ` Norton Allen
  3 siblings, 1 reply; 7+ messages in thread
From: Brian Inglis @ 2020-07-02  5:20 UTC (permalink / raw)
  To: cygwin

On 2020-07-01 07:36, Jeffrey Walton via Cygwin wrote:
> I think the documentation leaves a lot to be desired... I'm trying to
> tell someone what version of Cygwin I am using.
> 
> There's a FAQ item at
> https://cygwin.com/faq/faq.html#faq.what.version. It gives this
> useless advice:
> 
>    To find the version of the Cygwin DLL installed, you can use uname
>    as on Linux or cygcheck. Refer to each command's --help output and
>    the Cygwin User's Guide for more information.
> 
> OK, let's try it:
> 
> $ cygcheck -v
> Usage: cygcheck [-v] [-h] PROGRAM
>        cygcheck -c [-d] [PACKAGE]
>        cygcheck -s [-r] [-v] [-h]
>        cygcheck -k
>        ...
> 
> OK, -v is what we need:
> 
> $ cygcheck -v cygwin
> cygcheck: could not find 'cygwin'
> 
> OK, another failure.
> 
> RTFM does not work. Why the hell don't you just state how to check the
> god damn version?

Do you think it would help if this FAQ entry were changed to read:

1.5. What version of Cygwin is this, anyway?
     To find the version of the Cygwin DLL installed, you can use any of the
Cygwin commands uname -a, uname -srvm, head /proc/version as on Linux, or
cygcheck -V. Refer to each command's --help output or the Cygwin User's Guide
for more information.

and please make any further comments, feedback, or suggestions you think would
help with this entry.

Running the suggested commands with their --help options would have shown you:

$ uname --help
Usage: uname [OPTION]...
Print certain system information.  With no OPTION, same as -s.

  -a, --all                print all information, in the following order,
                             except omit -p and -i if unknown:
  -s, --kernel-name        print the kernel name
  -n, --nodename           print the network node hostname
  -r, --kernel-release     print the kernel release
  -v, --kernel-version     print the kernel version
  -m, --machine            print the machine hardware name
  -p, --processor          print the processor type (non-portable)
  -i, --hardware-platform  print the hardware platform (non-portable)
  -o, --operating-system   print the operating system
      --help     display this help and exit
      --version  output version information and exit

GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Full documentation at: <http://www.gnu.org/software/coreutils/uname>
or available locally via: info '(coreutils) uname invocation'

$ cygcheck --help
Usage: cygcheck [-v] [-h] PROGRAM
       cygcheck -c [-d] [PACKAGE]
       cygcheck -s [-r] [-v] [-h]
       cygcheck -k
       cygcheck -f FILE [FILE]...
       cygcheck -l [PACKAGE]...
       cygcheck -p REGEXP
       cygcheck --delete-orphaned-installation-keys
       cygcheck -h

List system information, check installed packages, or query package database.

At least one command option or a PROGRAM is required, as shown above.

  PROGRAM              list library (DLL) dependencies of PROGRAM
  -c, --check-setup    show installed version of PACKAGE and verify integrity
                       (or for all installed packages if none specified)
  -d, --dump-only      just list packages, do not verify (with -c)
  -s, --sysinfo        produce diagnostic system information (implies -c)
  -r, --registry       also scan registry for Cygwin settings (with -s)
  -k, --keycheck       perform a keyboard check session (must be run from a
                       plain console only, not from a pty/rxvt/xterm)
  -f, --find-package   find the package to which FILE belongs
  -l, --list-package   list contents of PACKAGE (or all packages if none given)
  -p, --package-query  search for REGEXP in the entire cygwin.com package
                       repository (requires internet connectivity)
  --delete-orphaned-installation-keys
                       Delete installation keys of old, now unused
                       installations from the registry.  Requires the right
                       to change the registry.
  -v, --verbose        produce more verbose output
  -h, --help           annotate output with explanatory comments when given
                       with another command, otherwise print this help
  -V, --version        print the version of cygcheck and exit

Note: -c, -f, and -l only report on packages that are currently installed. To
  search all official Cygwin packages use -p instead.  The -p REGEXP matches
  package names, descriptions, and names of files/paths within all packages.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to check cygwin version?
  2020-07-01 13:36 Jeffrey Walton
  2020-07-01 13:51 ` Thomas Wolff
  2020-07-01 13:58 ` Eric Lilja
@ 2020-07-01 15:58 ` Phill Ramsden
  2020-07-02  5:20 ` Brian Inglis
  3 siblings, 0 replies; 7+ messages in thread
From: Phill Ramsden @ 2020-07-01 15:58 UTC (permalink / raw)
  To: Jeffrey Walton via Cygwin

On Wed, Jul 01, 2020 at 09:36:47AM -0400, Jeffrey Walton via Cygwin wrote:
> I think the documentation leaves a lot to be desired... I'm trying to
> tell someone what version of Cygwin I am using.
> 
> There's a FAQ item at
> https://cygwin.com/faq/faq.html#faq.what.version. It gives this
> useless advice:
> 
>    To find the version of the Cygwin DLL installed, you can use uname
>    as on Linux or cygcheck. Refer to each command's --help output and
>    the Cygwin User's Guide for more information.
> 
> OK, let's try it:
> 
> $ cygcheck -v
> Usage: cygcheck [-v] [-h] PROGRAM
>        cygcheck -c [-d] [PACKAGE]
>        cygcheck -s [-r] [-v] [-h]
>        cygcheck -k
>        ...
> 
> OK, -v is what we need:

I note that you removed the bit that you actually wanted. 

v is NOT the same as V, you are in a case sensitive context.

> 
> $ cygcheck -v cygwin
> cygcheck: could not find 'cygwin'
> 
> OK, another failure.
> 
> RTFM does not work. Why the hell don't you just state how to check the
> god damn version?

If you had read the manual, you would have seen it says what I have said, and your ire and attitude are unnecessary, albeit understandable.

Always be nice first, you will find people (and we are just people) are just trying to do their best, mistakes will be rectified and attitude will usually get you ignored, you have been lucky this time.

Phill


> --
> Problem reports:      https://cygwin.com/problems.html
> FAQ:                  https://cygwin.com/faq/
> Documentation:        https://cygwin.com/docs.html
> Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to check cygwin version?
  2020-07-01 13:36 Jeffrey Walton
  2020-07-01 13:51 ` Thomas Wolff
@ 2020-07-01 13:58 ` Eric Lilja
  2020-07-01 15:58 ` Phill Ramsden
  2020-07-02  5:20 ` Brian Inglis
  3 siblings, 0 replies; 7+ messages in thread
From: Eric Lilja @ 2020-07-01 13:58 UTC (permalink / raw)
  To: noloader; +Cc: cygwin

On Wed, Jul 1, 2020 at 3:38 PM Jeffrey Walton via Cygwin <cygwin@cygwin.com>
wrote:

> I think the documentation leaves a lot to be desired... I'm trying to
> tell someone what version of Cygwin I am using.
>
> There's a FAQ item at
> https://cygwin.com/faq/faq.html#faq.what.version. It gives this
> useless advice:
>
>    To find the version of the Cygwin DLL installed, you can use uname
>    as on Linux
>


$ uname -r
3.1.5(0.340/5/3)

This is what I always do

- Eric L

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to check cygwin version?
  2020-07-01 13:36 Jeffrey Walton
@ 2020-07-01 13:51 ` Thomas Wolff
  2020-07-01 13:58 ` Eric Lilja
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Thomas Wolff @ 2020-07-01 13:51 UTC (permalink / raw)
  To: cygwin

Am 01.07.2020 um 15:36 schrieb Jeffrey Walton via Cygwin:
> I think the documentation leaves a lot to be desired... I'm trying to
> tell someone what version of Cygwin I am using.
>
> There's a FAQ item at
> https://cygwin.com/faq/faq.html#faq.what.version. It gives this
> useless advice:
The advice is correct and useful, if you read it.
>
>     To find the version of the Cygwin DLL installed, you can use uname
>     as on Linux or cygcheck. Refer to each command's --help output and
>     the Cygwin User's Guide for more information.
>
> OK, let's try it:
>
> $ cygcheck -v
> Usage: cygcheck [-v] [-h] PROGRAM
>         cygcheck -c [-d] [PACKAGE]
>         cygcheck -s [-r] [-v] [-h]
>         cygcheck -k
>         ...
>
> OK, -v is what we need:
>
> $ cygcheck -v cygwin
> cygcheck: could not find 'cygwin'
cygwin is a package, not a program, so cygcheck -c cygwin will help; 
also did you try uname?
>
> OK, another failure.
>
> RTFM does not work. Why the hell don't you just state how to check the
> god damn version?
> --
> Problem reports:      https://cygwin.com/problems.html
> FAQ:                  https://cygwin.com/faq/
> Documentation:        https://cygwin.com/docs.html
> Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple


^ permalink raw reply	[flat|nested] 7+ messages in thread

* How to check cygwin version?
@ 2020-07-01 13:36 Jeffrey Walton
  2020-07-01 13:51 ` Thomas Wolff
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jeffrey Walton @ 2020-07-01 13:36 UTC (permalink / raw)
  To: cygwin

I think the documentation leaves a lot to be desired... I'm trying to
tell someone what version of Cygwin I am using.

There's a FAQ item at
https://cygwin.com/faq/faq.html#faq.what.version. It gives this
useless advice:

   To find the version of the Cygwin DLL installed, you can use uname
   as on Linux or cygcheck. Refer to each command's --help output and
   the Cygwin User's Guide for more information.

OK, let's try it:

$ cygcheck -v
Usage: cygcheck [-v] [-h] PROGRAM
       cygcheck -c [-d] [PACKAGE]
       cygcheck -s [-r] [-v] [-h]
       cygcheck -k
       ...

OK, -v is what we need:

$ cygcheck -v cygwin
cygcheck: could not find 'cygwin'

OK, another failure.

RTFM does not work. Why the hell don't you just state how to check the
god damn version?

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-07-02 16:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-02 16:13 How to check cygwin version? KARL BOTTS
  -- strict thread matches above, loose matches on Subject: below --
2020-07-01 13:36 Jeffrey Walton
2020-07-01 13:51 ` Thomas Wolff
2020-07-01 13:58 ` Eric Lilja
2020-07-01 15:58 ` Phill Ramsden
2020-07-02  5:20 ` Brian Inglis
2020-07-02 15:34   ` Norton Allen

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).