public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* 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; 10+ 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] 10+ messages in thread
* Re: How to check cygwin version?
@ 2020-07-02 16:13 KARL BOTTS
  0 siblings, 0 replies; 10+ 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] 10+ messages in thread

end of thread, other threads:[~2020-07-04 12:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-01 13:36 How to check cygwin version? 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
2020-07-03  3:38     ` FAQ 1.5 changes (was: How to check cygwin version?) Brian Inglis
2020-07-03  4:02       ` Brian Inglis
2020-07-04 12:39         ` FAQ 1.5 changes Mark Hansen
2020-07-02 16:13 How to check cygwin version? KARL BOTTS

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