gen-dependencies.sh: fix handling variations in "file" output