www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2026/03/24/12:17:44

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 62OGHhr2426172
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 62OGHhr2426172
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=wfBFjmy5
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7E9254BB3BED
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1774369062;
bh=toLmqWIc5wj+hjKdBHxG1R/XEOd5nIanIQvl209MDMQ=;
h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post:
List-Help:List-Subscribe:From:Reply-To:From;
b=wfBFjmy5c0wMiBqyUP32vCBPsA+BLiJcYOua+DDODuige39+WFUx9jSjAG5jOWuEO
da0VoDS8ZpB5+fRMHLLmOMJyZH0U67iPjx9lJx+oGjmqYDtcXDT2a6UhePfqD0aLBS
LAdJFjzs3RSFisFUGu5hAQRbk0EqbcpCdvFDUq4s=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 24F224BAD15F
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 24F224BAD15F
ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1774369040; cv=pass;
b=dNSL+9OuMLQmccLU7yCJzazCoNxUWIhiLCVdtoXvJrRz/eVuUwWlL+QMzK3hbS3PPfjxlWx4G5cjx9Fy+eKysac90wQ7kRdmfZT1dqK+kFbqBWJeZXYLUYMw+UQIwMz84KfWU7wJAdAtZC6RXZ/whTvvQiOXd9WZpG6GCAneSOw=
ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key;
t=1774369040; c=relaxed/simple;
bh=y1vauSHVmgUa7jl0mAMxQrfpOAreGP8bW5i+cXqaNm0=;
h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;
b=O0zaJbPZC4OkU0MuWDBFiRB1Es4g98w8ED+3uLusnq9E+5XD9zEbuIi1yvASRyFz8uYwqsKrAVQ3D8Ant93D2NKxCTFB9+HQnewfAcUB7H2ihUMI8QQsS7uawgUjM3R3sS8GXnq0Xfa2l6zsF+SC5Ii7SRxrqR5/NcwXZqm4zmY=
ARC-Authentication-Results: i=2; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 24F224BAD15F
ARC-Seal: i=1; a=rsa-sha256; t=1774369038; cv=none;
d=google.com; s=arc-20240605;
b=g6NnJOcjyh7MWnhOskPR1LhBcOtIi/eMWGxjYBPKuiDAB7djCS5mQV3rB9SMQ80wLU
aI5HUUHYZ8rMYpdlAsr+NiQX9MqlTBDeN17ogtB8k+tL86phpjBoA1OKwcSVuw+MzO/J
0pJ2X+tbXa+Z0dTbwZu6JoEM0PYWtcuuFM2Wpb0+HHtyZP8OPYBilKwv8TX+Tx6NYMEu
ndAAlf0BGj9pG/1/KdONDNTE50uhKSWW798cVKmuXYicVl9d90UEtwSULlE10B1ccHhg
jitysYogYiXaUk7ytOSCJ80tOGbNI+JjpqRMgiuqvGhCNW/UjRYgTGj0ZFwzTHKUOw5L
ldwg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20240605;
h=to:subject:message-id:date:from:mime-version:dkim-signature;
bh=gom+a8h81CwbXS2Tvni+tPZWUXYtRjZq0yJz3eT0YL4=;
fh=UKNFaOBO97U3RYl3PEse//nArTqr7SLJjCCEBz281Ew=;
b=UgtBbAM+JAsEUtX6xu7Na+w8xADzjINnnDfBacqdyoaGcnKtMnw1xkrKFodC2sNI9A
Zr/TjXsjXm3rHfEOi1HdSAN1leG6NT/8QtYTvxqt2j+kyNVxTHx6RO0rE7k+TvkLA2QB
579WpvnFsSlWrlnO+Wwixzth/p92atm3negsY7+ckIA5N0rg0jmmWB743iDelcfLRtnD
/ghSD7GBDPUdtEpxlw2y+VCVwc0Gt5GlaODtOFC3CgJ5APNo6xv5JMxmFnsC7KEzUlbQ
JKrx6jHw1m/1zjXm92iLcuwJqRRmDrO3ksXzUTS7s9+unAYQbfTfG2vnGSut3H6E6cMI
Q+Ag==; darn=cygwin.com
ARC-Authentication-Results: i=1; mx.google.com; arc=none
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20251104; t=1774369038; x=1774973838;
h=to:subject:message-id:date:from:mime-version:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
bh=gom+a8h81CwbXS2Tvni+tPZWUXYtRjZq0yJz3eT0YL4=;
b=QMI4QWo2gpWaALg8xT04oV3eat4BkaRT8/7iz/jdqgqSegoKn5y2+BWXsg0c3h1XrD
3EdxoAYHU/C+w7ON0r8gfqK2BPiLDowWv+OHvIcl5EdQcIWw4Z7HQd8UfjVErZ63F/FC
WfCon7MoUsmwqTIRHjmdUlw/bRGrZyfc0BWna+jf37fUsnoDmtyO5ckjMcyLDeSPf0qn
oyboE5CmSlpzypqP3sREQEGivGn9HF9wuks6GkI7zouZeO0yst824w7YFTiTETw5QWaC
fxbyrlZwX+wvoT8f8fmB8R7oEsxME+YPdkrvF+AsfEfuzEWxBNw2zStIfOB4nX8kX0hg
uMyQ==
X-Gm-Message-State: AOJu0Yzo4zWWsD/biA6xyouTXVx/RUcieAmIzYjPOL5tikVFp9ksQ2K3
FOZ2RvTrVRloEpJIJiCXUqBobOXJ38r6azhekGwC8pd4x7FgOljZxYnjuxrIRhYZoyqHAl3zurE
qmS2iUcJLAe2oa1sSe/9OtjYCYNHq+MVu4cRG
X-Gm-Gg: ATEYQzxOFTFidPBul/cjrRqSqdPd49fBSq+5KRoSdAHfbiRt8+Bw3oXZJ6OHffC4ICP
TdyqKOibN1cf21J1Ls4SIQ53KuyfPdNWRvZ+snVEjo9nxSA1sRf9PcDD437sl3dYgt0D74ryxvW
tMqRUR3UMIo7xaAeXaNY8ONwxp4vQD33Mh2jQsLm+sGlCAZBNWRnRNL52+gdYjghKJJNt0y2fYQ
v8RhoK6BvAJwwUHU/dNzmNxq7cTw/zEmcGHKdOEbQ7sQqUlJROp/60YqF59DH+vjRJkU6cRxCx+
tJtt
X-Received: by 2002:a05:6512:12d5:b0:5a2:7b95:af0 with SMTP id
2adb3069b0e04-5a29b99beb3mr29954e87.25.1774369037919; Tue, 24 Mar 2026
09:17:17 -0700 (PDT)
MIME-Version: 1.0
Date: Tue, 24 Mar 2026 12:17:06 -0400
X-Gm-Features: AQROBzDovVF8kq-kL6wv9oCj1TTyR5Y_zLTPmldIj73bpbzdeF-S8dmSNKNAhLw
Message-ID: <CAGB_HuT9MZCLi2Z5wQw8-6SYUddeeLLLf5_1=Yf-xH9fDzrzNw@mail.gmail.com>
Subject: An offering to the Perl enthusiasts among us
To: cygwin AT cygwin DOT com
X-Content-Filtered-By: Mailman/MimeDel 2.1.30
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Soren via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Soren <somian08 AT gmail DOT com>
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

