[Pkg-mono-svn-commits] rev 3243 - in cli-common/trunk: . debian

D. Moonfire dmoonfire-guest at alioth.debian.org
Wed Jul 18 21:11:33 UTC 2007


Author: dmoonfire-guest
Date: 2007-07-18 21:11:33 +0000 (Wed, 18 Jul 2007)
New Revision: 3243

Added:
   cli-common/trunk/dh_cligacpolicy
   cli-common/trunk/postinst-cligacpolicy
   cli-common/trunk/postrm-cligacpolicy
Removed:
   cli-common/trunk/dh_clipolicy
   cli-common/trunk/dh_createclipolicy
   cli-common/trunk/postinst-clipolicy
   cli-common/trunk/postrm-clipolicy
Modified:
   cli-common/trunk/debian/changelog
   cli-common/trunk/debian/cli-common-dev.install
   cli-common/trunk/debian/cli-common-dev.manpages
   cli-common/trunk/debian/control
   cli-common/trunk/debian/rules
Log:
Renaming files from createclipolicy to cligacpolicy.


Modified: cli-common/trunk/debian/changelog
===================================================================
--- cli-common/trunk/debian/changelog	2007-07-18 21:06:56 UTC (rev 3242)
+++ cli-common/trunk/debian/changelog	2007-07-18 21:11:33 UTC (rev 3243)
@@ -1,9 +1,11 @@
 cli-common (0.4.10) unstable; urgency=low
 
   * Dylan R. E. Moonfire
-    + dh_createclipolicy:
+    + dh_cligacpolicy:
       - Cleaned up the code to simplify the file.
       - Corrected some typos in the man page.
+      - Removed some of the variables.
+      - Renamed from dh_createclipolicy
 
  -- Dylan R. E. Moonfire <debian at mfgames.com>  Tue, 17 Jul 2007 21:18:43 -0500
 

Modified: cli-common/trunk/debian/cli-common-dev.install
===================================================================
--- cli-common/trunk/debian/cli-common-dev.install	2007-07-18 21:06:56 UTC (rev 3242)
+++ cli-common/trunk/debian/cli-common-dev.install	2007-07-18 21:11:33 UTC (rev 3243)
@@ -6,7 +6,7 @@
 postinst-cligac		/usr/share/debhelper/autoscripts/
 prerm-cligac		/usr/share/debhelper/autoscripts/
 
-dh_createclipolicy	/usr/bin/
+dh_cligacpolicy		/usr/bin/
 policy-install		/usr/share/cli-common/
-postinst-clipolicy	/usr/share/debhelper/autoscripts/
-postrm-clipolicy        /usr/share/debhelper/autoscripts/
+postinst-cligacpolicy	/usr/share/debhelper/autoscripts/
+postrm-cligacpolicy     /usr/share/debhelper/autoscripts/

Modified: cli-common/trunk/debian/cli-common-dev.manpages
===================================================================
--- cli-common/trunk/debian/cli-common-dev.manpages	2007-07-18 21:06:56 UTC (rev 3242)
+++ cli-common/trunk/debian/cli-common-dev.manpages	2007-07-18 21:11:33 UTC (rev 3243)
@@ -2,4 +2,4 @@
 dh_clideps.1
 dh_installcligac.1
 dh_clifixperms.1
-dh_createclipolicy.1
+dh_cligacpolicy.1

Modified: cli-common/trunk/debian/control
===================================================================
--- cli-common/trunk/debian/control	2007-07-18 21:06:56 UTC (rev 3242)
+++ cli-common/trunk/debian/control	2007-07-18 21:11:33 UTC (rev 3243)
@@ -34,6 +34,6 @@
   * dh_clideps to generate cli:Depends information for debian/control
   * dh_makeclilibs to create clilibs files that are needed/used by dh_clideps
   * dh_installcligac to register assemblies to be late installed into a GAC
-  * dh_createclipolicy to create the CLI policy files for installing into a GAC
+  * dh_cligacpolicy to create the CLI policy files for installing into a GAC
   * dh_clifixperms to fix permissions of files in CLI package build directories
   * dh_clistrip to strip CLI debug symbols from package build directories

Modified: cli-common/trunk/debian/rules
===================================================================
--- cli-common/trunk/debian/rules	2007-07-18 21:06:56 UTC (rev 3242)
+++ cli-common/trunk/debian/rules	2007-07-18 21:11:33 UTC (rev 3243)
@@ -11,7 +11,7 @@
 	debiandoc2text cli-policy.sgml
 	debiandoc2html cli-policy.sgml
 	debiandoc2pdf cli-policy.sgml
