mirror of
https://github.com/GnoConsortium/gno.git
synced 2024-06-11 09:29:27 +00:00
Minor bug fixes for descu. See PR#66, PR#94, PR#95, and the README
file with the describe source.
This commit is contained in:
parent
c1c6594ed0
commit
07e0f96d2a
|
@ -1,7 +1,7 @@
|
||||||
$Id: README,v 1.8 1998/02/07 06:39:53 gdr-ftp Exp $
|
$Id: README,v 1.9 1999/04/05 19:47:19 gdr-ftp Exp $
|
||||||
|
|
||||||
This is the README file for the describe package. This package is
|
This is the README file for the describe package. This package is
|
||||||
designated as version 1.0.6, and consists of the following utilities:
|
designated as version 1.0.7, and consists of the following utilities:
|
||||||
|
|
||||||
describe - show database entries describing the current
|
describe - show database entries describing the current
|
||||||
status of programs
|
status of programs
|
||||||
|
@ -131,6 +131,17 @@ CHANGES
|
||||||
|
|
||||||
This details changes to the entire distribution.
|
This details changes to the entire distribution.
|
||||||
|
|
||||||
|
v1.0.7 April 1999
|
||||||
|
Make sure that if descu's rejects file already exists, that it
|
||||||
|
is a regular file. This prevents us from overwriting it.
|
||||||
|
If the rejects file is empty at the end of the run, then delete it.
|
||||||
|
Don't emit unchanged entries into the rejects file. Changes are
|
||||||
|
based on a whitespace-insensitive and case-insensitive
|
||||||
|
on all fields.
|
||||||
|
In descu, fix a bug that would sometimes eliminate blank lines
|
||||||
|
between the "FTP:" header and the description.
|
||||||
|
Removed some dead code in descu.
|
||||||
|
|
||||||
v1.0.6 February 1998
|
v1.0.6 February 1998
|
||||||
There used to be a limit of 65k on the size of the describe
|
There used to be a limit of 65k on the size of the describe
|
||||||
database source when using descu. This limit was imposed
|
database source when using descu. This limit was imposed
|
||||||
|
|
|
@ -2,14 +2,15 @@
|
||||||
* Header file for the describe package. This file is
|
* Header file for the describe package. This file is
|
||||||
* used by describe(1), descc(8), and descu(8).
|
* used by describe(1), descc(8), and descu(8).
|
||||||
*
|
*
|
||||||
* $Id: desc.h,v 1.7 1998/02/07 06:39:55 gdr-ftp Exp $
|
* $Id: desc.h,v 1.8 1999/04/05 19:47:19 gdr-ftp Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Keep these utilities in lockstep. Don't forget to change the version
|
* Keep these utilities in lockstep. Don't forget to change the version
|
||||||
* number in the *.rez files and in the manual pages.
|
* number in the *.rez files and in the manual pages.
|
||||||
*/
|
*/
|
||||||
#define _VERSION_ "v1.0.6"
|
#define _VERSION_ "v1.0.7"
|
||||||
|
#define CURRENT_YEAR "1999"
|
||||||
|
|
||||||
#define QUOTE_CHAR '#'
|
#define QUOTE_CHAR '#'
|
||||||
#define DATABASE "/usr/lib/describe.db"
|
#define DATABASE "/usr/lib/describe.db"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
.\"
|
.\"
|
||||||
.\" $Id: descc.8,v 1.7 1998/02/07 06:39:57 gdr-ftp Exp $
|
.\" $Id: descc.8,v 1.8 1999/04/05 19:47:19 gdr-ftp Exp $
|
||||||
.\"
|
.\"
|
||||||
.TH DESCC 8 "6 February 1998" GNO "System Administration"
|
.TH DESCC 8 "6 February 1998" GNO "System Administration"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
|
@ -13,7 +13,7 @@ descc \- the describe(1) source compiler
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
This manual page documents
|
This manual page documents
|
||||||
.BR descc
|
.BR descc
|
||||||
version 1.0.6.
|
version 1.0.7.
|
||||||
.LP
|
.LP
|
||||||
.BR descc
|
.BR descc
|
||||||
compiles the describe source file
|
compiles the describe source file
|
||||||
|
@ -55,7 +55,7 @@ a complete record:
|
||||||
.nf
|
.nf
|
||||||
|
|
||||||
Name: describe
|
Name: describe
|
||||||
Version: 1.0.6
|
Version: 1.0.7
|
||||||
Shell: GNO, ORCA/Shell
|
Shell: GNO, ORCA/Shell
|
||||||
Author: James Brookes
|
Author: James Brookes
|
||||||
Contact: jamesb@ecst.csuchico.edu
|
Contact: jamesb@ecst.csuchico.edu
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Name: descc
|
Name: descc
|
||||||
Version: 1.0.6
|
Version: 1.0.7
|
||||||
Shell: ORCA/Shell, GNO/ME
|
Shell: ORCA/Shell, GNO/ME
|
||||||
Author: James Brookes
|
Author: James Brookes
|
||||||
Contact: jamesb@ecst.csuchico.edu
|
Contact: jamesb@ecst.csuchico.edu
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Resources for version and comment
|
* Resources for version and comment
|
||||||
*
|
*
|
||||||
* $Id: descc.rez,v 1.4 1998/03/08 17:58:41 gdr-ftp Exp $
|
* $Id: descc.rez,v 1.5 1999/04/05 19:47:19 gdr-ftp Exp $
|
||||||
*/
|
*/
|
||||||
#include "Types.rez"
|
#include "Types.rez"
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ resource rVersion (1, purgeable3) {
|
||||||
* Comment
|
* Comment
|
||||||
*/
|
*/
|
||||||
resource rComment (1, purgeable3) {
|
resource rComment (1, purgeable3) {
|
||||||
PROG " v1.0.6\n"
|
PROG " v1.0.7\n"
|
||||||
DESC " (GNO) \n"
|
DESC " (GNO) \n"
|
||||||
BUILD_DATE "\n"
|
BUILD_DATE "\n"
|
||||||
AUTHOR
|
AUTHOR
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
.\"
|
.\"
|
||||||
.\" $Id: describe.1,v 1.7 1998/02/07 06:40:00 gdr-ftp Exp $
|
.\" $Id: describe.1,v 1.8 1999/04/05 19:47:19 gdr-ftp Exp $
|
||||||
.\"
|
.\"
|
||||||
.TH DESCRIBE 1 "6 February 1998" GNO "Commands and Applications"
|
.TH DESCRIBE 1 "6 February 1998" GNO "Commands and Applications"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
|
@ -13,7 +13,7 @@ describe \- show information about a program
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
This manual page documents
|
This manual page documents
|
||||||
.BR describe
|
.BR describe
|
||||||
version 1.0.6.
|
version 1.0.7.
|
||||||
.LP
|
.LP
|
||||||
.BR describe
|
.BR describe
|
||||||
will show current information about
|
will show current information about
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Name: describe
|
Name: describe
|
||||||
Version: 1.0.6
|
Version: 1.0.7
|
||||||
Shell: ORCA/Shell, GNO/ME
|
Shell: ORCA/Shell, GNO/ME
|
||||||
Author: James Brookes
|
Author: James Brookes
|
||||||
Contact: jamesb@ecst.csuchico.edu
|
Contact: jamesb@ecst.csuchico.edu
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Resources for version and comment
|
* Resources for version and comment
|
||||||
*
|
*
|
||||||
* $Id: describe.rez,v 1.4 1998/03/08 17:58:43 gdr-ftp Exp $
|
* $Id: describe.rez,v 1.5 1999/04/05 19:47:19 gdr-ftp Exp $
|
||||||
*/
|
*/
|
||||||
#include "Types.rez"
|
#include "Types.rez"
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ resource rVersion (1, purgeable3) {
|
||||||
* Comment
|
* Comment
|
||||||
*/
|
*/
|
||||||
resource rComment (1, purgeable3) {
|
resource rComment (1, purgeable3) {
|
||||||
PROG " v1.0.6\n"
|
PROG " v1.0.7\n"
|
||||||
DESC " (GNO) \n"
|
DESC " (GNO) \n"
|
||||||
BUILD_DATE "\n"
|
BUILD_DATE "\n"
|
||||||
AUTHOR
|
AUTHOR
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
.\"
|
.\"
|
||||||
.\" $Id: descu.8,v 1.7 1998/02/07 06:40:07 gdr-ftp Exp $
|
.\" $Id: descu.8,v 1.8 1999/04/05 19:47:19 gdr-ftp Exp $
|
||||||
.\"
|
.\"
|
||||||
.TH DESCU 8 "6 February 1998" GNO "System Administration"
|
.TH DESCU 8 "5 April 1999" GNO "System Administration"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
descu \- the describe(1) source updater
|
descu \- the describe(1) source updater
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -20,7 +20,7 @@ descu \- the describe(1) source updater
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
This manual page documents
|
This manual page documents
|
||||||
.BR descu
|
.BR descu
|
||||||
version 1.0.6.
|
version 1.0.7.
|
||||||
.LP
|
.LP
|
||||||
.BR descu
|
.BR descu
|
||||||
updates the describe source file
|
updates the describe source file
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
* Copyright 1995-1997 by Devin Reade for James Brookes' describe(1) utility.
|
* Copyright 1995-1997 by Devin Reade for James Brookes' describe(1) utility.
|
||||||
* See the included README file and man page for details.
|
* See the included README file and man page for details.
|
||||||
*
|
*
|
||||||
* $Id: descu.c,v 1.8 1998/02/07 06:40:08 gdr-ftp Exp $
|
* $Id: descu.c,v 1.9 1999/04/05 19:47:19 gdr-ftp Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -174,11 +174,6 @@ extract_info(char *source) {
|
||||||
if (q < p) {
|
if (q < p) {
|
||||||
*q++ = '\n';
|
*q++ = '\n';
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
if (q < p) {
|
|
||||||
*q++ = '\n';
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (q < p) {
|
if (q < p) {
|
||||||
*q = '\0';
|
*q = '\0';
|
||||||
}
|
}
|
||||||
|
@ -195,7 +190,7 @@ extract_info(char *source) {
|
||||||
|
|
||||||
/* move q to first non-whitespace character */
|
/* move q to first non-whitespace character */
|
||||||
q = p;
|
q = p;
|
||||||
while (isspace(*q)) q++;
|
while (isspace(*q) && *q != '\n') q++;
|
||||||
if (*q == '\0') break;
|
if (*q == '\0') break;
|
||||||
|
|
||||||
/* shift the buffer */
|
/* shift the buffer */
|
||||||
|
@ -426,9 +421,9 @@ int ns_stricmp (char *a, char *b) {
|
||||||
|
|
||||||
void version (char *progName) {
|
void version (char *progName) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%s version %s Copyright 1995-1997 Devin Reade\n"
|
"%s version %s Copyright 1995-%s Devin Reade\n"
|
||||||
"Freeware. See the manual page for copying restrictions.\n",
|
"Freeware. See the manual page for copying restrictions.\n",
|
||||||
progName,versionStr);
|
progName, versionStr, CURRENT_YEAR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -459,6 +454,7 @@ void usage(char *progName) {
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
static char *revisionMagic = "\n# Last revision:";
|
static char *revisionMagic = "\n# Last revision:";
|
||||||
|
static struct stat sbuf;
|
||||||
time_t t;
|
time_t t;
|
||||||
char *buffer;
|
char *buffer;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -500,6 +496,26 @@ int main(int argc, char **argv) {
|
||||||
/* show version info */
|
/* show version info */
|
||||||
if (Vflag) version(basename(argv[0]));
|
if (Vflag) version(basename(argv[0]));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Open the rejects file. Abort if it exists and is not a regular file
|
||||||
|
* (this is a security measure to avoid people putting in symlinks and
|
||||||
|
* thus overwriting files like, say, /etc/passwd).
|
||||||
|
*/
|
||||||
|
if (lstat(REJECT_FILE, &sbuf) < 0) {
|
||||||
|
if (errno != ENOENT) {
|
||||||
|
fprintf(stderr, "couldn't stat rejects file %s: %s\n",
|
||||||
|
REJECT_FILE, strerror(errno));
|
||||||
|
}
|
||||||
|
} else if (! S_ISREG(sbuf.st_mode)) {
|
||||||
|
fprintf(stderr, "%s exists and is not a regular file. Aborting\n",
|
||||||
|
REJECT_FILE);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
if ((rejfp = fopen(REJECT_FILE,"w+"))==NULL) {
|
||||||
|
perror("couldn't open rejects file");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* open output file if necessary. If the output filename matches
|
* open output file if necessary. If the output filename matches
|
||||||
* that of the first input file, then dump stuff to a temporary file.
|
* that of the first input file, then dump stuff to a temporary file.
|
||||||
|
@ -521,12 +537,6 @@ int main(int argc, char **argv) {
|
||||||
outfp = stdout;
|
outfp = stdout;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* open the rejects file */
|
|
||||||
if ((rejfp = fopen(REJECT_FILE,"w+"))==NULL) {
|
|
||||||
perror("couldn't open rejects file");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* read in original describe source file */
|
/* read in original describe source file */
|
||||||
if ((buffer = inhale(argv[optind])) != NULL) {
|
if ((buffer = inhale(argv[optind])) != NULL) {
|
||||||
insert(buffer,1);
|
insert(buffer,1);
|
||||||
|
@ -578,7 +588,9 @@ int main(int argc, char **argv) {
|
||||||
fprintf(outfp,"%s\n%s\n",entryArray2[j]->name,entryArray2[j]->data);
|
fprintf(outfp,"%s\n%s\n",entryArray2[j]->name,entryArray2[j]->data);
|
||||||
j++;
|
j++;
|
||||||
} else {
|
} else {
|
||||||
fprintf(rejfp,"%s\n%s\n",entryArray1[i]->name,entryArray1[i]->data);
|
if (ns_stricmp(entryArray1[i]->data, entryArray2[j]->data) != 0) {
|
||||||
|
fprintf(rejfp,"%s\n%s\n",entryArray1[i]->name,entryArray1[i]->data);
|
||||||
|
}
|
||||||
fprintf(outfp,"%s\n%s\n",entryArray2[j]->name,entryArray2[j]->data);
|
fprintf(outfp,"%s\n%s\n",entryArray2[j]->name,entryArray2[j]->data);
|
||||||
i++; j++;
|
i++; j++;
|
||||||
}
|
}
|
||||||
|
@ -599,8 +611,16 @@ int main(int argc, char **argv) {
|
||||||
fprintf(outfp,"%s",trailer);
|
fprintf(outfp,"%s",trailer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* close the files and exit */
|
/* Close the files and exit. Don't keep the rejects file if it is empty. */
|
||||||
fclose(rejfp);
|
fclose(rejfp);
|
||||||
|
if (lstat(REJECT_FILE, &sbuf) < 0) {
|
||||||
|
fprintf(stderr, "couldn't stat rejects file %s: %s\n",
|
||||||
|
REJECT_FILE, strerror(errno));
|
||||||
|
} else {
|
||||||
|
if ((sbuf.st_size == 0) && S_ISREG(sbuf.st_mode)) {
|
||||||
|
unlink(REJECT_FILE);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (oflag) {
|
if (oflag) {
|
||||||
if (temp != NULL) {
|
if (temp != NULL) {
|
||||||
/* temp and outfp refer to the same FILE struct at this point */
|
/* temp and outfp refer to the same FILE struct at this point */
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Name: descu
|
Name: descu
|
||||||
Version: 1.0.6
|
Version: 1.0.7
|
||||||
Shell: ORCA/Shell, GNO/ME
|
Shell: ORCA/Shell, GNO/ME
|
||||||
Author: Devin Reade
|
Author: Devin Reade
|
||||||
Contact: gdr@trenco.gno.org
|
Contact: gdr@trenco.gno.org
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Resources for version and comment
|
* Resources for version and comment
|
||||||
*
|
*
|
||||||
* $Id: descu.rez,v 1.4 1998/03/08 17:58:44 gdr-ftp Exp $
|
* $Id: descu.rez,v 1.5 1999/04/05 19:47:20 gdr-ftp Exp $
|
||||||
*/
|
*/
|
||||||
#include "Types.rez"
|
#include "Types.rez"
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ resource rVersion (1, purgeable3) {
|
||||||
* Comment
|
* Comment
|
||||||
*/
|
*/
|
||||||
resource rComment (1, purgeable3) {
|
resource rComment (1, purgeable3) {
|
||||||
PROG " v1.0.6\n"
|
PROG " v1.0.7\n"
|
||||||
DESC " (GNO) \n"
|
DESC " (GNO) \n"
|
||||||
BUILD_DATE "\n"
|
BUILD_DATE "\n"
|
||||||
AUTHOR
|
AUTHOR
|
||||||
|
|
Loading…
Reference in New Issue
Block a user