[tex-live] kpsewhich case insensitive?

Pablo Alfonso González Luengo pablgonz at educarchile.cl
Tue Sep 11 03:28:13 CEST 2018


I know that this is a very old thread, but, I keep thinking about it since
I read it. The latest versions of windows 10 (1803) with WSL installed,
allow to use "case sensitive" for folders using the "fsutils", that is,
"fsutils" is not recursive and must be made folder by folder.

Some days ago I am working on a collaborative (La) TeX project using
github, linux and windows and I have created a small script (csdirtree) to
leave dir trees  with "case sensitive" activated (ideal when using
"auxtree" loved...).

In the future maybe it could be an option to install TexLive using pseudo
"case sensitive" using "fsutils" in win10.

regards
Pablo

#!/usr/bin/perl
use v5.22;
use strict;
use autodie;
use File::Find;
use Getopt::Long qw(:config bundling_values require_order no_ignore_case);
use File::Spec::Functions qw(devnull);

# vars
my $enable  = 1;
my $disable = 0;
my $status  = 0;
my $help    = 0;
my $verbose = 0;
my $null    = devnull(); # "null" device for windows

# error
sub errorUsage { die "@_ (try csdirtree --help for more information)\n"; }

#----------------- script identification, options and help -----------#
my $script = "csdirtree";
my $nv='v1.0';
my $copyright = <<END_COPYRIGHT ;
[2018-09-11] (c) 2018 by Pablo Gonzalez L, pablgonz<at>yahoo.com
END_COPYRIGHT

my $licensetxt = <<END_LICENSE ;
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
    MA  02111-1307  USA
END_LICENSE

my $title = "$script $nv $copyright";

# usage
my $usage = <<"HOW_TO_USE";
${title}Syntax: csdirtree [--enable|--disable|--status]
"X:\\full\\path\\dirtree"
Function: Set case sensitive in directory tree for windows 10
Examples:
\$ csdirtree --enable  "C:\\testdir"
\$ csdirtree --disable "C:\\testdir"
\$ csdirtree --status  "C:\\testdir"

Options:
 -h, --help     - display this help and exit
 -e, --enable   - run fsutil.exe file SetCaseSensitiveInfo "X:\\dirtree"
enable
 -d, --disable  - run fsutil.exe file SetCaseSensitiveInfo "X:\\dirtree"
disable
 -s, --status   - run fsutil.exe file queryCaseSensitiveInfo "X:\\dirtree"
 -v, --verbose  - show information when running fsutil.exe command in cmd
HOW_TO_USE

# Getopt::Long
my %opts_cmd;
GetOptions (
    'h|help'       => \$opts_cmd{help},
    'e|enable'     => \$opts_cmd{enable},
    'd|disable'    => \$opts_cmd{disable},
    's|status'     => \$opts_cmd{status},
    'v|verbose'    => \$opts_cmd{verbose},
) or die $usage;

# help
if (defined $opts_cmd{help}){
    print $usage;
    exit(0);
}

# disable
if (defined $opts_cmd{disable}){
    $enable = 0;
    $disable=1;
}

# status
if (defined $opts_cmd{status}){
    $enable = $disable = 0;
    $status = $verbose = 1;
}

# verbose
if (defined $opts_cmd{verbose}){
    $verbose = 1;
}

# fsutils file <options> <$dirtree> [mark]
my $fsutil = $status ? 'fsutil file queryCaseSensitiveInfo'
            :          'fsutil file SetCaseSensitiveInfo'
            ;

my $mark    = $enable ? 'enable'
            : $disable? 'disable'
            :           ''
            ;

my $quiet   = $verbose ? ''
            :            "> $null"
            ;

# check input
@ARGV > 0 or errorUsage 'Input "X:\\full\\path\\dirtree" missing';
@ARGV < 2 or errorUsage 'Unknown option or too many inputs';

# dirtree to change case sensitive
my $dirtree  = $ARGV[0];

# search in tree
finddepth(\&read_tree, $dirtree);

sub read_tree{
my @subdirs;
my $element = $_;
if (-d $element){ # if a dir
    push @subdirs,$File::Find::name;
    s{/}{\\}mg foreach @subdirs; # changue / by \
    system("$fsutil @subdirs $mark $quiet");
    }
}
__END__



Message: 4
> Date: Mon, 16 Apr 2018 13:45:43 +0900
> From: "Akira Kakuto" <kakuto at fuk.kindai.ac.jp>
> To: "Daniel H. Luecking" <luecking at uark.edu>, <tex-live at tug.org>
> Subject: Re: [tex-live] kpsewhich case insensitive?
> Message-ID: <2A9C0925EB1145EEBC9E30EF7066EE34 at CJ3001517A>
> Content-Type: text/plain; format=flowed; charset="iso-8859-1";
>         reply-type=response
>
> > In TL2018, it shows the 'actual' name:
> > c:/texlive/2018/texmf-dist/tex/latex/ieeetran/IEEEtran.cls
> >
> > Maybe this is the reason of Daniel's example.
> >
> > In the next TL2019,
> > kpsewhich ieeetran.cls
> > does not print anything.
>
> After discussion with some people, I decided not
> to change the present case-insensitive matching
> on Windows, even in texmf trees with ls-R.
> Thus, in the next TL2019 also
> kpsewhich ieeetran.cls
> shall show
> c:/texlive/2019/texmf-dist/tex/latex/ieeetran/IEEEtran.cls
>
> Best,
> Akira
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/tex-live/attachments/20180910/917a444a/attachment.html>


More information about the tex-live mailing list