[packages/cvs-fast-export] - updated to 1.68; patch+flag to allow build with 32-bit time_t

qboosh qboosh at pld-linux.org
Fri Nov 8 08:00:20 CET 2024


commit dd1be6e29b5200acc6246da5ff26330adafe4e6d
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Nov 8 06:37:50 2024 +0100

    - updated to 1.68; patch+flag to allow build with 32-bit time_t

 cvs-fast-export-asan.patch  |  20 -------
 cvs-fast-export-tsan.patch  | 137 --------------------------------------------
 cvs-fast-export-ubsan.patch |  39 -------------
 cvs-fast-export-warn.patch  |  51 +++++++++++++++++
 cvs-fast-export.spec        |  12 ++--
 5 files changed, 55 insertions(+), 204 deletions(-)
---
diff --git a/cvs-fast-export.spec b/cvs-fast-export.spec
index bd75cb6..93a15a7 100644
--- a/cvs-fast-export.spec
+++ b/cvs-fast-export.spec
@@ -5,16 +5,14 @@
 Summary:	Tool to export CVS history into a fast-import stream
 Summary(pl.UTF-8):	Narzędzie eksportujące historię CVS w postaci strumienia fast-import
 Name:		cvs-fast-export
-Version:	1.67
+Version:	1.68
 Release:	1
 License:	GPL v2
 Group:		Development/Version Control
 Source0:	http://www.catb.org/~esr/cvs-fast-export/%{name}-%{version}.tar.gz
-# Source0-md5:	2eac6a0f2e24726ebc7289fff7415f3c
+# Source0-md5:	b92766afa090c8de1f4bd0e5067a7da0
 Patch0:		hack-disable-cvsignore.patch
-Patch1:		%{name}-tsan.patch
-Patch2:		%{name}-asan.patch
-Patch3:		%{name}-ubsan.patch
+Patch1:		%{name}-warn.patch
 URL:		http://www.catb.org/~esr/cvs-fast-export/
 BuildRequires:	asciidoc
 BuildRequires:	sed >= 4.0
@@ -49,15 +47,13 @@ ze zdalnych serwerów CVS.
 %setup -q
 %patch0 -p1
 %patch1 -p1
-%patch2 -p1
-%patch3 -p1
 
 %{__sed} -i -e '1s,/usr/bin/env python3$,%{__python3},' cvsconvert cvsstrip
 
 %build
 %{__make} cvs-fast-export man \
 	CC="%{__cc}" \
-	EXTRA_CFLAGS="%{rpmcflags}" \
+	EXTRA_CFLAGS="%{rpmcflags} -Wno-error=type-limits" \
 	LDFLAGS="%{rpmldflags}"
 
 %if %{with tests}