Greetings cygwinistas.

I've written a program in Perl that satisfies a desire I've had for a
while. I wanted to have a way  to check out what Perl module distributions
have been made into cygwin packages installable with Setup, but outside of
Setup. The main feature of how the program works is the specification of
"namespace globs" like "IO-*" or "Module-*" used as the argument to my
script. This allows for surveying a manageable grouping of packages from
the Cygwin server, in the TMI (terminal, text mode interface, commandline).
I think it's best if I just show some representative output rather than
struggling to explain what I mean:

$ perl ~/Scripts-working/cygchk-perl-mods.pl 'perl-Module-*'
Matching distributions packaged for Cygwin:
Fetching setup.ini from cygwin.com...

perl-Module-Build           Module::Build is installed as
/usr/local/share/perl5/site_perl/5.40/Module/Build.pm
perl-Module-Build-Tiny      Module::Build::Tiny is installed as
/usr/local/share/perl5/site_perl/5.40/Module/Build/Tiny.pm
perl-Module-Build-XSUtil    Module::Build::XSUtil is installed as
/usr/local/share/perl5/site_perl/5.40/Module/Build/XSUtil.pm
perl-Module-Implementation  Module::Implementation is installed as
/usr/local/share/perl5/site_perl/5.40/Module/Implementation.pm
perl-Module-Install         Module::Install is installed as
/usr/local/share/perl5/site_perl/5.40/Module/Install.pm
perl-Module-Metadata        Module::Metadata is installed as
/usr/share/perl5/5.40/Module/Metadata.pm
perl-Module-Pluggable       Module::Pluggable is installed as
/usr/local/share/perl5/site_perl/5.40/Module/Pluggable.pm
perl-Module-Runtime         Module::Runtime is installed as
/usr/local/share/perl5/site_perl/5.40/Module/Runtime.pm
perl-Module-ScanDeps        Module::ScanDeps is installed as
/usr/local/share/perl5/site_perl/5.40/Module/ScanDeps.pm
perl-Module-Signature       Module::Signature is not installed

