File: policy-install

package info (click to toggle)
cli-common 0.9%2Bnmu1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 280 kB
  • sloc: perl: 1,208; sh: 103; makefile: 42
file content (31 lines) | stat: -rwxr-xr-x 1,002 bytes parent folder | download | duplicates (6)
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
#!/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/policy-remove $ASSEMBLY $VERSION > /dev/null
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

    #echo "Installing GAC policy file ($POLICY) into available GACs"
    /usr/share/cli-common/gac-package-install $POLICY > /dev/null || exit 1
    	    
    # We just deal with the one
    exit
done