/usr/bin/notice is in licenseutils 0.0.7-8.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | #!/bin/bash
# Copyright (C) 2013 Ben Asselstine
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if [[ "$BASH_ENV" == *\.lu-shrc* ]]; then
progname=$(basename $0)
else
progname="licensing $(basename $0)"
fi
showusage() {
cat <<EOF
Usage: ${progname} [-?] [-l LICENSE] [-s COMMENTING-STYLE] [-c NAME-AND-YEAR] FILE...
EOF
}
showhelp() {
cat <<EOF
Usage: ${progname} [OPTION...] FILE...
A simple wrapper script for writing license notices to source files.
Supported Licenses: gpl gplv3+ gplv3 gplv2+ gplv2 gplv1+ gplv1 lgpl lgplv3+
lgplv3 lgplv2+ lgplv2 lgplv1+ lgplv1 agpl agplv3+ agplv3 fdl fdlv13+ fdlv13
fdlv12+ fdlv12 fdlv11+ fdlv11 all-permissive bsd bsd3clause bsd2clause apache
apachev2 mit isc openbsd
Supported Comment Styles: c c++ shell scheme texinfo m4 haskell groff gettext
fortran pascal
-c NAME-AND-YEAR specify the copyright holder
-l LICENSE specify the license
-s COMMENTING-STYLE specify the comment style
-n don't retain a backup file
-?, --help give this help list
This wrapper script is for users who want to do everything on single line.
If greater control than what is offered here is required, try running the
choose, copyright, and apply commands individually.
EOF
}
if [[ "$#" = 1 && "x$1" = x--help ]]; then
showhelp
exit 0
fi
if [[ "$#" = 0 ]]; then
showhelp
exit 0
fi
license=""
style=""
copyright=""
backup=""
readopt='getopts $opts opt;rc=$?;[ $rc$opt == 0? ]&&exit 1;[ $rc == 0 ]||{ shift $[OPTIND-1];false; }'
opts=n?l:s:c:
# Enumerating options
declare -a copyright_holders
count=0
while eval $readopt
do
case "$opt" in
\?)
showhelp
exit;;
n)
backup="--no-backup"
;;
l)
license="$license $OPTARG"
;;
s)
style=$OPTARG
;;
c)
licensing copyright --dry-run -- $OPTARG 2>/dev/null >/dev/null
retval=$?
if [ "x$retval" == "x0" ]; then
copyright_holders[$count]=`echo $OPTARG`
count=`expr $count + 1`
else
licensing copyright --dry-run -- $OPTARG
exit 1
fi
;;
esac
done
# Validating arguments
for arg
do
if [ ! -f $arg ]; then
echo ${progname}: cannot open $arg for writing
exit 1
fi
done
if [ "x$license" == "x" ]; then
echo "${progname}: you must supply a license with -l"
echo "Try '${progname} --help' for more information."
exit 1
fi
if [ "x$style" == "x" ]; then
echo "${progname}: you must supply a commenting style with -s"
echo "Try '${progname} --help' for more information."
exit 1
fi
if [ "x$count" == "x0" ]; then
echo "${progname}: you must supply a copyright holder with -c"
echo "Try '${progname} --help' for more information."
exit 1
fi
if [ "$#" == "0" ]; then
echo "${progname}: no files specified"
echo "Try '${progname} --help' for more information."
exit 1
fi
#copy the old files away
oldconf=`mktemp -d`
cp ~/.licenseutils/* $oldconf 2>/dev/null
rm -f ~/.licenseutils/top-line 2> /dev/null && \
rm -f ~/.licenseutils/copyright-holders 2> /dev/null && \
rm -f ~/.licenseutils/project-line 2> /dev/null && \
rm -f ~/.licenseutils/extra-line 2> /dev/null && \
rm -f ~/.licenseutils/selected-licenses 2>/dev/null && \
rm -f ~/.licenseutils/license-notice 2>/dev/null
licensing new-boilerplate --quiet
count=`expr $count - 1`
for i in `seq 0 $count`; do
licensing copyright --quiet -- ${copyright_holders[$i]}
done
licensing choose --quiet -- $license $style && licensing apply $backup -- $*
retval=$?
licensing new-boilerplate --quiet
#put the old files back
mv $oldconf/* ~/.licenseutils/ 2>/dev/null
rmdir $oldconf 2>/dev/null
exit $retval
|