-	for x in dh_clideps dh_makeclilibs dh_installcligac dh_clifixperms dh_clistrip dh_createclipolicy; \
+	for x in dh_clideps dh_makeclilibs dh_installcligac dh_clifixperms dh_clistrip dh_cligacpolicy; \
 	  do chmod +x $$x; pod2man -c "Debhelper for CLI (Common Language Infrastructure)" $$x > $$x.1; done
 	touch build-stamp
 
@@ -20,7 +20,7 @@
 	dh_testroot
 	rm -f dh_clideps.1 dh_makeclilibs.1 dh_installcligac.1 dh_clifixperms.1
 	rm -fr cli-policy.html cli-policy.txt cli-policy.pdf cli-policy.tpt
-	rm -f dh_createclipolicy.1
+	rm -f dh_cligacpolicy.1
 	rm -f build-stamp
 	rm -rf $(MONO_SHARED_DIR)/.wapi
 	dh_clean

Copied: cli-common/trunk/dh_cligacpolicy (from rev 3242, cli-common/trunk/dh_clipolicy)
===================================================================
--- cli-common/trunk/dh_cligacpolicy	                        (rev 0)
+++ cli-common/trunk/dh_cligacpolicy	2007-07-18 21:11:33 UTC (rev 3243)
@@ -0,0 +1,265 @@
+#!/usr/bin/perl -w
+
+=head1 NAME
+
+dh_cligacpolicy - creates and installs a CLI policy file for a package
+
+=cut
+
+use strict;
+use Debian::Debhelper::Dh_Lib;
+
+=head1 SYNOPSIS
+
+B<dh_cligacpolicy> [S<I<debhelper options>>] [B<-n>]
+
+=head1 DESCRIPTION
+
+dh_cligacpolicy is a debhelper program that is responsible for creating,
+compiling, and installing policy files for a Debian package.  This
+automatically includes postinst and prerm commands needed to install
+these policies into the system.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<-n>, B<--noscripts>
+
+Do not modify postinst/prerm scripts.
+
+=head1 FILE FORMAT
+
+This file uses the I<debian/cligacpolicy> files (either
+I<policyassemblies> or I<debian/packagename.cligacpolicy>) to generate
+the policy file. It supports multiple versions of the policy,
+including mapping multiple versions to a single file.
+
+The file format of the I<cligacpolicy> file consists of five
+properties per line, each one separated by whitespace.
+
+=over 4
+=item B<Keyfile> is a path, from the package root, to the .snk file
+=used to sign the assembly.
+
+=item B<Assembly> is the name of the assembly, without the .dll
+=extension. For example, for log4net.dll, use I<log4net>.
+
+=item B<Version Range> can be a single four-part version, such as
+=1.2.3.4, or a full range, such as 1.2.3.4-1.2.6.7. For a single line,
+=the first two numbers must be identical. To have an assembly apply to
+=multiple versions, such as 1.2.0.0 to 2.4.0.0, there needs to be one
+=line for each version range.
+
+=item B<Assembly version> is the version of the assembly being
+=built.
+
+=item B<Priority> defines the priority of the policy files.
+=Typically, each version will increase the priority and
+=contains all the policy controls for prior versions.
+
+=back
+
+The fields can be separated with spaces or tabs. Comments start the
+line with I<#> characters and blank lines are ignored.
+
+=head1 NOTES
+
+Note that this command is not idempotent. "dh_clean -k" should be called
+between invocations of this command. Otherwise, it may cause multiple
+instances of the same text to be added to maintainer scripts.
+
+=head1 EXAMPLE
+
+For the log4net 1.2.10.0 version, a policy file is used to map all
+versions from 1.2.8.0 to 1.2.9.99 into the current version.
+
+debian/log4net.snk log4net 1.2.8.0-1.2.9.99 1.2.10.0 10
+
+=cut
+
+# Set up debhelper
+init();
+
+# Go through each of the packages being built
+my $errors = 0;
+
+foreach my $package (@{$dh{DOPACKAGES}})
+{
+    # Set up our internal variables
+    my $tmp = tmpdir($package);
+    my $policy = pkgfile($package, "cligacpolicy");
+    my %policies = ();
+    
+    # If $policy is blank, then there is no file
+    next if $policy eq "";
+
+    # Load the policy file into memory.
+    my ($keyfile, $pkg_tmp, $cli_dir, $token, $priority);
+    open POLICY, "<$policy" or die "E: Can't open $policy ($!)";
+
+    while (<POLICY>)
+    {
+	# Clean up the line and ignore blanks and comments
+	chomp;
+	s/^\s+//;
+	s/\s+$//;
+	next if /^\#/;
+	next if /^$/;
+
+	# Each line consists of six parts:
+	#   1. snk file for encryption, relative to the package root
+	#   2. Assembly name
+	#   3. Versions to map from
+	#   4. Versions to map to
+	#   5. Priority of this policy
+
+	my ($snk, $assembly, $map, $version, $priority) =
+	    split(/\s+/);
+
+	# Verify the fields
+	my $version_map;
+
+	# Remove the .dll to normalize it
+	$assembly =~ s/\.dll$//;
+
+	# Get the token from the file
+	my $cmd = "/usr/bin/cli-sn -t '$snk' | grep 'Public Key' "
+	    . "| cut -f 2- -d :";
+	my $token = `$cmd`;
+	$token =~ s/^\s*(.*?)\s*$/$1/sg;
+	
+
+	# Check the version numbers
+	if ($map =~ /^(\d+\.\d+)\.\d+\.\d+$/)
+	{
+	    $version_map = $1;
+	}
+	else
+	{
+	    if ($map =~ /^(\d+\.\d+)\.\d+\.\d+-(\d+\.\d+)\.\d+\.\d+$/)
+	    {
+		if ($1 ne $2)
+		{
+		    $errors = 1;
+		    print STDERR "E: $package $.: Version ranges ($map) must "
+			. "have the first two digits of the version the same. "
+			. "Use two different lines for this line.\n";
+		    next;
+		}
+
+		$version_map = $1;
+	    }
+	    else
+	    {
+		$errors = 1;
+		print STDERR "E: $package $.: The version field ($map) "
+		    . "must be in the following format: "
+		    . "'A.B.C.D' or 'A.B.C.D-E.F.G.H'\n";
+		next;
+	    }
+	}
+
+	# We have now gathered up everything we need. We use a hash to
+	# consolidate all the various bindings into the unique
+	# combinations of policy files we need.
+	my $pk = join("--", $snk, $assembly, $version_map, $priority);
+
+ 	$policies{$pk} .=
+ 	    join("\n",
+ 		 '    <assemblyBinding '
+		 . 'xmlns="urn:schemas-microsoft-com:asm.v1">',
+ 		 '      <dependentAssembly>',
+ 		 "        <assemblyIdentity name=\"$assembly\" "
+		 . "publicKeyToken=\"$token\"/>",
+ 		 "          <bindingRedirect oldVersion="
+ 		 . "\"$map\" newVersion=\"$version\"/>",
+ 		 "      </dependentAssembly>",
+ 		 "    </assemblyBinding>") . "\n";
+    }
+
+    close POLICY;
+
+    # Make sure the policies.d directory exists
+    if (! -d "$tmp/usr/share/cli-common/policies.d") {
+	doit("install","-d","$tmp/usr/share/cli-common/policies.d");
+    }
+
+    # Once all the various <assemblyBinding> tags are consolidated, we
+    # then generate the policy files. This will result in one policy file for
+    # a given assembly, key file, and A.B version.
+    foreach my $pk (keys %policies)
+    {
+	# Get the pkg_dir
+	my ($snk, $assembly, $version_map, $priority) =
+	    split(/--/, $pk);
+	my $pkg_dir = "$usr/share-cli/common/policies.d/$package/";
+	my $tmp_pkg_dir = "$tmp/$pkg_dir";
+	my $policy_file = "$version_map.$assembly";
+
+	# Open the policy file chooser
+	open CHOOSER, ">$tmp/usr/share/cli-common/policies.d/"
+	    . sprintf("%03d-%s.%s", $priority, $version_map, $assembly);
+	print CHOOSER "/$pkg_dir/policy.$policy_file.dll\n";
+	close CHOOSER;
+
+	# Open up the file
+	unless (open PF, ">$tmp_pkg_dir/policy.$policy_file.config")
+	{
+	    $errors = 1;
+	    print STDERR "E: $package: Cannot write $policy_file.config";
+	    next;
+	}
+
+	# Write out the policy file
+	print PF "<configuration>\n  <runtime>\n";
+	print PF $policies{$pk};
+	print PF "  </runtime>\n</configuration>\n";
+	close PF;
+
+ 	# Compile the assembly file. We have to change directory first
+ 	# because of AL limitation.
+ 	system("cd $tmp_pkg_dir/ && /usr/bin/cli-al "
+ 	       . "/link:policy.$policy_file.config "
+ 	       . "/out:policy.$policy_file.dll "
+ 	       . "/keyfile:" . $ENV{PWD} . "/$snk");
+
+ 	# Clean up the config file
+ 	unlink("$pkg_dir/policy.$policy_file.config");
+
+	# Set up the scripts
+	if (! $dh{NOSCRIPTS})
+	{
+	    autoscript($package, "postinst", "postinst-cligacpolicy",
+		       "s/#PACKAGE#/$assembly $version_map/");
+	    autoscript($package, "postrm", "postrm-cligacpolicy",
+		       "s/#PACKAGE#/$assembly $version_map/");
+	}
+    }    
+}
+
+# Finish up
+exit $errors;
+
+=head1 SEE ALSO
+
+L<debhelper(7)>
+
+This program is a part of cli-common-dev.
+
+=head1 AUTHOR
+
+Dylan R. E. Moonfire <debian at mfgames.com>
+
+=cut
+
+#      <configuration>
+#         <runtime>
+#            <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+#             <dependentAssembly>
+#               <assemblyIdentity name="foo" publicKeyToken="35e10195dab3c99f" />
+#               <bindingRedirect oldVersion="1.2.0.0-1.2.10.0" newVersion="1.3.0.0"/>
+#      	   </dependentAssembly>
+#            </assemblyBinding>
+#         </runtime>
+#      </configuration>

Deleted: cli-common/trunk/dh_clipolicy
===================================================================
--- cli-common/trunk/dh_clipolicy	2007-07-18 21:06:56 UTC (rev 3242)
+++ cli-common/trunk/dh_clipolicy	2007-07-18 21:11:33 UTC (rev 3243)
@@ -1,269 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_cligacpolicy - creates and installs a CLI policy file for a package
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_cligacpolicy> [S<I<debhelper options>>] [B<-n>]
-
-=head1 DESCRIPTION
-
-dh_cligacpolicy is a debhelper program that is responsible for creating,
-compiling, and installing policy files for a Debian package.  This
-automatically includes postinst and prerm commands needed to install
-these policies into the system.
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-n>, B<--noscripts>
-
-Do not modify postinst/prerm scripts.
-
-=head1 FILE FORMAT
-
-This file uses the I<debian/cligacpolicy> files (either
-I<policyassemblies> or I<debian/packagename.cligacpolicy>) to generate
-the policy file. It supports multiple versions of the policy,
-including mapping multiple versions to a single file.
-
-The file format of the I<cligacpolicy> file consists of six
-properties per line, each one separated by whitespace.
-
-=over 4
-=item B<Keyfile> is a path, from the package root, to the .snk file
-=used to sign the assembly.
-
-=item B<CLI directory> is the directory inside I<usr/lib/cli> that
-=contains the assemblies. This is typically found in the install
-=file of the package.
-
-=item B<Assembly> is the name of the assembly, without the .dll
-=extension. For example, for log4net.dll, use I<log4net>.
-
-=item B<Version Range> can be a single four-part version, such as
-=1.2.3.4, or a full range, such as 1.2.3.4-1.2.6.7. For a single line,
-=the first two numbers must be identical. To have an assembly apply to
-=multiple versions, such as 1.2.0.0 to 2.4.0.0, there needs to be one
-=line for each version range.
-
-=item B<Assembly version> is the version of the assembly being
-=built.
-
-=item B<Priority> defines the priority of the policy files.
-=Typically, each version will increase the priority and
-=contains all the policy controls for prior versions.
-
-=back
-
-The fields can be separated with spaces or tabs. Comments start the
-line with I<#> characters and blank lines are ignored.
-
-=head1 NOTES
-
-Note that this command is not idempotent. "dh_clean -k" should be called
-between invocations of this command. Otherwise, it may cause multiple
-instances of the same text to be added to maintainer scripts.
-
-=head1 EXAMPLE
-
-For the log4net 1.2.10.0 version, a policy file is used to map all
-versions from 1.2.8.0 to 1.2.9.99 into the current version.
-
-debian/log4net.snk log4net-1.2 log4net 1.2.8.0-1.2.9.99 1.2.10.0 10
-
-=cut
-
-# Set up debhelper
-init();
-
-# Go through each of the packages being built
-my $errors = 0;
-
-foreach my $package (@{$dh{DOPACKAGES}})
-{
-    # Set up our internal variables
-    my $tmp = tmpdir($package);
-    my $policy = pkgfile($package, "cligacpolicy");
-    my %policies = ();
-    
-    # If $policy is blank, then there is no file
-    next if $policy eq "";
-
-    # Load the policy file into memory.
-    my ($keyfile, $pkg_tmp, $cli_dir, $token, $priority);
-    open POLICY, "<$policy" or die "E: Can't open $policy ($!)";
-
-    while (<POLICY>)
-    {
-	# Clean up the line and ignore blanks and comments
-	chomp;
-	s/^\s+//;
-	s/\s+$//;
-	next if /^\#/;
-	next if /^$/;
-
-	# Each line consists of six parts:
-	#   1. snk file for encryption, relative to the package root
-	#   2. Assembly name
-	#   3. Versions to map from
-	#   4. Versions to map to
-	#   5. Priority of this policy
-
-	my ($snk, $assembly, $map, $version, $priority) =
-	    split(/\s+/);
-
-	# Verify the fields
-	my $version_map;
-
-	# Remove the .dll to normalize it
-	$assembly =~ s/\.dll$//;
-
-	# Get the token from the file
-	my $cmd = "/usr/bin/cli-sn -t '$snk' | grep 'Public Key' "
-	    . "| cut -f 2- -d :";
-	my $token = `$cmd`;
-	$token =~ s/^\s*(.*?)\s*$/$1/sg;
-	
-
-	# Check the version numbers
-	if ($map =~ /^(\d+\.\d+)\.\d+\.\d+$/)
-	{
-	    $version_map = $1;
-	}
-	else
-	{
-	    if ($map =~ /^(\d+\.\d+)\.\d+\.\d+-(\d+\.\d+)\.\d+\.\d+$/)
-	    {
-		if ($1 ne $2)
-		{
-		    $errors = 1;
-		    print STDERR "E: $package $.: Version ranges ($map) must "
-			. "have the first two digits of the version the same. "
-			. "Use two different lines for this line.\n";
-		    next;
-		}
-
-		$version_map = $1;
-	    }
-	    else
-	    {
-		$errors = 1;
-		print STDERR "E: $package $.: The version field ($map) "
-		    . "must be in the following format: "
-		    . "'A.B.C.D' or 'A.B.C.D-E.F.G.H'\n";
-		next;
-	    }
-	}
-
-	# We have now gathered up everything we need. We use a hash to
-	# consolidate all the various bindings into the unique
-	# combinations of policy files we need.
-	my $pk = join("--", $snk, $assembly, $version_map, $priority);
-
- 	$policies{$pk} .=
- 	    join("\n",
- 		 '    <assemblyBinding '
-		 . 'xmlns="urn:schemas-microsoft-com:asm.v1">',
- 		 '      <dependentAssembly>',
- 		 "        <assemblyIdentity name=\"$assembly\" "
-		 . "publicKeyToken=\"$token\"/>",
- 		 "          <bindingRedirect oldVersion="
- 		 . "\"$map\" newVersion=\"$version\"/>",
- 		 "      </dependentAssembly>",
- 		 "    </assemblyBinding>") . "\n";
-    }
-
-    close POLICY;
-
-    # Make sure the policies.d directory exists
-    if (! -d "$tmp/usr/share/cli-common/policies.d") {
-	doit("install","-d","$tmp/usr/share/cli-common/policies.d");
-    }
-
-    # Once all the various <assemblyBinding> tags are consolidated, we
-    # then generate the policy files. This will result in one policy file for
-    # a given assembly, key file, and A.B version.
-    foreach my $pk (keys %policies)
-    {
-	# Get the pkg_dir
-	my ($snk, $assembly, $version_map, $priority) =
-	    split(/--/, $pk);
-	my $pkg_dir = "$usr/share-cli/common/policies.d/$package/";
-	my $tmp_pkg_dir = "$tmp/$pkg_dir";
-	my $policy_file = "$version_map.$assembly";
-
-	# Open the policy file chooser
-	open CHOOSER, ">$tmp/usr/share/cli-common/policies.d/"
-	    . sprintf("%03d-%s.%s", $priority, $version_map, $assembly);
-	print CHOOSER "/$pkg_dir/policy.$policy_file.dll\n";
-	close CHOOSER;
-
-	# Open up the file
-	unless (open PF, ">$tmp_pkg_dir/policy.$policy_file.config")
-	{
-	    $errors = 1;
-	    print STDERR "E: $package: Cannot write $policy_file.config";
-	    next;
-	}
-
-	# Write out the policy file
-	print PF "<configuration>\n  <runtime>\n";
-	print PF $policies{$pk};
-	print PF "  </runtime>\n</configuration>\n";
-	close PF;
-
- 	# Compile the assembly file. We have to change directory first
- 	# because of AL limitation.
- 	system("cd $tmp_pkg_dir/ && /usr/bin/cli-al "
- 	       . "/link:policy.$policy_file.config "
- 	       . "/out:policy.$policy_file.dll "
- 	       . "/keyfile:" . $ENV{PWD} . "/$snk");
-
- 	# Clean up the config file
- 	unlink("$pkg_dir/policy.$policy_file.config");
-
-	# Set up the scripts
-	if (! $dh{NOSCRIPTS})
-	{
-	    autoscript($package, "postinst", "postinst-cligacpolicy",
-		       "s/#PACKAGE#/$assembly $version_map/");
-	    autoscript($package, "postrm", "postrm-cligacpolicy",
-		       "s/#PACKAGE#/$assembly $version_map/");
-	}
-    }    
-}
-
-# Finish up
-exit $errors;
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of cli-common-dev.
-
-=head1 AUTHOR
-
-Dylan R. E. Moonfire <debian at mfgames.com>
-
-=cut
-
-#      <configuration>
-#         <runtime>
-#            <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
-#             <dependentAssembly>
-#               <assemblyIdentity name="foo" publicKeyToken="35e10195dab3c99f" />
-#               <bindingRedirect oldVersion="1.2.0.0-1.2.10.0" newVersion="1.3.0.0"/>
-#      	   </dependentAssembly>
-#            </assemblyBinding>
-#         </runtime>
-#      </configuration>

