#!/bin/bash # # This script is licensed whith GPL-3 or Higher. # # Author: Angel Berlanas Vicente CONF_FILE="/etc/lliurex/llxdev.conf" LIB_FILE="/usr/share/lliurex-non-essential-tools/common.sh" FILE_TPL="/usr/share/lliurex-non-essential-tools/templates/copyright.tpl" FILE_TMP=$(mktemp /tmp/llxdev-copyright.XXXX) [ -e "$LIB_FILE" -a -e "$CONF_FILE" ] || exit 1 . "$LIB_FILE" . "$CONF_FILE" # Some Test _sanity_checks_additional(){ [ -f "$FILE_TPL" ] || _die "$FILE_TPL not present: error" return 0 } _make_the_copyright(){ CURDIR=$(basename $(pwd)) cat /usr/share/lliurex-non-essential-tools/templates/copyright.tpl | sed -e "s%DEBFULLNAME%$DEBFULLNAME%g;s%DEBEMAIL%$DEBEMAIL%g;s%LLPACKAGE%$CURDIR%g" > $FILE_TMP } _ask_confirmation(){ echo "***********************************" echo "THE COPYRIGHT IN PROGRAM FILES ARE:" echo "***********************************" licensecheck -r *|cut -d: -f 2|sort -u echo "***********************************" echo "THE PROPOSED COPYRIGHT FILE IS: " echo "***********************************" cat $FILE_TMP echo "You want this (y/N)" read ANSWER if [ "$ANSWER" = "y" ]; then cp "$FILE_TMP" debian/copyright dch -a "Fixed copyright " else echo "Nothing to do" fi echo "You must edit the debian/copyright and fix the posible wrong values ^_^" } # Clean _clean(){ rm $FILE_TMP } # Main _sanity_checks _sanity_checks_additional _make_the_copyright _ask_confirmation _clean exit 0