diff options
author | crees <crees@FreeBSD.org> | 2013-03-03 18:30:46 +0800 |
---|---|---|
committer | crees <crees@FreeBSD.org> | 2013-03-03 18:30:46 +0800 |
commit | 77dff5414f2f4c50d67d77fc160b98ab10f4269b (patch) | |
tree | ba3ca10a6a7e76f81d2fef5cf96d2fd58998825e | |
parent | 35332da57716168ad69eea9c28a5cf3ebc119c16 (diff) | |
download | freebsd-ports-gnome-77dff5414f2f4c50d67d77fc160b98ab10f4269b.tar.gz freebsd-ports-gnome-77dff5414f2f4c50d67d77fc160b98ab10f4269b.tar.zst freebsd-ports-gnome-77dff5414f2f4c50d67d77fc160b98ab10f4269b.zip |
Rewrite in sh for version 1.0
Minor behaviour changes, but still very
simple to use-- now supports Subversion!
-rw-r--r-- | ports-mgmt/portdowngrade/Makefile | 37 | ||||
-rw-r--r-- | ports-mgmt/portdowngrade/distinfo | 2 | ||||
-rw-r--r-- | ports-mgmt/portdowngrade/files/patch-portdowngrade.cpp | 11 | ||||
-rw-r--r-- | ports-mgmt/portdowngrade/files/portdowngrade | 114 | ||||
-rw-r--r-- | ports-mgmt/portdowngrade/pkg-descr | 2 |
5 files changed, 121 insertions, 45 deletions
diff --git a/ports-mgmt/portdowngrade/Makefile b/ports-mgmt/portdowngrade/Makefile index edc09cffbdf7..4140f4424a93 100644 --- a/ports-mgmt/portdowngrade/Makefile +++ b/ports-mgmt/portdowngrade/Makefile @@ -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> diff --git a/ports-mgmt/portdowngrade/distinfo b/ports-mgmt/portdowngrade/distinfo deleted file mode 100644 index c4153d88f61b..000000000000 --- a/ports-mgmt/portdowngrade/distinfo +++ /dev/null @@ -1,2 +0,0 @@ -SHA256 (portdowngrade-0.6.tar.bz2) = cc8a60ae6b9a4b78dc388759cecc0b2232aab8ca4c36a72546402a4a8b52f02a -SIZE (portdowngrade-0.6.tar.bz2) = 84926 diff --git a/ports-mgmt/portdowngrade/files/patch-portdowngrade.cpp b/ports-mgmt/portdowngrade/files/patch-portdowngrade.cpp deleted file mode 100644 index edaa0cefde5d..000000000000 --- a/ports-mgmt/portdowngrade/files/patch-portdowngrade.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- portdowngrade/portdowngrade.cpp.orig 2004-12-28 00:34:52.000000000 -0800 -+++ portdowngrade/portdowngrade.cpp 2010-02-09 23:04:21.480393138 -0800 -@@ -28,6 +28,8 @@ - #include <dirent.h> - #include <termios.h> - #include <fcntl.h> -+#include <string.h> -+#include <limits.h> - #ifndef TIOCGWINSIZE - #include <sys/ioctl.h> - #endif diff --git a/ports-mgmt/portdowngrade/files/portdowngrade b/ports-mgmt/portdowngrade/files/portdowngrade new file mode 100644 index 000000000000..c5e9111798f0 --- /dev/null +++ b/ports-mgmt/portdowngrade/files/portdowngrade @@ -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 diff --git a/ports-mgmt/portdowngrade/pkg-descr b/ports-mgmt/portdowngrade/pkg-descr index 349475771e66..f475cb91c05e 100644 --- a/ports-mgmt/portdowngrade/pkg-descr +++ b/ports-mgmt/portdowngrade/pkg-descr @@ -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/ |