summaryrefslogtreecommitdiff
path: root/bin/identify-cygwin-packages.sh
blob: a16c885b0b21b46254ceba42d6201eda40cfabc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

export OUT="cygwin files and packages.csv"

if [[ $# == 0 ]]; then
	echo "Example usage: $0 sh.exe libgcc_s-1.dll"
	echo "Output will be appended to \"${OUT}\""
        echo "This script is intended to help with GPL compliance."
	echo "Currently this script does not identify the source package,"
        echo "Only the binary package."
	echo "Browse a cygwin mirror or use Google/DuckDuckGo to identify the source package."
fi

echo "File,Binary Package w/ Version,Source Package" >> "${OUT}"

for file in "$@"
do
		filepath="/bin/${file}"
        binPkg=`cygcheck -f $filepath| tr -d '\r' | tr -d '\n'`
        echo "${file},${binPkg}," >> "${OUT}"
done