File: policy-install

package info (click to toggle)
cli-common 0.4.6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 180 kB
  • ctags: 8
  • sloc: perl: 825; sh: 47; makefile: 42
file content (32 lines) | stat: -rwxr-xr-x 990 bytes parent folder | download
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
#!/bin/bash

# This file is actually used to create and to remove entries from a
# policy. It automatically removes old versions, and if there is a new
# one, it installs it. This allows the system to remove the "best" one
# and have it pick the second-best, if installed.

# Variables
ASSEMBLY=$1
VERSION=$2
COMBINED="$VERSION.$ASSEMBLY"
POLICY="policy.$VERSION.$ASSEMBLY"

# Remove the old policy, if we have one installed
if [ -f /usr/share/cli-common/packages.d/$POLICY.installcligac ]; then
    /usr/share/cli-common/gac-package-remove $POLICY > /dev/null
    rm -f /usr/share/cli-common/packages.d/$POLICY.installcligac
fi

# Choose the correct one
for file in $(ls /usr/share/cli-common/policies.d/???-$COMBINED \
    2>/dev/null | sort -rn)
do
    # Copy this one as a installcligac
    cp $file /usr/share/cli-common/packages.d/$POLICY.installcligac

    # Install it
    /usr/share/cli-common/gac-package-install $POLICY > /dev/null

    # We just deal with the one
    exit
done