packages: netcat-openbsd/netcat-openbsd.spec, netcat-openbsd/netcat-openbsd...
baggins
baggins at pld-linux.org
Sun Jul 10 11:58:17 CEST 2011
Author: baggins Date: Sun Jul 10 09:58:17 2011 GMT
Module: packages Tag: HEAD
---- Log message:
- add patch file properly
---- Files affected:
packages/netcat-openbsd:
netcat-openbsd.spec (1.1 -> 1.2) , netcat-openbsd_1.89-4.diff (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/netcat-openbsd/netcat-openbsd.spec
diff -u packages/netcat-openbsd/netcat-openbsd.spec:1.1 packages/netcat-openbsd/netcat-openbsd.spec:1.2
--- packages/netcat-openbsd/netcat-openbsd.spec:1.1 Thu May 5 15:53:37 2011
+++ packages/netcat-openbsd/netcat-openbsd.spec Sun Jul 10 11:58:12 2011
@@ -10,7 +10,8 @@
Group: Networking/Utilities
Source0: http://ftp.de.debian.org/debian/pool/main/n/%{name}/%{name}_%{version}.orig.tar.gz
# Source0-md5: 7238ce15aae43069e96ba7faf03f153e
-Patch0: http://cdn.debian.net/debian/pool/main/n/%{name}/%{name}_%{version}-4.diff.gz
+# http://cdn.debian.net/debian/pool/main/n/%{name}/%{name}_%{version}-4.diff.gz
+Patch0: %{name}_%{version}-4.diff
URL: http://packages.debian.org/sid/netcat-openbsd
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -82,6 +83,9 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.2 2011/07/10 09:58:12 baggins
+- add patch file properly
+
Revision 1.1 2011/05/05 13:53:37 alucard
- initial, based on debian / arch linux
================================================================
Index: packages/netcat-openbsd/netcat-openbsd_1.89-4.diff
diff -u /dev/null packages/netcat-openbsd/netcat-openbsd_1.89-4.diff:1.1
--- /dev/null Sun Jul 10 11:58:17 2011
+++ packages/netcat-openbsd/netcat-openbsd_1.89-4.diff Sun Jul 10 11:58:12 2011
@@ -0,0 +1,2794 @@
+--- netcat-openbsd-1.89.orig/Makefile
++++ netcat-openbsd-1.89/Makefile
+@@ -1,6 +1,21 @@
+ # $OpenBSD: Makefile,v 1.6 2001/09/02 18:45:41 jakob Exp $
+
+ PROG= nc
+-SRCS= netcat.c atomicio.c socks.c
++SRCS= netcat.c atomicio.c socks.c \
++ openbsd-compat/base64.c openbsd-compat/readpassphrase.c
+
+-.include <bsd.prog.mk>
++CC = gcc
++override CFLAGS += `pkg-config --cflags glib-2.0`
++INC = -Iopenbsd-compat
++LIBS = `pkg-config --libs glib-2.0`
++OBJS = $(SRCS:.c=.o)
++
++all: nc
++nc: $(OBJS)
++ $(CC) $(LIBS) $(OBJS) -o nc
++
++$(OBJS): %.o: %.c
++ $(CC) $(CFLAGS) $(INC) -c $< -o $@
++
++clean:
++ rm -f $(OBJS) nc
+--- netcat-openbsd-1.89.orig/debian/rules
++++ netcat-openbsd-1.89/debian/rules
+@@ -0,0 +1,64 @@
++#!/usr/bin/make -f
++#export DH_VERBOSE=1
++
++DEB_CFLAGS = -g -Wall
++ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
++DEB_CFLAGS += -O0
++else
++DEB_CFLAGS += -O2
++endif
++ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
++INSTALL_PROG = install -m 0755
++else
++INSTALL_PROG = install -s -m 0755
++endif
++DEB_VER = $(shell dpkg-parsechangelog | sed -n 's/^Version: //p')
++
++patch: patch-stamp
++patch-stamp:
++ QUILT_PATCHES=debian/patches quilt push -a || test $$? = 2
++ touch patch-stamp
++
++unpatch:
++ QUILT_PATCHES=debian/patches quilt pop -a -R || test $$? = 2
++ rm -rf .pc patch-stamp
++
++build: build-stamp
++build-stamp: patch-stamp
++
++ $(MAKE) CFLAGS='$(DEB_CFLAGS) -DDEBIAN_VERSION=\"$(DEB_VER)\"'
++ touch build-stamp
++
++clean: unpatch
++ dh_testdir
++ dh_clean patch-stamp build-stamp
++ $(MAKE) clean
++
++install:
++ dh_testdir
++ dh_testroot
++ dh_clean -k
++ dh_installdirs
++
++ $(INSTALL_PROG) nc $(CURDIR)/debian/netcat-openbsd/bin/nc.openbsd
++ cp nc.1 $(CURDIR)/debian/netcat-openbsd/usr/share/man/man1/nc_openbsd.1
++
++binary-indep: build install
++
++binary-arch: build install
++ dh_testdir
++ dh_testroot
++ dh_installchangelogs
++ dh_installdocs
++ dh_installexamples debian/examples/*
++ dh_link
++ dh_strip
++ dh_compress -Xexamples
++ dh_fixperms
++ dh_installdeb
++ dh_shlibdeps
++ dh_gencontrol
++ dh_md5sums
++ dh_builddeb
++
++binary: binary-indep binary-arch
+--- netcat-openbsd-1.89.orig/debian/changelog
++++ netcat-openbsd-1.89/debian/changelog
+@@ -0,0 +1,44 @@
++netcat-openbsd (1.89-4) unstable; urgency=low
++
++ * Quit immediately after EOF if -q is not given (i.e. make the default
++ equivalent to -q 0). This is the standard upstream behavior and what
++ other Linux distributions use. It is different from netcat-traditional,
++ but compatibility with other versions of OpenBSD netcat is more
++ important. (Closes: #502188)
++
++ -- Decklin Foster <decklin at red-bean.com> Sun, 18 Apr 2010 20:05:08 -0400
++
++netcat-openbsd (1.89-3) unstable; urgency=low
++
++ * Silence -z flag, for compatibility with netcat-traditional (Closes:
++ #464564)
++ * Move stray line in socks.c to quilt patch series (Closes: #485160)
++ * Add missing documentation for -q option to man page.
++
++ -- Decklin Foster <decklin at red-bean.com> Thu, 19 Jun 2008 16:20:01 -0400
++
++netcat-openbsd (1.89-2) unstable; urgency=low
++
++ * Replace references to "netcat-base" with "netcat-traditional" (future
++ name of the old netcat package).
++
++ -- Decklin Foster <decklin at red-bean.com> Wed, 30 Jan 2008 18:24:46 -0500
++
++netcat-openbsd (1.89-1) unstable; urgency=low
++
++ * Initial release. (Closes: #145798)
++ * Includes support for:
++ - IPv6 (Closes: #461317)
++ - Unix domain sockets (Closes: #348564)
++ - SOCKS (Closes: #142898)
++ * Conflict with netcat versions older than netcat-traditional, so that we
++ can use alternatives.
++ * Port some features over from netcat-traditional:
++ - Exit successfully when printing help text (-h), and include the Debian
++ revision.
++ - Add the -q (quit on standard input EOF) flag.
++ - Add support for specifying ports by name (/etc/services). Unlike the
++ old hack for this, nc will first try to find a named service, then fall
++ back to numeric parsing, so no escaping is needed.
++
++ -- Decklin Foster <decklin at red-bean.com> Mon, 21 Jan 2008 18:41:37 -0500
+--- netcat-openbsd-1.89.orig/debian/netcat-openbsd.prerm
++++ netcat-openbsd-1.89/debian/netcat-openbsd.prerm
+@@ -0,0 +1,7 @@
++#!/bin/sh -e
++
++if [ "$1" = "remove" ]; then
++ update-alternatives --remove nc /bin/nc.openbsd
++fi
++
++#DEBHELPER#
+--- netcat-openbsd-1.89.orig/debian/copyright
++++ netcat-openbsd-1.89/debian/copyright
+@@ -0,0 +1,130 @@
++The netcat-openbsd Debian package was created by Soren Hansen
++<soren at ubuntu.com> and by Decklin Foster <decklin at red-bean.com>, based
++loosely on the original netcat package. The code itself was rewritten
++by the OpenBSD project, from the original implementation by Hobbit
++<hobbit at atstake.com>.
++
++Sources can be found at:
++
++ http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/
++
++Copyright and license of netcat.c:
++
++ Copyright (c) 2001 Eric Jackson <ericj at monkey.org>
++
++ 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.
++ 3. The name of the author may not be used to endorse or promote products
++ derived from this software without specific prior written permission.
++
++ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
++
++Copyright and license of atomicio.c:
++
++ Copyright (c) 2005 Anil Madhavapeddy. All rights served.
++ Copyright (c) 1995,1999 Theo de Raadt. All rights reserved.
++ 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 ``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 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.
++
++ Copyright (c) 2005 Anil Madhavapeddy. All rights served.
++ Copyright (c) 1995,1999 Theo de Raadt. All rights reserved.
++
++Copyright of socks.c (license is identical to that of atomicio.c):
++
++ Copyright (c) 1999 Niklas Hallqvist. All rights reserved.
++ Copyright (c) 2004, 2005 Damien Miller. All rights reserved.
++
++Copyright and license of readpassphrase.c:
++
++ Copyright (c) 2000-2002, 2007 Todd C. Miller <Todd.Miller at courtesan.com>
++
++ Permission to use, copy, modify, and distribute this software for any
++ purpose with or without fee is hereby granted, provided that the above
++ copyright notice and this permission notice appear in all copies.
++
++ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
++ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++
++ Sponsored in part by the Defense Advanced Research Projects
++ Agency (DARPA) and Air Force Research Laboratory, Air Force
++ Materiel Command, USAF, under agreement number F39502-99-1-0512.
++
++Copyright and license of base64.c:
++
++ Copyright (c) 1996 by Internet Software Consortium.
++
++ Permission to use, copy, modify, and distribute this software for any
++ purpose with or without fee is hereby granted, provided that the above
++ copyright notice and this permission notice appear in all copies.
++
++ THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
++ ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
++ OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
++ CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
++ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
++ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
++ ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
++ SOFTWARE.
++
++ Portions Copyright (c) 1995 by International Business Machines, Inc.
++
++ International Business Machines, Inc. (hereinafter called IBM) grants
++ permission under its copyrights to use, copy, modify, and distribute this
++ Software with or without fee, provided that the above copyright notice and
++ all paragraphs of this notice appear in all copies, and that the name of IBM
++ not be used in connection with the marketing of any product incorporating
++ the Software or modifications thereof, without specific, written prior
++ permission.
++
++ To the extent it has a right to do so, IBM grants an immunity from suit
++ under its patents, if any, for the use, sale or manufacture of products to
++ the extent that such products are used for performing Domain Name System
++ dynamic updates in TCP/IP networks by means of the Software. No immunity is
++ granted for any product per se or for any other function of any product.
++
++ THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
++ INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
++ PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
++ DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
++ OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
++ IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
+--- netcat-openbsd-1.89.orig/debian/compat
++++ netcat-openbsd-1.89/debian/compat
+@@ -0,0 +1 @@
++4
+--- netcat-openbsd-1.89.orig/debian/control
++++ netcat-openbsd-1.89/debian/control
+@@ -0,0 +1,24 @@
++Source: netcat-openbsd
++Section: net
++Priority: optional
++Maintainer: Decklin Foster <decklin at red-bean.com>
++Standards-Version: 3.7.3
++Build-Depends: quilt, debhelper (>= 4.0.0), libglib2.0-dev
++
++Package: netcat-openbsd
++Architecture: any
++Depends: ${shlibs:Depends}
++Provides: netcat
++Conflicts: netcat (<< 1.10-35)
++Replaces: netcat (<< 1.10-35)
++Description: TCP/IP swiss army knife
++ A simple Unix utility which reads and writes data across network
++ connections using TCP or UDP protocol. It is designed to be a reliable
++ "back-end" tool that can be used directly or easily driven by other
++ programs and scripts. At the same time it is a feature-rich network
++ debugging and exploration tool, since it can create almost any kind of
++ connection you would need and has several interesting built-in
++ capabilities.
++ .
++ This package contains the OpenBSD rewrite of netcat, including support
++ for IPv6, proxies, and Unix sockets.
+--- netcat-openbsd-1.89.orig/debian/netcat-openbsd.README.Debian
++++ netcat-openbsd-1.89/debian/netcat-openbsd.README.Debian
+@@ -0,0 +1,41 @@
++OpenBSD netcat for Debian
++-------------------------
++
++This package has been rebased on OpenBSD's implementation of netcat. The
++code has been massively cleaned up, and important functionality has been
++added.
++
++ -- Soren Hansen <soren at ubuntu.com> Tue, 15 Jan 2008 10:38:34 +0100
++
++The OpenBSD implementation has been split from netcat-traditional for
++two reasons (not counting sentimental value):
++
++ 1. Netcat should be part of the base system; OpenBSD netcat uses
++ strlcpy. While there is already a perfectly good implementation of
++ strlcpy in Debian, it is part of glib, which is not included in base.
++ 2. Packages should not be replaced under users' feet; a transitional
++ package will be provided for lenny so that users can note the new
++ package and switch if they wish.
++
++You may install this package alongside netcat-traditional; they both
++use the alternatives system for nc(1) as well as the deprecated alias
++netcat(1). Other implementations of netcat with compatible command line
++options are encouraged to also do so and provide the virtual package
++"netcat".
++
++The following features from netcat-traditional will not be added to this
++package:
++
++ * The -e and -c options (This should be done by redirecting the
++ appropriate file descriptors, not within netcat. How to do so should
++ be better documented.)
++ * Printing "connection refused" messages when -v is not specified
++ (because there is only one level of verbosity in this netcat, and
++ that message is primarily what the option is for.)
++
++Anything else that netcat-traditional does that this package doesn't
++is a bug. Wherever possible, command-line compatibility with the BSDs
++and Fedora is desired, but it should be easy to use netcat-openbsd as a
++"drop-in" replacement for netcat-traditional as well.
++
++ -- Decklin Foster <decklin at red-bean.com> Tue, 22 Jan 2008 18:50:08 -0500
+--- netcat-openbsd-1.89.orig/debian/netcat-openbsd.postinst
++++ netcat-openbsd-1.89/debian/netcat-openbsd.postinst
+@@ -0,0 +1,13 @@
++#!/bin/sh -e
++
++if [ "$1" = "configure" ]; then
++ update-alternatives \
++ --install /bin/nc nc /bin/nc.openbsd 50 \
++ --slave /bin/netcat netcat /bin/nc.openbsd \
++ --slave /usr/share/man/man1/nc.1.gz nc.1.gz \
++ /usr/share/man/man1/nc_openbsd.1.gz \
++ --slave /usr/share/man/man1/netcat.1.gz netcat.1.gz \
++ /usr/share/man/man1/nc_openbsd.1.gz
++fi
++
++#DEBHELPER#
+--- netcat-openbsd-1.89.orig/debian/netcat-openbsd.dirs
++++ netcat-openbsd-1.89/debian/netcat-openbsd.dirs
+@@ -0,0 +1,2 @@
++bin
++usr/share/man/man1
+--- netcat-openbsd-1.89.orig/debian/examples/irc
++++ netcat-openbsd-1.89/debian/examples/irc
+@@ -0,0 +1,79 @@
++#! /bin/sh
++## Shit-simple script to supply the "privmsg <recipient>" of IRC typein, and
++## keep the connection alive. Pipe this thru "nc -v -w 5 irc-server port".
++## Note that this mechanism makes the script easy to debug without being live,
++## since it just echoes everything bound for the server.
++## if you want autologin-type stuff, construct some appropriate files and
++## shovel them in using the "<" mechanism.
++
++# magic arg: if "tick", do keepalive process instead of main loop
++if test "$1" = "tick" ; then
++# ignore most signals; the parent will nuke the kid
++# doesn't stop ^Z, of course.
++ trap '' 1 2 3 13 14 15 16
++ while true ; do
++ sleep 60
++ echo "PONG !"
++ done
++fi
++
++# top level: fire ourselves off as the keepalive process, and keep track of it
++sh $0 tick &
++ircpp=$!
++echo "[Keepalive: $ircpp]" >&2
++# catch our own batch of signals: hup int quit pipe alrm term urg
++trap 'kill -9 $ircpp ; exit 0' 1 2 3 13 14 15 16
++sleep 2
++
++sender=''
++savecmd=''
++
++# the big honkin' loop...
++while read xx yy ; do
++ case "${xx}" in
++# blank line: do nothing
++ "")
++ continue
++ ;;
++# new channel or recipient; if bare ">", we're back to raw literal mode.
++ ">")
++ if test "${yy}" ; then
++ sender="privmsg ${yy} :"
++ else
++ sender=''
++ fi
++ continue
++ ;;
++# send crud from a file, one line per second. Can you say "skr1pt kidz"??
++# *Note: uses current "recipient" if set.
++ "<")
++ if test -f "${yy}" ; then
++ ( while read zz ; do
++ sleep 1
++ echo "${sender}${zz}"
++ done ) < "$yy"
++ echo "[done]" >&2
++ else
++ echo "[File $yy not found]" >&2
++ fi
++ continue
++ ;;
++# do and save a single command, for quick repeat
++ "/")
++ if test "${yy}" ; then
++ savecmd="${yy}"
++ fi
++ echo "${savecmd}"
++ ;;
++# default case goes to recipient, just like always
++ *)
++ echo "${sender}${xx} ${yy}"
++ continue
++ ;;
++ esac
++done
++
++# parting shot, if you want it
++echo "quit :Bye all!"
++kill -9 $ircpp
++exit 0
+--- netcat-openbsd-1.89.orig/debian/examples/README
++++ netcat-openbsd-1.89/debian/examples/README
+@@ -0,0 +1,5 @@
++A collection of example scripts that use netcat as a backend, each
++documented by its own internal comments.
++
++I'll be the first to admit that some of these are seriously *sick*,
++but they do work and are quite useful to me on a daily basis.
+--- netcat-openbsd-1.89.orig/debian/examples/web
++++ netcat-openbsd-1.89/debian/examples/web
+@@ -0,0 +1,148 @@
++#! /bin/sh
++## The web sucks. It is a mighty dismal kludge built out of a thousand
++## tiny dismal kludges all band-aided together, and now these bottom-line
++## clueless pinheads who never heard of "TCP handshake" want to run
++## *commerce* over the damn thing. Ye godz. Welcome to TV of the next
++## century -- six million channels of worthless shit to choose from, and
++## about as much security as today's cable industry!
++##
++## Having grown mightily tired of pain in the ass browsers, I decided
++## to build the minimalist client. It doesn't handle POST, just GETs, but
++## the majority of cgi forms handlers apparently ignore the method anyway.
++## A distinct advantage is that it *doesn't* pass on any other information
++## to the server, like Referer: or info about your local machine such as
++## Netscum tries to!
++##
++## Since the first version, this has become the *almost*-minimalist client,
++## but it saves a lot of typing now. And with netcat as its backend, it's
++## totally the balls. Don't have netcat? Get it here in /src/hacks!
++## _H* 950824, updated 951009 et seq.
++##
++## args: hostname [port]. You feed it the filename-parts of URLs.
++## In the loop, HOST, PORT, and SAVE do the right things; a null line
++## gets the previous spec again [useful for initial timeouts]; EOF to exit.
++## Relative URLs behave like a "cd" to wherever the last slash appears, or
++## just use the last component with the saved preceding "directory" part.
++## "\" clears the "filename" part and asks for just the "directory", and
++## ".." goes up one "directory" level while retaining the "filename" part.
++## Play around; you'll get used to it.
++
++if test "$1" = "" ; then
++ echo Needs hostname arg.
++ exit 1
++fi
++umask 022
++
++# optional PATH fixup
++# PATH=${HOME}:${PATH} ; export PATH
++
++test "${PAGER}" || PAGER=more
++BACKEND="nc -v -w 15"
++TMPAGE=/tmp/web$$
++host="$1"
++port="80"
++if test "$2" != "" ; then
++ port="$2"
++fi
++
++spec="/"
++specD="/"
++specF=''
++saving=''
++
++# be vaguely smart about temp file usage. Use your own homedir if you're
++# paranoid about someone symlink-racing your shell script, jeez.
++rm -f ${TMPAGE}
++test -f ${TMPAGE} && echo "Can't use ${TMPAGE}" && exit 1
++
++# get loopy. Yes, I know "echo -n" aint portable. Everything echoed would
++# need "\c" tacked onto the end in an SV universe, which you can fix yourself.
++while echo -n "${specD}${specF} " && read spec ; do
++ case $spec in
++ HOST)
++ echo -n 'New host: '
++ read host
++ continue
++ ;;
++ PORT)
++ echo -n 'New port: '
++ read port
++ continue
++ ;;
++ SAVE)
++ echo -n 'Save file: '
++ read saving
++# if we've already got a page, save it
++ test "${saving}" && test -f ${TMPAGE} &&
++ echo "=== ${host}:${specD}${specF} ===" >> $saving &&
++ cat ${TMPAGE} >> $saving && echo '' >> $saving
++ continue
++ ;;
++# changing the logic a bit here. Keep a state-concept of "current dir"
++# and "current file". Dir is /foo/bar/ ; file is "baz" or null.
++# leading slash: create whole new state.
++ /*)
++ specF=`echo "${spec}" | sed 's|.*/||'`
++ specD=`echo "${spec}" | sed 's|\(.*/\).*|\1|'`
++ spec="${specD}${specF}"
++ ;;
++# embedded slash: adding to the path. "file" part can be blank, too
++ */*)
++ specF=`echo "${spec}" | sed 's|.*/||'`
++ specD=`echo "${specD}${spec}" | sed 's|\(.*/\).*|\1|'`
++ ;;
++# dotdot: jump "up" one level and just reprompt [confirms what it did...]
<<Diff was trimmed, longer than 597 lines>>
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/netcat-openbsd/netcat-openbsd.spec?r1=1.1&r2=1.2&f=u
More information about the pld-cvs-commit
mailing list