[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#193492: changetrack: Problem is related to locale settings and ls options *** Please type your report below this line ***



Package: changetrack
Version: 3.16-5
Followup-For: Bug #193492

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I just found the same problem on several of my sarge
systems. Eventually discovered that the output of `ls -l` depends on
your locale (see the ls info page). In particular, with LANG=en_us,
you get

- -rwxr-xr-x    1 ron      ron         16139 2003-05-29 16:28 changetrack*

   With LANG unset,

- -rwxr-xr-x    1 ron      ron         16139 May 29 16:28 changetrack*

   Unfortunately, this means that the filename is on field 7 in the
first instance, field 8 in the second, meaning that whether line 162
of the changetrack program gets a real filename or not depends on the
locale.

   There are probably lots of ways to fix this one. I found that by
setting the 'time-style' option in the ls invocation seemed to
work. Patch below.

 .....Ron

 ---------------------------------
*** /usr/bin/changetrack        2003-04-21 09:55:04.000000000 -0400
- --- changetrack 2003-05-29 16:28:44.000000000 -0400
***************
*** 152,165 ****
        $filename = $homedir . $filename;
      }
                
!     open(LS,"ls -l -d $filename |");              # match wildcards
like 'ls'
      my $anyfile = 0;                              # flag in case we
	  find nothing
      while(<LS>) {                                 # may match
	  several (wildcards)
        my @diff = ();
        my @ed = ();
        chomp;
        s/  / /g;                                 # remove redundant
		spaces
!       my $realfile = (split(/\s+/))[8];         # filename
        my $filebits = (split(/\s+/))[0];         # permission bits
        if((substr($realfile,-1,1) eq "~") && ($filename =~ m/\*/)) {
            # it's a backup file not explicitly included        
- --- 152,165 ----
        $filename = $homedir . $filename;
      }
                
!     open(LS,"ls -l -d --time-style=long-iso $filename |");
# match wildcards like 'ls'
      my $anyfile = 0;                              # flag in case we
	  find nothing
      while(<LS>) {                                 # may match
	  several (wildcards)
        my @diff = ();
        my @ed = ();
        chomp;
        s/  / /g;                                 # remove redundant
		spaces
!       my $realfile = (split(/\s+/))[7];         # filename
        my $filebits = (split(/\s+/))[0];         # permission bits
        if((substr($realfile,-1,1) eq "~") && ($filename =~ m/\*/)) {
            # it's a backup file not explicitly included        



- -- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux khufu 2.4.19-khufu-8 #1 Tue Apr 1 20:28:13 EST 2003 i686
Locale: LANG=C, LC_CTYPE=C

Versions of packages changetrack depends on:
ii  debconf                       1.2.35     Debian configuration management sy
ii  libfile-ncopy-perl            0.32-1     file copying like cp for perl
ii  libmail-sendmail-perl         0.78.5-1   Send email from a perl script
ii  perl                          5.8.0-17   Larry Wall's Practical Extraction 
ii  perl-modules                  5.8.0-17   Core Perl modules.
ii  rcs                           5.7-13     The GNU Revision Control System

- -- debconf information:
  changetrack/remove_depository: false
  changetrack/unified_diff: true
  changetrack/remove_repository: false
  changetrack/quiet: true
* changetrack/old_defaults: 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+1nPRitqjxNhsdN4RAuzsAJ97X7Rhgk3YkC2Zj7g1BRv5cKg+pgCgjfSi
rNQ0zAALjHDvj6t+NIyuU6A=
=uXSx
-----END PGP SIGNATURE-----



Reply to: