Check filename of assemblies before installing with gacutil.
authorAndrius Bentkus <andrius.bentkus@gmail.com>
Sat, 29 Jan 2011 15:35:46 +0000 (16:35 +0100)
committerMiguel de Icaza <miguel@gnome.org>
Fri, 11 Feb 2011 22:23:09 +0000 (17:23 -0500)
commit0317e5e5ed7fae46cc8b79f9234a8324055c2f96
treed0ba432ea775776448f4770bbf01d167eb2d7761
parent2714556067274769e850b8cca316a91976447c2b
Check filename of assemblies before installing with gacutil.

gacutil just used the filename (which can be different compared to
the assembly name) in order to install assemblies, though afterwards
entirely relied on the filename to be equal to the assembly name.
In other words, installing assemblies where the filename differed
from the assembly name resulted in an incorrect install: the
files were not visible in the GAC.

Example: gacutil -i mysql.data.dll
Wouldn't return any errors, but the assembly (which is called MySql.Data)
still couldn't be reached.

This patch will check for filename compliance and return an error
if it does not comply, which will look like this:
Failure adding assembly v4/mysql.data.dll to the cache: the filename "mysql.data.dll" doesn't match the assembly name "MySql.Data"

A warning is not sufficient, since it will be impossible to remove
the installed junk with gacutil.
mcs/tools/gacutil/driver.cs