Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Mar 2013 10:30:47 +0000 (UTC)
From:      Chris Rees <crees@FreeBSD.org>
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
Message-ID:  <201303031030.r23AUlIC091723@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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/



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