~ubuntu-branches/ubuntu/intrepid/net-snmp/intrepid-updates

« back to all changes in this revision

Viewing changes to dist/nsb-config

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant
  • Date: 2006-11-28 12:29:34 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20061128122934-82xxzy2zcvypnvy7
Tags: 5.2.3-4ubuntu1
* Merge from debian unstable, remaining changes:
  - remove stop links from rc0 and rc6

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
#
3
 
# $Id: nsb-config,v 1.3 2002/09/10 19:05:24 rstory Exp $
4
 
# Author: Robert Story <rstory@freesnmp.com>
5
 
#
6
 
########################################################################
7
 
########################################################################
8
 
 
9
 
usage()
10
 
{
11
 
   echo "Usage: $0  [-d|-x] [-s SRCD]"
12
 
   echo ""
13
 
   echo " -s SRCDIR  : soure directory [$HOME/src/net-snmp-VERSION]"
14
 
   echo ""
15
 
   echo " -x : configure extra features for pre-release testing"
16
 
   echo " -d : configure for binary distribution"
17
 
   exit 1
18
 
}
19
 
 
20
 
#set -x
21
 
 
22
 
 
23
 
#
24
 
# find nsb-platform based on te path to this script
25
 
#
26
 
EXE_PATH=${0%nsb-config}
27
 
EXE_PATH=${EXE_PATH%/}
28
 
if [ -f $EXE_PATH/nsb-functions ];then
29
 
   source $EXE_PATH/nsb-functions
30
 
elif [ -f $HOME/bin/nsb-functions ]; then
31
 
   source $HOME/bin/nsb-functions
32
 
elif [ -f nsb-functions ];then
33
 
   source nsb-functions
34
 
else
35
 
   echo "Cannot find nsb-functions in $EXE_PATH, $HOME/bin or $PWD"
36
 
   exit 1
37
 
fi
38
 
 
39
 
 
40
 
########################################################################
41
 
########################################################################
42
 
NSB_CONFIG_ALL=2
43
 
 
44
 
#      x)  x=$OPTARG ;;
45
 
while getopts ds:x opt
46
 
do
47
 
    case "$opt" in
48
 
      d)  NSB_CONFIG_ALL=0;;
49
 
      s)  SRCD=$OPTARG ;;
50
 
      x)  NSB_CONFIG_ALL=1;;
51
 
      \?)# unknown flag
52
 
        usage;;
53
 
    esac
54
 
done
55
 
shift `expr $OPTIND - 1`
56
 
 
57
 
if [ $NSB_CONFIG_ALL -eq 2 ]; then
58
 
   echo "You must specify -d or -x"
59
 
   usage
60
 
fi
61
 
 
62
 
if [ -z "$SRCD" ]; then
63
 
   for x in . $HOME/src/net-snmp
64
 
   do
65
 
      if [ -f $x/configure ]; then
66
 
         SRCD=$x
67
 
         break
68
 
      fi
69
 
   done
70
 
   if [ -z "$SRCD" ]; then
71
 
      echo "Couldn't find a source directory. Please specify one for me."
72
 
      usage
73
 
   fi
74
 
fi
75
 
 
76
 
 
77
 
########################################################################
78
 
########################################################################
79
 
if [ $NSB_CONFIG_ALL -eq 0 ];then
80
 
    nsb-config-dist $SRCD
81
 
else
82
 
    nsb-config-all $SRCD
83
 
fi