That's how it produces output. The point of this is twofold. One is that
there are hundreds of packaged modules in Setup and I find myself squinting
and getting a headache if I just try to scroll through the huge list that
matches "perl-". The other point is that the output allows me to check
whether I've built a module from CPAN and perl has installed it under
"site_perl/" (which has the consequence that it has precedence over modules
installed to "vendor_perl/" [which is called "shadowing"]).

I could possibly add features to this program: displaying the version of
the module installed would be one nice thing. But I believe in the unix
virtue of "small tools that do one thing well" (and I am a bit busy, yeah)
and so for now I'll avoid feeping creaturism and just show y'all the script:

(If you prefer to download rather than c&p I've made a gist for it at
https://gist.github.com/somian/22f6d1baae1b44c6c1e0cb0ea867e0a5)

#!/usr/bin/perl
# Last modified: Tue Mar 24 11:57:45 2026

use strict;
use v5.18;
use utf8;
use warnings;
use Carp qw/ carp croak /;
=head1 NAME
cygchk-perlmods.pl

=head1 SYNOPSIS
cygchk-perlmods.pl "IO-*"      # "glob expression"

=head1 VERSION
0.10

=head1 AUTHOR
Soren Andersen C<somian08 AT gmail DOT com>

=cut

if ( @ARGV * 1 == 0 ) {
    croak 'You must type an argument. Exiting.';
}
my ($globexpr) = @ARGV;
my $as_perl_says;

if ($globexpr !~/^perl-/) {  # you may omit the "perl-" prefix in the
argument
    $globexpr = 'perl-' . $globexpr;
}

$globexpr = lc $globexpr;
open( my $ok_fh, '-|', "cygcheck", "-e", $globexpr);
croak "Dying from no open on cygcheck" unless $ok_fh;

printf( "Matching distributions packaged for Cygwin:\n" );
my ( @dists, $mlen );
$mlen = 0;
while (<$ok_fh>) {
     my $setup_name = $_;
     my $nonly = (split( ' : ' ))[0];
     $mlen = length($nonly) > $mlen ? length($nonly) : $mlen;
     push @dists, $nonly;
}
for (@dists) {
     my $e = substr($_,5);
     $e =~s/-/::/g;
     $as_perl_says = $e;
     my $report_str = sprintf( "%-${mlen}s  %s" =>
                              $_, $as_perl_says );
     $report_str .=  q[ ].chk_inst( $as_perl_says );
     say $report_str;
}

sub chk_inst {
    local $::pkgname = $_[0];
    eval qq{require $::pkgname;};
    unless ( $@ ) {
        my $pm = $_[0];
        $pm =~ s{::}{/}g;
        $pm .= '.pm';
        return 'is installed as '. $INC{ $pm };
    } else {
        return 'is not installed';
    }
}
__END__

=head1 LICENSE
This program is Free software, made available under the same terms as Perl.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

=cut

# vim: ft=perl et sw=4 ts=4 :


-- 
Soren

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019