Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

12
net/batchftp/DESCR Normal file
View File

@@ -0,0 +1,12 @@
Batchftp is a C program which automates the ftp process on Berkeley
UNIX systems. A user is able to upload and download files from almost
any remote computer without monitoring the transfer. A user simply
enters the commands or files to be retrieved in an input file. Then,
the program will log onto the specified computer (not necessarily a
ftp site) and execute the given commands. Since Batchftp can run in
the background, a user is free to do other things while the transfer
sessions are taking place. More importantly, it will not give up until
a successful connection has been established with the remote
site. However, execution will be temporarily suspended after a given
number of failures; connection attempts will resume after the extended
delay.

24
net/batchftp/Makefile Normal file
View File

@@ -0,0 +1,24 @@
# $NetBSD: Makefile,v 1.16 2012/10/23 17:18:11 asau Exp $
DISTNAME= batchftp102
PKGNAME= batchftp-1.02
PKGREVISION= 1
CATEGORIES= net
MASTER_SITES= ftp://ftp.fu-berlin.de/unix/network/batchftp/
MAINTAINER= pkgsrc-users@NetBSD.org
COMMENT= Automatically download files via the FTP protocol
PKG_INSTALLATION_TYPES= overwrite pkgviews
WRKSRC= ${WRKDIR}
CPPFLAGS.Interix+= -Dsetpgrp=setpgid
MAKE_ENV+= BINOWN=${BINOWN:Q} BINGRP=${BINGRP:Q}
INSTALLATION_DIRS= bin share/doc/batchftp
post-extract:
${LN} -fs ${FILESDIR}/Makefile ${WRKSRC}
.include "../../mk/bsd.pkg.mk"

3
net/batchftp/PLIST Normal file
View File

@@ -0,0 +1,3 @@
@comment $NetBSD: PLIST,v 1.2 2009/06/14 18:09:22 joerg Exp $
bin/batchftp
share/doc/batchftp/batchftp.doc

6
net/batchftp/distinfo Normal file
View File

@@ -0,0 +1,6 @@
$NetBSD: distinfo,v 1.5 2006/12/18 22:46:53 rillig Exp $
SHA1 (batchftp102.tar.gz) = 8d4e21719e9c1e8114e254ef7329cc192e824635
RMD160 (batchftp102.tar.gz) = abd392131b18b3381747e7d45263ad0e828c0980
Size (batchftp102.tar.gz) = 20507 bytes
SHA1 (patch-aa) = 46ce0bce79e930042b437a0ba8011dba7fedfd00

View File

@@ -0,0 +1,9 @@
# $NetBSD: Makefile,v 1.1.1.1 1999/05/30 21:34:39 tron Exp $
PROG= batchftp
MKMAN= no
BINDIR= ${PREFIX}/bin
FILES= batchftp.doc
FILESDIR= ${PREFIX}/share/doc/batchftp
.include <bsd.prog.mk>

View File

