summaryrefslogtreecommitdiff
path: root/policy-install
diff options
context:
space:
mode:
authorDylan R. E. Moonfire <debian@mfgames.com>2006-07-28 00:04:31 +0000
committerDylan R. E. Moonfire <debian@mfgames.com>2006-07-28 00:04:31 +0000
commitdfd941f5d7d421590715896bea024f74c6ac66e6 (patch)
tree09c5896d6941464d58508497dd5a71584a450f4b /policy-install
parent23dcf190859ed6c28eb771cc1942d4559a492cc2 (diff)
This is the proposed dh_createclipolicy and related files. It still needs
a bit of work, but it appears to create properly formatted policy files for multiple versions, handles issues like the nunit ABI breakage, and auto-selects the "best" policy file.
Diffstat (limited to 'policy-install')
-rwxr-xr-xpolicy-install32
1 files changed, 32 insertions, 0 deletions
diff --git a/policy-install b/policy-install
new file mode 100755
index 0000000..2a69f2f
--- /dev/null
+++ b/policy-install
@@ -0,0 +1,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