[Git][reproducible-builds/disorderfs][debian] 8 commits: disorderfs.1.txt: fix typo in list index
Chris Lamb (@lamby)
gitlab at salsa.debian.org
Mon May 19 17:11:10 UTC 2025
Chris Lamb pushed to branch debian at Reproducible Builds / disorderfs
Commits:
76c9e78e by Holger Levsen at 2023-02-16T14:30:49+01:00
disorderfs.1.txt: fix typo in list index
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
2a1f1a6f by Holger Levsen at 2023-02-16T14:32:17+01:00
prepare new upstream release
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
2c3df223 by Holger Levsen at 2023-02-16T15:54:51+01:00
disorderfs.1.txt: set revdate to last relevant change.
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
065f09a7 by Siva Mahadevan at 2025-05-16T18:06:13-04:00
tests: improve portability
This helps with porting disorderfs to FreeBSD.
- - - - -
c04c8f40 by Chris Lamb at 2025-05-17T16:15:52+00:00
Merge branch 'push-ntslpmkskzxq' into 'master'
tests: improve portability
See merge request reproducible-builds/disorderfs!7
- - - - -
6180da08 by Chris Lamb at 2025-05-19T10:06:38-07:00
Release 0.6.0
- - - - -
d02936f8 by Chris Lamb at 2025-05-19T10:07:53-07:00
Merge tag '0.6.0' into debian
Release 0.6.0
* tag '0.6.0':
Release 0.6.0
tests: improve portability
disorderfs.1.txt: set revdate to last relevant change.
prepare new upstream release
disorderfs.1.txt: fix typo in list index
- - - - -
a5f5d82b by Chris Lamb at 2025-05-19T10:08:57-07:00
releasing package disorderfs version 0.6.0-1
- - - - -
7 changed files:
- debian/changelog
- disorderfs.1.txt
- disorderfs.cpp
- disorderfs.spec
- tests/common
- tests/test_inodes
- tests/test_touch
Changes:
=====================================
debian/changelog
=====================================
@@ -1,9 +1,16 @@
-disorderfs (0.5.11-5) UNRELEASED; urgency=medium
+disorderfs (0.6.0-1) unstable; urgency=medium
- * Start 0.5.11-5 development. d/changelog entries will be written on
- release using the git commit messages.
+ [ Siva Mahadevan ]
+ * Improve portability, especially to FreeBSD.
- -- Holger Levsen <holger at debian.org> Mon, 30 Sep 2024 15:24:41 +0200
+ [ Chris Lamb ]
+ * Drop a patch made on debian branch; already made on master.
+
+ [ Holger Levsen ]
+ * disorderfs.1.txt: Fix a typo in the list index and set the revdate to the
+ last relevant change.
+
+ -- Chris Lamb <lamby at debian.org> Mon, 19 May 2025 10:08:54 -0700
disorderfs (0.5.11-4) unstable; urgency=medium
=====================================
disorderfs.1.txt
=====================================
@@ -1,7 +1,7 @@
DISORDERFS(1)
=============
:doctype: manpage
-:revdate: 2015-08-21
+:revdate: 2018-04-10
NAME
----
@@ -108,7 +108,7 @@ c b a .. . <5>
<2> Mount *rootdir* in sorted mode...
<3> ... and the results are in sorted order.
<4> We mount *rootdir* again, sorting the results in reversed order...
-<3> ... and the directory contents are returned in reverse.
+<5> ... and the directory contents are returned in reverse.
$ fusermount -u sorted
$ fusermount -u reversed
=====================================
disorderfs.cpp
=====================================
@@ -43,7 +43,7 @@ extern "C" {
#include <sys/file.h>
#include <stddef.h>
-#define DISORDERFS_VERSION "0.5.11"
+#define DISORDERFS_VERSION "0.6.0"
namespace {
std::vector<std::string> bare_arguments;
@@ -465,7 +465,7 @@ int main (int argc, char** argv)
std::shuffle(dirents.begin(), dirents.end(), g);
}
- for (const auto dirent : dirents) {
+ for (const auto &dirent : dirents) {
st.st_ino = dirent.second;
if (filler(buf, dirent.first.c_str(), &st, 0) != 0) {
return -ENOMEM;
=====================================
disorderfs.spec
=====================================
@@ -1,5 +1,5 @@
Name: disorderfs
-Version: 0.5.11
+Version: 0.5.12
Release: 1%{?dist}
Summary: FUSE filesystem that introduces non-determinism
=====================================
tests/common
=====================================
@@ -1,7 +1,6 @@
trap "Unmount 2>/dev/null" EXIT
Mount () {
- Unmount
mkdir -p target
../disorderfs -q "${@}" fixtures/ target/
}
=====================================
tests/test_inodes
=====================================
@@ -9,26 +9,11 @@ trap "Unmount 2>/dev/null; rm -rf ${TEMPDIR}" EXIT
Setup () {
cat >${TEMPDIR}/inodes.cpp <<EOF
#include <dirent.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
#include <sys/stat.h>
-#include <sys/syscall.h>
#include <map>
#include <iostream>
-struct linux_dirent {
- unsigned long d_ino;
- off_t d_off;
- unsigned short d_reclen;
- char d_name[];
-};
-
-#define BUF_SIZE 1024
-
void perror_and_die (const char* s)
{
std::perror(s);
@@ -38,50 +23,44 @@ void perror_and_die (const char* s)
int
main(int argc, char *argv[])
{
- int fd, nread, ret = EXIT_SUCCESS;
- char buf[BUF_SIZE];
+ int ret = EXIT_SUCCESS;
struct stat st;
- const std::string dirname = argc > 1 ? argv[1] : ".";
- struct linux_dirent *d;
std::map<ino_t, std::string> inodes;
+ DIR *dirp;
+ struct dirent *d;
- if ((fd = open(dirname.c_str(), O_RDONLY | O_DIRECTORY)) == -1)
- perror_and_die("open");
+ if ((dirp = opendir("target")) == NULL) perror_and_die("opendir");
- while ((nread = syscall(SYS_getdents, fd, buf, BUF_SIZE)) > 0) {
- for (int pos = 0; pos < nread; pos += d->d_reclen) {
- d = (struct linux_dirent *) (buf + pos);
+ while ((d = readdir(dirp)) != NULL) {
+ const std::string filename = "target/" + std::string(d->d_name);
+ if (stat(filename.c_str(), &st) == -1)
+ perror_and_die("stat");
- std::string filename = dirname + "/" + std::string(d->d_name);
- if (stat(filename.c_str(), &st) == -1)
- perror_and_die("stat");
-
- if (d->d_ino != st.st_ino) {
- std::cerr << filename << ": inode from getdents does not match stat: "
- << d->d_ino << " != " << st.st_ino << std::endl;
- ret = EXIT_FAILURE;
- }
+ if (d->d_ino != st.st_ino) {
+ std::cerr << filename << ": inode from readdir does not match stat: "
+ << d->d_ino << " != " << st.st_ino << std::endl;
+ ret = EXIT_FAILURE;
+ }
- if (inodes.find(d->d_ino) == inodes.end()) {
- inodes[d->d_ino] = filename;
- } else {
- std::cerr << filename << ": duplicate inode: " << d->d_ino
- << " used by " << inodes[d->d_ino] << std::endl;
- ret = EXIT_FAILURE;
- }
+ if (inodes.find(d->d_ino) == inodes.end()) {
+ inodes[d->d_ino] = filename;
+ } else {
+ std::cerr << filename << ": duplicate inode: " << d->d_ino
+ << " used by " << inodes[d->d_ino] << std::endl;
+ ret = EXIT_FAILURE;
}
}
- if (nread == -1)
- perror_and_die("open");
+ if (closedir(dirp) == -1) perror_and_die("closedir");
- exit(ret);
+ return ret;
}
EOF
- g++ -Wall -o${TEMPDIR}/inodes ${TEMPDIR}/inodes.cpp || Fail "Could not compile testcase"
+ c++ -Wall -Werror -pedantic -o${TEMPDIR}/inodes ${TEMPDIR}/inodes.cpp || \
+ Fail "Could not compile testcase"
}
Setup
Mount
-${TEMPDIR}/inodes target || Fail "inodes"
+${TEMPDIR}/inodes || Fail "inodes"
Unmount
=====================================
tests/test_touch
=====================================
@@ -5,32 +5,53 @@
Mount
+EXPECTED_HUMAN="1970-05-23T21:21:18.000Z"
EXPECTED="12345678"
FILENAME="target/a"
+# $1 = 'a' for access time OR 'm' for modified time
+Expect() {
+ cat > ${TEMPDIR}/test_touch.c <<EOF
+#include <stdio.h>
+#include <sys/stat.h>
+
+int main(void) {
+ struct stat st;
+
+ if (stat("${FILENAME}", &st) == -1) {
+ fprintf(stderr, "ERROR: could not stat '${FILENAME}'\n");
+ return 1;
+ }
+
+ if (st.st_${1}tim.tv_sec != ${EXPECTED}) {
+ fprintf(stderr, "ASSERTION FAILED: ${1}time result=%ld != expected=${EXPECTED}\n",
+ st.st_${1}tim.tv_sec);
+ return 1;
+ }
+
+ return 0;
+}
+EOF
+ cc -Wall -Werror -pedantic -o ${TEMPDIR}/test_touch ${TEMPDIR}/test_touch.c || \
+ Fail "Could not compile test_touch.c testcase"
+ ${TEMPDIR}/test_touch
+}
+
+TEMPDIR="$(mktemp -d -t test_touch.XXXXXXXXXX)"
+trap "Unmount 2>/dev/null; rm -rf ${TEMPDIR}" EXIT
+
touch ${FILENAME}
-touch -d @${EXPECTED} ${FILENAME}
-RESULT="$(stat --format=%X-%Y ${FILENAME})"
-if [ "${RESULT}" != "${EXPECTED}-${EXPECTED}" ]
-then
- Fail "test1: Got=${RESULT} Expected=${EXPECTED}"
-fi
+touch -d ${EXPECTED_HUMAN} ${FILENAME}
+Expect m || Fail "test1: mtime"
+Expect a || Fail "test1: atime"
# This is what tar xf does for extracted files via futimens(2)
touch ${FILENAME}
-touch -m -d @${EXPECTED} ${FILENAME}
-RESULT="$(stat --format=%Y ${FILENAME})"
-if [ "${RESULT}" != "${EXPECTED}" ]
-then
- Fail "test2: Got=${RESULT} Expected=${EXPECTED}"
-fi
+touch -m -d ${EXPECTED_HUMAN} ${FILENAME}
+Expect m || Fail "test2: mtime"
touch ${FILENAME}
-touch -a -d @${EXPECTED} ${FILENAME}
-RESULT="$(stat --format=%X ${FILENAME})"
-if [ "${RESULT}" != "${EXPECTED}" ]
-then
- Fail "test3: Got=${RESULT} Expected=${EXPECTED}"
-fi
+touch -a -d ${EXPECTED_HUMAN} ${FILENAME}
+Expect a || Fail "test3: atime"
Unmount
View it on GitLab: https://salsa.debian.org/reproducible-builds/disorderfs/-/compare/70f9c2194c4da6d34532ebf3f7c102463d9aed51...a5f5d82b1f00f236433643ff2adb62a88e3583fa
--
View it on GitLab: https://salsa.debian.org/reproducible-builds/disorderfs/-/compare/70f9c2194c4da6d34532ebf3f7c102463d9aed51...a5f5d82b1f00f236433643ff2adb62a88e3583fa
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20250519/82ba643c/attachment.htm>
More information about the rb-commits
mailing list