lib: Change godepcop to an XML (rather than JSON) config file.

Most of the rest of our build-related config files use XML, so
this increases consistency.  It's also easier to add comments.

The XML file is called .godepcop (rather than GO.PACKAGE) to
match the naming of the .api config file, and also to hide it
from view since it's rarely edited.  Here's an example of the
v.io/x/lib/.godepcop file:

<godepcop>
<import allow="v.io/x/lib/..."/>
<import allow="github.com/cosnicolaou/llog"/>
<import deny="..."/>

<xtest allow="v.io/v23/..."/>
<xtest allow="v.io/x/ref/..."/>
</godepcop>

Note that the new file allows specification of rules for regular
imports, test imports and xtest imports.  Having rules for all
three groups of imports is useful, since we can now have strict
rules about the dependencies for all code (both test and
non-test) that is used to build each package.  E.g. we have very
strict rules for the vdl package and the v23 tool, since they're
so critical to our codebase.

I also discovered (and fixed) a bug that caused us to miss some
transitive dependencies during checking.  E.g. vlog imports
verror, which imports a bunch of other packages under v23, but
the bug caused us to only check the verror dependency and skip
the others.  The bug was in checkImports, where we were
incorrectly re-using the "deps" variable.

I've also created reasonable .godepcop files for our codebase, as
appropriate, and added comments describing the philosophy.

MultiPart: 3/3

Change-Id: Idd7b2694410aa6c3009139b26a547cdb0a411dd5
diff --git a/.godepcop b/.godepcop
new file mode 100644
index 0000000..6439b23
--- /dev/null
+++ b/.godepcop
@@ -0,0 +1,15 @@
+<godepcop>
+  <!-- Most packages under v.io/x/lib should be free of other dependencies.
+
+       NOTE: llog is used in the implementation of v.io/x/lib/vlog, which is
+       used in other packages under v.io/x/lib.  Reimplementing vlog to stand
+       alone will allow us to remove this dependency. -->
+  <import allow="v.io/x/lib/..."/>
+  <import allow="github.com/cosnicolaou/llog"/>
+  <import deny="..."/>
+
+  <!-- Relax the rule for external tests, but keep a curated list rather than
+       allowing a blanket "..." to avoid adding unwanted dependencies. -->
+  <xtest allow="v.io/v23/..."/>
+  <xtest allow="v.io/x/ref/..."/>
+</godepcop>
diff --git a/GO.PACKAGE b/GO.PACKAGE
deleted file mode 100644
index b3a25cf..0000000
--- a/GO.PACKAGE
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-	"imports": [
-		{"allow": "v.io/x/lib/..."},
-		{"deny": "..."}
-	]
-}
diff --git a/dbutil/.godepcop b/dbutil/.godepcop
new file mode 100644
index 0000000..53701f1
--- /dev/null
+++ b/dbutil/.godepcop
@@ -0,0 +1,3 @@
+<godepcop>
+  <import allow="github.com/go-sql-driver/mysql"/>
+</godepcop>
diff --git a/dbutil/GO.PACKAGE b/dbutil/GO.PACKAGE
deleted file mode 100644
index 088b3c8..0000000
--- a/dbutil/GO.PACKAGE
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-	"imports": [
-		{"allow": "github.com/go-sql-driver/mysql"}
-	]
-}
diff --git a/pubsub/.godepcop b/pubsub/.godepcop
new file mode 100644
index 0000000..366503a
--- /dev/null
+++ b/pubsub/.godepcop
@@ -0,0 +1,5 @@
+<godepcop>
+  <!-- The pubsub package pulls in verror, which pulls in a bunch of v23 deps.
+       TODO(cnicolaou,toddw): Remove the verror dependency. -->
+  <import allow="v.io/v23/..."/>
+</godepcop>
diff --git a/pubsub/GO.PACKAGE b/pubsub/GO.PACKAGE
deleted file mode 100644
index 2e7e83f..0000000
--- a/pubsub/GO.PACKAGE
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-	"imports": [
-		{"allow": "v.io/v23/verror"}
-	]
-}
diff --git a/vlog/GO.PACKAGE b/vlog/GO.PACKAGE
deleted file mode 100644
index a46fa75..0000000
--- a/vlog/GO.PACKAGE
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-	"imports": [
-		{"allow": "github.com/cosnicolaou/llog"}
-	]
-}