pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

cvs2fossil: improve example script and install it to bin/



Module Name:	pkgsrc-wip
Committed By:	Thomas Klausner <wiz%gatalith.at@localhost>
Pushed By:	wiz
Date:		Sun Jun 25 00:40:04 2023 +0200
Changeset:	8b3021f7ab557591e2e8ec5dac75df00e187d448

Modified Files:
	cvs2fossil/Makefile
	cvs2fossil/PLIST
	cvs2fossil/distinfo
	cvs2fossil/patches/patch-convert.sh
Added Files:
	cvs2fossil/patches/patch-01-import_main.c

Log Message:
cvs2fossil: improve example script and install it to bin/

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=8b3021f7ab557591e2e8ec5dac75df00e187d448

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 cvs2fossil/Makefile                       |  5 ++---
 cvs2fossil/PLIST                          |  2 +-
 cvs2fossil/distinfo                       |  3 ++-
 cvs2fossil/patches/patch-01-import_main.c | 15 +++++++++++++++
 cvs2fossil/patches/patch-convert.sh       | 32 ++++++++++++++++++++++++-------
 5 files changed, 45 insertions(+), 12 deletions(-)

diffs:
diff --git a/cvs2fossil/Makefile b/cvs2fossil/Makefile
index 8a4e5ad24b..1338de9ae9 100644
--- a/cvs2fossil/Makefile
+++ b/cvs2fossil/Makefile
@@ -13,8 +13,7 @@ DEPENDS+=	fossil1-[0-9]*:../../wip/fossil1
 
 WRKSRC=		${WRKDIR}/cvs2fossil
 
-INSTALLATION_DIRS+=	libexec/cvs2fossil
-INSTALLATION_DIRS+=	share/examples/cvs2fossil
+INSTALLATION_DIRS+=	bin libexec/cvs2fossil
 
 SUBST_CLASSES+=		prefix
 SUBST_FILES.prefix=	convert.sh
@@ -29,6 +28,6 @@ do-install:
 .for file in 01-import 02-vendorbranches 03-branchtime 04-commit
 	${INSTALL_PROGRAM} ${WRKSRC}/${file}/${file} ${DESTDIR}${PREFIX}/libexec/cvs2fossil
 .endfor
-	${INSTALL_SCRIPT} ${WRKSRC}/convert.sh ${DESTDIR}${PREFIX}/share/examples/cvs2fossil
+	${INSTALL_SCRIPT} ${WRKSRC}/convert.sh ${DESTDIR}${PREFIX}/bin/cvs2fossil
 
 .include "../../mk/bsd.pkg.mk"
diff --git a/cvs2fossil/PLIST b/cvs2fossil/PLIST
index 470749ba22..1e0252bfef 100644
--- a/cvs2fossil/PLIST
+++ b/cvs2fossil/PLIST
@@ -1,6 +1,6 @@
 @comment $NetBSD$
+bin/cvs2fossil
 libexec/cvs2fossil/01-import
 libexec/cvs2fossil/02-vendorbranches
 libexec/cvs2fossil/03-branchtime
 libexec/cvs2fossil/04-commit
-share/examples/cvs2fossil/convert.sh
diff --git a/cvs2fossil/distinfo b/cvs2fossil/distinfo
index b82b313cd7..21adace434 100644
--- a/cvs2fossil/distinfo
+++ b/cvs2fossil/distinfo
@@ -3,6 +3,7 @@ $NetBSD$
 BLAKE2s (cvs2fossil-20140502.tar.gz) = 275555dc446eedb1c50bbb446391e72dac23fea5b55b078fba54a53d5fad11e2
 SHA512 (cvs2fossil-20140502.tar.gz) = dc5f64c5af0fe6a35143244c2858dcccd4ad2131fb5e375132ffc9071dfcff8984fdbb9664f774238ddd2c14c5155686e2c99962753131a3f5cd2f58f0d19a3d
 Size (cvs2fossil-20140502.tar.gz) = 1258545 bytes
+SHA1 (patch-01-import_main.c) = 6177f632e9a7213e9aff911e28ac04378102fae5
 SHA1 (patch-04-commit_main.c) = a7afef765fca714dfe672ab7207789d91cd839c8
 SHA1 (patch-common_common.h) = 625959ee61513df52696987c9fba2abb83c91262
-SHA1 (patch-convert.sh) = 732fe531076784dd09ab5a90771581784c288e43
+SHA1 (patch-convert.sh) = fd8d6ec9875f4ac250985fcc0ba01589b507c401
diff --git a/cvs2fossil/patches/patch-01-import_main.c b/cvs2fossil/patches/patch-01-import_main.c
new file mode 100644
index 0000000000..f96a2eeb1e
--- /dev/null
+++ b/cvs2fossil/patches/patch-01-import_main.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Fix usage to match supported options.
+
+--- 01-import/main.c.orig	2011-04-18 23:32:07.000000000 +0000
++++ 01-import/main.c
+@@ -772,7 +772,7 @@ parsedir(sqlite3 *db, const char *path, 
+ static void
+ usage(void)
+ {
+-	fprintf(stderr, "Usage: %s [-aqs] database directory", getprogname());
++	fprintf(stderr, "Usage: %s [-amqs] database directory", getprogname());
+ 	exit(1);
+ }
+ 
diff --git a/cvs2fossil/patches/patch-convert.sh b/cvs2fossil/patches/patch-convert.sh
index c1c35f5c9b..112a6bd650 100644
--- a/cvs2fossil/patches/patch-convert.sh
+++ b/cvs2fossil/patches/patch-convert.sh
@@ -1,27 +1,45 @@
 $NetBSD$
 
-Adapt example for pkgsrc paths.
+Adapt script for pkgsrc paths, make arguments available from command line.
 
 --- convert.sh.orig	2011-02-15 18:57:40.000000000 +0000
 +++ convert.sh
-@@ -4,6 +4,7 @@
+@@ -1,18 +1,29 @@
+ #!/bin/sh
  
+-# Sample conversion script
+-
  set -e
  
+-db=/home/joerg/repo/src-new
+-repo=/home/joerg/repo/netbsd/src
++strip=""
++if [ "$#" > 1 ] && [ "$1" = -m ]
++then
++	shift
++	strip=-m
++fi
++if [ "$#" != 2 ]
++then
++	echo usage: $0 [-m] source-cvs-rsync-path target-path >&2
++	exit 1
++fi
++
 +PATH=@PREFIX@/libexec/cvs2fossil:$PATH
- db=/home/joerg/repo/src-new
- repo=/home/joerg/repo/netbsd/src
++db="$2"
++repo="$1"
  fossil=$db.fossil
-@@ -12,7 +13,7 @@ fossil=$db.fossil
+ 
+ #
  # If you want the module name itself to be skipped, add -m.
  # Instead of e.g. src/bin/... as path, this will create only bin/...
  #
 -time 01-import/01-import $db $repo
-+time 01-import $db $repo
++time 01-import "$strip" $db $repo
  oldest=$(echo 'SELECT datetime(r.date,"-1 second") FROM revision r ORDER BY r.date LIMIT 1;' | sqlite3 $db)
  
  #
-@@ -35,14 +36,14 @@ oldest=$(echo 'SELECT datetime(r.date,"-
+@@ -35,14 +46,14 @@ oldest=$(echo 'SELECT datetime(r.date,"-
  #  revision IN (SELECT revision.id FROM revision WHERE date > "1998-05-01");
  #EOF
  


Home | Main Index | Thread Index | Old Index