From owner-freebsd-ports-bugs@FreeBSD.ORG Wed May 15 22:30:01 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 59458328 for ; Wed, 15 May 2013 22:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 3BB12EFA for ; Wed, 15 May 2013 22:30:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r4FMU1C8036262 for ; Wed, 15 May 2013 22:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r4FMU0On036260; Wed, 15 May 2013 22:30:00 GMT (envelope-from gnats) Date: Wed, 15 May 2013 22:30:00 GMT Message-Id: <201305152230.r4FMU0On036260@freefall.freebsd.org> To: freebsd-ports-bugs@FreeBSD.org Cc: From: dfilter@FreeBSD.ORG (dfilter service) Subject: Re: ports/178366: commit references a PR X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: dfilter service List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 May 2013 22:30:01 -0000 The following reply was made to PR ports/178366; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: ports/178366: commit references a PR Date: Wed, 15 May 2013 22:21:39 +0000 (UTC) Author: rakuco Date: Wed May 15 22:21:30 2013 New Revision: 318266 URL: http://svnweb.freebsd.org/changeset/ports/318266 Log: Add ports-mgmt/pkg-rmleaf. A little script for removing leaf packages (requires pkgng). PR: ports/178366 Submitted by: Yanhui Shen (maintainer) Added: head/ports-mgmt/pkg-rmleaf/ head/ports-mgmt/pkg-rmleaf/Makefile (contents, props changed) head/ports-mgmt/pkg-rmleaf/files/ head/ports-mgmt/pkg-rmleaf/files/pkg-rmleaf (contents, props changed) head/ports-mgmt/pkg-rmleaf/pkg-descr (contents, props changed) Modified: head/ports-mgmt/Makefile Modified: head/ports-mgmt/Makefile ============================================================================== --- head/ports-mgmt/Makefile Wed May 15 21:22:21 2013 (r318265) +++ head/ports-mgmt/Makefile Wed May 15 22:21:30 2013 (r318266) @@ -34,6 +34,7 @@ SUBDIR += pkg SUBDIR += pkg-orphan SUBDIR += pkg-plist + SUBDIR += pkg-rmleaf SUBDIR += pkg_add_it SUBDIR += pkg_cleanup SUBDIR += pkg_cutleaves Added: head/ports-mgmt/pkg-rmleaf/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/ports-mgmt/pkg-rmleaf/Makefile Wed May 15 22:21:30 2013 (r318266) @@ -0,0 +1,29 @@ +# Created by: Yanhui Shen +# $FreeBSD$ + +PORTNAME= pkg-rmleaf +PORTVERSION= 0.2 +CATEGORIES= ports-mgmt +MASTER_SITES= # none +DISTFILES= # none + +MAINTAINER= shen.elf@gmail.com +COMMENT= Remove leaf packages + +LICENSE= BSD + +RUN_DEPENDS= ${LOCALBASE}/sbin/pkg:${PORTSDIR}/ports-mgmt/pkg + +NO_BUILD= yes +WRKSRC= ${WRKDIR} + +PLIST_FILES= sbin/pkg-rmleaf + +do-extract: + ${MKDIR} ${WRKSRC} + ${CP} ${FILESDIR}/pkg-rmleaf ${WRKSRC} + +do-install: + ${INSTALL_SCRIPT} ${WRKSRC}/pkg-rmleaf ${PREFIX}/sbin/pkg-rmleaf + +.include Added: head/ports-mgmt/pkg-rmleaf/files/pkg-rmleaf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/ports-mgmt/pkg-rmleaf/files/pkg-rmleaf Wed May 15 22:21:30 2013 (r318266) @@ -0,0 +1,77 @@ +#!/bin/sh + +# Copyright (c) 2013 Yanhui Shen, shen.elf@gmail.c0m +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +#Twiddle="echo '|/-\\' | cut -c" +PkgQuery="pkg query -e \"%#r=0\" \"%o#%c\" | sort" +PkgDelete="pkg delete -y" +DialogList="dialog --stdout --checklist \"leaf packages (%s)\" 30 90 30" + +KeptLeaves="" +while true; do + #==== refresh leaves ==== + echo "Calculating..." + AllLeaves=`eval $PkgQuery` + NewLeaves="" + nNewLeaves="0" + #n="0" + IFS=$'\n' + for line in $AllLeaves; do + # print twiddle will be a little slower + #n=$(($n % 4 + 1)) + #ch=`eval "$Twiddle $n"` + #printf "Calculating...%s\r" "$ch" + + port=`echo "$line" | cut -d'#' -f1` + desc=`echo "$line" | cut -d'#' -f2 | sed -e 's/\"/\\\"/g'` + ret=`echo "$KeptLeaves" | grep "$port"` + if [ -z "$ret" ]; then + NewLeaves="$NewLeaves $port \"$desc\" off" + nNewLeaves=$(($nNewLeaves + 1)) + fi + done + + #==== show dialog ==== + if [ -z "$NewLeaves" ]; then + echo "Nothing to do!" + exit + fi + cmd=`printf $DialogList "$nNewLeaves"` + selections=`eval "$cmd $NewLeaves"` + if [ $? -ne 0 ]; then + echo "Canceled." + exit + fi + + #==== record old leaves ==== + KeptLeaves="$AllLeaves" + + #==== deinstall selected ==== + if [ -z $selections ]; then + echo "No selection, quit." + exit + fi + eval "$PkgDelete $selections" +done Added: head/ports-mgmt/pkg-rmleaf/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/ports-mgmt/pkg-rmleaf/pkg-descr Wed May 15 22:21:30 2013 (r318266) @@ -0,0 +1 @@ +A little script for removing leaf packages (requires pkgng). _______________________________________________ svn-ports-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-ports-all To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"