Skip to content

Commit

Permalink
* Tidied-up code for modern autoconf/automake/C99 compiler.
Browse files Browse the repository at this point in the history
        * Fixed apparent very old bug involving use of close instead of fclose.

        * Updated copyright notices to 2014.
  • Loading branch information
jonathanhogg committed Mar 27, 2014
1 parent 50a871b commit 3f4365f
Show file tree
Hide file tree
Showing 22 changed files with 393 additions and 64 deletions.
10 changes: 9 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Usepackage Environment Manager
Copyright (C) 1995-2007 Jonathan Hogg <jonathan@onegoodidea.com>
Copyright (C) 1995-2014 Jonathan Hogg <jonathan@onegoodidea.com>
.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -15,6 +15,14 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

2014-03-27 Jonathan Hogg <me@jonathanhogg.com>

* Tidied-up code for modern autoconf/automake/C99 compiler.

* Fixed apparent very old bug involving use of close instead of fclose.

* Updated copyright notices to 2014.

2007-06-08 Jonathan Hogg <jonathan@onegoodidea.com>

* Tagged version 1.10 for release.
Expand Down
384 changes: 354 additions & 30 deletions INSTALL

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Usepackage Environment Manager
# Copyright (C) 1995-2007 Jonathan Hogg <jonathan@onegoodidea.com>
# Copyright (C) 1995-2014 Jonathan Hogg <jonathan@onegoodidea.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Usepackage Environment Manager
Copyright (C) 1995-2007 Jonathan Hogg <jonathan@onegoodidea.com>
Copyright (C) 1995-2014 Jonathan Hogg <jonathan@onegoodidea.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Usepackage Environment Manager
Copyright (C) 1995-2007 Jonathan Hogg <jonathan@onegoodidea.com>
Copyright (C) 1995-2014 Jonathan Hogg <jonathan@onegoodidea.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -71,7 +71,7 @@ of available packages with:

% use -l

usepackage 1.9, Copyright (C) 1995-2007 Jonathan Hogg
usepackage 1.9, Copyright (C) 1995-2014 Jonathan Hogg

Available packages are:

Expand Down
2 changes: 1 addition & 1 deletion bootstrap.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /bin/sh

# Usepackage Environment Manager
# Copyright (C) 1995-2007 Jonathan Hogg <jonathan@onegoodidea.com>
# Copyright (C) 1995-2014 Jonathan Hogg <jonathan@onegoodidea.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
11 changes: 3 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Usepackage Environment Manager
# Copyright (C) 1995-2007 Jonathan Hogg <jonathan@onegoodidea.com>
# Copyright (C) 1995-2014 Jonathan Hogg <jonathan@onegoodidea.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -16,7 +16,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

AC_INIT(usepackage,1.10,jonathan@onegoodidea.com,usepackage)
AM_INIT_AUTOMAKE(usepackage,1.10)
AM_INIT_AUTOMAKE

AM_CONFIG_HEADER(config.h)
AC_PROG_CC
Expand All @@ -31,15 +31,10 @@ AC_CHECK_HEADER(string.h)
AC_CHECK_HEADER(sys/utsname.h)
AC_CHECK_HEADER(dirent.h)

