1 |
Signed-off-by: Göktürk Yüksek <gokturk@××××××××××.edu> |
2 |
--- |
3 |
.../invalid-attributes-0.1.ebuild | 11 +++++++ |
4 |
xml-test/invalid-attributes/metadata.xml | 38 ++++++++++++++++++++++ |
5 |
2 files changed, 49 insertions(+) |
6 |
create mode 100644 xml-test/invalid-attributes/invalid-attributes-0.1.ebuild |
7 |
create mode 100644 xml-test/invalid-attributes/metadata.xml |
8 |
|
9 |
diff --git a/xml-test/invalid-attributes/invalid-attributes-0.1.ebuild b/xml-test/invalid-attributes/invalid-attributes-0.1.ebuild |
10 |
new file mode 100644 |
11 |
index 0000000..3076b2a |
12 |
--- /dev/null |
13 |
+++ b/xml-test/invalid-attributes/invalid-attributes-0.1.ebuild |
14 |
@@ -0,0 +1,11 @@ |
15 |
+# Copyright 1999-2016 Gentoo Foundation |
16 |
+# Distributed under the terms of the GNU General Public License v2 |
17 |
+# $Id$ |
18 |
+ |
19 |
+EAPI=6 |
20 |
+ |
21 |
+DESCRIPTION="Metadata example with invalid attribute values and locations" |
22 |
+HOMEPAGE="https://wiki.gentoo.org/wiki/GLEP:68" |
23 |
+LICENSE="HPND" |
24 |
+SLOT="0" |
25 |
+KEYWORDS="~amd64" |
26 |
diff --git a/xml-test/invalid-attributes/metadata.xml b/xml-test/invalid-attributes/metadata.xml |
27 |
new file mode 100644 |
28 |
index 0000000..66902dc |
29 |
--- /dev/null |
30 |
+++ b/xml-test/invalid-attributes/metadata.xml |
31 |
@@ -0,0 +1,38 @@ |
32 |
+<?xml version='1.0' encoding='UTF-8'?> |
33 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
34 |
+<pkgmetadata> |
35 |
+ <longdescription> |
36 |
+ Tests for invalid attribute values and attributes appearing |
37 |
+ in elements that they're not supposed to. |
38 |
+ |
39 |
+ There's a multitude of invalid attribute values and combinations. |
40 |
+ We only consider a few sane cases that are likely to happen: |
41 |
+ - type attribute in upstream maintainer (allowed only in downstream) |
42 |
+ - status attribute in downstream maintainer (allowed only in upstream) |
43 |
+ - invalid values for enumerated attributes: type, status, lang |
44 |
+ |
45 |
+ We also introduce multiple violations in a single element to test |
46 |
+ repoman's ability to display errors. |
47 |
+ </longdescription> |
48 |
+ <!-- |
49 |
+ The errors for the following are: |
50 |
+ (1) invalid value for type |
51 |
+ (2) status attribute is not allowed in downstream maintainer |
52 |
+ (3) status attribute has invalid value |
53 |
+ There's no point in reporting (3) due to (2), so it |
54 |
+ should only print errors for the first two. |
55 |
+ --> |
56 |
+ <maintainer type='cow' status='retired'> |
57 |
+ <email>larry@g.o</email> |
58 |
+ <!-- invalid value for lang --> |
59 |
+ <description lang="english">Moo</description> |
60 |
+ </maintainer> |
61 |
+ <upstream> |
62 |
+ <!-- type attribute isn't allowed in upstream maintainer --> |
63 |
+ <maintainer status='active' type='person'> |
64 |
+ <name>Gen B0rk</name> |
65 |
+ </maintainer> |
66 |
+ <!-- invalid value for type --> |
67 |
+ <remote-id type='gen-b0rk'>gentoo/gen-b0rk</remote-id> |
68 |
+ </upstream> |
69 |
+</pkgmetadata> |
70 |
-- |
71 |
2.7.3 |