From owner-svn-ports-all@FreeBSD.ORG Sun Mar 3 10:30:48 2013 Return-Path: <owner-svn-ports-all@FreeBSD.ORG> Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0D725CB4; Sun, 3 Mar 2013 10:30:48 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E5866E4F; Sun, 3 Mar 2013 10:30:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23AUlwf091729; Sun, 3 Mar 2013 10:30:47 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23AUlIC091723; Sun, 3 Mar 2013 10:30:47 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201303031030.r23AUlIC091723@svn.freebsd.org> From: Chris Rees <crees@FreeBSD.org> Date: Sun, 3 Mar 2013 10:30:47 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r313338 - in head/ports-mgmt/portdowngrade: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree <svn-ports-all.freebsd.org> List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-ports-all>, <mailto:svn-ports-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/svn-ports-all> List-Post: <mailto:svn-ports-all@freebsd.org> List-Help: <mailto:svn-ports-all-request@freebsd.org?subject=help> List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-ports-all>, <mailto:svn-ports-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 03 Mar 2013 10:30:48 -0000 Author: crees Date: Sun Mar 3 10:30:46 2013 New Revision: 313338 URL: http://svnweb.freebsd.org/changeset/ports/313338 Log: Rewrite in sh for version 1.0 Minor behaviour changes, but still very simple to use-- now supports Subversion! Added: head/ports-mgmt/portdowngrade/files/portdowngrade (contents, props changed) Deleted: head/ports-mgmt/portdowngrade/distinfo head/ports-mgmt/portdowngrade/files/patch-portdowngrade.cpp Modified: head/ports-mgmt/portdowngrade/Makefile head/ports-mgmt/portdowngrade/pkg-descr Modified: head/ports-mgmt/portdowngrade/Makefile ============================================================================== --- head/ports-mgmt/portdowngrade/Makefile Sun Mar 3 10:27:00 2013 (r313337) +++ head/ports-mgmt/portdowngrade/Makefile Sun Mar 3 10:30:46 2013 (r313338) @@ -2,43 +2,20 @@ # $FreeBSD$ PORTNAME= portdowngrade -PORTVERSION= 0.6 -PORTREVISION= 4 +PORTVERSION= 1.0 CATEGORIES= ports-mgmt -MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION} +MASTER_SITES= # empty +DISTFILES= # none MAINTAINER= crees@FreeBSD.org COMMENT= Sets a port back to a previous version -LIB_DEPENDS= popt.0:${PORTSDIR}/devel/popt +RUN_DEPENDS= svn:${PORTSDIR}/devel/subversion -CONFIGURE_ENV= LIBS="-lpopt -L${LOCALBASE}/lib" -CPPFLAGS+= -I${LOCALBASE}/include -.if defined(DEFAULT_CVS_SERVER) -CONFIGURE_ARGS+= --enable-default-server=${DEFAULT_CVS_SERVER} -.endif - -DEPRECATED= depends on ports being hosted in CVS -EXPIRATION_DATE= 2013-06-01 - -GNU_CONFIGURE= yes -USE_GMAKE= yes - -USE_BZIP2= yes - -MAN1= portdowngrade.1 +NO_BUILD= yes PLIST_FILES= sbin/portdowngrade -pre-everything:: -.if !defined(DEFAULT_CVS_SERVER) - @${ECHO_MSG} "" - @${ECHO_MSG} "Press CTRL-C and define DEFAULT_CVS_SERVER" - @${ECHO_MSG} "(e.g. make DEFAULT_CVS_SERVER=\":pserver:anoncvs@anoncvs. ... .FreeBSD.org:/home/ncvs\" install)" - @${ECHO_MSG} "if you want to use a special CVS server as default. See" - @${ECHO_MSG} "http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/anoncvs.html" - @${ECHO_MSG} "for a list of possible cvs server" - @${ECHO_MSG} "" - @sleep 3 -.endif +do-install: + ${INSTALL_SCRIPT} ${FILESDIR}/${PORTNAME} ${PREFIX}/sbin/ .include <bsd.port.mk> Added: head/ports-mgmt/portdowngrade/files/portdowngrade ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/ports-mgmt/portdowngrade/files/portdowngrade Sun Mar 3 10:30:46 2013 (r313338) @@ -0,0 +1,114 @@ +#!/bin/sh + +# portdowngrade + +# Fetch a port directory from an older version; +# easy to use wrapper around Subversion + +# Copyright 2013 Chris Rees +# crees@FreeBSD.org + +# This script is in the public domain + +# $FreeBSD$ + +usage() +{ + <<EOF cat +Usage: $0 port-directory|port [revision/date] + +When called without a revision to restore, svn log is called on the port's +directory so that relevant revisions can be identified. Look for lines +containing "Update to X.X" + +When called with a port name instead of directory/origin, INDEX is grepped +for the correct origins and a list is presented. +EOF + exit 1 +} + +err() +{ + echo "${@:-An unknown error has occurred}" + exit 1 +} + +svn=$(which svn 2>/dev/null) || err "Where is Subversion??" + +PORTSDIR="$(make -f /usr/share/mk/bsd.port.mk -VPORTSDIR)" + +[ -d $PORTSDIR ] || err "Where is your ports tree??" + +case ${1-NULL} in +NULL|-*) + usage + ;; +*/*) + # Contains a directory, so we're ready for the next stage + + # noop + + ;; +*) + # Probably a port name, get list of origins from INDEX + INDEXFILE=$(make -C $PORTSDIR -VINDEXDIR) + INDEXFILE="$INDEXFILE/$(make -C $PORTSDIR -VINDEXFILE)" + + [ -f $INDEXFILE ] || err You need to run make -C $PORTSDIR fetchindex + + sed -ne "s,^\([^|]*$1-[^|]*\)|/usr/ports/\([^|]*\)|.*,\1 -> \2,p" \ + < $INDEXFILE + <<EOF cat + +Choose a port origin (directory) from the list +above, and then run $0 category/port + +EOF + exit 0 + ;; +esac + +: ${svnroot=http://svn.freebsd.org/ports/head} + +# Get port directory +portdir="${1%$PORTSDIR}" +portdir="${portdir#/}" + +if [ ! -d "$PORTSDIR/$portdir" ]; then + err $portdir does not exist in $PORTSDIR +fi + +case ${2-NULL} in +NULL) + # No revision/date provided, get log + echo Choose a revision from this list and run $0 $1 revision + $svn log $svnroot/$portdir | $PAGER + echo Choose a revision from the above list and run $0 $1 revision + exit 0 + ;; +*) + case ${2} in + *-*-*) + rev=\{$2\} + ;; + r*) + rev=$2 + ;; + *) + # Number? + echo $2 | grep -q '^[[:digit:]]*$' || \ + err Revision argument must be a number or date + rev=r$2 + ;; + esac + + $svn co "$svnroot/$portdir@$rev" || \ + err "Something went wrong with svn... Ensure you have the correct revision!" + + echo + echo "You should be done-- now cd into ${portdir%*/} and you can run" + echo "make deinstall install clean" + echo + + exit 0 +esac Modified: head/ports-mgmt/portdowngrade/pkg-descr ============================================================================== --- head/ports-mgmt/portdowngrade/pkg-descr Sun Mar 3 10:27:00 2013 (r313337) +++ head/ports-mgmt/portdowngrade/pkg-descr Sun Mar 3 10:30:46 2013 (r313338) @@ -1,5 +1,3 @@ Portdowngrade helps to downgrade FreeBSD ports by analyzing the history of commits to the port and presenting the user the list of changes. By selecting one, the port can be set back to a previous version easily. - -WWW: http://sourceforge.net/projects/portdowngrade/