@@ -0,0 +1,253 @@
$NetBSD: patch-aa,v 1.4 2006/12/18 22:46:53 rillig Exp $
--- batchftp.c.orig 1990-10-23 21:12:42.000000000 +0100
+++ batchftp.c 2006-12-18 23:44:29.000000000 +0100
@@ -5,10 +5,16 @@
requests, and execute all other ftp commands. A user has the option to run
the program in either the background or the foreground. */
+#include <limits.h>
+
#define _DIR_PATH 200 /* directory path name length -- can be set to MAXPATHNAMELEN */
#define _NULL 0
#define _HOSTLEN MAXHOSTNAMELEN + 80 /* local hostname + domain + network */
+#if defined(NAME_MAX)
+#define _PATHLEN _DIR_PATH + NAME_MAX /* file path length -- directory + filename */
+#else
#define _PATHLEN _DIR_PATH + MAXNAMLEN /* file path length -- directory + filename */
+#endif
#define _TRUE 1
#define _FALSE 0
@@ -47,7 +53,8 @@
#include <sys/file.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/dir.h>
+#include <dirent.h>
+#include <string.h>
#include <sys/socket.h>
#include <netdb.h>
@@ -60,16 +67,18 @@
#include <pwd.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+static void init_sh_script(char *, char *, char *);
+static void init_fscript (char *, char *, char *, FILE **);
+static void start_session (FILE **, char *, char *, char *, char *);
typedef char boolean;
/* All string functions used in Batchftp are user-defined */
-char *strcpy ();
-int strlen ();
-int strncmp ();
char *substr ();
-char *strcat ();
int strpos ();
int process_entry ();
@@ -95,12 +104,17 @@ int h_errno;
an error such as "multiply defined variable during compilation or linking,
delete the above declaration. */
+int
main (argc, argv)
int argc;
char *argv[];
{
char msgfile[_PATHLEN]; /* file containing output for all ftp transfer sessions */
+#if defined(NAME_MAX)
+ char ftp_script[NAME_MAX + 1]; /* file containing ftp commands */
+#else
char ftp_script[MAXNAMLEN + 1]; /* file containing ftp commands */
+#endif
char user_name[_LOGIN_LENGTH + 1]; /* user's login name */
char pass_word[_PASS_LENGTH + 1]; /* password used for ftp login */
char local_dir[_DIR_PATH]; /* local directory for ftp session */
@@ -108,8 +122,13 @@ char *argv[];
char remote_dir[_DIR_PATH]; /* remote directory for ftp session */
char input_file[_PATHLEN]; /* user supplied file containing ftp commands and/or shorthand notation */
char remote_host[_HOSTLEN]; /* remote hostname */
+#if defined(NAME_MAX)
+ char f_stdout[NAME_MAX + 1]; /* file containing output for a single transfer session */
+ char sh_name[NAME_MAX + 1]; /* name of exec'd sh script -- 1 line ftp command */
+#else
char f_stdout[MAXNAMLEN + 1]; /* file containing output for a single transfer session */
char sh_name[MAXNAMLEN + 1]; /* name of exec'd sh script -- 1 line ftp command */
+#endif
char linebuf[_LBUF]; /* one line of user's input file */
boolean start_flag = _FALSE; /* indicates whether ftp attempt should begin */
@@ -129,7 +148,7 @@ char *argv[];
parent_pid = (int) getpid(); /* sprintf does not always support type "long" */
- getwd(home_dir);
+ getcwd(home_dir,sizeof(home_dir));
sprintf(msgfile, "%s/msg%d",home_dir, parent_pid); /*construct full pathname for ftp output file */
/* Parse command line switches and assign other arguments */
@@ -242,7 +261,7 @@ char *remote_host;
/* extern int h_errno is global flag defined in <netdb.h> */
strcpy(temp_host, remote_host);
- if (inet_addr(remote_host) != -1) /* check for valid Internet address */
+ if (inet_addr(remote_host) != INADDR_NONE) /* check for valid Internet address */
return(remote_host);
do {
@@ -307,6 +326,7 @@ char *local_host;
the responsibility of the user to enter the proper login
information in the input file (free-form mode). */
+static void
init_fscript (remote_host, user_name, pass_word, fptr)
char *remote_host;
char *user_name;
@@ -353,6 +373,7 @@ char *s;
/* Init_sh_script creates the one line (not including interpreter) Bourne
shell script to be exec'd during the ftp session. */
+static void
init_sh_script(f_stdout, ftp_script, sh_name)
char *f_stdout;
char *ftp_script;
@@ -716,6 +737,7 @@ int *address_flag;
ftp command are killed simultaneously. Otherwise, the child is not
signalled, and it will terminate naturally. */
+static void
start_ftp (mptr, f_stdout, sh_name, alarm_flag, ftp_script)
FILE **mptr;
char *f_stdout;
@@ -729,7 +751,7 @@ char *ftp_script;
FILE *fs_ptr; /* pointer to f_stdout */
FILE *msg_ptr; /* pointer to ftp output file */
int monitor_flag; /* return value of monitor_ftp () */
- union wait status; /* wait for child to terminate */
+ int status; /* wait for child to terminate */
char *sh_args[3]; /* arguments for execv */
*alarm_flag = _FALSE; /* alarm has not been called */
@@ -755,7 +777,7 @@ char *ftp_script;
sh_args[1] = sh_name;
sh_args[2] = 0;
- if ((int) signal(SIGALRM, alarm_handler) == -1) {
+ if (signal(SIGALRM, alarm_handler) == (void *)-1) {
fprintf(*mptr, "\nSYSTEM ERROR -- Unable to establish timer");
return;
}
@@ -944,6 +966,7 @@ unsigned sleep_time;
reset. Start_session will not terminate until check_ftp() returns a value
other than -1 */
+static void
start_session (mptr, f_stdout, sh_name, ftp_script, msgfile)
FILE **mptr;
char *f_stdout;
@@ -958,6 +981,7 @@ char *msgfile;
int monitor_flag; /* return value of monitor_ftp () */
int check_flag; /* return value of check_ftp () */
+ check_flag = 0; /* XXX: gcc */
do {
msg_ptr = *mptr;
sleep_time = connect_delay(sleep_time);
@@ -986,69 +1010,6 @@ char *msgfile;
}
/*------------------------------------------------------- */
-int strlen (s)
-
-register char *s;
-{
- register int n = 0;
-
- while (*s++)
- ++n;
-
- return (n);
-}
-/* -------------------------------------------------- */
-
-int strncmp (s1, s2, n)
-
-register char *s1, *s2;
-register int n;
-{
- if (n < 1)
- return (_INVARG);
-
- {
- register int char_count = -1;
-
- while ((++char_count < n) && (*s1) && (*s2)) {
- if (*s1 > *s2)
- return (_GREATER);
-
- if (*s1++ < *s2++)
- return (_LESS);
- }
-
- if (char_count == n)
- return (_EQUAL);
-
-
- if (*s1 > *s2)
- return (_GREATER);
-
- if (*s1 < *s2)
- return (_LESS);
-
- }
-
- return (_EQUAL);
-}
-
-/*--------------------------------------------------- */
-
-char *strcpy (s1, s2)
-
-register char *s1, *s2;
-{
-
- register char *ptr;
-
- ptr = s1;
- while (*ptr++ = *s2++)
- ;
-
- return (s1);
-}
-/*---------------------------------------------------------- */
char *substr (s1, s2)
register char *s1, *s2;
@@ -1068,20 +1029,6 @@ register char *s1, *s2;
}
/* -------------------------------------------------- */
-char *strcat (s1, s2)
-
-register char *s1, *s2;
-{
- register char *p;
-
- p = s1;
- while (*p++)
- ;
-
- --p;
- strcpy (p, s2);
- return (s1);
-}
/*--------------------------------------------------------- */
int strpos (s, c)