solus-packages/common/Scripts/sync_licenses.sh
Bryan T. Meyers 69491ad3e4 common: General cleanup and fixes
- Created Legacy directory for known unused scripts
 - Moved known unused scripts to Legacy
 - Moved legacy docs to Legacy
 - Moved legacy Templates to Legacy
 - Fixed sync_licenses.sh script
 - Added packages, sync-licenses, and stateless to Makefile
 - Added switch_repo_domains to Makefile.toplevel and Makefile.common
 - Added new script for updateing stateless report (STATELESSNESS)
2020-02-20 16:28:30 -05:00

22 lines
451 B
Bash
Executable file

#!/bin/bash
fail_exit(){
echo "$1"
exit 1
}
git clone https://github.com/spdx/license-list-XML.git --depth=1 || fail_exit "Failed to clone"
if [[ -e "licenses.spdx" ]];
then rm -v licenses.spdx
fi
pushd license-list-XML/src
for i in *.xml ; do
sum=`sha1sum "${i}"|cut -f 1 -d ' '`
nom=`echo "$i" | sed 's@\.xml$@@'`
echo -e "${sum}\t${nom}" >> ../../licenses.spdx
done
popd
rm -rf license-list-XML