commit: 91aa7fb3e59c0c5ab449017263ed1ea135d0c5ac
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 1 13:34:01 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Mar 1 13:34:01 2018 +0000
URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=91aa7fb3
scripts/rsync-generation: remove tests again, they fail the tree
Tests were designed to expose problems, so it's kind of nasty when they
are included in the tree. Not a good idea.
scripts/rsync-generation/hashgen.c | 14 +++++++++-----
.../tests/hashverify/simpletree/Manifest | 2 --
.../tests/hashverify/simpletree/Manifest.files.gz | Bin 437 -> 0 bytes
.../tests/hashverify/simpletree/my-cat/Manifest.gz | Bin 231 -> 0 bytes
.../hashverify/simpletree/my-cat/mypackage/Manifest | 6 ------
.../simpletree/my-cat/mypackage/metadata.xml | 10 ----------
.../simpletree/my-cat/mypackage/mypackage-0.ebuild | 16 ----------------
.../simpletree/my-cat/mypackage/mypackage-1.ebuild | 18 ------------------
.../simpletree/my-cat/mypackage/mypackage-2.ebuild | 16 ----------------
.../simpletree/my-cat/mypackage/unrecorded-file | 1 -
10 files changed, 9 insertions(+), 74 deletions(-)
diff --git a/scripts/rsync-generation/hashgen.c
b/scripts/rsync-generation/hashgen.c
index 93723f7e60..226daa74df 100644
--- a/scripts/rsync-generation/hashgen.c
+++ b/scripts/rsync-generation/hashgen.c
@@ -218,6 +218,7 @@ compare_strings(const void *l, const void *r)
* starting with a dot are ignored, and not present in the returned
* list. The list and all entries are allocated using malloc() and need
* to be freed.
+ * This function returns 0 when everything is fine, non-zero otherwise.
*/
static char
list_dir(char ***retlist, size_t *retcnt, const char *path)
@@ -324,7 +325,7 @@ write_hashes_dir(
size_t i;
snprintf(path, sizeof(path), "%s/%s", root, name);
- if (list_dir(&dentries, &dentrieslen, path) != 0) {
+ if (list_dir(&dentries, &dentrieslen, path) == 0) {
for (i = 0; i < dentrieslen; i++) {
snprintf(path, sizeof(path), "%s/%s", name,
dentries[i]);
free(dentries[i]);
@@ -350,7 +351,7 @@ process_files(const char *dir, const char *off, FILE *m)
struct timeval tv[2]; /* dummy, won't use its result */
snprintf(path, sizeof(path), "%s/%s", dir, off);
- if (list_dir(&dentries, &dentrieslen, path) != 0) {
+ if (list_dir(&dentries, &dentrieslen, path) == 0) {
for (i = 0; i < dentrieslen; i++) {
snprintf(path, sizeof(path), "%s%s%s",
off, *off == '\0' ? "" : "/",
dentries[i]);
@@ -519,7 +520,7 @@ process_dir_gen(const char *dir)
size_t dentrieslen;
size_t i;
- if (list_dir(&dentries, &dentrieslen, dir) != 0) {
+ if (list_dir(&dentries, &dentrieslen, dir) == 0) {
char *my_manifest = str_manifest_gz;
if (type_manifest == GLOBAL_MANIFEST)
@@ -657,7 +658,7 @@ process_dir_gen(const char *dir)
}
fclose(f);
- if (list_dir(&dentries, &dentrieslen, dir) != 0) {
+ if (list_dir(&dentries, &dentrieslen, dir) == 0) {
for (i = 0; i < dentrieslen; i++) {
if (strcmp(dentries[i] + strlen(dentries[i]) -
7,
".ebuild") != 0)
@@ -1348,8 +1349,11 @@ main(int argc, char *argv[])
int ret = 0;
char *rsn;
- if ((prog = strrchr(argv[0], '/')) == NULL)
+ if ((prog = strrchr(argv[0], '/')) == NULL) {
prog = argv[0];
+ } else {
+ prog++;
+ }
if (argc > 1) {
if (strcmp(argv[1], "hashverify") == 0 ||
diff --git a/scripts/rsync-generation/tests/hashverify/simpletree/Manifest
b/scripts/rsync-generation/tests/hashverify/simpletree/Manifest
deleted file mode 100644
index 58c61a8625..0000000000
--- a/scripts/rsync-generation/tests/hashverify/simpletree/Manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-MANIFEST Manifest.files.gz 437 BLAKE2B
32dd239c7cc855c08a02c50b07970cc4df0af1a40e4be3c69c05d36e97ec8b611a45f2fdc773450fecd4d22253122f3978080cea595247e7891b66688ac45668
SHA512
85036ad84f245f8137591223c0db936ab80a21c363e06dae63e6e0f1f2c78715a733abc55b9707a89df39481dedcddd3887f66fd59d4ce8dcdf5e8ccf3c2a267
-TIMESTAMP 2018-03-01T10:58:37Z
diff --git
a/scripts/rsync-generation/tests/hashverify/simpletree/Manifest.files.gz
b/scripts/rsync-generation/tests/hashverify/simpletree/Manifest.files.gz
deleted file mode 100644
index 09eadcad7b..0000000000
Binary files
a/scripts/rsync-generation/tests/hashverify/simpletree/Manifest.files.gz and
/dev/null differ
diff --git
a/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/Manifest.gz
b/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/Manifest.gz
deleted file mode 100644
index 9bc47b288a..0000000000
Binary files
a/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/Manifest.gz and
/dev/null differ
diff --git
a/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/mypackage/Manifest
b/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/mypackage/Manifest
deleted file mode 100644
index da5accb70b..0000000000
---
a/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/mypackage/Manifest
+++ /dev/null
@@ -1,6 +0,0 @@
-DIST foo 12 bar
-EBUILD mypackage-0.ebuild 237 BLAKE2B
2410d545e7441e6402c32ca3ce7e80d6eda82306db1c7d9732ed35d273a20f0983a4a40b02492fbad4145cc776f249fb575bd6f74e7cd92e125181af722500a3
SHA512
b22f73bd10773a7b01456a237b5224226c4178cc0755d0e84c8b8597071683b148f3b9f56d8b5c7fb8e58f7e618fd62307fba13d8b04988c5aeb417f2e286d61
-EBUILD mypackage-1.ebuild 237 BLAKE2B
2410d545e7441e6402c32ca3ce7e80d6eda82306db1c7d9732ed35d273a20f0983a4a40b02492fbad4145cc776f249fb575bd6f74e7cd92e125181af722500a3
SHA512
b22f73bd10773a7b01456a237b5224226c4178cc0755d0e84c8b8597071683b148f3b9f56d8b5c7fb8e58f7e618fd62307fba13d8b04988c5aeb417f2e286d61
-EBUILD mypackage-2.ebuild 237 BLAKE2B
2410d545e7441e6402c32ca3ce7e80d6eda82306db1c7d9732ed35d273a20f0983a4a40b02492fbad4145cc776f249fb575bd6f74e7cd92e125181af722500a3
SHA512
b22f73bd10773a7b01456a237b5224226c4178cc0755d0e84c8b8597071683b148f3b9f56d8b5c7fb8e58f7e618fd62307fba13d8b04988c5aeb417f2e286d61
-EBUILD mypackage-3.ebuild 237 BLAKE2B
2410d545e7441e6402c32ca3ce7e80d6eda82306db1c7d9732ed35d273a20f0983a4a40b02492fbad4145cc776f249fb575bd6f74e7cd92e125181af722500a3
SHA512
b22f73bd10773a7b01456a237b5224226c4178cc0755d0e84c8b8597071683b148f3b9f56d8b5c7fb8e58f7e618fd62307fba13d8b04988c5aeb417f2e286d61
-MISC metadata.xml 297 BLAKE2B
14dd1b26d504485cb920cf01ddb68fe36a3f4646c7283b01697363680a0c56520cc28f1ad3df4f41a7dba532e08e66321fe89a309f43feeeafc65ef1f7617c8e
SHA512
4b07eaacba80c46a68348ecc95c67b821d5e23ef5f6e7a0dec89f1a380d5562fc50d65d9fb09fe2c3079b4ca16ed6a9774668aabb93a56a9d8864f5de53aac57
diff --git
a/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/mypackage/metadata.xml
b/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/mypackage/metadata.xml
deleted file mode 100644
index 33b480e2ec..0000000000
---
a/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/mypackage/metadata.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
- <maintainer type="person">
- <email>[email protected]</email>
- <name>Fabian Groffen</name>
- </maintainer>
- <longdescription lang="en">
- </longdescription>
-</pkgmetadata>
diff --git
a/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/mypackage/mypackage-0.ebuild
b/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/mypackage/mypackage-0.ebuild
deleted file mode 100644
index 708fc58efb..0000000000
---
a/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/mypackage/mypackage-0.ebuild
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-DESCRIPTION=""
-HOMEPAGE=""
-SRC_URI=""
-
-LICENSE=""
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE=""
-
-DEPEND=""
-RDEPEND="${DEPEND}"
diff --git
a/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/mypackage/mypackage-1.ebuild
b/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/mypackage/mypackage-1.ebuild
deleted file mode 100644
index a4388abd8e..0000000000
---
a/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/mypackage/mypackage-1.ebuild
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-#filesize mismatch
-
-EAPI=6
-
-DESCRIPTION=""
-HOMEPAGE=""
-SRC_URI=""
-
-LICENSE=""
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE=""
-
-DEPEND=""
-RDEPEND="${DEPEND}"
diff --git
a/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/mypackage/mypackage-2.ebuild
b/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/mypackage/mypackage-2.ebuild
deleted file mode 100644
index 38bbcfc4e4..0000000000
---
a/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/mypackage/mypackage-2.ebuild
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-HASH_MISMATCH_
-HOMEPAGE=""
-SRC_URI=""
-
-LICENSE=""
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE=""
-
-DEPEND=""
-RDEPEND="${DEPEND}"
diff --git
a/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/mypackage/unrecorded-file
b/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/mypackage/unrecorded-file
deleted file mode 100644
index 257cc5642c..0000000000
---
a/scripts/rsync-generation/tests/hashverify/simpletree/my-cat/mypackage/unrecorded-file
+++ /dev/null
@@ -1 +0,0 @@
-foo