FS#20758 - [namcap] check pathes for non-ascii symbols

Attached to Project: Arch Linux
Opened by Sergej Pupykin (sergej) - Monday, 06 September 2010, 21:30 GMT
Last edited by Rémy Oudompheng (remyoudompheng) - Sunday, 13 February 2011, 09:44 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Dan McGee (toofishes)
Rémy Oudompheng (remyoudompheng)
Hugo Doria (hdoria)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

It would be good if namcap checks filenames for non-ascii chars and print warning.

It looks like namcap does not do it now: see smbnetfs bug  FS#20746 .
This task depends upon

Closed by  Rémy Oudompheng (remyoudompheng)
Sunday, 13 February 2011, 09:44 GMT
Reason for closing:  Implemented
Additional comments about closing:  Done in version 2.8.1
Comment by Dan McGee (toofishes) - Sunday, 12 September 2010, 22:29 GMT
Hugo has been MIA for months, not sure at all why this got assigned to him.
Comment by Rémy Oudompheng (remyoudompheng) - Saturday, 22 January 2011, 18:13 GMT
Implemented in http://projects.archlinux.org/users/remy/namcap.git/commit/?id=08caa0
Please provide any needed comments.
Comment by Dan McGee (toofishes) - Thursday, 03 February 2011, 15:51 GMT
$ namcap picasa-beta-3.0_5744.02-3-x86_64.pkg.tar.xz PKGBUILD
picasa-beta W: File name opt/google/picasa/3.0/wine/drive_c/Program Files contains non standard characters
...

That seems a bit strict, no? Spaces have a valid case in some paths.
Comment by Rémy Oudompheng (remyoudompheng) - Thursday, 03 February 2011, 21:21 GMT
As a first try I chose to allow ASCII printable characters that do not have a special meaning in bash (except for several of them that I found in existing packages). I think adding space to the allowed characters is unharmful, but still I think it deserves some warning, at least to try to prevent upstream inserting spaces in filenames. Do you think differently ?
Comment by Dan McGee (toofishes) - Thursday, 03 February 2011, 21:32 GMT
I think totally differently, yes, especially since you already made exceptions for most other punctuation characters. The only request here was non-ascii, not anything else. I think the check should stick to this and not try to whitelist/blacklist, but at the very least, I'm not sure how a space is any more suspect than { or }.

Also note that this warning is overwhelming in this package's case, and it isn't the only package in this boat:
$ pacman -Qlq picasa-beta | grep ' ' | wc -l
610
$ pacman -Qlq | grep ' ' | wc -l
1499

Especially vs. other characters you are currently excluding:
$ pacman -Qlq | grep '{' | wc -l
8
$ pacman -Qlq | grep '!' | wc -l
3
Comment by Rémy Oudompheng (remyoudompheng) - Thursday, 03 February 2011, 21:39 GMT
That's fine for me, since I had no real reason to exclude these, except for sticking to some tradition. Do we still agree on sticking with printable characters and excluding \r and \n for example ?
Comment by Dan McGee (toofishes) - Thursday, 03 February 2011, 21:41 GMT
Seems fine with me.

Loading...