summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2004-11-12 00:51:13 (GMT)
committerTon Voon <tonvoon@users.sourceforge.net>2004-11-12 00:51:13 (GMT)
commitc58b5f02acdee26b9c468bd71114bcb4cce58b76 (patch)
treefeb74a55e8a26d30d361009d3ffe261396406b80 /tools
parentfbf1e60f477460205c2002bb34b87f9e1e3b0faf (diff)
downloadmonitoring-plugins-c58b5f02acdee26b9c468bd71114bcb4cce58b76.tar.gz
Tool to pull newer coreutil libs into nagiosplug's lib directory
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@896 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'tools')
-rwxr-xr-xtools/update_coreutils31
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/update_coreutils b/tools/update_coreutils
new file mode 100755
index 0000000..5e195a0
--- /dev/null
+++ b/tools/update_coreutils
@@ -0,0 +1,31 @@
1#!/bin/bash
2# Quick script to copy coreutil files into Nagios area
3# Pass $1 as top level of coreutils source dir
4# Expects to be run in the lib directory
5
6function die { echo $1; exit 1; }
7
8function copy_if_newer { [[ $1 -nt $2 ]] && cp $1 $2; }
9
10coreutils_dir=$1
11
12[[ -z $coreutils_dir ]] && die "Please specify coreutils directory"
13
14cwd=`pwd`
15
16[[ ${cwd##*/} != "lib" ]] && die "Must be run in lib directory"
17
18# Get list of files from EXTRA_DIST in Makefile.am
19# Need \\\ because the perl needs \\ but one is escaped
20files="`perl -ne '$a=1 if s/^EXTRA_DIST\s*=\s*|libnagiosplug_a_SOURCES\s*=\s*//; $a=0 if /^\s*$/; if ($a==1) {s/\\\//; print $_}' Makefile.am`"
21
22for i in $files ; do
23 if [[ -e $coreutils_dir/lib/$i ]] ; then
24 copy_if_newer $coreutils_dir/lib/$i ./$i
25 elif [[ -e $coreutils_dir/m4/$i ]] ; then
26 copy_if_newer $coreutils_dir/m4/$i ./$i
27 else
28 echo "Not found: $i"
29 fi
30done
31