projects
/
etcdiff.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix typo
[etcdiff.git]
/
etcdiff.include
diff --git
a/etcdiff.include
b/etcdiff.include
index
e26498c
..
c82468d
100644
(file)
--- a/
etcdiff.include
+++ b/
etcdiff.include
@@
-3,6
+3,13
@@
_get_unpack_package()
{
PACKAGE=$1
_get_unpack_package()
{
PACKAGE=$1
+
+ if [ "x$PACKAGE" = "x" ];
+ then
+ echo "Argument missing."
+ exit 1
+ fi
+
FILEPATH=$(apt-cache show $PACKAGE | grep ^Filename | cut -d ' ' -f 2-)
if [ "x$FILEPATH" = "x" ];
FILEPATH=$(apt-cache show $PACKAGE | grep ^Filename | cut -d ' ' -f 2-)
if [ "x$FILEPATH" = "x" ];
@@
-23,6
+30,12
@@
_do_etcdiff()
ETCBASEDIR=$1
PREFIX=$2
ETCBASEDIR=$1
PREFIX=$2
+ if [ "x$ETCBASEDIR" = "x" ];
+ then
+ echo "Argument missing."
+ exit 1
+ fi
+
REPORT_NAME=$(basename $ETCBASEDIR)
# Report diff between debian conf and our local one
REPORT_NAME=$(basename $ETCBASEDIR)
# Report diff between debian conf and our local one
@@
-42,7
+55,7
@@
_do_etcdiff()
done
}
done
}
-etc
h
diff_system()
+etcdiff_system()
{
PACKAGES=$(dpkg --get-selections | grep 'install$' | cut -f 1 -d ' ')
{
PACKAGES=$(dpkg --get-selections | grep 'install$' | cut -f 1 -d ' ')
@@
-73,6
+86,12
@@
etcdiff_by_package()
{
PACKAGE=$1
{
PACKAGE=$1
+ if [ "x$PACKAGE" = "x" ];
+ then
+ echo "Argument missing."
+ exit 1
+ fi
+
if dpkg --status $PACKAGE | grep -q 'not-installed';
then
echo "Package '$PACKAGE' not installed"
if dpkg --status $PACKAGE | grep -q 'not-installed';
then
echo "Package '$PACKAGE' not installed"
@@
-97,6
+116,12
@@
etcdiff_by_file()
{
FILE=$1
{
FILE=$1
+ if [ "x$FILE" = "x" ];
+ then
+ echo "Argument missing."
+ exit 1
+ fi
+
if [ ! -e $FILE ];
then
echo "ERROR, file $FILE does not exist."
if [ ! -e $FILE ];
then
echo "ERROR, file $FILE does not exist."