FreeBSD Bugzilla – Attachment 144364 Details for
Bug 191577
Update Port: ports-mgmt/pkg-rmleaf from 0.2 to 0.3
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
shar file
pkg-rmleaf.shar (text/plain), 4.50 KB, created by
Yanhui Shen
on 2014-07-03 03:20:46 UTC
(
hide
)
Description:
shar file
Filename:
MIME Type:
Creator:
Yanhui Shen
Created:
2014-07-03 03:20:46 UTC
Size:
4.50 KB
patch
obsolete
># This is a shell archive. Save it in a file, remove anything before ># this line, and then unpack it by entering "sh file". Note, it may ># create directories; files and directories will be owned by you and ># have default permissions. ># ># This archive contains: ># ># pkg-rmleaf ># pkg-rmleaf/files ># pkg-rmleaf/files/pkg-rmleaf ># pkg-rmleaf/Makefile ># pkg-rmleaf/pkg-descr ># >echo c - pkg-rmleaf >mkdir -p pkg-rmleaf > /dev/null 2>&1 >echo c - pkg-rmleaf/files >mkdir -p pkg-rmleaf/files > /dev/null 2>&1 >echo x - pkg-rmleaf/files/pkg-rmleaf >sed 's/^X//' >pkg-rmleaf/files/pkg-rmleaf << '29ef2316dbde3ecdd0c6487fcf644a44' >X#!/bin/sh >X >X# version 0.3 >X >X# Copyright (c) 2013 Yanhui Shen, shen.elf@gmail.c0m >X# All rights reserved. >X# >X# Redistribution and use in source and binary forms, with or without >X# modification, are permitted provided that the following conditions >X# are met: >X# 1. Redistributions of source code must retain the above copyright >X# notice, this list of conditions and the following disclaimer. >X# 2. Redistributions in binary form must reproduce the above copyright >X# notice, this list of conditions and the following disclaimer in the >X# documentation and/or other materials provided with the distribution. >X# >X# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND >X# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >X# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE >X# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE >X# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >X# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS >X# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) >X# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT >X# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY >X# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF >X# SUCH DAMAGE. >X >Xcols=$((`stty size | cut -w -f2` - 6)) >Xrows=$((`stty size | cut -w -f1` - 4)) >Xheight=$(($rows - 7)) >Xsep="#" >XPkgQuery="pkg query -e \"%#r=0\" \"%o$sep%c\" | sort" >XPkgDelete="pkg delete -y" >XFmtDialog="dialog --checklist \"Leaf Packages: %s\" $rows $cols $height %s" >X >XKeptLeaves="" >Xwhile true; do >X #==== refresh leaves ==== >X echo "Querying..." >X AllLeaves=`eval $PkgQuery` >X NewLeaves="" >X nNewLeaves="0" >X >X #IFS=$'\n' >X # see http://svnweb.freebsd.org/base?view=revision&revision=221513 >X # for compatibility, use the following trick instead >X IFS=" >X" >X for line in $AllLeaves; do >X case $line in >X (*"$sep"*) >X port=${line%%"$sep"*} >X desc=${line#*"$sep"} >X ;; >X (*) >X echo "Bad line: " $line >X exit >X ;; >X esac >X >X ret=`echo "$KeptLeaves" | grep "$port"` >X if [ -z "$ret" ]; then >X NewLeaves="$NewLeaves $port \"$desc\" off" >X nNewLeaves=$(($nNewLeaves + 1)) >X fi >X done >X >X #==== show dialog ==== >X if [ -z "$NewLeaves" ]; then >X echo "Nothing to do!" >X exit >X fi >X cmd=`printf $FmtDialog "$nNewLeaves" "$NewLeaves"` >X selections=`eval "$cmd 3>&2 2>&1 1>&3"` >X if [ $? -ne 0 ]; then >X echo "Canceled." >X exit >X fi >X >X #==== record old leaves ==== >X KeptLeaves="$AllLeaves" >X >X #==== deinstall selected ==== >X if [ -z $selections ]; then >X echo "No selection, quit." >X exit >X fi >X eval "$PkgDelete $selections" >Xdone >29ef2316dbde3ecdd0c6487fcf644a44 >echo x - pkg-rmleaf/Makefile >sed 's/^X//' >pkg-rmleaf/Makefile << '90b081522a03c78615bf1fbde8757eba' >X# Created by: Yanhui Shen <shen.elf@gmail.com> >X# $FreeBSD: head/ports-mgmt/pkg-rmleaf/Makefile 345980 2014-02-25 12:30:09Z ehaupt $ >X >XPORTNAME= pkg-rmleaf >XPORTVERSION= 0.3 >XCATEGORIES= ports-mgmt >XMASTER_SITES= # none >XDISTFILES= # none >X >XMAINTAINER= shen.elf@gmail.com >XCOMMENT= Remove leaf packages >X >XLICENSE= BSD >X >XNO_BUILD= yes >XWRKSRC= ${WRKDIR} >X >XPLIST_FILES= sbin/pkg-rmleaf >X >Xdo-extract: >X ${MKDIR} ${WRKSRC} >X ${CP} ${FILESDIR}/pkg-rmleaf ${WRKSRC} >X >Xdo-install: >X ${INSTALL_SCRIPT} ${WRKSRC}/pkg-rmleaf \ >X ${STAGEDIR}${PREFIX}/sbin/pkg-rmleaf >X >X.include <bsd.port.mk> >90b081522a03c78615bf1fbde8757eba >echo x - pkg-rmleaf/pkg-descr >sed 's/^X//' >pkg-rmleaf/pkg-descr << '7fe204c325fc4fdeef345cc0f0a99f60' >XA little script for removing leaf packages (requires pkgng). >7fe204c325fc4fdeef345cc0f0a99f60 >exit >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 191577
:
144364
|
144531