/usr/bin/installwatch is in checkinstall 1.6.2-3ubuntu1.
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 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 | #!/bin/bash
#$Id: installwatch,v 0.6.7.0 2007/12/04 07:35:04 gna Exp $
#set -x
PREFIX=${PREFIX:-/usr}
HACK="PREFIX"
HACK="#$HACK#";
if test "$PREFIX" = "$HACK" ; then
echo 'This script has not been installed'
echo 'Please run "make install"'
exit 1
fi
LIBDIR=$DESTDIR$PREFIX/lib/checkinstall
LIB64_PLATFORM=false
case `uname -m` in
x86_64|ppc64|s390x)
LIB64_PLATFORM=true
;;
esac
if test -d $PREFIX/lib/checkinstall64 && test "$LIB64_PLATFORM" = "true" ; then
LIBDIR=$PREFIX/lib/checkinstall64
else
LIBDIR=$PREFIX/lib/checkinstall
fi
BASE_TMP_DIR=/tmp
INSTALLWATCH_VERSION=0.7.0beta7
#
# ##############################################################################
#
# Function definitions
#
#
function ckversion {
echo
echo -n "installwatch $INSTALLWATCH_VERSION, "
echo "Copyright 1998 Pancrazio de Mauro"
echo "Copyright 2002 Felipe Eduardo Sanchez Diaz Duran"
echo " This software is released under the GNU GPL."
}
function usage() {
(
ckversion
echo
echo "Usage: installwatch [options] [command [command arguments]]"
echo "Options:"
echo
echo "-r, --root=<rootdir> Sets the directory under which will be stored "
echo " meta-infos and translated files. "
echo "-t, --transl=<yes|no> Toggle translation capabilities "
echo "-b, --backup=<yes|no> Toggle backup capabilities "
echo "-e, --exclude=<dir1,...,dirN> Sets a neutral directory list, that won't be"
echo " concerned by translation or backups. "
echo "-o, --logfile=<logfile> Sets the log file to be used. "
echo "-d, --dbgfile=<dbgfile> Sets the debug file to be used. "
echo "-v, --dbglvl=<dbglvl> Sets the debug level to be used. "
)
exit 1
}
function help_notice() {
echo
echo "Use --help or -h to get more information"
echo
exit 1
}
function boolean_usage() {
echo
echo "$2 is an invalid value for $1"
help_notice
exit 1
}
function make_temp {
local mkt_refdir=$1
local mkt_wrkdir=""
mkt_wrkdir=`mktemp -q -d -p ${BASE_TMP_DIR}`
eval $mkt_refdir=\$mkt_wrkdir
}
#
#
# Function definitions
#
# ##############################################################################
#
#
# ##############################################################################
#
# Options and arguments parsing and validation
#
#
CKNAME=`basename $0`
PARAMS=`getopt -a -n $CKNAME -o +r:e:o:d:v:tb -l root:,transl:,backup:,exclude:,logfile:,dbgfile:,dbglvl:,help,version,copyright -- "$@"`
[ $? -gt 0 ] && help_notice
eval set -- $PARAMS
unset INSTW_ROOTPATH
unset INSTW_TRANSL
unset INSTW_BACKUP
unset INSTW_LOGFILE
unset INSTW_DBGFILE
unset INSTW_DBGLVL
unset INSTW_EXCLUDE
while [ "$1" != "--" ]; do
case "$1" in
-h|-H|--help)
usage;;
-r|--root)
shift
INSTW_ROOTPATH=`eval echo $1`
;;
-e|--exclude)
shift
INSTW_EXCLUDE=`eval echo $1`
;;
-o|--logfile)
shift
INSTW_LOGFILE=`eval echo $1`
;;
-d|--dbgfile)
shift
INSTW_DBGFILE=`eval echo $1`
;;
-v|--dbglvl)
shift
INSTW_DBGLVL=`eval echo $1`
;;
-t)
INSTW_TRANSL=1
;;
--transl)
shift
case `eval echo $1` in
"1"|"yes"|"")
INSTW_TRANSL=1
;;
"0"|"no")
INSTW_TRANSL=0
;;
*)
boolean_usage "--transl" $1
esac
;;
-b)
INSTW_BACKUP=1
;;
--backup)
shift
case `eval echo $1` in
"1"|"yes"|"")
INSTW_BACKUP=1
;;
"0"|"no")
INSTW_BACKUP=0
;;
*)
boolean_usage "--backup" $1
esac
;;
--copyright|--version)
cat << EOF
Copyright (C) 1998 Pancrazio 'Ezio' de Mauro
Copyright (C) 2002 Felipe Eduardo Sanchez Diaz Duran <izto@asic-linux.com.mx>
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 2 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, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
EOF
exit 0
;;
esac
shift
done
#
# ##############################################
#
# do we have an installation process command
shift
if [ "$1" = "" ]; then
echo
echo "Error : You must specify a command !!!"
echo
usage
exit 1
fi
if [ -u "$1" ]; then
echo "Warning: `basename $0` may not work with suid programs"
fi
# we must have a root path defined
if [ "${INSTW_ROOTPATH}_" = "_" ]; then
make_temp "INSTW_ROOTPATH"
echo
echo "INFO : Using a default root directory : ${INSTW_ROOTPATH}"
echo
fi
if [ ! -d "${INSTW_ROOTPATH}" ]; then
echo
echo "The root directory is mandatory ."
echo
usage
exit 1
fi
if [ "${INSTW_ROOTPATH:((${#INSTW_ROOTPATH}-1)):1}" = "/" ]; then
INSTW_ROOTPATH="${INSTW_ROOTPATH%/}"
fi
export INSTW_ROOTPATH
if [ "${INSTW_BACKUP}_" = "_" ]; then
INSTW_BACKUP=0;
fi
export INSTW_BACKUP
if [ "${INSTW_TRANSL}_" = "_" ]; then
INSTW_TRANSL=0;
fi
export INSTW_TRANSL
if [ "${INSTW_LOGFILE}_" = "_" ]; then
INSTW_LOGFILE="${INSTW_ROOTPATH}/logfile"
fi
export INSTW_LOGFILE
if [ "${INSTW_DBGFILE}_" = "_" ]; then
INSTW_DBGFILE="${INSTW_ROOTPATH}/dbgfile"
fi
export INSTW_DBGFILE
if [ "${INSTW_DBGLVL}_" = "_" ]; then
INSTW_DBGLVL=0
fi
export INSTW_DBGLVL
[ $INSTW_DBGLVL -gt 0 ] && echo "debug: INSTW_EXCLUD before sort =${INSTW_EXCLUDE}"
INSTW_EXCLUDE="/dev,/proc,/tmp,/var/tmp,${INSTW_EXCLUDE}"
OFS="$IFS"
IFS=','
INSTW_EXCLUDE=$(for name in $INSTW_EXCLUDE; do
echo $name
done | sort -u |
while read elem; do
echo -n "$elem,"
done)
export INSTW_EXCLUDE
IFS="$OIFS"
if [ "${INSTW_LOGFILE}_" != "_" ]; then
# If INSTW_LOGFILE is a relative path, it must become absolute
if echo ${INSTW_LOGFILE} | grep -qv '^/' ; then
INSTW_LOGFILE="$(pwd)/${INSTW_LOGFILE}"
fi
export INSTW_LOGFILE
if cat /dev/null >"${INSTW_LOGFILE}"; then
true
else
echo
echo "Error : Unable to prepare ${INSTW_LOGFILE}"
echo
exit 1
fi
fi
if [ "${INSTW_DBGFILE}_" != "_" ]; then
# If INSTW_DBGFILE is a relative path, it must become absolute
if echo ${INSTW_DBGFILE} | grep -qv '^/' ; then
INSTW_DBGFILE="$(pwd)/${INSTW_DBGFILE}"
fi
export INSTW_DBGFILE
if cat /dev/null >"${INSTW_DBGFILE}"; then
true
else
echo
echo "Error : Unable to prepare ${INSTW_DBGFILE}"
echo
exit 1
fi
fi
#
#
# Options and arguments parsing and validation
#
# ##############################################################################
#
if [ "$LD_PRELOAD" ]; then
LD_PRELOAD="$LIBDIR/installwatch.so:$LD_PRELOAD"
else
LD_PRELOAD="$LIBDIR/installwatch.so"
fi
export LD_PRELOAD
if [ $INSTW_DBGLVL -gt 0 ]; then
echo "debug: INSTW_EXCLUDE=${INSTW_EXCLUDE}"
echo "debug: INSTW_ROOTPATH=${INSTW_ROOTPATH}"
echo "debug: INSTW_LOGFILE=${INSTW_LOGFILE}"
echo "debug: INSTW_DBGFILE=${INSTW_DBGFILE}"
echo "debug: INSTW_DBGLVL=${INSTW_DBGLVL}"
fi
"$@"
if [ $? -eq 0 ]; then
FAIL=0
else
FAIL=1
fi
unset LD_PRELOAD
exit $FAIL
|