Deleted: cli-common/trunk/dh_createclipolicy
===================================================================
--- cli-common/trunk/dh_createclipolicy	2007-07-18 21:06:56 UTC (rev 3242)
+++ cli-common/trunk/dh_createclipolicy	2007-07-18 21:11:33 UTC (rev 3243)
@@ -1,276 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_createclipolicy - created the CLI policy files for a package
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_createclipolicy> [S<I<debhelper options>>] [B<-n>]
-
-=head1 DESCRIPTION
-
-dh_createclipolicy is a debhelper program that is responsible for
-creating, compiling, and installing policy files for a Debian package.
-This automatically includes postinst and prerm commands needed to
-install these policies into the system.
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-n>, B<--noscripts>
-
-Do not modify postinst/prerm scripts.
-
-=head1 FILE FORMAT
-
-This file uses the I<policyassemblies> files (either
-I<policyassemblies> or I<packagename.policyassemblies>) to generate
-the policy file. It supports multiple versions of the policy,
-including mapping multiple versions to a single file.
-
-The file format of the I<policyassemblies> file consists of six
-properties per line, each one separated by whitespace.
-
-=over 4
-=item B<Keyfile> is a path, from the package root, to the .snk file
-=used to sign the assembly.
-
-=item B<CLI directory> is the directory inside I<usr/lib/cli> that
-=contains the assemblies. This is typically found in the install
-=file of the package.
-
-=item B<Assembly> is the name of the assembly, without the .dll
-=extension. For example, for log4net.dll, use I<log4net>.
-
-=item B<Version Range> can be a single four-part version, such as
-=1.2.3.4, or a full range, such as 1.2.3.4-1.2.6.7. For a single line,
-=the first two numbers must be identical. To have an assembly apply to
-=multiple versions, such as 1.2.0.0 to 2.4.0.0, there needs to be one
-=line for each version range.
-
-=item B<Assembly version> is the version of the assembly being
-=built.
-
-=item B<Priority> defines the priority of the policy files.
-=Typically, each version will increase the priority and
-=contains all the policy controls for prior versions.
-
-=back
-
-The fields can be separated with spaces or tabs. Comments start the
-line with I<#> characters and blank lines are ignored.
-
-=head1 NOTES
-
-Note that this command is not idempotent. "dh_clean -k" should be called
-between invocations of this command. Otherwise, it may cause multiple
-instances of the same text to be added to maintainer scripts.
-
-=head1 EXAMPLE
-
-For the log4net 1.2.10.0 version, a policy file is used to map all
-versions from 1.2.8.0 to 1.2.9.99 into the current version.
-
-debian/log4net.snk log4net-1.2 log4net 1.2.8.0-1.2.9.99 1.2.10.0 10
-
-=cut
-
-# Set up debhelper
-init();
-
-# Go through each of the packages being built
-my $errors = 0;
-
-foreach my $package (@{$dh{DOPACKAGES}})
-{
-    # Set up our internal variables
-    my $tmp = tmpdir($package);
-    my $policy = pkgfile($package, "policyassemblies");
-    my %policies = ();
-    
-    # If $policy is blank, then there is no file
-    next if $policy eq "";
-
-    # Load the policy file into memory.
-    my ($keyfile, $pkg_tmp, $cli_dir, $token, $priority);
-    open POLICY, "<$policy" or die "E: Can't open $policy ($!)";
-
-    while (<POLICY>)
-    {
-	# Clean up the line and ignore blanks and comments
-	chomp;
-	s/^\s+//;
-	s/\s+$//;
-	next if /^\#/;
-	next if /^$/;
-
-	# Each line consists of six parts:
-	#   1. snk file for encryption, relative to the package root
-	#   2. Directory in debian/package/usr/lib/cli
-	#   3. Assembly name
-	#   4. Versions to map from
-	#   5. Versions to map to
-	#   6. Priority of this policy
-
-	my ($snk, $cli_dir, $assembly, $map, $version, $priority) = split(/\s+/);
-
-	# Verify the fields
-	my $version_map;
-
-	# Remove the .dll to normalize it
-	$assembly =~ s/\.dll$//;
-
-	my $assembly_tmp = "$tmp/usr/lib/cli/$cli_dir/$assembly.dll";
-
-	if (! -f $assembly_tmp)
-	{
-	    $errors = 1;
-	    print STDERR "E: $package $.: Cannot find assembly: "
-		. "$assembly.dll in $tmp/usr/lib/cli\n";
-	    next;
-	}
-
-	# Get the token from the file
-	my $cmd = "/usr/bin/cli-sn -t '$snk' | grep 'Public Key' "
-	    . "| cut -f 2- -d :";
-	my $token = `$cmd`;
-	$token =~ s/^\s*(.*?)\s*$/$1/sg;
-	
-
-	# Check the version numbers
-	if ($map =~ /^(\d+\.\d+)\.\d+\.\d+$/)
-	{
-	    $version_map = $1;
-	}
-	else
-	{
-	    if ($map =~ /^(\d+\.\d+)\.\d+\.\d+-(\d+\.\d+)\.\d+\.\d+$/)
-	    {
-		if ($1 ne $2)
-		{
-		    $errors = 1;
-		    print STDERR "E: $package $.: Version ranges ($map) must "
-			. "have the first two digits of the version the same. "
-			. "Use two different lines for this line.\n";
-		    next;
-		}
-
-		$version_map = $1;
-	    }
-	    else
-	    {
-		$errors = 1;
-		print STDERR "E: $package $.: The version field ($map) "
-		    . "must be in the following format: "
-		    . "'A.B.C.D' or 'A.B.C.D-E.F.G.H'\n";
-		next;
-	    }
-	}
-
-	# We have now gathered up everything we need. We use a hash to
-	# consolidate all the various bindings into the unique
-	# combinations of policy files we need.
-	my $pk = join("--", $snk, $cli_dir, $assembly, $version_map, $priority);
-
- 	$policies{$pk} .=
- 	    join("\n",
- 		 '    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">',
- 		 '      <dependentAssembly>',
- 		 "        <assemblyIdentity name=\"$assembly\" "
-		 . "publicKeyToken=\"$token\"/>",
- 		 "          <bindingRedirect oldVersion="
- 		 . "\"$map\" newVersion=\"$version\"/>",
- 		 "      </dependentAssembly>",
- 		 "    </assemblyBinding>") . "\n";
-    }
-
-    close POLICY;
-
-    # Make sure the policies.d directory exists
-    if (! -d "$tmp/usr/share/cli-common/policies.d") {
-	doit("install","-d","$tmp/usr/share/cli-common/policies.d");
-    }
-
-    # Once all the various <assemblyBinding> tags are consolidated, we
-    # then generate the policy files. This will result in one policy file for
-    # a given assembly, key file, and A.B version.
-    foreach my $pk (keys %policies)
-    {
-	# Get the pkg_dir
-	my ($snk, $cli_dir, $assembly, $version_map, $priority) = split(/--/, $pk);
-	my $pkg_dir = "$tmp/usr/lib/cli/$cli_dir";
-	my $policy_file = "$version_map.$assembly";
-
-	# Open the policy file chooser
-	open CHOOSER, ">$tmp/usr/share/cli-common/policies.d/"
-	    . sprintf("%03d-%s.%s", $priority, $version_map, $assembly);
-	print CHOOSER "/usr/lib/cli/$cli_dir/policy.$policy_file.dll\n";
-	close CHOOSER;
-
-	# Open up the file
-	unless (open PF, ">$pkg_dir/policy.$policy_file.config")
-	{
-	    $errors = 1;
-	    print STDERR "E: $package: Cannot write $policy_file.config";
-	    next;
-	}
-
-	# Write out the policy file
-	print PF "<configuration>\n  <runtime>\n";
-	print PF $policies{$pk};
-	print PF "  </runtime>\n</configuration>\n";
-	close PF;
-
- 	# Compile the assembly file. We have to change directory first
- 	# because of AL limitation.
- 	system("cd $pkg_dir/ && /usr/bin/cli-al "
- 	       . "/link:policy.$policy_file.config "
- 	       . "/out:policy.$policy_file.dll "
- 	       . "/keyfile:" . $ENV{PWD} . "/$snk");
-
- 	# Clean up the config file
- 	#unlink("$pkg_dir/policy.$policy_file.config");
-
-	# Set up the scripts
-	if (! $dh{NOSCRIPTS})
-	{
-	    autoscript($package, "postinst", "postinst-clipolicy",
-		       "s/#PACKAGE#/$assembly $version_map/");
-	    autoscript($package, "postrm", "postrm-clipolicy",
-		       "s/#PACKAGE#/$assembly $version_map/");
-	}
-    }    
-}
-
-# Finish up
-exit $errors;
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of cli-common-dev.
-
-=head1 AUTHOR
-
-Dylan R. E. Moonfire <debian at mfgames.com>
-
-=cut
-
-#      <configuration>
-#         <runtime>
-#            <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
-#             <dependentAssembly>
-#               <assemblyIdentity name="foo" publicKeyToken="35e10195dab3c99f" />
-#               <bindingRedirect oldVersion="1.2.0.0-1.2.10.0" newVersion="1.3.0.0"/>
-#      	   </dependentAssembly>
-#            </assemblyBinding>
-#         </runtime>
-#      </configuration>