diff --git a/cvs-fast-export-asan.patch b/cvs-fast-export-asan.patch
deleted file mode 100644
index c5f056f..0000000
--- a/cvs-fast-export-asan.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- cvs-fast-export-1.66/export.c.orig	2024-04-07 15:56:24.234143317 +0200
-+++ cvs-fast-export-1.66/export.c	2024-04-07 15:59:49.626363945 +0200
-@@ -182,7 +182,7 @@ static void export_blob(node_t *node, vo
- 				*cp = '\n';
- 			}
- 		}
--		if (strlen(cbuf) >= 2 && cbuf[0] == '!' && cbuf[1] == '\n') {
-+		if (strnlen(cbuf, len) >= 2 && cbuf[0] == '!' && cbuf[1] == '\n') {
- 			extralen = 0;
- 			cbuf += 2;
- 			clen -= 2;
-@@ -724,7 +724,7 @@ static struct commit_seq *canonicalize(g
- 	(((struct commit_seq *)x)->commit->date <                              \
- 	 ((struct commit_seq *)y)->commit->date)
- 		/* back up as far as we can */
--		while (!is_parent_of(bp - 1, hp) &&
-+		while ((bp > history) && !is_parent_of(bp - 1, hp) &&
- 		       !is_branchroot_of(bp - 1, hp) &&
- 		       !is_older_than(bp - 1, hp)) {
- 			bp--;
diff --git a/cvs-fast-export-tsan.patch b/cvs-fast-export-tsan.patch
deleted file mode 100644
index 87b3294..0000000
--- a/cvs-fast-export-tsan.patch
+++ /dev/null
@@ -1,137 +0,0 @@
---- cvs-fast-export-1.66/atom.c.orig	2024-04-07 15:44:05.728144147 +0200
-+++ cvs-fast-export-1.66/atom.c	2024-04-07 15:49:33.189703469 +0200
-@@ -100,24 +100,24 @@ const char *atom(const char *string)
- 	hash_bucket_t *b;
- 	int len;
- 
-+#ifdef THREADS
-+	if (threads > 1) {
-+		pthread_mutex_lock(&bucket_mutex);
-+	}
-+#endif /* THREADS */
- 	while ((b = *head)) {
- 	collision:
- 		if (b->hash == hash && !strcmp(string, b->string)) {
-+#ifdef THREADS
-+			if (threads > 1) {
-+				pthread_mutex_unlock(&bucket_mutex);
-+			}
-+#endif /* THREADS */
- 			return b->string;
- 		}
- 		head = &(b->next);
- 	}
--#ifdef THREADS
--	if (threads > 1) {
--		pthread_mutex_lock(&bucket_mutex);
--	}
--#endif /* THREADS */
- 	if ((b = *head)) {
--#ifdef THREADS
--		if (threads > 1) {
--			pthread_mutex_unlock(&bucket_mutex);
--		}
--#endif /* THREADS */
- 		goto collision;
- 	}
- 
-@@ -157,24 +157,24 @@ const cvs_number *atom_cvs_number(const
- 	number_bucket_t **head = &number_buckets[bucket];
- 	number_bucket_t *b;
- 
-+#ifdef THREADS
-+	if (threads > 1) {
-+		pthread_mutex_lock(&number_bucket_mutex);
-+	}
-+#endif /* THREADS */
- 	while ((b = *head)) {
- 	collision:
- 		if (cvs_number_equal(&b->number, &n)) {
-+#ifdef THREADS
-+			if (threads > 1) {
-+				pthread_mutex_unlock(&number_bucket_mutex);
-+			}
-+#endif /* THREADS */
- 			return &b->number;
- 		}
- 		head = &(b->next);
- 	}
--#ifdef THREADS
--	if (threads > 1) {
--		pthread_mutex_lock(&number_bucket_mutex);
--	}
--#endif /* THREADS */
- 	if ((b = *head)) {
--#ifdef THREADS
--		if (threads > 1) {
--			pthread_mutex_unlock(&number_bucket_mutex);
--		}
--#endif /* THREADS */
- 		goto collision;
- 	}
- 
---- cvs-fast-export-1.66/revcvs.c.orig	2024-04-07 15:44:05.731477463 +0200
-+++ cvs-fast-export-1.66/revcvs.c	2024-04-07 15:56:06.944236984 +0200
-@@ -22,6 +22,9 @@
- #endif
- 
- const master_dir *root_dir = NULL;
-+#ifdef THREADS
-+static pthread_mutex_t root_dir_mutex = PTHREAD_MUTEX_INITIALIZER;
-+#endif
- 
- static const char *fileop_name(const char *rectified) {
- 	size_t rlen = strlen(rectified);
-@@ -79,24 +82,24 @@ static const master_dir *atom_dir(const
- 	dir_bucket **head = &dir_buckets[HASH_VALUE(dirname) % DIR_BUCKETS];
- 	dir_bucket *b;
- 
-+#ifdef THREADS
-+	if (threads > 1) {
-+		pthread_mutex_lock(&dir_bucket_mutex);
-+	}
-+#endif /* THREADS */
- 	while ((b = *head)) {
- 	collision:
- 		if (b->dir.name == dirname) {
-+#ifdef THREADS
-+			if (threads > 1) {
-+				pthread_mutex_unlock(&dir_bucket_mutex);
-+			}
-+#endif /* THREADS */
- 			return &(b->dir);
- 		}
- 		head = &(b->next);
- 	}
--#ifdef THREADS
--	if (threads > 1) {
--		pthread_mutex_lock(&dir_bucket_mutex);
--	}
--#endif /* THREADS */
- 	if ((b = *head)) {
--#ifdef THREADS
--		if (threads > 1) {
--			pthread_mutex_unlock(&dir_bucket_mutex);
--		}
--#endif /* THREADS */
- 		goto collision;
- 	}
- 	b = xmalloc(sizeof(dir_bucket), __func__);
-@@ -859,9 +862,17 @@ cvs_commit *cvs_master_digest(cvs_file *
- 	cvs_branch *cb;
- 	cvs_version *ctrunk = NULL;
- 
-+#ifdef THREADS
-+    if (threads > 1)
-+	pthread_mutex_lock(&root_dir_mutex);
-+#endif
- 	if (!root_dir) {
- 		root_dir = atom_dir(atom("\0"));
- 	}
-+#ifdef THREADS
-+    if (threads > 1)
-+	pthread_mutex_unlock(&root_dir_mutex);
-+#endif
- 	build_rev_master(cvs, master);
- #if CVSDEBUG
- 	char buf[CVS_MAX_REV_LEN];
diff --git a/cvs-fast-export-ubsan.patch b/cvs-fast-export-ubsan.patch
deleted file mode 100644
index e2dd37a..0000000
--- a/cvs-fast-export-ubsan.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- cvs-fast-export-1.66/treepack.c.orig	2024-04-07 16:00:03.669621200 +0200
-+++ cvs-fast-export-1.66/treepack.c	2024-04-07 16:01:11.059256119 +0200
-@@ -210,6 +210,7 @@ void revdir_pack_init(void) {
- 	frame = frames;
- 	nfiles = 0;
- 	frames[0].dir = root_dir;
-+	frames[0].dirs = xmalloc(0, __func__);
- 	frames[0].ndirs = 0;
- 	frames[0].hash = hash_init();
- }
-@@ -253,6 +254,7 @@ void revdir_pack_add(const cvs_commit *f
- 
- 			const master_dir *parent = frame++->dir;
- 			frame->dir = first_subdir(dir, parent);
-+			frame->dirs = xmalloc(0, __func__);
- 			frame->ndirs = 0;
- 			frame->hash = hash_init();
- 			continue;
---- cvs-fast-export-1.66/generate.c.orig	2024-04-07 16:00:03.669621200 +0200
-+++ cvs-fast-export-1.66/generate.c	2024-04-07 16:02:04.075635571 +0200
-@@ -1158,7 +1158,7 @@ static node_t *generate_setup(generator_
- 		eb->Gfilename = gen->master_name;
- 		eb->Gexpand = gen->expand;
- 		eb->Gabspath = NULL;
--		Gline(eb) = NULL;
-+		Gline(eb) = xmalloc(0, __func__);
- 		Ggap(eb) = Ggapsize(eb) = Glinemax(eb) = 0;
- 	}
- 
---- cvs-fast-export-1.66/import.c.orig	2024-04-07 16:00:03.669621200 +0200
-+++ cvs-fast-export-1.66/import.c	2024-04-07 16:02:53.108703269 +0200
-@@ -347,6 +347,7 @@ void analyze_masters(int argc, const cha
- 	striplen = analyzer->striplen;
- 
- 	forest->textsize = forest->filecount = 0;
-+	forest->is_cvs = false;
- 	progress_begin("Reading file list...", NO_MAX);
- 	for (;;) {
- 		struct stat stb;
diff --git a/cvs-fast-export-warn.patch b/cvs-fast-export-warn.patch
new file mode 100644
index 0000000..481a511
--- /dev/null
+++ b/cvs-fast-export-warn.patch
@@ -0,0 +1,51 @@
+--- cvs-fast-export-1.68/lex.l.orig	2024-06-02 02:28:02.000000000 +0200
++++ cvs-fast-export-1.68/lex.l	2024-11-06 21:53:41.007437796 +0100
+@@ -324,10 +324,10 @@ cvstime_t lex_date(const cvs_number *con
+ 		}
+ 		fprintf(stderr, "\n");
+ 	}
+-	if (d < RCS_EPOCH)
++	if (d < (int64_t)RCS_EPOCH)
+ 		fatal_error("%s: (%d) date before RCS epoch: ",
+ 		            cvs->gen.master_name, yyget_lineno(yyscanner));
+-	else if (d >= RCS_OMEGA)
++	else if (d >= (int64_t)RCS_OMEGA)
+ 		fatal_error("%s: (%d) date too far in future: ",
+ 		            cvs->gen.master_name, yyget_lineno(yyscanner));
+ 	return d - RCS_EPOCH;
+--- cvs-fast-export-1.68/export.c.orig	2024-11-06 22:00:05.052023915 +0100
++++ cvs-fast-export-1.68/export.c	2024-11-07 21:39:16.320719897 +0100
+@@ -554,7 +554,7 @@ static void export_commit(git_commit *co
+ 				/* should never happen */
+ 				fatal_error("internal error: child commit "
+ 				            "emitted before parent exists");
+-			} else if (opts->fromtime < commit->parent->date) {
++			} else if (opts->fromtime < (int64_t)commit->parent->date) {
+ 				printf("from :%d\n",
+ 				       (int)markmap[commit->parent->serial]);
+ 			}
+@@ -842,13 +842,13 @@ void export_commits(forest_t *forest, ex
+ 	     hp++) {
+ 		bool report = true;
+ 		if (opts->fromtime > 0) {
+-			if (opts->fromtime >= display_date(hp->commit, mark + 1,
++			if (opts->fromtime >= (int64_t)display_date(hp->commit, mark + 1,
+ 			                                   opts->force_dates)) {
+ 				report = false;
+ 			} else if (!hp->realized) {
+ 				struct commit_seq *lp;
+ 				if (hp->commit->parent != NULL &&
+-				    display_date(
++				    (int64_t)display_date(
+ 				        hp->commit->parent,
+ 				        markmap[hp->commit->parent->serial],
+ 				        opts->force_dates) < opts->fromtime) {
+@@ -870,7 +870,7 @@ void export_commits(forest_t *forest, ex
+ 		export_commit(hp->commit, hp->head->ref_name, report, opts);
+ 		for (t = all_tags; t; t = t->next) {
+ 			if (t->commit == hp->commit &&
+-			    display_date(hp->commit,
++			    (int64_t)display_date(hp->commit,
+ 			                 markmap[hp->commit->serial],
+ 			                 opts->force_dates) > opts->fromtime) {
+ 				printf("reset refs/tags/%s\nfrom :%d\n\n",
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/cvs-fast-export.git/commitdiff/dd1be6e29b5200acc6246da5ff26330adafe4e6d



More information about the pld-cvs-commit mailing list