Date: Sun, 3 Mar 2013 21:42:37 GMT From: Waitman Gobble <uzimac@da3m0n8t3r.com> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/176625: New Port: ports-mgmt/prhistory-sync-perl Sync GNATS PR db (ports) and create SQLite3 Summary for prhistory program Message-ID: <201303032142.r23Lgbdx071969@red.freebsd.org> Resent-Message-ID: <201303032150.r23Lo0M9039642@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 176625 >Category: ports >Synopsis: New Port: ports-mgmt/prhistory-sync-perl Sync GNATS PR db (ports) and create SQLite3 Summary for prhistory program >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: Sun Mar 03 21:50:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Waitman Gobble >Release: FreeBSD 9.1-STABLE >Organization: Waitman Gobble >Environment: FreeBSD do.burplex.com 9.1-STABLE FreeBSD 9.1-STABLE #0 r246923M: Sun Feb 17 18:30:48 PST 2013 da3m0n8t3r@do.burplex.com:/usr/obj/usr/src/sys/KAGISO amd64 >Description: This software contains two PERL5 scripts. sync-gnats-ports.pl <DESTDIR> This program uses rsync to mirror the FreeBSD GNATS PR database (ports only) to <DESTDIR>. It sets a 'lock' file in /tmp so that it will not run multiple simultaneous instances. You should probably add 'rm -f /tmp/pr-up-running' to your /etc/rc.local to solve problems that may happen on power loss, or reboot. parse-gnats-ports.pl <DESTDIR> This program parses summary information from the PR files and builds an SQLite3 database for the ports-mgmt/prhistory port. The database file is stored in /var/db/ports/ports-pr.db. Also it creates a file /var/db/ports/lastrun.txt to remember the last update, so it will only operate on new information. If you delete /var/db/ports/lastrun.txt it will cause the script to reparse all PR files and rebuild the /var/db/ports/ports-pr.db file. <DESTDIR> This should be an existing path to store the PR files. (presently requires approximately 1.5GB of storage space). example: > mkdir /b > sync-gnats-ports.pl /b >How-To-Repeat: >Fix: thanks Patch attached with submission follows: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # prhistory-sync-perl # prhistory-sync-perl/Makefile # prhistory-sync-perl/pkg-descr # prhistory-sync-perl/distinfo # prhistory-sync-perl/pkg-plist # echo c - prhistory-sync-perl mkdir -p prhistory-sync-perl > /dev/null 2>&1 echo x - prhistory-sync-perl/Makefile sed 's/^X//' >prhistory-sync-perl/Makefile << '5c67456260bfdec0134c634d9c9f4302' X# Created by: "Waitman Gobble" <uzimac@da3m0n8t3r.com> X# $FreeBSD$ X# New ports collection makefile for: sync-pr-ports X# Date created: 3 March 2013 X XPORTNAME= sync-pr-ports XPORTVERSION= 1.0 XCATEGORIES= ports-mgmt perl5 XMASTER_SITES= http://dx.burplex.com/ http://www.burplex.com/ XPKGNAMEPREFIX= p5- X XMAINTAINER= waitman@waitman.net XCOMMENT= Creates and updates ports-pr.db SQLite3 file for prhistory X XLICENSE= BSD X XRUN_DEPENDS= p5-DBI>=0:${PORTSDIR}/databases/p5-DBI \ X p5-DBD-SQLite>=0:${PORTSDIR}/databases/p5-DBD-SQLite \ X p5-Time-Piece>=0:${PORTSDIR}/devel/p5-Time-Piece \ X p5-Sys-Syslog>=0:${PORTSDIR}/sysutils/p5-Sys-Syslog \ X rsync>=0:${PORTSDIR}/net/rsync XBUILD_DEPENDS:= ${RUN_DEPENDS} X XUSE_PERL5_RUN= YES XUSE_SQLITE= YES X XTMPDIR?= /tmp X Xpost-patch: X ${REINPLACE_CMD} -e 's|/usr/pkg/bin/perl|${PERL}|g' ${WRKSRC}/parse-gnats-ports.pl X ${REINPLACE_CMD} -e 's|/var/db/ports-pr.db|/var/db/ports/ports-pr.db|g' ${WRKSRC}/parse-gnats-ports.pl X ${REINPLACE_CMD} -e 's|/var/db/lastrun.txt|/var/db/ports/lastrun.txt|g' ${WRKSRC}/parse-gnats-ports.pl X ${REINPLACE_CMD} -e 's|/usr/pkg/bin/perl|${PERL}|g' ${WRKSRC}/sync-gnats-ports.pl X ${REINPLACE_CMD} -e 's|/usr/pkg/bin/rsync|${PREFIX}/bin/rsync|g' ${WRKSRC}/sync-gnats-ports.pl X ${REINPLACE_CMD} -e 's|/usr/local/bin/parse-gnats-ports.pl|${PREFIX}/bin/parse-gnats-ports.pl|g' ${WRKSRC}/sync-gnats-ports.pl X ${REINPLACE_CMD} -e 's|/tmp/pr-up-running|${TMPDIR}/pr-up-running|g' ${WRKSRC}/sync-gnats-ports.pl X ${REINPLACE_CMD} -e 's|/var/db/ports-pr.db|/var/db/ports/ports-pr.db|g' ${WRKSRC}/README X ${REINPLACE_CMD} -e 's|/var/db/lastrun.txt|/var/db/ports/lastrun.txt|g' ${WRKSRC}/README X ${REINPLACE_CMD} -e 's|/TMPDIR/|${TMPDIR}/|g' ${WRKSRC}/README X ${REINPLACE_CMD} -e 's|TMPDIR|${TMPDIR}|g' ${WRKSRC}/README X XPORTDOCS= * X X.include <bsd.port.options.mk> X Xpost-install: X.if ${PORT_OPTIONS:MDOCS} X @${MKDIR} ${DOCSDIR} X ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR} X.endif X @${CAT} ${WRKSRC}/README X X.include <bsd.port.mk> 5c67456260bfdec0134c634d9c9f4302 echo x - prhistory-sync-perl/pkg-descr sed 's/^X//' >prhistory-sync-perl/pkg-descr << 'd0fe15fbb42c44787cbf6f391e9dd41a' XThis port consists of two PERL5 scripts. One uses rsync to sync the FreeBSD XGNATS PR database (ports-related only), the other script parses the PR files Xto build the SQLite3 database file for ports/ports-mgmt/prhistory d0fe15fbb42c44787cbf6f391e9dd41a echo x - prhistory-sync-perl/distinfo sed 's/^X//' >prhistory-sync-perl/distinfo << '18469cf977d5955910263d9aa48a7b9e' XSHA256 (sync-pr-ports-1.0.tar.gz) = d909162a369fd6874989907dc67e9b7dee1d1b83a451e82f18f09178323594a3 XSIZE (sync-pr-ports-1.0.tar.gz) = 2804 18469cf977d5955910263d9aa48a7b9e echo x - prhistory-sync-perl/pkg-plist sed 's/^X//' >prhistory-sync-perl/pkg-plist << '8d04faf6b48f8b3fa40066988d3243ff' Xbin/parse-gnats-ports.pl Xbin/sync-gnats-ports.pl X@unexec echo "NOTICE: If you are permanently removing this utility, you may wish to delete the database file /var/db/ports/ports-pr.db AND /var/db/ports/lastrun.txt" 8d04faf6b48f8b3fa40066988d3243ff exit >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303032142.r23Lgbdx071969>