AH_VERBATIM([MAILING_LIST],
[/* Mailing list address. */
#ifndef MAILING_LIST
# define MAILING_LIST "usepackage@onegoodidea.com"
#endif])
AH_VERBATIM([COPYRIGHT],
[/* Copyright string for the executable. */
#ifndef COPYRIGHT
# define COPYRIGHT "Copyright (C) 1995-2007 Jonathan Hogg"
# define COPYRIGHT "Copyright (C) 1995-2014 Jonathan Hogg"
#endif])

AC_OUTPUT(Makefile)
6 changes: 4 additions & 2 deletions grammar.y
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*****************************************************************************
*
* Usepackage Environment Manager
* Copyright (C) 1995-2007 Jonathan Hogg <jonathan@onegoodidea.com>
* Copyright (C) 1995-2014 Jonathan Hogg <jonathan@onegoodidea.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -55,6 +55,8 @@ char file_name[10][256];
FILE* file[10];

int include(char* filename);
int yyerror();
extern int yylex();

%}

Expand Down Expand Up @@ -303,7 +305,7 @@ int get_packages(linked_list** packages, linked_list** groups,

int yywrap()
{
close(file[stack_pointer--]);
fclose(file[stack_pointer--]);

if (stack_pointer != -1)
{
Expand Down
2 changes: 1 addition & 1 deletion linked_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*****************************************************************************
*
* Usepackage Environment Manager
* Copyright (C) 1995-2007 Jonathan Hogg <jonathan@onegoodidea.com>
* Copyright (C) 1995-2014 Jonathan Hogg <jonathan@onegoodidea.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion linked_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*****************************************************************************
*
* Usepackage Environment Manager
* Copyright (C) 1995-2007 Jonathan Hogg <jonathan@onegoodidea.com>
* Copyright (C) 1995-2014 Jonathan Hogg <jonathan@onegoodidea.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion match.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*****************************************************************************
*
* Usepackage Environment Manager
* Copyright (C) 1995-2007 Jonathan Hogg <jonathan@onegoodidea.com>
* Copyright (C) 1995-2014 Jonathan Hogg <jonathan@onegoodidea.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion package.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*****************************************************************************
*
* Usepackage Environment Manager
* Copyright (C) 1995-2007 Jonathan Hogg <jonathan@onegoodidea.com>
* Copyright (C) 1995-2014 Jonathan Hogg <jonathan@onegoodidea.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
3 changes: 1 addition & 2 deletions scanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*****************************************************************************
*
* Usepackage Environment Manager
* Copyright (C) 1995-2007 Jonathan Hogg <jonathan@onegoodidea.com>
* Copyright (C) 1995-2014 Jonathan Hogg <jonathan@onegoodidea.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -36,7 +36,6 @@ static char *bufp;
extern int stack_pointer;
extern int line_number[10];
extern char file_name[10][256];
extern FILE* file[10];

extern int include(char* filename);

Expand Down
2 changes: 1 addition & 1 deletion use.1.in
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ and detecting the style of environment output that should be used, see
.SH COPYRIGHT
.nf
Usepackage Environment Manager
Copyright (C) 1995-2007 Jonathan Hogg
Copyright (C) 1995-2014 Jonathan Hogg
.fi
.PP
This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion use.bsh.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Usepackage Environment Manager
# Copyright (C) 1995-2007 Jonathan Hogg <jonathan@onegoodidea.com>
# Copyright (C) 1995-2014 Jonathan Hogg <jonathan@onegoodidea.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion use.csh.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Usepackage Environment Manager
# Copyright (C) 1995-2007 Jonathan Hogg <jonathan@onegoodidea.com>
# Copyright (C) 1995-2014 Jonathan Hogg <jonathan@onegoodidea.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion use.ksh.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Usepackage Environment Manager
# Copyright (C) 1995-2007 Jonathan Hogg <jonathan@onegoodidea.com>
# Copyright (C) 1995-2014 Jonathan Hogg <jonathan@onegoodidea.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion usepackage.1.in
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ and detecting the style of environment output that should be used (see
.SH COPYRIGHT
.nf
Usepackage Environment Manager
Copyright (C) 1995-2007 Jonathan Hogg
Copyright (C) 1995-2014 Jonathan Hogg
.fi
.PP
This program is free software; you can redistribute it and/or modify
Expand Down
7 changes: 3 additions & 4 deletions usepackage.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*****************************************************************************
*
* Usepackage Environment Manager
* Copyright (C) 1995-2007 Jonathan Hogg <jonathan@onegoodidea.com>
* Copyright (C) 1995-2014 Jonathan Hogg <jonathan@onegoodidea.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -123,7 +123,6 @@ int main(int argc, char *argv[])
{
fprintf(stderr, "\n%s %s, %s\n", PACKAGE_NAME, PACKAGE_VERSION, COPYRIGHT);
fprintf(stderr, "Bug reports and comments to: %s\n", PACKAGE_BUGREPORT);
fprintf(stderr, "Discussion/announcement list: %s\n\n", MAILING_LIST);
fprintf(stderr, "usage: use [-vs] [-f <file>] <package> [<package>...]\n");
fprintf(stderr, " use -l\n\n");
fprintf(stderr, " -v : verbose\n");
Expand Down Expand Up @@ -174,7 +173,7 @@ int main(int argc, char *argv[])

for (first = i, i = argc - 1 ; i >= first ; i--)
{
if (group = get_group(argv[i]))
if ((group = get_group(argv[i])))
use_group(group);
else
use_package(argv[i]);
Expand Down Expand Up @@ -239,7 +238,7 @@ void add_package(package_t* package)
{
name = (char*) get_value(rnode);

if (group = get_group(name))
if ((group = get_group(name)))
use_group(group);
else
use_package(name);
Expand Down
2 changes: 1 addition & 1 deletion usepackage.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Usepackage Environment Manager
# Copyright (C) 1995-2007 Jonathan Hogg <jonathan@onegoodidea.com>
# Copyright (C) 1995-2014 Jonathan Hogg <jonathan@onegoodidea.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 3 additions & 1 deletion utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*****************************************************************************
*
* Usepackage Environment Manager
* Copyright (C) 1995-2007 Jonathan Hogg <jonathan@onegoodidea.com>
* Copyright (C) 1995-2014 Jonathan Hogg <jonathan@onegoodidea.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -35,6 +35,8 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include "utils.h"


Expand Down
2 changes: 1 addition & 1 deletion utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*****************************************************************************
*
* Usepackage Environment Manager
* Copyright (C) 1995-2007 Jonathan Hogg <jonathan@onegoodidea.com>
* Copyright (C) 1995-2014 Jonathan Hogg <jonathan@onegoodidea.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down

0 comments on commit 3f4365f

Please sign in to comment.