Copied: cli-common/trunk/postinst-cligacpolicy (from rev 3241, cli-common/trunk/postinst-clipolicy)
===================================================================
--- cli-common/trunk/postinst-cligacpolicy	                        (rev 0)
+++ cli-common/trunk/postinst-cligacpolicy	2007-07-18 21:11:33 UTC (rev 3243)
@@ -0,0 +1,4 @@
+if [ "$1" = "configure" ] && [ -x /usr/share/cli-common/policy-install ]
+then
+	/usr/share/cli-common/policy-install #PACKAGE#
+fi

Deleted: cli-common/trunk/postinst-clipolicy
===================================================================
--- cli-common/trunk/postinst-clipolicy	2007-07-18 21:06:56 UTC (rev 3242)
+++ cli-common/trunk/postinst-clipolicy	2007-07-18 21:11:33 UTC (rev 3243)
@@ -1,4 +0,0 @@
-if [ "$1" = "configure" ] && [ -x /usr/share/cli-common/policy-install ]
-then
-	/usr/share/cli-common/policy-install #PACKAGE#
-fi

Copied: cli-common/trunk/postrm-cligacpolicy (from rev 3241, cli-common/trunk/postrm-clipolicy)
===================================================================
--- cli-common/trunk/postrm-cligacpolicy	                        (rev 0)
+++ cli-common/trunk/postrm-cligacpolicy	2007-07-18 21:11:33 UTC (rev 3243)
@@ -0,0 +1,3 @@
+if [ -x /usr/share/cli-common/policy-install ] ; then
+	/usr/share/cli-common/policy-install #PACKAGE#
+fi

Deleted: cli-common/trunk/postrm-clipolicy
===================================================================
--- cli-common/trunk/postrm-clipolicy	2007-07-18 21:06:56 UTC (rev 3242)
+++ cli-common/trunk/postrm-clipolicy	2007-07-18 21:11:33 UTC (rev 3243)
@@ -1,3 +0,0 @@
-if [ -x /usr/share/cli-common/policy-install ] ; then
-	/usr/share/cli-common/policy-install #PACKAGE#
-fi




More information about the Pkg-mono-svn-commits mailing list