Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore Icon? #66

Open
joswr1ght opened this issue Aug 9, 2023 · 4 comments
Open

Ignore Icon? #66

joswr1ght opened this issue Aug 9, 2023 · 4 comments

Comments

@joswr1ght
Copy link

My Integrity files often fail validation during courseware processing because macOS insists on making an Icon? (Icon\r) file. macOS doesn't allow me to delete this file from my lab files directory, so I need to manually edit the YAML file to remove the entry after creating the integrity file.

Feature Request: Integrity should ignore this file and not calculate a checksum, nor should it include the file in the sans-integrity.yml file.

image

504.23.3 $ ls -l Icon*
-rw-r--r--@ 16 jwright  staff     0B Aug  5 06:09 Icon?
504.23.3 $ rm Icon*
504.23.3 $ sudo rm Icon*
504.23.3 $ ls -l Icon*
-rw-r--r--@ 16 jwright  staff     0B Aug  5 06:09 Icon?
@ekristen
Copy link
Collaborator

ekristen commented Aug 9, 2023

Interesting, that's a new one for me I haven't seen Icon? before. What version of MacOS are you running?

Integrity should already exclude and ignore the sans-integrity.yml, but if it isn't that seems to be a regression.

@ekristen
Copy link
Collaborator

ekristen commented Aug 9, 2023

@joswr1ght integrity has an additional ignore feature, you can pass --ignore <file> it will try it as a prefix, direct match and parse as a regex for matching.

It adds to the Always Ignore list which is the sans-integrity.yml and sans-integrity.yml.gpg.

@ekristen
Copy link
Collaborator

In re-reading after a slack conversation, I meant to be way more specific. First we can easily add more files to the ignore list, including Icon\r which I haven't seen before yet.

Second, to test adding any files for exclusion you can always add by using the --ignore switch.

If you can confirm Iron\r as the value works to exclude then I'll add it to the default configuration and cut a new release.

if you are seeing issues with sans-integrity.yml not being excluded, I might need some more details as we haven't changed anything in a while and it was originally excluded. There could be some regression happening.

@joswr1ght
Copy link
Author

joswr1ght commented Aug 12, 2023

macOS 13.3 on x64:

$ sw_vers
ProductName:		macOS
ProductVersion:		13.3
BuildVersion:		22E252

The file is called Icon\r, but the output of ls shows Icon?:

504.23.3 $ ls
-Lab0-StartHere.pdf      cheat_sheets/            sans-integrity.yml       virtual_machines/
Icon?                    course_index/            sans-integrity.yml.gpg   visual_association_maps/
bonus_content/           course_tools/            utilities/
bootcamp/                license.txt              videos/
504.23.3 $ python -c 'import os; print(os.listdir("."))'
['visual_association_maps', 'sans-integrity.yml', '.DS_Store', 'course_index', 'Icon\r', '-Lab0-StartHere.pdf', 'cheat_sheets', 'virtual_machines', 'course_tools', 'utilities', 'videos', 'bonus_content', 'sans-integrity.yml.gpg', 'license.txt', 'bootcamp']

Using Integrity with --ignore works as described (using ? as a wildcard, not a literal file name match:

504.23.3 $ integrity create --name 504.23.3 --ignore Icon? 2> /dev/null
504.23.3 $ grep Icon sans-integrity.yml
504.23.3 $

It's possible this file is introduced by having an extra icon in my Finder (which I used with Applescript to open an iTerm in the current directory displayed by Finder), as shown here, though I've had that icon for a long time and I don't remember having to take extra steps with Integrity to ignore this Icon\r file:
Screenshot 2023-08-12 at 6 18 06 AM

I think this file name is a candidate for addition to IgnoreOnCreate. I'd setup alias integrity="integrity --ignore Icon?" in my shell profile but that breaks integrity validate. In the meantime I'll just manually ignore this file, or edit the YAML file when I forget. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants