summaryrefslogtreecommitdiff
path: root/pkgtools/ftp
diff options
context:
space:
mode:
authorhubertf <hubertf>1998-09-30 10:27:53 +0000
committerhubertf <hubertf>1998-09-30 10:27:53 +0000
commita2a7e53ee22051ea8673eefe45dc2323ffc97cee (patch)
tree77178886682d732a54a24d0f1ce35e7a56eba5ac /pkgtools/ftp
parentb73ce37d99bb1f7aa9eb09e5f7230bfbb0726c82 (diff)
downloadpkgsrc-a2a7e53ee22051ea8673eefe45dc2323ffc97cee.tar.gz
Make this actually work under 1.3.
Patches supplied by Alistair Crooks (thanks!), plus some more input from Luke Mewburn and some minor tweaks from me.
Diffstat (limited to 'pkgtools/ftp')
-rw-r--r--pkgtools/ftp/patches/patch-aa42
-rw-r--r--pkgtools/ftp/patches/patch-ab17
-rw-r--r--pkgtools/ftp/patches/patch-ac230
-rw-r--r--pkgtools/ftp/patches/patch-ad93
-rw-r--r--pkgtools/ftp/patches/patch-ae18
5 files changed, 400 insertions, 0 deletions
diff --git a/pkgtools/ftp/patches/patch-aa b/pkgtools/ftp/patches/patch-aa
new file mode 100644
index 00000000000..67f55670951
--- /dev/null
+++ b/pkgtools/ftp/patches/patch-aa
@@ -0,0 +1,42 @@
+$NetBSD: patch-aa,v 1.1 1998/09/30 10:27:53 hubertf Exp $
+
+--- util.c.orig Sat Aug 8 13:18:50 1998
++++ util.c Wed Sep 30 09:05:46 1998
+@@ -912,10 +912,16 @@
+ HistEvent ev;
+ int editmode;
+
++#ifdef EL_EDITMODE /* hack */
+ el = el_init(__progname, stdin, ttyout, stderr);
++#else
++ el = el_init(__progname, stdin, ttyout);
++#endif /* EL_EDITMODE */
+ /* init editline */
+ hist = history_init(); /* init the builtin history */
++#ifdef H_SETSIZE
+ history(hist, &ev, H_SETSIZE, 100);/* remember 100 events */
++#endif
+ el_set(el, EL_HIST, history, hist); /* use history */
+
+ el_set(el, EL_EDITOR, "emacs"); /* default editor is emacs */
+@@ -927,12 +933,20 @@
+ complete);
+ el_set(el, EL_BIND, "^I", "ftp-complete", NULL);
+ el_source(el, NULL); /* read ~/.editrc */
++#ifdef EL_EDITMODE
+ if ((el_get(el, EL_EDITMODE, &editmode) != -1) && editmode == 0)
+ editing = 0; /* the user doesn't want editing,
+ * so disable, and let statement
+ * below cleanup */
+ else
+ el_set(el, EL_SIGNAL, 1);
++#else
++ if (editmode == 0) {
++ editing = 0;
++ } else {
++ el_set(el, EL_SIGNAL, 1);
++ }
++#endif
+ }
+ if (!editing) {
+ if (hist) {
diff --git a/pkgtools/ftp/patches/patch-ab b/pkgtools/ftp/patches/patch-ab
new file mode 100644
index 00000000000..ae0e600f885
--- /dev/null
+++ b/pkgtools/ftp/patches/patch-ab
@@ -0,0 +1,17 @@
+$NetBSD: patch-ab,v 1.1 1998/09/30 10:27:54 hubertf Exp $
+
+NetBSD 1.3.2 doesn't have CC_REFRESH_BEEP.
+
+--- complete.c 1998/09/29 15:27:45 1.1
++++ complete.c 1998/09/29 15:28:54
+@@ -71,6 +71,10 @@
+ return (strcmp(*(char **)a, *(char **)b));
+ }
+
++#ifndef CC_REFRESH_BEEP
++#define CC_REFRESH_BEEP 9
++#endif
++
+ /*
+ * Determine if complete is ambiguous. If unique, insert.
+ * If no choices, error. If unambiguous prefix, insert that.
diff --git a/pkgtools/ftp/patches/patch-ac b/pkgtools/ftp/patches/patch-ac
new file mode 100644
index 00000000000..54defa77566
--- /dev/null
+++ b/pkgtools/ftp/patches/patch-ac
@@ -0,0 +1,230 @@
+$NetBSD: patch-ac,v 1.1 1998/09/30 10:27:54 hubertf Exp $
+
+Provide -current's fparseln.c
+
+--- /dev/null Tue Sep 29 16:43:01 1998
++++ fparseln.c Tue Sep 29 16:46:40 1998
+@@ -0,0 +1,223 @@
++/* NetBSD: fparseln.c,v 1.5 1997/12/01 02:58:41 lukem Exp */
++
++/*
++ * Copyright (c) 1997 Christos Zoulas. 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.
++ * 3. All advertising materials mentioning features or use of this software
++ * must display the following acknowledgement:
++ * This product includes software developed by Christos Zoulas.
++ * 4. 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.
++ */
++
++#include <sys/cdefs.h>
++#if defined(LIBC_SCCS) && !defined(lint)
++__RCSID("NetBSD: fparseln.c,v 1.5 1997/12/01 02:58:41 lukem Exp");
++#endif
++
++#include <stdio.h>
++#include <string.h>
++#include <stdlib.h>
++#include <util.h>
++
++static int isescaped __P((const char *, const char *, char));
++
++/* isescaped():
++ * Return true if the character in *p that belongs to a string
++ * that starts in *sp, is escaped by the escape character esc.
++ */
++static int
++isescaped(sp, p, esc)
++ const char *sp, *p;
++ char esc;
++{
++ const char *cp;
++ size_t ne;
++
++ /* No escape character */
++ if (esc == '\0')
++ return 1;
++
++ /* Count the number of escape characters that precede ours */
++ for (ne = 0, cp = p; --cp >= sp && *cp == esc; ne++)
++ continue;
++
++ /* Return true if odd number of escape characters */
++ return (ne & 1) != 0;
++}
++
++
++/* fparseln():
++ * Read a line from a file parsing continuations ending in \
++ * and eliminating trailing newlines, or comments starting with
++ * the comment char.
++ */
++char *
++fparseln(fp, size, lineno, str, flags)
++ FILE *fp;
++ size_t *size;
++ size_t *lineno;
++ const char str[3];
++ int flags;
++{
++ static const char dstr[3] = { '\\', '\\', '#' };
++
++ size_t s, len;
++ char *buf;
++ char *ptr, *cp;
++ int cnt;
++ char esc, con, nl, com;
++
++ len = 0;
++ buf = NULL;
++ cnt = 1;
++
++ if (str == NULL)
++ str = dstr;
++
++ esc = str[0];
++ con = str[1];
++ com = str[2];
++ /*
++ * XXX: it would be cool to be able to specify the newline character,
++ * but unfortunately, fgetln does not let us
++ */
++ nl = '\n';
++
++ while (cnt) {
++ cnt = 0;
++
++ if (lineno)
++ (*lineno)++;
++
++ if ((ptr = fgetln(fp, &s)) == NULL)
++ break;
++
++ if (s && com) { /* Check and eliminate comments */
++ for (cp = ptr; cp < ptr + s; cp++)
++ if (*cp == com && !isescaped(ptr, cp, esc)) {
++ s = cp - ptr;
++ cnt = s == 0 && buf == NULL;
++ break;
++ }
++ }
++
++ if (s && nl) { /* Check and eliminate newlines */
++ cp = &ptr[s - 1];
++
++ if (*cp == nl)
++ s--; /* forget newline */
++ }
++
++ if (s && con) { /* Check and eliminate continuations */
++ cp = &ptr[s - 1];
++
++ if (*cp == con && !isescaped(ptr, cp, esc)) {
++ s--; /* forget escape */
++ cnt = 1;
++ }
++ }
++
++ if (s == 0 && buf != NULL)
++ continue;
++
++ if ((cp = realloc(buf, len + s + 1)) == NULL) {
++ free(buf);
++ return NULL;
++ }
++ buf = cp;
++
++ (void) memcpy(buf + len, ptr, s);
++ len += s;
++ buf[len] = '\0';
++ }
++
++ if ((flags & FPARSELN_UNESCALL) != 0 && esc && buf != NULL &&
++ strchr(buf, esc) != NULL) {
++ ptr = cp = buf;
++ while (cp[0] != '\0') {
++ int skipesc;
++
++ while (cp[0] != '\0' && cp[0] != esc)
++ *ptr++ = *cp++;
++ if (cp[0] == '\0' || cp[1] == '\0')
++ break;
++
++ skipesc = 0;
++ if (cp[1] == com)
++ skipesc += (flags & FPARSELN_UNESCCOMM);
++ if (cp[1] == con)
++ skipesc += (flags & FPARSELN_UNESCCONT);
++ if (cp[1] == esc)
++ skipesc += (flags & FPARSELN_UNESCESC);
++ if (cp[1] != com && cp[1] != con && cp[1] != esc)
++ skipesc = (flags & FPARSELN_UNESCREST);
++
++ if (skipesc)
++ cp++;
++ else
++ *ptr++ = *cp++;
++ *ptr++ = *cp++;
++ }
++ *ptr = '\0';
++ len = strlen(buf);
++ }
++
++ if (size)
++ *size = len;
++ return buf;
++}
++
++#ifdef TEST
++
++int main __P((int, char **));
++
++int
++main(argc, argv)
++ int argc;
++ char **argv;
++{
++ char *ptr;
++ size_t size, line;
++
++ line = 0;
++ while ((ptr = fparseln(stdin, &size, &line, NULL,
++ FPARSELN_UNESCALL)) != NULL)
++ printf("line %d (%d) |%s|\n", line, size, ptr);
++ return 0;
++}
++
++/*
++
++# This is a test
++line 1
++line 2 \
++line 3 # Comment
++line 4 \# Not comment \\\\
++
++# And a comment \
++line 5 \\\
++line 6
++
++*/
++
++#endif /* TEST */
diff --git a/pkgtools/ftp/patches/patch-ad b/pkgtools/ftp/patches/patch-ad
new file mode 100644
index 00000000000..648f60e0e0d
--- /dev/null
+++ b/pkgtools/ftp/patches/patch-ad
@@ -0,0 +1,93 @@
+$NetBSD: patch-ad,v 1.1 1998/09/30 10:27:54 hubertf Exp $
+
+We need the FPARSELN constants for fparseln(3)
+
+--- /dev/null Tue Sep 29 16:43:01 1998
++++ util.h Tue Sep 29 16:50:46 1998
+@@ -0,0 +1,86 @@
++/* NetBSD: util.h,v 1.10 1997/12/01 02:25:46 lukem Exp */
++
++/*-
++ * Copyright (c) 1995
++ * The Regents of the University of California. 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.
++ * 3. All advertising materials mentioning features or use of this software
++ * must display the following acknowledgement:
++ * This product includes software developed by the University of
++ * California, Berkeley and its contributors.
++ * 4. Neither the name of the University nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
++ */
++
++#ifndef _UTIL_H_
++#define _UTIL_H_
++
++#include <sys/cdefs.h>
++#include <sys/ttycom.h>
++#include <sys/types.h>
++#include <stdio.h>
++#include <pwd.h>
++#include <termios.h>
++#include <utmp.h>
++
++#define PIDLOCK_NONBLOCK 1
++#define PIDLOCK_USEHOSTNAME 2
++
++#define FPARSELN_UNESCESC 0x01
++#define FPARSELN_UNESCCONT 0x02
++#define FPARSELN_UNESCCOMM 0x04
++#define FPARSELN_UNESCREST 0x08
++#define FPARSELN_UNESCALL 0x0f
++
++__BEGIN_DECLS
++void login __P((struct utmp *));
++int login_tty __P((int));
++int logout __P((const char *));
++void logwtmp __P((const char *, const char *, const char *));
++int pw_lock __P((int retries));
++int pw_mkdb __P((void));
++int pw_abort __P((void));
++void pw_init __P((void));
++void pw_edit __P((int notsetuid, const char *filename));
++void pw_prompt __P((void));
++void pw_copy __P((int ffd, int tfd, struct passwd *pw,
++ struct passwd *old_pw));
++int pw_scan __P((char *bp, struct passwd *pw, int *flags));
++void pw_error __P((const char *name, int err, int eval));
++int openpty __P((int *, int *, char *, struct termios *,
++ struct winsize *));
++char *fparseln __P((FILE *, size_t *, size_t *, const char[3], int));
++pid_t forkpty __P((int *, char *, struct termios *, struct winsize *));
++int getmaxpartitions __P((void));
++int getrawpartition __P((void));
++int opendisk __P((const char *, int, char *, size_t, int));
++int pidlock __P((const char *, int, pid_t *, const char *));
++int ttylock __P((const char *, int, pid_t *));
++int ttyunlock __P((const char *));
++int ttyaction __P((char *tty, char *act, char *user));
++struct iovec;
++char *ttymsg __P((struct iovec *, int, const char *, int));
++__END_DECLS
++
++#endif /* !_UTIL_H_ */
diff --git a/pkgtools/ftp/patches/patch-ae b/pkgtools/ftp/patches/patch-ae
new file mode 100644
index 00000000000..fc28cacc8e9
--- /dev/null
+++ b/pkgtools/ftp/patches/patch-ae
@@ -0,0 +1,18 @@
+$NetBSD: patch-ae,v 1.1 1998/09/30 10:27:54 hubertf Exp $
+
+--- Makefile.orig Thu Jul 23 13:13:14 1998
++++ Makefile Wed Sep 30 09:08:58 1998
+@@ -3,11 +3,12 @@
+
+ PROG= ftp
+ SRCS= cmds.c cmdtab.c complete.c domacro.c fetch.c ftp.c main.c ruserpass.c \
+- util.c
++ util.c fparseln.c
+
+ # Uncomment the following to provide defaults for gate-ftp operation
+ #
+ #CPPFLAGS+=-DGATE_SERVER=\"ftp-gw.host\" # -DGATE_PORT=21
++CPPFLAGS+= -I.
+
+ LDADD+= -ledit -ltermcap -lutil
+ DPADD+= ${LIBEDIT} ${LIBTERMCAP} ${LIBUTIL}