Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Jul 2009 16:17:27 +0200
From:      Peter Schuller <peter.schuller@infidyne.com>
To:        FreeBSD-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/136940: [MAINTAINER] textproc/asciidoc: use realpath instead of GNU readlink
Message-ID:  <20090725141727.GA64139@hyperion.scode.org>
In-Reply-To: <200907202030.n6KKU41w040198@freefall.freebsd.org>
References:  <20090720202817.990213ABBA7@prometheus.scode.org> <200907202030.n6KKU41w040198@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--WYTEVAkct0FjGQmd
Content-Type: multipart/mixed; boundary="BXVAT5kNtrzKuDFl"
Content-Disposition: inline


--BXVAT5kNtrzKuDFl
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Attached is a new version of the patch. After some digging I didn't
really find a nice idiomatic way of doing this, so ended up just doing
the patching of the patched file in post-patch.

--=20
/ Peter Schuller

PGP userID: 0xE9758B7D or 'Peter Schuller <peter.schuller@infidyne.com>'
Key retrieval: Send an E-Mail to getpgpkey@scode.org
E-Mail: peter.schuller@infidyne.com Web: http://www.scode.org


--BXVAT5kNtrzKuDFl
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="patch-asciidoc_a2x_rev2.diff"
Content-Transfer-Encoding: quoted-printable

=3D=3D=3D> Generating patch
=3D=3D=3D> Viewing diff with more
diff -ruN --exclude=3DCVS /usr/ports/textproc/asciidoc.orig/Makefile /usr/p=
orts/textproc/asciidoc/Makefile
--- /usr/ports/textproc/asciidoc.orig/Makefile	2009-07-06 00:24:18.00000000=
0 +0200
+++ /usr/ports/textproc/asciidoc/Makefile	2009-07-25 16:12:44.633716190 +02=
00
@@ -7,6 +7,7 @@
=20
 PORTNAME=3D	asciidoc
 PORTVERSION=3D	8.4.5
+PORTREVISION=3D	1
 CATEGORIES=3D	textproc
 MASTER_SITES=3D	http://www.methods.co.nz/asciidoc/ \
 		SF
@@ -14,7 +15,8 @@
 MAINTAINER=3D	peter.schuller@infidyne.com
 COMMENT=3D	A text document format for writing short documents and man pages
=20
-RUN_DEPENDS=3D	bash:${PORTSDIR}/shells/bash
+RUN_DEPENDS+=3D	bash:${PORTSDIR}/shells/bash \
+		getopt>=3D0:${PORTSDIR}/misc/getopt
=20
 USE_PYTHON=3D	2.4+
 USE_GMAKE=3D	yes
@@ -32,4 +34,8 @@
 	@${REINPLACE_CMD} -e "s|/bin/bash|${LOCALBASE}/bin/bash|g" \
 		${WRKSRC}/a2x ${WRKSRC}/asciidoc.py
=20
+post-patch:
+	@${REINPLACE_CMD} -e "s|%%PREFIX%%|${LOCALBASE}|g" \
+		${WRKSRC}/a2x
+
 .include <bsd.port.mk>
diff -ruN --exclude=3DCVS /usr/ports/textproc/asciidoc.orig/files/patch-a2x=
 /usr/ports/textproc/asciidoc/files/patch-a2x
--- /usr/ports/textproc/asciidoc.orig/files/patch-a2x	1970-01-01 01:00:00.0=
00000000 +0100
+++ /usr/ports/textproc/asciidoc/files/patch-a2x	2009-07-25 16:11:07.164811=
737 +0200
@@ -0,0 +1,61 @@
+--- a2x.orig	2009-07-23 18:51:01.485493322 +0200
++++ a2x	2009-07-23 18:52:01.107211768 +0200
+@@ -9,11 +9,12 @@
+=20
+ VERSION=3D1.0.0
+ BASENAME=3D$(basename "$0")
++GETOPT=3D%%PREFIX%%/bin/getopt
+ REALNAME=3D"$0"
+ if [ ! -e "$REALNAME" ]; then
+     REALNAME=3D$(which "$REALNAME")
+ fi
+-REALNAME=3D"$(readlink -f "$REALNAME")"
++REALNAME=3D"$(/bin/realpath "$REALNAME")"
+ CONF_DIR=3D/etc/asciidoc
+ # FOP executable is named fop on some systems.
+ FOP_COMMAND=3D"fop.sh"
+@@ -244,14 +245,14 @@
+     if [ -z "$*" ]; then
+         help; exit 0
+     fi
+-    require "getopt"
+-    getopt -T >/dev/null
++    require "$GETOPT"
++    $GETOPT -T >/dev/null
+     if [ $? -ne 4 ]; then
+         quit "enhanced getopt(1) required"
+     fi
+     short_opts=3D"a:d:D:f:hLnsv"
+     long_opts=3D"attribute:,asciidoc-opts:,destination-dir:,doctype:,help=
,icons-dir:,dry-run,format:,copy,icons,skip-asciidoc,stylesheet:,unsafe,ver=
sion,verbose,xsltproc-opts:,dblatex-opts:,fop,fop-opts:,no-xmllint"
+-    args=3D$(getopt -o $short_opts -l $long_opts -n $BASENAME -- "$@" 2>/=
dev/null)
++    args=3D$($GETOPT -o $short_opts -l $long_opts -n $BASENAME -- "$@" 2>=
/dev/null)
+     if [ $? -ne 0 ]; then
+         quit "invalid command options, run: a2x --help"
+     fi
+@@ -494,7 +495,7 @@
+         quit "file not found: $xsl"
+     fi
+     to_docbook
+-    xml=3D$(readlink -f "$SRC_DIR/$SRC_NAME.xml")
++    xml=3D$(/bin/realpath "$SRC_DIR/$SRC_NAME.xml")
+     html=3D"$SRC_NAME.html"
+     copy_stylesheet_and_icons "$DESTINATION_DIR"
+     execute_command_2 "cd \"$DESTINATION_DIR\""
+@@ -527,7 +528,7 @@
+         quit "file not found: $xsl"
+     fi
+     to_docbook
+-    xml=3D$(readlink -f "$SRC_DIR/$SRC_NAME.xml")
++    xml=3D$(/bin/realpath "$SRC_DIR/$SRC_NAME.xml")
+     if [ ! -d "$chunkdir" ]; then
+         execute_command_2 "mkdir \"$chunkdir\""
+     fi
+@@ -549,7 +550,7 @@
+         quit "file not found: $xsl"
+     fi
+     to_docbook "-d manpage"
+-    xml=3D$(readlink -f "$SRC_DIR/$SRC_NAME.xml")
++    xml=3D$(/bin/realpath "$SRC_DIR/$SRC_NAME.xml")
+     execute_command_2 "cd \"$DESTINATION_DIR\""
+     execute_command_2 "xsltproc $XSLTPROC_OPTS --nonet \
+         \"$xsl\" \"$xml\""
=3D=3D=3D> Done

--BXVAT5kNtrzKuDFl--

--WYTEVAkct0FjGQmd
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (FreeBSD)

iEYEARECAAYFAkprE/YACgkQDNor2+l1i31FTACfao4Gxd5km4IvAk6ZpcP4YngQ
mKYAn3zCZaPcKXUgjkpDEAJJo6LXYZTB
=r/cA
-----END PGP SIGNATURE-----

--WYTEVAkct0FjGQmd--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090725141727.GA64139>