Bug#696492: uscan fails unnecessarily when directory pattern matches a non-directory

Osamu Aoki osamu at debian.org
Fri Oct 2 18:07:26 UTC 2015


Hi,

Excuse me ... my first reaction was immediate rejection since (.+) is
too broad. I thought if you wish 10.04 and similar, (\d+\.\d+) or
similar ...  But there are few things I should be reminded after
re-reading this bug report.

#1, we are matching directory.  So match should look for symlink and
    directory.  No pint looking at FILE.

#2, sorting priority needs to be either date based or version-like order
    based.

With newer test code, this is more obvious:  We are sorting using string
within ().

uscan debug: matching pattern (.+)
-- Found the following matching FTP dirs (newest first):
     -rw-rw-r--    1 ftp      ftp            49 Oct 29  2009 robots.txt (-rw-rw-r--    1 ftp      ftp            49 Oct 29  2009 robots.txt) 
     -rw-rw-r--    1 ftp      ftp            22 Feb 01  2006 FOOTER.html (-rw-rw-r--    1 ftp      ftp            22 Feb 01  2006 FOOTER.html) 
     -rw-rw-r--    1 ftp      ftp          2252 Aug 06 20:33 HEADER.html (-rw-rw-r--    1 ftp      ftp          2252 Aug 06 20:33 HEADER.html) 
     -rw-rw-r--    1 ftp      ftp          1150 Jun 16  2011 favicon.ico (-rw-rw-r--    1 ftp      ftp          1150 Jun 16  2011 favicon.ico) 
     lrwxrwxrwx    1 ftp      ftp             7 Mar 01  2012 12.04 -> precise (lrwxrwxrwx    1 ftp      ftp             7 Mar 01  2012 12.04 -> precise) 
     lrwxrwxrwx    1 ftp      ftp             7 Aug 07  2014 12.04.5 -> precise (lrwxrwxrwx    1 ftp      ftp             7 Aug 07  2014 12.04.5 -> precise) 
     lrwxrwxrwx    1 ftp      ftp             6 Sep 26  2014 14.10 -> utopic (lrwxrwxrwx    1 ftp      ftp             6 Sep 26  2014 14.10 -> utopic) 
     lrwxrwxrwx    1 ftp      ftp             6 Mar 27  2014 14.04 -> trusty (lrwxrwxrwx    1 ftp      ftp             6 Mar 27  2014 14.04 -> trusty) 
     lrwxrwxrwx    1 ftp      ftp             6 Aug 06 19:44 14.04.3 -> trusty (lrwxrwxrwx    1 ftp      ftp             6 Aug 06 19:44 14.04.3 -> trusty) 
     lrwxrwxrwx    1 ftp      ftp             5 Mar 26  2015 15.04 -> vivid (lrwxrwxrwx    1 ftp      ftp             5 Mar 26  2015 15.04 -> vivid) 
     lrwxrwxrwx    1 ftp      ftp             5 Mar 19  2010 10.04 -> lucid (lrwxrwxrwx    1 ftp      ftp             5 Mar 19  2010 10.04 -> lucid) 
     lrwxrwxrwx    1 ftp      ftp             5 Feb 16  2012 10.04.4 -> lucid (lrwxrwxrwx    1 ftp      ftp             5 Feb 16  2012 10.04.4 -> lucid) 
     lrwxrwxrwx    1 ftp      ftp             4 Sep 24 23:04 15.10 -> wily (lrwxrwxrwx    1 ftp      ftp             4 Sep 24 23:04 15.10 -> wily) 
     lrwxrwxrwx    1 ftp      ftp             1 Jul 31  2007 releases -> . (lrwxrwxrwx    1 ftp      ftp             1 Jul 31  2007 releases -> .) 
     drwxr-xr-x    2 ftp      ftp          4096 Aug 06 20:45 trusty (drwxr-xr-x    2 ftp      ftp          4096 Aug 06 20:45 trusty) 
     drwxrwxr-x    3 ftp      ftp          4096 Aug 21  2014 include (drwxrwxr-x    3 ftp      ftp          4096 Aug 21  2014 include) 
     drwxrwxr-x    2 ftp      ftp          4096 Sep 26  2013 lucid (drwxrwxr-x    2 ftp      ftp          4096 Sep 26  2013 lucid) 
     drwxrwxr-x    2 ftp      ftp          4096 Sep 24 23:07 wily (drwxrwxr-x    2 ftp      ftp          4096 Sep 24 23:07 wily) 
     drwxrwxr-x    2 ftp      ftp          4096 Sep 21  2012 cdicons (drwxrwxr-x    2 ftp      ftp          4096 Sep 21  2012 cdicons) 
     drwxrwxr-x    2 ftp      ftp          4096 Sep 17 15:11 vivid (drwxrwxr-x    2 ftp      ftp          4096 Sep 17 15:11 vivid) 
     drwxrwxr-x    2 ftp      ftp          4096 Oct 23  2014 utopic (drwxrwxr-x    2 ftp      ftp          4096 Oct 23  2014 utopic) 
     drwxrwxr-x    2 ftp      ftp         12288 Jun 03 22:11 precise (drwxrwxr-x    2 ftp      ftp         12288 Jun 03 22:11 precise) 
uscan debug: newest_dir => '-rw-rw-r--    1 ftp      ftp            49 Oct 29  2009 robots.txt'
uscan debug: requesting URL ftp://ftp.mirrorservice.org/sites/releases.ubuntu.com/-rw-rw-r--    1 ftp      ftp            49 Oct 29  2009 robots.txt/
uscan warning: In watchfile debian/watch, reading FTP directory
  ftp://ftp.mirrorservice.org/sites/releases.ubuntu.com/-rw-rw-r--    1 ftp      ftp            49 Oct 29  2009 robots.txt/ failed: 404 File '-rw-rw-r--    1 ftp      ftp            49 Oct 29  2009 robots.txt' not found
-- Scan finished

Clearly, sorting order is bogus and should exclide ^\s+- and include ^\s+l and ^\s+d 

Osamu



More information about the devscripts-devel mailing list