Date: Mon, 1 Dec 2014 12:02:06 -0700 From: "Reed A. Cartwright" <cartwright@asu.edu> To: Stefan Esser <se@freebsd.org>, freebsd-ports@freebsd.org Subject: Re: Tracking Binary Ports/Pkgs Tree Message-ID: <CALOkxuwa9siHbxOj_AyJNWPfLr4=LNDCuer27k8iDUJ5NiSx%2BQ@mail.gmail.com> In-Reply-To: <547C4935.9060607@freebsd.org> References: <CALOkxuxDJ7fV9XOZ1t8D9tfLqMZvN3CwQa9iz0qQOGmgGnNXmQ@mail.gmail.com> <547AF3AE.5050803@gmx.net> <CALOkxux8YZraifyk-FLd4YrtfTCAZ5pfWpO61bgT_McNwwBJ-Q@mail.gmail.com> <547C4935.9060607@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
The attachment was stripped, so I created a gist. https://gist.github.com/reedacartwright/8622973baf89b263a6d7 #!/bin/sh # Copyright (c) 2014 Reed A. Cartwright <cartwright@asu.edu> # # This script determines the revision number used to build FreeBSD packages # and syncs a local ports directory to match it. # # USAGE: sync_local_ports.sh [name or abs_path] # # Requirements: textproc/jq, ports-mgmt/poudriere SERVER=beefy2.isc.freebsd.org JAIL=10amd64-default URL="http://${SERVER}/data/${JAIL}/.data.json" PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin PORTSTREE=$1 if [ -z "$PORTSTREE" ]; then PORTSTREE="default" fi # If the argument is not an absolute path, use poudriere to resolve it. # We test for absolute path by seeing if it begins with a slash. if [ "${PORTSTREE#/}" != "${PORTSTREE}" ]; then PORTSDIR="${PORTSTREE}" else PORTSDIR=`poudriere ports -ql | awk "\\\$1 == \"${PORTSTREE}\" { print \\\$3 }"` fi if [ ! -d "${PORTSDIR}" ]; then >&2 echo "ERROR: Unable to resolve ports tree '${PORTSTREE}' to a directory." exit 1 fi JSON=`fetch -qo - $URL` if [ $? -gt 0 ]; then >&2 echo "ERROR: Unable to fetch data from package server." exit 1 fi REV=`echo "${JSON}" | jq -r '.builds[.builds.latest].svn_url | split("@")[1]'` if expr "$REV" : '^[[:digit:]][[:digit:]]*$' >/dev/null; then svnlite up -r "${REV}" "${PORTSDIR}" else >& echo "ERROR: Unable to determine revision number for latest packages." fi On Mon, Dec 1, 2014 at 3:55 AM, Stefan Esser <se@freebsd.org> wrote: > Am 01.12.2014 um 08:55 schrieb Reed A. Cartwright: >> I turned my one liner into a script. I've attached it; hopefully, it >> will not be stripped. > > > Hi Reed, > > it has been stripped ;-) > > Please resend with your script inline, not attached. > > (There are mime-types that are not stripped by the mail-list > processor, but I forgot which types that are ...) > > Regards, STefan -- Reed A. Cartwright, PhD Barrett Honors Faculty Assistant Professor of Genomics, Evolution, and Bioinformatics School of Life Sciences Center for Evolutionary Medicine and Informatics The Biodesign Institute Arizona State University ================== Address: The Biodesign Institute, PO Box 875301, Tempe, AZ 85287-5301 USA Packages: The Biodesign Institute, 1001 S. McAllister Ave, Tempe, AZ 85287-5301 USA Office: Biodesign A-224A, 1-480-965-9949 Website: http://cartwrig.ht/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALOkxuwa9siHbxOj_AyJNWPfLr4=LNDCuer27k8iDUJ5NiSx%2BQ>