summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Vogel <jvogel@stygian.me>2024-12-14 13:54:01 -0500
committerJohn Vogel <jvogel@stygian.me>2024-12-14 13:54:01 -0500
commitc6f27c7035b185bac7256a329a620b8f9ea72227 (patch)
treeec136442232ed8052f15af8baa4699ce38e6cad4
parent05e1d5340bd967a2e898341ffa02cabe1b39e098 (diff)
downloadforked-aports-c6f27c7035b185bac7256a329a620b8f9ea72227.tar.gz
local/cvs-fast-export: new aport
-rw-r--r--cvs-fast-export/0001-Allow-in-branch-names.patch26
-rw-r--r--cvs-fast-export/0002-Address-GitLab-issue-69-Segfault-due-to-uninitialize.patch33
-rw-r--r--cvs-fast-export/0003-xalloc.xmalloc-argument-cleanup.patch28
-rw-r--r--cvs-fast-export/0004-Address-GitLab-bug-70-xmalloc-xcalloc-bad-parameter-.patch50
-rw-r--r--cvs-fast-export/0005-xcalloc-argument-cleanup.patch28
-rw-r--r--cvs-fast-export/APKBUILD56
6 files changed, 221 insertions, 0 deletions
diff --git a/cvs-fast-export/0001-Allow-in-branch-names.patch b/cvs-fast-export/0001-Allow-in-branch-names.patch
new file mode 100644
index 0000000..a886126
--- /dev/null
+++ b/cvs-fast-export/0001-Allow-in-branch-names.patch
@@ -0,0 +1,26 @@
+From bc0138caf12f9d214b085ce6f207684e61eabdcc Mon Sep 17 00:00:00 2001
+From: "Eric S. Raymond" <esr@thyrsus.com>
+Date: Mon, 23 Sep 2024 18:37:28 -0400
+Subject: [PATCH 1/4] Allow ' in branch names.
+
+Addresses GitLab bug #66: cvs-fast-export does not handle branch/tag name with apostrophe
+---
+ lex.l | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lex.l b/lex.l
+index 1efecdb..5f985a5 100644
+--- a/lex.l
++++ b/lex.l
+@@ -80,7 +80,7 @@ YY_DECL;
+ BEGIN(INITIAL);
+ return TEXT_DATA;
+ }
+-<CONTENT>[-a-zA-Z_+%][-a-zA-Z_0-9+/%=.~^\\*?#!\[\]()<>]* {
++<CONTENT>[-a-zA-Z_+%][-a-zA-Z_0-9+/%=.~^\\*?#!'\[\]()<>]* {
+ /* CVS-like tag identifiers */
+ fast_export_sanitize(yyscanner, cvs);
+ yylval->atom = atom(yytext);
+--
+2.47.1
+
diff --git a/cvs-fast-export/0002-Address-GitLab-issue-69-Segfault-due-to-uninitialize.patch b/cvs-fast-export/0002-Address-GitLab-issue-69-Segfault-due-to-uninitialize.patch
new file mode 100644
index 0000000..bca9277
--- /dev/null
+++ b/cvs-fast-export/0002-Address-GitLab-issue-69-Segfault-due-to-uninitialize.patch
@@ -0,0 +1,33 @@
+From 160f2478f28f36b536ffbc2a1b2cd8e5053106eb Mon Sep 17 00:00:00 2001
+From: "Eric S. Raymond" <esr@thyrsus.com>
+Date: Tue, 15 Oct 2024 13:25:18 -0400
+Subject: [PATCH 2/4] Address GitLab issue #69: Segfault due to uninitialized
+ pack_frame->sdirs
+
+---
+ treepack.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/treepack.c b/treepack.c
+index fc8b76c..b385460 100644
+--- a/treepack.c
++++ b/treepack.c
+@@ -212,6 +212,7 @@ void revdir_pack_init(void) {
+ frames[0].dir = root_dir;
+ frames[0].dirs = xmalloc(0, __func__);
+ frames[0].ndirs = 0;
++ frame->sdirs = 0;
+ frames[0].hash = hash_init();
+ }
+
+@@ -256,6 +257,7 @@ void revdir_pack_add(const cvs_commit *file, const master_dir *dir) {
+ frame->dir = first_subdir(dir, parent);
+ frame->dirs = xmalloc(0, __func__);
+ frame->ndirs = 0;
++ frame->sdirs = 0;
+ frame->hash = hash_init();
+ continue;
+ }
+--
+2.47.1
+
diff --git a/cvs-fast-export/0003-xalloc.xmalloc-argument-cleanup.patch b/cvs-fast-export/0003-xalloc.xmalloc-argument-cleanup.patch
new file mode 100644
index 0000000..4554d5c
--- /dev/null
+++ b/cvs-fast-export/0003-xalloc.xmalloc-argument-cleanup.patch
@@ -0,0 +1,28 @@
+From 93d2ed1814d2c9e8425ba318c81c36db5ff4b58f Mon Sep 17 00:00:00 2001
+From: "Eric S. Raymond" <esr@thyrsus.com>
+Date: Tue, 15 Oct 2024 14:06:43 -0400
+Subject: [PATCH 3/4] xalloc.xmalloc argument cleanup.
+
+Problems reveaked by -Werror.
+---
+ import.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/import.c b/import.c
+index 15f1134..2a13c09 100644
+--- a/import.c
++++ b/import.c
+@@ -410,8 +410,8 @@ void analyze_masters(int argc, const char *argv[], import_options_t *analyzer,
+ }
+ forest->filecount = total_files;
+
+- generators = xcalloc(sizeof(generator_t), total_files, "Generators");
+- sorted_files = xmalloc(sizeof(rev_file) * total_files, "sorted_files");
++ generators = xcalloc(total_files, sizeof(generator_t), "Generators");
++ sorted_files = xcalloc(total_files, sizeof(rev_file), "sorted_files");
+ cvs_masters = xcalloc(total_files, sizeof(cvs_master), "cvs_masters");
+ rev_masters = xmalloc(sizeof(rev_master) * total_files, "rev_masters");
+ fn_n = total_files;
+--
+2.47.1
+
diff --git a/cvs-fast-export/0004-Address-GitLab-bug-70-xmalloc-xcalloc-bad-parameter-.patch b/cvs-fast-export/0004-Address-GitLab-bug-70-xmalloc-xcalloc-bad-parameter-.patch
new file mode 100644
index 0000000..1e71c11
--- /dev/null
+++ b/cvs-fast-export/0004-Address-GitLab-bug-70-xmalloc-xcalloc-bad-parameter-.patch
@@ -0,0 +1,50 @@
+From f0c3155affc1f3242677b2107431a55cc706805a Mon Sep 17 00:00:00 2001
+From: "Eric S. Raymond" <esr@thyrsus.com>
+Date: Tue, 15 Oct 2024 14:26:32 -0400
+Subject: [PATCH 4/4] Address GitLab bug #70: xmalloc/xcalloc bad parameter
+ sizes...
+
+...seize compilation with -Werror (default).
+---
+ generate.c | 2 +-
+ treepack.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/generate.c b/generate.c
+index 3cf7bd6..cd3994a 100644
+--- a/generate.c
++++ b/generate.c
+@@ -1066,7 +1066,7 @@ static node_t *generate_setup(generator_t *gen) {
+ eb->Gfilename = gen->master_name;
+ eb->Gexpand = gen->expand;
+ eb->Gabspath = NULL;
+- Gline(eb) = xmalloc(0, __func__);
++ Gline(eb) = NULL;
+ Ggap(eb) = Ggapsize(eb) = Glinemax(eb) = 0;
+ }
+
+diff --git a/treepack.c b/treepack.c
+index b385460..06d6d2f 100644
+--- a/treepack.c
++++ b/treepack.c
+@@ -210,7 +210,7 @@ void revdir_pack_init(void) {
+ frame = frames;
+ nfiles = 0;
+ frames[0].dir = root_dir;
+- frames[0].dirs = xmalloc(0, __func__);
++ frames[0].dirs = NULL;
+ frames[0].ndirs = 0;
+ frame->sdirs = 0;
+ frames[0].hash = hash_init();
+@@ -255,7 +255,7 @@ void revdir_pack_add(const cvs_commit *file, const master_dir *dir) {
+
+ const master_dir *parent = frame++->dir;
+ frame->dir = first_subdir(dir, parent);
+- frame->dirs = xmalloc(0, __func__);
++ frame->dirs = NULL;
+ frame->ndirs = 0;
+ frame->sdirs = 0;
+ frame->hash = hash_init();
+--
+2.47.1
+
diff --git a/cvs-fast-export/0005-xcalloc-argument-cleanup.patch b/cvs-fast-export/0005-xcalloc-argument-cleanup.patch
new file mode 100644
index 0000000..30bd15e
--- /dev/null
+++ b/cvs-fast-export/0005-xcalloc-argument-cleanup.patch
@@ -0,0 +1,28 @@
+From b575cfb478df8b6b6bb81b149178fd66401788b1 Mon Sep 17 00:00:00 2001
+From: John Vogel <jvogel@stygian.me>
+Date: Sat, 14 Dec 2024 03:19:13 -0500
+Subject: [PATCH] xcalloc argument cleanup.
+
+---
+ export.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/export.c b/export.c
+index 24c6161..5ab1ad7 100644
+--- a/export.c
++++ b/export.c
+@@ -798,9 +798,9 @@ void export_commits(forest_t *forest, export_options_t *opts,
+
+ export_stats.export_total_commits = export_ncommit(rl);
+ /* the +1 is because mark indices are 1-origin, slot 0 always empty */
+- markmap = (serial_t *)xcalloc(sizeof(serial_t),
+- forest->total_revisions +
++ markmap = (serial_t *)xcalloc(forest->total_revisions +
+ export_stats.export_total_commits + 1,
++ sizeof(serial_t),
+ "markmap allocation");
+
+ progress_begin("Generating snapshots...", forest->filecount);
+--
+2.47.1
+
diff --git a/cvs-fast-export/APKBUILD b/cvs-fast-export/APKBUILD
new file mode 100644
index 0000000..3c7bc19
--- /dev/null
+++ b/cvs-fast-export/APKBUILD
@@ -0,0 +1,56 @@
+# Contributor: TBK <alpine@jjtc.eu>
+# Maintainer: TBK <alpine@jjtc.eu>
+pkgname=cvs-fast-export
+pkgver=1.68
+pkgrel=0
+pkgdesc="Export RCS or CVS history as a fast-import stream"
+url="http://www.catb.org/esr/cvs-fast-export/"
+arch="all"
+license="GPL-2.0-or-later"
+depends="cvs rcs"
+makedepends="asciidoctor bison flex libxslt"
+checkdepends="python3"
+subpackages="$pkgname-doc $pkgname-tools::noarch"
+source="https://gitlab.com/esr/cvs-fast-export/-/archive/$pkgver/cvs-fast-export-$pkgver.tar.gz
+ 0001-Allow-in-branch-names.patch
+ 0002-Address-GitLab-issue-69-Segfault-due-to-uninitialize.patch
+ 0003-xalloc.xmalloc-argument-cleanup.patch
+ 0004-Address-GitLab-bug-70-xmalloc-xcalloc-bad-parameter-.patch
+ 0005-xcalloc-argument-cleanup.patch
+ "
+options="!check" # take 50 years
+
+build() {
+ # "make all" will run the commands below + html.
+ # html can not run in parallel because the ".adoc.html"
+ # rules reuse the "docbook-xsl.css" file name.
+ make cvs-fast-export man
+}
+
+check() {
+ # v1.55 - More then one job and the tests
+ # are executed in the wrong order!
+ make -j 1 check
+}
+
+package() {
+ make DESTDIR="$pkgdir" prefix=/usr install
+}
+
+tools() {
+ pkgdesc="$pkgdesc (extra tools)"
+ depends="$pkgname=$pkgver-r$pkgrel git python3 rsync"
+
+ amove \
+ usr/bin/cvsconvert \
+ usr/bin/cvssync
+}
+
+sha512sums="
+f967c3d2cda2c5ba4c14fdd33923807690d7b8e85e19aceb6f9580cb74a15af32291324675cdd10d72cbd160a0e18be980bb0442e99e9cd63daad8d76dd848f6 cvs-fast-export-1.68.tar.gz
+5cafafb64d010cca9b5f3d394dcb93e1ab12315064c2dbbbebdfec42dd4fbd00126d44521f423338ed05163e493f3d4f458953bae2fbdb29c2bfa08f13822d0f 0001-Allow-in-branch-names.patch
+46ad8751ec7c7581780650309e18c4ccacc2dca94ca4a0d0d7976b04034222e644964637e45db490d12e1547e2863527031794ab89d3132cf738a600c9843219 0002-Address-GitLab-issue-69-Segfault-due-to-uninitialize.patch
+48d698ca403d9fff8624a6ce09238f441ff4225664d8bdf9824dc2d9d857ceffd6495ad7a7c0b5f4c7e0c8c8d1dbd84504996a992dca559f7386924d3e6c1ec4 0003-xalloc.xmalloc-argument-cleanup.patch
+a9f4a526901cb7ee26e543628cf63e7eb3e9cbe64a67057541f529c49169a243a9b2b5daa3b6c2fe5c7080fcac636a0ede8e247ccf34fd9cf0af15bdb297af47 0004-Address-GitLab-bug-70-xmalloc-xcalloc-bad-parameter-.patch
+ce5bfad4edbf0fdf0bc3692b2cfc1a220a01f8026c127533efb5166e2f61496c3a67455db3fbb5c69ab0299979a19960ae2265d64df8c47bbce48684313f5cd3 0005-xcalloc-argument-cleanup.patch
+"