Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jul 2006 09:12:20 +1000 (EST)
From:      Edwin Groothuis <edwin@mavetju.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/100584: sysutils/portsnap - cleanup
Message-ID:  <20060719231220.5D922F7@k7.mavetju>
Resent-Message-ID: <200607192320.k6JNKGtA014044@freefall.freebsd.org>

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

>Number:         100584
>Category:       ports
>Synopsis:       sysutils/portsnap - cleanup
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 19 23:20:16 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Edwin Groothuis
>Release:        FreeBSD 6.1-RELEASE i386
>Organization:
-
>Environment:
System: FreeBSD k7.mavetju 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sun May 7 04:42:56 UTC 2006 root@opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386


>Description:

- move pkg-message to files/pkg-message.in and use SUB_FILES
- move post-extract to post-patch and use REINPLACE_CMD
- replace ${PREFIX} in man-page with %%PREFIX%% and then REINPLACE_CMD
  over it.
- Make replacement in former post-extract actually work due to
  changed layout of the file.

>How-To-Repeat:
>Fix:

Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/sysutils/portsnap/Makefile,v
retrieving revision 1.15
diff -u -r1.15 Makefile
--- Makefile	26 May 2006 23:36:12 -0000	1.15
+++ Makefile	19 Jul 2006 23:10:17 -0000
@@ -31,15 +31,12 @@
 		libexec/phttpget				\
 		libexec/make_index portsnap/.package.this.directory
 PLIST_DIRS=	portsnap
-
+SUB_FILES=	pkg-message
 PKGMESSAGE=	${WRKDIR}/pkg-message
 
-post-extract:
-	${SED} -e "s#PREFIX=/usr/local#PREFIX=${PREFIX}#g" \
-		${WRKSRC}/portsnap > ${WRKSRC}/portsnap.new
-	${MV} ${WRKSRC}/portsnap.new ${WRKSRC}/portsnap
-	@${SED} -e "s=%%PREFIX%%=${PREFIX}=g" ${PKGDIR}/pkg-message \
-		> ${PKGMESSAGE}
+post-patch:
+	${REINPLACE_CMD} -e "s,%%PREFIX%%,${PREFIX},g" \
+		${WRKSRC}/portsnap ${WRKSRC}/portsnap.8
 
 do-install:
 	${INSTALL_SCRIPT} ${WRKSRC}/portsnap ${PREFIX}/sbin
Index: pkg-message
===================================================================
RCS file: pkg-message
diff -N pkg-message
--- pkg-message	20 Mar 2005 09:38:26 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,20 +0,0 @@
-
-Before you can use portsnap, you will have to create an update configuration
-file specifying the server from which to fetch snapshots and the sha256 hash
-of the openssl public key which is trusted to sign the snapshots.
-
-A sample configuration file has been installed in
-
-	%%PREFIX%%/etc/portsnap.conf.sample
-
-which will fetch snapshots built and signed by the author.  If you want to
-use these updates, copy that file to
-
-	%%PREFIX%%/etc/portsnap.conf
-
-otherwise, create that file as appropriate.
-
-NOTE TO USERS UPGRADING FROM PORTSNAP 0.3.1 OR EARLIER:  The structure
-of the portsnap configuration file has changed; you will have to replace
-your existing portsnap.conf with a new version.
- 
Index: files/patch-portsnap
===================================================================
RCS file: files/patch-portsnap
diff -N files/patch-portsnap
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-portsnap	19 Jul 2006 23:10:17 -0000
@@ -0,0 +1,11 @@
+--- portsnap.orig	Thu Jul 20 09:00:57 2006
++++ portsnap	Thu Jul 20 09:01:14 2006
+@@ -81,7 +81,7 @@
+ 	NDEBUG=""
+ 	DDSTATS=""
+ 	INDEXONLY=""
+-	PREFIX="/usr/local"
++	PREFIX="%%PREFIX%%"
+ 	SERVERNAME=""
+ 	REFUSE=""
+ 	LOCALDESC=""
Index: files/patch-portsnap.8
===================================================================
RCS file: files/patch-portsnap.8
diff -N files/patch-portsnap.8
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-portsnap.8	19 Jul 2006 23:10:17 -0000
@@ -0,0 +1,41 @@
+--- portsnap.8.orig	Sat May 27 09:21:29 2006
++++ portsnap.8	Thu Jul 20 09:06:29 2006
+@@ -57,13 +57,13 @@
+ Store working files (e.g. downloaded updates) in
+ .Ar workdir .
+ (default:
+-.Pa $PREFIX/portsnap ,
++.Pa %%PREFIX%%/portsnap ,
+ or as given in the configuration file.)
+ .It Fl f Ar conffile
+ Read the configuration from from
+ .Ar conffile .
+ (default:
+-.Pa $PREFIX/etc/portsnap.conf )
++.Pa %%PREFIX%%/etc/portsnap.conf )
+ .It Fl I
+ For the
+ .Cm update
+@@ -157,7 +157,7 @@
+ .It
+ If your clock is set to local time, adding the line
+ .Pp
+-.Dl 0 3 * * * root /usr/local/sbin/portsnap cron
++.Dl 0 3 * * * root /foo/sbin/portsnap cron
+ .Pp
+ to /etc/crontab is a good way to make sure you always have
+ an up-to-date snapshot of the ports tree available which
+@@ -218,10 +218,10 @@
+ may be published, but only in aggregate and after anonymizing the
+ individual systems.
+ .Sh FILES
+-.Bl -tag -width "$PREFIX/etc/portsnap.conf"
+-.It $PREFIX/etc/portsnap.conf
++.Bl -tag -width "%%PREFIX%%/etc/portsnap.conf"
++.It %%PREFIX%%/etc/portsnap.conf
+ Default location of the portsnap configuration file.
+-.It $PREFIX/portsnap
++.It %%PREFIX%%/portsnap
+ Default location where compressed snapshots are stored.
+ .It /usr/ports
+ Default location where the ports tree is extracted.
Index: files/pkg-message.in
===================================================================
RCS file: files/pkg-message.in
diff -N files/pkg-message.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/pkg-message.in	19 Jul 2006 23:10:17 -0000
@@ -0,0 +1,20 @@
+
+Before you can use portsnap, you will have to create an update configuration
+file specifying the server from which to fetch snapshots and the sha256 hash
+of the openssl public key which is trusted to sign the snapshots.
+
+A sample configuration file has been installed in
+
+	%%PREFIX%%/etc/portsnap.conf.sample
+
+which will fetch snapshots built and signed by the author.  If you want to
+use these updates, copy that file to
+
+	%%PREFIX%%/etc/portsnap.conf
+
+otherwise, create that file as appropriate.
+
+NOTE TO USERS UPGRADING FROM PORTSNAP 0.3.1 OR EARLIER:  The structure
+of the portsnap configuration file has changed; you will have to replace
+your existing portsnap.conf with a new version.
+ 
>Release-Note:
>Audit-Trail:
>Unformatted:



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