From 491a93c69b438d7fcbf3980185558dee614781ea Mon Sep 17 00:00:00 2001
From: Ivan Rako <Ivan.Rako@CARNet.hr>
Date: Tue, 22 Mar 2005 10:06:05 +0000
Subject: [PATCH] r18:

---
 changelog.CARNet |    6 ++++--
 debian/control   |    2 +-
 functions.sh     |    8 ++++++--
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/changelog.CARNet b/changelog.CARNet
index f12dc85..7c29811 100644
--- a/changelog.CARNet
+++ b/changelog.CARNet
@@ -4,11 +4,13 @@ carnet-tools-cn (2.0) testing; urgency=low
   * dodane funkcije:
       - cp_get_ifaddr
       - cp_get_ifmask
-      - cp_get_cidr
+      - cp_get_ifdefault
+      - cp_get_netaddr
       - cp_backup_conffile
       - cp_check_and_sed
+      - cp_safe_file_replace
 
- -- Ivan 'ico' Rako <irako@srce.hr>  Wed, 16 Mar 2005 14:27:46 +0100
+ -- Ivan 'ico' Rako <irako@srce.hr>  Tue, 22 Mar 2005 10:53:43 +0100
 
 carnet-tools (1.2) unstable; urgency=low
 
diff --git a/debian/control b/debian/control
index 585a8ed..4b8f96b 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Standards-Version: 3.6.1
 
 Package: carnet-tools-cn
 Architecture: all
-Depends: perl, coreutils, debianutils, awk, ipcalc, net-tools
+Depends: perl, coreutils, debianutils, awk | mawk | gawk, ipcalc, net-tools
 Description: CARNet tools for Debian packaging
  CARNet tools for Debian packaging. Include:
   - functions.sh
diff --git a/functions.sh b/functions.sh
index e625d51..5bb7ae6 100644
--- a/functions.sh
+++ b/functions.sh
@@ -223,8 +223,12 @@ ${CP_NOTICE}----------"
 cp_safe_file_replace () {
   [ "$CP_SCRIPT_DEBUG" ] && set -vx
   local new old
-  new=$1
-  old=$2
+  if [ -z "$2" ]; then
+    echo "Usage: cp_safe_file_replace <new-file> <target-file>" 1>&2
+    return 1
+  fi
+  new="$1"
+  old="$2"
   if [ -e "$old" ]; then
     chown --reference "$old" "$new"
     chmod --reference "$old" "$new"
-- 
1.7.10.4