summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1995-12-26 05:11:06 +0000
committerpeter <peter@FreeBSD.org>1995-12-26 05:11:06 +0000
commit256260b5ebdae6fc252bc9ceaa12f6323e320a13 (patch)
treeb00077bb9df4a9ae9ca851380c794187f6425dfe /usr.sbin
parent0f0c1319be7a6a44be1d4618b57bb658be4021e0 (diff)
downloadFreeBSD-src-256260b5ebdae6fc252bc9ceaa12f6323e320a13.zip
FreeBSD-src-256260b5ebdae6fc252bc9ceaa12f6323e320a13.tar.gz
Apply ports/net/sup/patches/patch-ab
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/sup/lib/scan.c41
-rw-r--r--usr.sbin/sup/sup/sup.113
-rw-r--r--usr.sbin/sup/supfilesrv/supservers.813
-rw-r--r--usr.sbin/sup/supscan/supscan.c61
4 files changed, 100 insertions, 28 deletions
diff --git a/usr.sbin/sup/lib/scan.c b/usr.sbin/sup/lib/scan.c
index 9547ab6..edb42ea 100644
--- a/usr.sbin/sup/lib/scan.c
+++ b/usr.sbin/sup/lib/scan.c
@@ -28,6 +28,9 @@
**********************************************************************
* HISTORY
* $Log: scan.c,v $
+ * Revision 1.2 1995/12/26 05:02:48 peter
+ * Apply ports/net/sup/patches/patch-aa...
+ *
* Revision 1.1.1.1 1995/12/26 04:54:47 peter
* Import the unmodified version of the sup that we are using.
* The heritage of this version is not clear. It appears to be NetBSD
@@ -188,7 +191,7 @@ static listdir();
static omitanyone();
static anyglob();
static int getscanfile();
-static chkscanfile();
+static int chkscanfile();
static makescanfile();
static recordone();
static recordexec();
@@ -327,13 +330,15 @@ char *release;
return (TRUE);
}
-makescanlists ()
+makescanlists (releases)
+ char **releases;
{
TREELIST *tl;
char buf[STRINGLENGTH];
char *p,*q;
FILE *f;
char *saveprefix = prefix;
+ char **rel_index;
int count = 0;
(void) sprintf (buf,FILERELEASES,collname);
@@ -352,14 +357,26 @@ makescanlists ()
goaway ("Can't chdir to %s",prefix);
(void) chdir (basedir);
}
- makescan (tl->TLlist,tl->TLscan);
+ if (releases)
+ {
+ rel_index = releases;
+ while (*rel_index) {
+ if (!strcmp (*rel_index, tl->TLname)) {
+ makescan (tl->TLlist,tl->TLscan);
+ break;
+ }
+ rel_index++;
+ }
+ }
+ else
+ makescan (tl->TLlist,tl->TLscan);
free ((char *)tl);
count++;
}
(void) fclose (f);
}
if (count == 0)
- makescan ((char *)NULL,(char *)NULL);
+ makescan ((char *)NULL,FILESCANDEF);
}
static
@@ -405,10 +422,11 @@ makescan (listfile,scanfile)
char *listfile,*scanfile;
{
listT = NULL;
- chkscanfile (scanfile); /* can we can write a scan file? */
- doscan (listfile); /* read list file and scan disk */
- makescanfile (scanfile); /* record names in scan file */
- Tfree (&listT); /* free file list tree */
+ if(chkscanfile (scanfile)) { /* can we can write a scan file? */
+ doscan (listfile); /* read list file and scan disk */
+ makescanfile (scanfile);/* record names in scan file */
+ Tfree (&listT); /* free file list tree */
+ }
}
static
@@ -821,7 +839,7 @@ char *scanfile;
register TREELIST *tl;
if (scanfile == NULL)
- scanfile = FILESCANDEF;
+ return(FALSE);
(void) sprintf (buf,FILESCAN,collname,scanfile);
if (stat(buf,&sbuf) < 0)
return (FALSE);
@@ -929,7 +947,7 @@ char *scanfile;
FILE *f;
if (scanfile == NULL)
- scanfile = FILESCANDEF;
+ return(FALSE);
(void) sprintf (fname,FILESCAN,collname,scanfile);
(void) sprintf (tname,"%s.temp",fname);
if (NULL == (f = fopen (tname, "w")))
@@ -938,6 +956,7 @@ char *scanfile;
(void) unlink (tname);
(void) fclose (f);
}
+ return(TRUE);
}
static makescanfile (scanfile)
@@ -948,8 +967,6 @@ char *scanfile;
FILE *scanF; /* output file for scanned file list */
int recordone ();
- if (scanfile == NULL)
- scanfile = FILESCANDEF;
(void) sprintf (fname,FILESCAN,collname,scanfile);
(void) sprintf (tname,"%s.temp",fname);
scanF = fopen (tname,"w");
diff --git a/usr.sbin/sup/sup/sup.1 b/usr.sbin/sup/sup/sup.1
index 0e860c6..b5a4d65 100644
--- a/usr.sbin/sup/sup/sup.1
+++ b/usr.sbin/sup/sup/sup.1
@@ -23,6 +23,9 @@
.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.\" HISTORY
.\" $Log: sup.1,v $
+.\" Revision 1.2 1995/12/26 05:03:02 peter
+.\" Apply ports/net/sup/patches/patch-aa...
+.\"
.\" Revision 1.1.1.1 1995/12/26 04:54:46 peter
.\" Import the unmodified version of the sup that we are using.
.\" The heritage of this version is not clear. It appears to be NetBSD
@@ -721,8 +724,10 @@ to use a different parent directory for the files in this release.
.I list=<listname>
to specify the list of files in the release.
.I scan=<scanfile>
-must be used in multi-release collections that are scanned to keep
-the scan files for the different releases separate.
+tells supscan to generate
+.B scanfile
+for this release. Supscan will only generate scan files for releases that specify
+a scanfile or for collections that do not have a releases file.
.I host=<hostfile>
to allow different host restrictions for this release.
.I next=<release>
@@ -730,7 +735,7 @@ used to chain releases together. This has the effect of making one release
be a combination of serveral other releases. If the same file appears in
more than one chained release, the first one found will be used.
If these files are not specified for a release the default names:
-prefix,list,scan and host will be used.
+prefix, list and host will be used.
.TP
.B scan
This file, created by
@@ -936,7 +941,7 @@ file containing the name of the prefix directory
for a collection
.TP
<\fIbase-directory\fR>\fB/sup/\fR<\fIcollection\fR>\fB/scan
-scan file for a collection
+default scan file for a collection if no release file exists
.TP
\fB/usr/\fR<\fIcollection\fR>
default base directory for a file collection
diff --git a/usr.sbin/sup/supfilesrv/supservers.8 b/usr.sbin/sup/supfilesrv/supservers.8
index b39e1fc..c0f8488 100644
--- a/usr.sbin/sup/supfilesrv/supservers.8
+++ b/usr.sbin/sup/supfilesrv/supservers.8
@@ -23,6 +23,11 @@
.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.\" HISTORY
.\" $Log: supservers.8,v $
+.\" Revision 1.1.1.1 1995/12/26 04:54:48 peter
+.\" Import the unmodified version of the sup that we are using.
+.\" The heritage of this version is not clear. It appears to be NetBSD
+.\" derived from some time ago.
+.\"
.\" Revision 1.1.1.1 1993/08/21 00:46:35 jkh
.\" Current sup with compression support.
.\"
@@ -167,6 +172,14 @@ will cause
.I
supscan
to produce output messages as it scans the files in the collection.
+The "release" option
+.I -r
+causes
+.I supscan
+to only update the scan file for the specified release. More than one
+release may be specified by using
+.I -r
+multiple times.
The "system" flag
.I
-s
diff --git a/usr.sbin/sup/supscan/supscan.c b/usr.sbin/sup/supscan/supscan.c
index f43623d..fb7a0b9 100644
--- a/usr.sbin/sup/supscan/supscan.c
+++ b/usr.sbin/sup/supscan/supscan.c
@@ -25,20 +25,27 @@
/*
* supscan -- SUP Scan File Builder
*
- * Usage: supscan [ -v ] collection [ basedir ]
+ * Usage: supscan [ -v ] collection [ -r release ] [ basedir ]
* supscan [ -v ] -f dirfile
* supscan [ -v ] -s
- * -f "file" -- use dirfile instead of system coll.dir
- * -s "system" -- perform scan for system supfile
- * -v "verbose" -- print messages as you go
- * collection -- name of the desired collection if not -s
- * basedir -- name of the base directory, if not
- * the default or recorded in coll.dir
- * dirfile -- name of replacement for system coll.dir.
+ * -f "file" -- use dirfile instead of system coll.dir
+ * -r "release" -- scan only the specified release. Multiple
+ * releases can be specified.
+ * -s "system" -- perform scan for system supfile
+ * -v "verbose" -- print messages as you go
+ * collection -- name of the desired collection if not -s
+ * basedir -- name of the base directory, if not
+ * the default or recorded in coll.dir
+ * dirfile -- name of replacement for system coll.dir.
*
**********************************************************************
* HISTORY
* $Log: supscan.c,v $
+ * Revision 1.1.1.1 1995/12/26 04:54:48 peter
+ * Import the unmodified version of the sup that we are using.
+ * The heritage of this version is not clear. It appears to be NetBSD
+ * derived from some time ago.
+ *
* Revision 1.1.1.1 1993/08/21 00:46:35 jkh
* Current sup with compression support.
*
@@ -158,6 +165,8 @@ COLLECTION *firstC; /* collection list pointer */
char *collname; /* collection name */
char *basedir; /* base directory name */
char *prefix; /* collection pathname prefix */
+char **releases = NULL; /* releases to scan */
+int numreleases = 0; /* size of releases */
long lasttime = 0; /* time of last upgrade */
long scantime; /* time of this scan */
int newonly = FALSE; /* new files only */
@@ -190,7 +199,8 @@ char **argv;
ctime (&scantime));
(void) fflush (stdout);
if (!setjmp (sjbuf)) {
- makescanlists (); /* record names in scan files */
+ /* record names in scan files */
+ makescanlists (releases);
scantime = time ((long *)NULL);
printf ("SUP Scan for %s completed at %s",collname,
ctime (&scantime));
@@ -215,9 +225,19 @@ char **argv;
usage ()
{
- fprintf (stderr,"Usage: supscan [ -v ] collection [ basedir ]\n");
- fprintf (stderr," supscan [ -v ] -f dirfile\n");
- fprintf (stderr," supscan [ -v ] -s\n");
+ fprintf(stderr,"Usage: supscan [ -v ] [ -r release ] collection [ basedir ]\n"
+ " supscan [ -v ] [ -r release ] -f dirfile\n"
+ " supscan [ -v ] [ -r release ] -s\n"
+ " supscan [ -v ] [ -r release ] -s\n"
+ " -f \"file\" -- use dirfile instead of system coll.dir\n"
+ " -r \"release\" -- scan only the specified release. Multiple\n"
+ " releases can be specified.\n"
+ " -s \"system\" -- perform scan for system supfile\n"
+ " -v \"verbose\" -- print messages as you go\n"
+ " collection -- name of the desired collection if not -s\n"
+ " basedir -- name of the base directory, if not\n"
+ " the default or recorded in coll.dir\n"
+ " dirfile -- name of replacement for system coll.dir.\n");
exit (1);
}
@@ -244,6 +264,23 @@ char **argv;
argv++;
filename = argv[1];
break;
+ case 'r':
+ if (argc == 2)
+ usage ();
+ --argc;
+ argv++;
+ if (argv[1][0] == '-')
+ usage ();
+ numreleases++;
+ releases = (char **)realloc(releases,
+ sizeof(*releases) * (numreleases+1));
+ if (!releases) {
+ fprintf(stderr,"supscan: cannot malloc!\n");
+ exit(1);
+ }
+ releases[numreleases - 1] = argv[1];
+ releases[numreleases] = NULL;
+ break;
case 'v':
trace = TRUE;
break;
OpenPOWER on IntegriCloud