diff options
45 files changed, 250 insertions, 224 deletions
@@ -1,3 +1,9 @@ +Thu Sep 5 11:04:38 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * version.h: New file. + * sh-version.sed: New file. + * Makefile (DIST_FILES): Add version.h and sh-version.sed. + Wed Sep 4 16:25:24 1996 Miles Bader <miles@gnu.ai.mit.edu> * Makeconf @@ -40,7 +40,7 @@ working-prog-subdirs := $(filter-out \ $(prog-subdirs)) DIST_FILES = COPYING Makeconf config.make.in configure.in configure \ hurd.boot build.mk.in build.mkcf.in SETUP \ - README NEWS tasks INSTALL INSTALL-cross + README NEWS tasks INSTALL INSTALL-cross version.h sh-version.sed all: $(addsuffix -all,$(lib-subdirs) $(working-prog-subdirs)) @@ -242,7 +242,7 @@ See `tasks', the exported task list. ====== -List for version 0.1 release +List for version 0.2 binary release * Try and get new mach4 from Shantanu. * pfinet needs to support no-network operation @@ -250,7 +250,6 @@ List for version 0.1 release * Make sure nfs still works * nfsd? * released libc -* rename nfs/rpcsvc files to something better. * Arrange GCC not to install assert.h on GNU. * zero (/dev/null) doesn't do access right; probably many in trans/ too. * recompile libraries after libc release diff --git a/auth/ChangeLog b/auth/ChangeLog index 2f82a470..55c978a7 100644 --- a/auth/ChangeLog +++ b/auth/ChangeLog @@ -1,3 +1,9 @@ +Thu Sep 5 11:05:37 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * auth.c (AUTH_VERSION): Delete macro. + (argp_program_version): Use STANDARD_HURD_VERSION. + (main): Pass empty string as release; HURD_VERSION as version. + Fri Jul 19 00:35:46 1996 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu> * auth.c (S_auth_makeauth): Deallocate initial reference to diff --git a/auth/auth.c b/auth/auth.c index d77c484e..5fd2897c 100644 --- a/auth/auth.c +++ b/auth/auth.c @@ -29,12 +29,12 @@ #include <idvec.h> #include <assert.h> #include <argp.h> +#include <version.h> #include "auth_S.h" #include "auth_reply_U.h" -#define AUTH_VERSION "0.0" +char *argp_program_version = STANDARD_HURD_VERSION(auth); -char *argp_program_version = "auth " AUTH_VERSION " (GNU " HURD_RELEASE ")"; /* Auth handles are server ports with sets of ids. */ struct authhandle @@ -466,7 +466,7 @@ main (int argc, char **argv) /* Register ourselves with the proc server and then start signals. */ proc_getprivports (proc, &hostpriv, &masterdev); - proc_register_version (proc, hostpriv, "auth", HURD_RELEASE, AUTH_VERSION); + proc_register_version (proc, hostpriv, "auth", "", HURD_VERSION); mach_port_deallocate (mach_task_self (), masterdev); _hurd_port_set (&_hurd_ports[INIT_PORT_PROC], proc); _hurd_proc_init (argv); diff --git a/exec/ChangeLog b/exec/ChangeLog index 0667d35a..2b6eb242 100644 --- a/exec/ChangeLog +++ b/exec/ChangeLog @@ -1,3 +1,10 @@ +Thu Sep 5 11:11:19 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * main.c: Include <version.h>. + (exec_version): Delete variable. + (S_exec_init): Pass empty string as release; HURD_VERSION + as version. + Thu Aug 29 13:00:38 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> * priv.h: Only include <bfd.h> if BFD. Only declare diff --git a/exec/main.c b/exec/main.c index 44577d9c..4148946d 100644 --- a/exec/main.c +++ b/exec/main.c @@ -22,6 +22,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <error.h> #include <hurd/paths.h> #include <hurd/startup.h> +#include <version.h> #ifdef BFD bfd_arch_info_type host_bfd_arch_info; @@ -49,7 +50,6 @@ int trivfs_cntl_nportclasses = 1; struct trivfs_control *fsys; -char *exec_version = "0.0"; char **save_argv; @@ -252,8 +252,7 @@ S_exec_init (struct trivfs_protid *protid, err = get_privileged_ports (&host_priv, &dev_master); if (!err) { - proc_register_version (procserver, host_priv, "exec", HURD_RELEASE, - exec_version); + proc_register_version (procserver, host_priv, "exec", "", HURD_VERSION); mach_port_deallocate (mach_task_self (), dev_master); err = proc_getmsgport (procserver, 1, &startup); if (err) diff --git a/hurd/=pending-changes b/hurd/=pending-changes index 5fcf741c..01fe330e 100644 --- a/hurd/=pending-changes +++ b/hurd/=pending-changes @@ -18,6 +18,10 @@ Add optional timeout arg to msg.defs. Add file_fetch_dir. +Delete release arg from register version crap. + +Delete non-string args from io_server_version; separate name and version. + Not user visible: diff --git a/hurd/ChangeLog b/hurd/ChangeLog index 99a0fe2f..562729b5 100644 --- a/hurd/ChangeLog +++ b/hurd/ChangeLog @@ -1,3 +1,7 @@ +Thu Sep 5 10:39:40 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * version.h: File removed. + Wed Jul 17 14:30:36 1996 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu> * Makefile: gs/install-hdrs/install-headers/g. diff --git a/hurd/version.h b/hurd/version.h deleted file mode 100644 index 6afdf4a6..00000000 --- a/hurd/version.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Hurd version calculation - Copyright (C) 1994, 1996 Free Software Foundation - - 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 the Free Software Foundation; either version 2, or (at - your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#ifndef _HURD_VERSION_H -#define _HURD_VERSION_H - -/* Each version of the Hurd defines a set of versions for the servers - that make it up. Each server is identified by one of these - structures. */ -struct hurd_server_version -{ - char *name; /* The name of the server. */ - char *version; /* The server's version. */ -}; - -/* A version of the Hurd is therefore defined by its version number - (which is incremented for each distribution) and its release number - (which refers to the interfaces in the hurd directory, and is found - in <hurd/hurd_types.h> as HURD_RELEASE) and by a list of hurd_vers - structures defining servers that were distributed with that - version. */ -struct hurd_version -{ - char *hurdrelease; - char *hurdversion; - int nservers; - struct hurd_server_version vers[0]; -}; - -#endif /* hurd/version.h */ - - -/* And these are the standard lists referred to above. */ -#ifdef HURD_VERSION_DEFINE - -struct hurd_version hurd_versions[] = -{ - { - /* Hurd version 0.0 pre-alpha; frozen May 3, 1996. */ - "0.0 pre-alpha", - "0.0 pre-alpha", - 5, - { - {"auth", "0.0 pre-alpha"}, - {"proc", "0.0 pre-alpha"}, - {"ufs", "0.0 pre-alpha"}, - {"init", "0.0 pre-alpha"}, - {"exec", "0.0 pre-alpha"}, - } - }, - { - /* Hurd version 0.0. Not frozen yet. */ - "0.0", - "0.0", - 5, - { - {"auth", "0.0"}, - {"proc", "0.0"}, - {"ufs", "0.0"}, - {"init", "0.0"}, - {"exec", "0.0"}, - } - } -}; - -int nhurd_versions = sizeof hurd_versions / sizeof *hurd_versions; - -#endif - - diff --git a/init/ChangeLog b/init/ChangeLog index f24a4d9e..7e3b7617 100644 --- a/init/ChangeLog +++ b/init/ChangeLog @@ -1,3 +1,10 @@ +Thu Sep 5 11:12:32 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * init.c: Include <version.h>. + (init_version): Delete variable. + (launch_core_servers): Pass empty string as release; HURD_VERSION + as version. + Tue Aug 13 17:51:38 1996 Miles Bader <miles@gnu.ai.mit.edu> * Makefile (init): Remove -lutil. diff --git a/init/init.c b/init/init.c index 40d96a6f..406e79da 100644 --- a/init/init.c +++ b/init/init.c @@ -49,6 +49,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <argz.h> #include <utmp.h> #include <maptime.h> +#include <version.h> #include "startup_notify_U.h" #include "startup_reply_U.h" @@ -155,8 +156,6 @@ int fakeboot; /* The tasks of auth and proc and the bootstrap filesystem. */ task_t authtask, proctask, fstask; -char *init_version = "0.0"; - mach_port_t default_ports[INIT_PORT_MAX]; mach_port_t default_dtable[3]; int default_ints[INIT_INT_MAX]; @@ -879,8 +878,7 @@ launch_core_servers (void) default_ports[INIT_PORT_AUTH] = authserver; - proc_register_version (procserver, host_priv, "init", HURD_RELEASE, - init_version); + proc_register_version (procserver, host_priv, "init", "", HURD_VERSION); /* Get the bootstrap filesystem's proc server port. We must do this before calling proc_setmsgport below. */ diff --git a/libdiskfs/ChangeLog b/libdiskfs/ChangeLog index a0d446e8..03f07fd0 100644 --- a/libdiskfs/ChangeLog +++ b/libdiskfs/ChangeLog @@ -1,3 +1,20 @@ +Thu Sep 5 11:13:54 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * io-version.c (diskfs_S_io_server_version): Only fill in + SERVER_NAME; ignore the rest. + + * diskfs.h (diskfs_major_version, diskfs_minor_version, + diskfs_edit_version): Delete variables. + (diskfs_server_version, diskfs_extra_version): New variables. + * boot-start.c (diskfs_S_fsys_init): Register version from + diskfs_server_version; pass empty string as release. + * extra-version.c: New file. + * Makefile (OTHERSRCS): Add extra-version.c. + * opts-version.c (diskfs_extra_version): Delete special + declaration. + (_print_version): Use the user's provided version number, and also + give it our (libdiskfs) version number. + Tue Sep 3 10:48:05 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> * name-cache.c (diskfs_enter_lookup_cache): Cache `.' and `..' diff --git a/libdiskfs/Makefile b/libdiskfs/Makefile index bf355c47..e2304863 100644 --- a/libdiskfs/Makefile +++ b/libdiskfs/Makefile @@ -48,7 +48,7 @@ OTHERSRCS = conch-fetch.c conch-set.c dir-clear.c dir-init.c dir-renamed.c \ dev-open.c dev-io.c dev-globals.c console.c disk-pager.c \ name-cache.c direnter.c dirrewrite.c dirremove.c lookup.c dead-name.c \ validate-mode.c validate-group.c validate-author.c validate-flags.c \ - validate-rdev.c validate-owner.c + validate-rdev.c validate-owner.c extra-version.c SRCS = $(OTHERSRCS) $(FSSRCS) $(IOSRCS) $(FSYSSRCS) $(IFSOCKSRCS) LCLHDRS = diskfs.h priv.h lithp.h fsmutations.h diskfs-pager.h installhdrs = diskfs.h diskfs-pager.h diff --git a/libdiskfs/boot-start.c b/libdiskfs/boot-start.c index 9c0e0f79..ee44eb9a 100644 --- a/libdiskfs/boot-start.c +++ b/libdiskfs/boot-start.c @@ -366,7 +366,6 @@ diskfs_S_fsys_init (mach_port_t port, struct port_infe *pt; static int initdone = 0; process_t execprocess; - string_t version; mach_port_t host, startup; error_t err; mach_port_t root_pt; @@ -463,9 +462,8 @@ diskfs_S_fsys_init (mach_port_t port, if (err) return err; - sprintf (version, "%d.%d", diskfs_major_version, diskfs_minor_version); - proc_register_version (procserver, host, - diskfs_server_name, HURD_RELEASE, version); + proc_register_version (procserver, host, diskfs_server_name, "", + diskfs_server_version); err = proc_getmsgport (procserver, 1, &startup); if (!err) diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h index fe8374de..450e6e2e 100644 --- a/libdiskfs/diskfs.h +++ b/libdiskfs/diskfs.h @@ -203,11 +203,13 @@ extern struct node *diskfs_root_node; filesystem server. */ extern char *diskfs_server_name; -/* The user must define these variables. Set these to be the major, minor, - and edit version numbers. */ -extern int diskfs_major_version; -extern int diskfs_minor_version; -extern int diskfs_edit_version; +/* The user must define this variables. Set this to be the server + version number. */ +extern char *diskfs_server_version; + +/* The user may define this variable. Set this to be any additional + version specification that should be printed for --version. */ +extern char *diskfs_extra_version; /* The user may define this variable. This should be nonzero iff the filesystem format supports shortcutting symlink translation. diff --git a/libdiskfs/io-version.c b/libdiskfs/io-version.c index a1f12d79..0dba8046 100644 --- a/libdiskfs/io-version.c +++ b/libdiskfs/io-version.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1994 Free Software Foundation + Copyright (C) 1994, 1996 Free Software Foundation This file is part of the GNU Hurd. @@ -31,10 +31,8 @@ diskfs_S_io_server_version (struct protid *cred, { if (cred) { - strcpy (server_name, diskfs_server_name); - *major = diskfs_major_version; - *minor = diskfs_minor_version; - *edit = diskfs_edit_version; + sprintf (server_name, "%s %s", + diskfs_server_name, diskfs_server_version); return 0; } else diff --git a/libdiskfs/opts-version.c b/libdiskfs/opts-version.c index 268a4017..a42a79d6 100644 --- a/libdiskfs/opts-version.c +++ b/libdiskfs/opts-version.c @@ -22,36 +22,23 @@ #include "priv.h" -extern char *diskfs_extra_version; -#pragma weak diskfs_extra_version - static void _print_version (FILE *stream, struct argp_state *state) { if (argp_program_version) /* If this is non-zero, then the program's probably defined it, so let that take precedence over the default. */ - fprintf (stream, "%s\n", argp_program_version); + fputs (argp_program_version, stream); else - /* Construct a version using the standard diskfs variables. */ { - char ev[15] = { 0 }; - - if (diskfs_edit_version) - if (diskfs_edit_version <= 26) - sprintf (ev, "%c", diskfs_edit_version - 1 + 'a'); - else - sprintf (ev, ".%d", diskfs_edit_version); - - if (diskfs_extra_version) - fprintf (stream, "%s %d.%d%s (%s, GNU %s)\n", - diskfs_server_name, diskfs_major_version, diskfs_minor_version, - ev, diskfs_extra_version, HURD_RELEASE); - else - fprintf (stream, "%s %d.%d%s (GNU %s)\n", - diskfs_server_name, diskfs_major_version, diskfs_minor_version, - ev, HURD_RELEASE); + fprintf (stream, "%s %s ", diskfs_server_name, diskfs_server_version); + if (diskfs_extra_version[0]) + fprintf (stream, "(%s) ", diskfs_extra_version); } + /* And because diskfs is big and huge, put our information out too. */ + fputs (STANDARD_HURD_VERSION (libdiskfs), stream); + + putc ('\n', stream); } void (*argp_program_version_hook) (FILE *stream, struct argp_state *state) diff --git a/proc/ChangeLog b/proc/ChangeLog index 0b5159c4..24b13925 100644 --- a/proc/ChangeLog +++ b/proc/ChangeLog @@ -1,3 +1,13 @@ +Thu Sep 5 10:43:39 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * host.c (struct server_version): Delete member `release'. + (kernel_name, kernel_version): New variables. + (rebuild_uname): Do the voting on versions, not releases. + (initialize_version_info): Store kernel information in kernel_name + and kernel_version, not as an entry in the server_versions array. + Don't fill in a release for ourselves. + (S_proc_register_version): Ignore RELEASE arg. + Sun Jul 28 22:57:03 1996 Miles Bader <miles@gnu.ai.mit.edu> * info.c (get_string_array): Correctly adjust NEWSIZE when diff --git a/proc/host.c b/proc/host.c index 3b1e03c8..ab6ca059 100644 --- a/proc/host.c +++ b/proc/host.c @@ -47,7 +47,6 @@ struct server_version { char *name; char *version; - char *release; } *server_versions; int nserver_versions, server_versions_nalloc; @@ -271,14 +270,17 @@ check_dead_execdata_notify (mach_port_t port) /* Version information handling. - A server registers its name, release, and version with - startup_register_version. The uname version string is composed of all - the server names and versions. The uname release is composed of the - differing server releases in order of decreasing popularity (just one if - they all agree). + A server registers its name and version with + startup_register_version. + + The uname release is the most popular version number. + + The uname version string is composed of all the server names and + versions, omitting special mention of those which match the uname + release, plus the kernel version string. */ + +char *kernel_name, *kernel_version; - The Hurd release comes from <hurd/hurd_types.h> and - is compiled into proc as well as the other servers. */ /* Rebuild the uname version string. */ static void @@ -314,73 +316,59 @@ rebuild_uname (void) *p++ = '/'; } - /* Collect all the differing release strings and count how many + /* Collect all the differing version strings and count how many servers use each. */ - struct release + struct version { - const char *release; + const char *version; unsigned int count; - } releases[nserver_versions]; - int compare_releases (const void *a, const void *b) + } versions[nserver_versions]; + int compare_versions (const void *a, const void *b) { - return (((const struct release *) b)->count - - ((const struct release *) a)->count); + return (((const struct version *) b)->count - + ((const struct version *) a)->count); } - unsigned int nreleases = 0; + unsigned int nversions = 0; for (i = 0; i < nserver_versions; ++i) { - for (j = 0; j < nreleases; ++j) - if (! strcmp (releases[j].release, server_versions[i].release)) + for (j = 0; j < nversions; ++j) + if (! strcmp (versions[j].version, server_versions[i].version)) { - ++releases[j].count; + ++versions[j].count; break; } - if (j == nreleases) + if (j == nversions) { - releases[nreleases].release = server_versions[i].release; - releases[nreleases].count = 1; - ++nreleases; + versions[nversions].version = server_versions[i].version; + versions[nversions].count = 1; + ++nversions; } } - /* Sort the releases in order of decreasing popularity. */ - qsort (releases, nreleases, sizeof (struct release), compare_releases); + /* Sort the versions in order of decreasing popularity. */ + qsort (versions, nversions, sizeof (struct version), compare_versions); /* Now build the uname strings. */ - initstr (uname_info.release); - for (i = 0; i < nreleases; ++i) - addstr (NULL, releases[i].release); - - if (p > end) -#ifdef notyet - syslog (LOG_EMERG, - "_UTSNAME_LENGTH %u too short; inform bug-glibc@prep.ai.mit.edu\n", - p - end) -#endif - ; - else - p[-1] = '\0'; - end[-1] = '\0'; + /* release is the most popular version */ + strcpy (uname_info.release, versions[0].version); + + initstr (uname_info.version); - for (i = 2; i < nserver_versions; i++) - if (strcmp (server_versions[i].version, server_versions[1].version)) - break; + addstr (kernel_name, kernel_version); - initstr (uname_info.version); + if (versions[0].count > 1) + addstr ("Hurd", versions[0].version); - if (i == nserver_versions) - { - /* All the servers after [0] (the microkernel version) - are the same, so just write one "hurd" version. */ - addstr (server_versions[0].name, server_versions[0].version); - addstr ("Hurd", server_versions[1].version); - } - else + /* Now, for any which differ (if there might be any), write it out + separately. */ + if (versions[0].count != nserver_versions) for (i = 0; i < nserver_versions; i++) - addstr (server_versions[i].name, server_versions[i].version); - + if (versions[0].count == 1 + || strcmp (server_versions[i].version, versions[0].version)) + addstr (server_versions[i].name, server_versions[i].version); + if (p > end) #ifdef notyet syslog (LOG_EMERG, @@ -393,13 +381,12 @@ rebuild_uname (void) end[-1] = '\0'; } - void initialize_version_info (void) { extern const char *const mach_cpu_types[]; extern const char *const mach_cpu_subtypes[][32]; - kernel_version_t kernel_version; + kernel_version_t kv; char *p; struct host_basic_info info; unsigned int n = sizeof info; @@ -419,23 +406,21 @@ initialize_version_info (void) server_versions = malloc (sizeof (struct server_version) * 10); server_versions_nalloc = 10; - err = host_kernel_version (mach_host_self (), kernel_version); + err = host_kernel_version (mach_host_self (), kv); assert (! err); - p = index (kernel_version, ':'); + p = index (kv, ':'); if (p) *p = '\0'; - p = index (kernel_version, ' '); + p = index (kv, ' '); if (p) *p = '\0'; - server_versions[0].name = strdup (p ? kernel_version : "mach"); - server_versions[0].release = strdup (HURD_RELEASE); - server_versions[0].version = strdup (p ? p + 1 : kernel_version); + kernel_name = strdup (p ? kv : "mach"); + kernel_version = strdup (p ? p + 1 : kv); server_versions[1].name = strdup (OUR_SERVER_NAME); - server_versions[1].release = strdup (HURD_RELEASE); server_versions[1].version = strdup (OUR_VERSION); - nserver_versions = 2; + nserver_versions = 1; rebuild_uname (); @@ -471,11 +456,8 @@ S_proc_register_version (pstruct_t server, { /* Change this entry. */ free (server_versions[i].version); - free (server_versions[i].release); server_versions[i].version = malloc (strlen (version) + 1); - server_versions[i].release = malloc (strlen (version) + 1); strcpy (server_versions[i].version, version); - strcpy (server_versions[i].release, release); break; } if (i == nserver_versions) @@ -491,11 +473,8 @@ S_proc_register_version (pstruct_t server, server_versions[nserver_versions].name = malloc (strlen (name) + 1); server_versions[nserver_versions].version = malloc (strlen (version) + 1); - server_versions[nserver_versions].release = malloc (strlen (release) - + 1); strcpy (server_versions[nserver_versions].name, name); strcpy (server_versions[nserver_versions].version, version); - strcpy (server_versions[nserver_versions].release, release); nserver_versions++; } diff --git a/sutils/ChangeLog b/sutils/ChangeLog index ce5e777a..2c5f1765 100644 --- a/sutils/ChangeLog +++ b/sutils/ChangeLog @@ -1,3 +1,13 @@ +Thu Sep 5 11:40:00 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * Makefile: Use $(top_srcdir)/sh-version.sed to make executables + from .sh files. + + * fsck.c: Include <version.h>. + (argp_program_version): Define with STANDARD_HURD_VERSION. + * halt.c: Likewise. + * reboot.c: Likewise. + Tue Aug 27 12:06:55 1996 Miles Bader <miles@gnu.ai.mit.edu> * reboot.c, halt.c (main): Add argument parsing. diff --git a/sutils/Makefile b/sutils/Makefile index 823c69c3..e06ef317 100644 --- a/sutils/Makefile +++ b/sutils/Makefile @@ -34,7 +34,7 @@ include ../Makeconf fsck: fstab.o clookup.o reboot halt fsck: ../libshouldbeinlibc/libshouldbeinlibc.a -%: %.sh - cp $< $@ +%: %.sh $(top_srcdir)/sh-version.sed + sed -f $(top_srcdir)/sh-version.sed < $< > $@ $(filter-out $(special-targets), $(targets)): %: %.o diff --git a/sutils/e2os.sh b/sutils/e2os.sh index 644e9616..8d3628d0 100755 --- a/sutils/e2os.sh +++ b/sutils/e2os.sh @@ -41,7 +41,7 @@ while :; do echo "Usage: $0 [-V?] [--help] [--usage] [--version] DEVICE [OS]" exit 0;; --version|-V) - echo "e2os 1.0 (`uname -sr`)"; exit 0;; + echo "STANDARD_HURD_VERSION_e2os_"; exit 0;; -*) echo 1>&2 "$0: unrecognized option \`$1'" echo 1>&2 "Try \`$0 --help' for more information"; diff --git a/sutils/fsck.c b/sutils/fsck.c index 161c275d..b3165ace 100644 --- a/sutils/fsck.c +++ b/sutils/fsck.c @@ -51,10 +51,12 @@ #include <argp.h> #include <argz.h> #include <assert.h> +#include <version.h> #include "fstab.h" -char *argp_program_version = "fsck 1.0 (GNU " HURD_RELEASE ")"; +char *argp_program_version = STANDARD_HURD_VERSION (fsck); + /* for debugging */ static int _debug = 0; diff --git a/sutils/halt.c b/sutils/halt.c index 824934b9..9b6980fa 100644 --- a/sutils/halt.c +++ b/sutils/halt.c @@ -24,8 +24,9 @@ #include <stdio.h> #include <argp.h> #include <hurd.h> +#include <version.h> -char *argp_program_version = "halt 1.1 (GNU " HURD_RELEASE ")"; +char *argp_program_version = STANDARD_HURD_VERSION (halt); int main (int argc, char *argv[]) diff --git a/sutils/reboot.c b/sutils/reboot.c index 4d4269af..2b3d1130 100644 --- a/sutils/reboot.c +++ b/sutils/reboot.c @@ -24,8 +24,9 @@ #include <stdio.h> #include <argp.h> #include <hurd.h> +#include <version.h> -char *argp_program_version = "reboot 1.1 (GNU " HURD_RELEASE ")"; +char *argp_program_version = STANDARD_HURD_VERSION (reboot); int main (int argc, char *argv[]) diff --git a/ufs-fsck/ChangeLog b/ufs-fsck/ChangeLog index c8def0d7..d4e404b2 100644 --- a/ufs-fsck/ChangeLog +++ b/ufs-fsck/ChangeLog @@ -1,3 +1,8 @@ +Thu Sep 5 11:42:21 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * main.c: Include <version.h>. + (argp_program_version): Define with STANDARD_HURD_VERSION. + Fri Aug 16 10:25:37 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> * dir.c (record_directory): Maximum number of block pointers to diff --git a/ufs-fsck/main.c b/ufs-fsck/main.c index b5af2d88..c159b170 100644 --- a/ufs-fsck/main.c +++ b/ufs-fsck/main.c @@ -21,10 +21,11 @@ #include <errno.h> #include <argp.h> #include <hurd.h> +#include <version.h> #include "fsck.h" -char *argp_program_version = "fsck.ufs 1.0 (GNU " HURD_RELEASE ")"; +char *argp_program_version = STANDARD_HURD_VERSION (fsck.ufs) char *lfname = "lost+found"; mode_t lfmode = 0755; diff --git a/ufs-utils/ChangeLog b/ufs-utils/ChangeLog index 201a2958..7f892351 100644 --- a/ufs-utils/ChangeLog +++ b/ufs-utils/ChangeLog @@ -1,3 +1,8 @@ +Thu Sep 5 11:44:38 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * mkfs.c: Include <version.h>. + (argp_program_version): Define with STANDARD_HURD_VERSION. + Mon Aug 19 15:18:30 1996 Miles Bader <miles@gnu.ai.mit.edu> * mkfs.c (doc): Supply a useful value. diff --git a/ufs-utils/mkfs.c b/ufs-utils/mkfs.c index 48a5a688..de8c712e 100644 --- a/ufs-utils/mkfs.c +++ b/ufs-utils/mkfs.c @@ -33,7 +33,7 @@ #ifndef lint /*static char sccsid[] = "from: @(#)mkfs.c 8.3 (Berkeley) 2/3/94";*/ -static char *rcsid = "$Id: mkfs.c,v 1.14 1996/08/27 18:24:31 miles Exp $"; +static char *rcsid = "$Id: mkfs.c,v 1.15 1996/09/05 16:59:14 thomas Exp $"; #endif /* not lint */ #include <unistd.h> @@ -54,6 +54,7 @@ static char *rcsid = "$Id: mkfs.c,v 1.14 1996/08/27 18:24:31 miles Exp $"; #include <sys/stat.h> #include <fcntl.h> #include <dirent.h> +#include <version.h> #include <device/device_types.h> #include <device/disk_status.h> @@ -163,7 +164,7 @@ struct dinode zino[MAXBSIZE / sizeof(struct dinode)]; int fsi, fso; daddr_t alloc(); -char *argp_program_version = "mkfs.ufs 1.0 (GNU " HURD_RELEASE ")"; +char *argp_program_version = STANDARD_HURD_VERSION (mkfs.ufs); #define _STRINGIFY(arg) #arg #define STRINGIFY(arg) _STRINGIFY (arg) diff --git a/utils/ChangeLog b/utils/ChangeLog index 133ea97e..f55b5f0c 100644 --- a/utils/ChangeLog +++ b/utils/ChangeLog @@ -1,3 +1,22 @@ +Thu Sep 5 11:45:58 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * Makefile: Use $(top_srcdir)/sh-version.h to make executables + from .sh files. + + * fsysopts.c: Include <version.h>. + (argp_program_version): Define with STANDARD_HURD_VERSION. + * w.c: Likewise. + * vmstat.c: Likewise. + * vminfo.c: Likewise. + * sync.c: Likewise. + * storeinfo.c: Likewise. + * showtrans.c: Likewise. + * settrans.c: Likewise. + * ps.c: Likewise. + * portinfo.c: Likewise. + * login.c: Likewise. + * hurdids.c: Likewise. + Sun Sep 1 14:15:46 1996 Miles Bader <miles@gnu.ai.mit.edu> * sync.c (argp_program_version): New variable. diff --git a/utils/Makefile b/utils/Makefile index 4b73d8de..5079d0c6 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -47,6 +47,6 @@ ps w hurdids settrans sync showtrans fsysopts storeinfo login vmstat portinfo \ devprobe vminfo: ../libshouldbeinlibc/libshouldbeinlibc.a %: %.sh - cp $< $@ + sed -f $(top_srcdir)/sh-version.sed < $< > $@ $(filter-out $(special-targets), $(targets)): %: %.o diff --git a/utils/fsysopts.c b/utils/fsysopts.c index a4cab6b7..b6d7e971 100644 --- a/utils/fsysopts.c +++ b/utils/fsysopts.c @@ -28,10 +28,11 @@ #include <error.h> #include <argz.h> +#include <version.h> #include <hurd/fsys.h> -char *argp_program_version = "fsysopts 1.0 (GNU " HURD_RELEASE ")"; +char *argp_program_version = STANDARD_HURD_VERSION (fsysopts); static struct argp_option options[] = { diff --git a/utils/hurdids.c b/utils/hurdids.c index 26c2d14a..d48d0d69 100644 --- a/utils/hurdids.c +++ b/utils/hurdids.c @@ -26,11 +26,12 @@ #include <unistd.h> #include <pwd.h> #include <grp.h> +#include <version.h> #include <error.h> #include <hurd/id.h> -char *argp_program_version = "hurdids 1.0 (GNU " HURD_RELEASE ")"; +char *argp_program_version = STANDARD_HURD_VERSION (hurdids); static struct argp_option options[] = { diff --git a/utils/login.c b/utils/login.c index 4e0c7d12..53d27ed0 100644 --- a/utils/login.c +++ b/utils/login.c @@ -31,6 +31,7 @@ #include <netdb.h> #include <time.h> #include <assert.h> +#include <version.h> #include <netinet/in.h> #include <arpa/inet.h> @@ -50,7 +51,8 @@ exec_reauth (auth_t auth, int secure, int must_reauth, mach_port_t *ports, unsigned num_ports, mach_port_t *fds, unsigned num_fds); -char *argp_program_version = "login 1.0 (GNU " HURD_RELEASE ")"; +char *argp_program_version = STANDARD_HURD_VERSION (login); + /* Defaults for various login parameters. */ char *default_args[] = { diff --git a/utils/portinfo.c b/utils/portinfo.c index fc0ce214..3f9ce6b5 100644 --- a/utils/portinfo.c +++ b/utils/portinfo.c @@ -25,6 +25,7 @@ #include <string.h> #include <unistd.h> #include <stdlib.h> +#include <version.h> #include <mach.h> @@ -34,7 +35,7 @@ #include <portinfo.h> #include <portxlate.h> -char *argp_program_version = "portinfo 1.0 (GNU " HURD_RELEASE ")"; +char *argp_program_version = STANDARD_HURD_VERSION (portinfo); static const struct argp_option options[] = { {0,0,0,0,0, 1}, @@ -30,9 +30,11 @@ #include <idvec.h> #include <ps.h> #include <error.h> +#include <version.h> + #include "psout.h" -char *argp_program_version = "ps 1.0 (GNU " HURD_RELEASE ")"; +char *argp_program_version = STANDARD_HURD_VERSION (ps); #define OA OPTION_ARG_OPTIONAL diff --git a/utils/settrans.c b/utils/settrans.c index 93dbdefa..13632d81 100644 --- a/utils/settrans.c +++ b/utils/settrans.c @@ -29,8 +29,9 @@ #include <error.h> #include <argz.h> #include <hurd/fshelp.h> +#include <version.h> -char *argp_program_version = "settrans 1.0 (GNU " HURD_RELEASE ")"; +char *argp_program_version = STANDARD_HURD_VERSION (settrans); #define DEFAULT_TIMEOUT 60 diff --git a/utils/showtrans.c b/utils/showtrans.c index 32aaaa74..1ddef038 100644 --- a/utils/showtrans.c +++ b/utils/showtrans.c @@ -25,11 +25,12 @@ #include <argp.h> #include <fcntl.h> #include <unistd.h> +#include <version.h> #include <error.h> #include <argz.h> -char *argp_program_version = "showtrans 1.0 (GNU " HURD_RELEASE ")"; +char *argp_program_version = STANDARD_HURD_VERSION (showtrans); static struct argp_option options[] = { diff --git a/utils/storeinfo.c b/utils/storeinfo.c index 86e827be..0bfc1b1f 100644 --- a/utils/storeinfo.c +++ b/utils/storeinfo.c @@ -25,13 +25,14 @@ #include <argp.h> #include <unistd.h> #include <sys/fcntl.h> +#include <version.h> #include <error.h> #include <hurd/fs.h> #include <hurd/store.h> -char *argp_program_version = "storeinfo 1.0 (GNU " HURD_RELEASE ")"; +char *argp_program_version = STANDARD_HURD_VERSION (storeinfo); static struct argp_option options[] = { diff --git a/utils/sync.c b/utils/sync.c index 3a10cc1b..c03ed2d2 100644 --- a/utils/sync.c +++ b/utils/sync.c @@ -20,8 +20,9 @@ #include <hurd.h> #include <argp.h> +#include <version.h> -char *argp_program_version = "sync 1.0 (GNU " HURD_RELEASE ")"; +char *argp_program_version = STANDARD_HURD_VERSION (sync); int main (int argc, char *argv[]) diff --git a/utils/vminfo.c b/utils/vminfo.c index e570589a..7d56378a 100644 --- a/utils/vminfo.c +++ b/utils/vminfo.c @@ -25,13 +25,14 @@ #include <string.h> #include <unistd.h> #include <stdlib.h> +#include <version.h> #include <mach.h> #include <mach/vm_statistics.h> #include <mach/default_pager.h> #include <hurd.h> -char *argp_program_version = "vminfo 1.0 (GNU " HURD_RELEASE ")"; +char *argp_program_version = STANDARD_HURD_VERSION (vminfo); static const struct argp_option options[] = { {"verbose", 'v', 0, 0, "Give more detailed information"}, diff --git a/utils/vmstat.c b/utils/vmstat.c index eb0595f7..14a88d66 100644 --- a/utils/vmstat.c +++ b/utils/vmstat.c @@ -25,13 +25,14 @@ #include <string.h> #include <unistd.h> #include <stdlib.h> +#include <version.h> #include <mach.h> #include <mach/vm_statistics.h> #include <mach/default_pager.h> #include <hurd.h> -char *argp_program_version = "vmstat 1.1 (GNU " HURD_RELEASE ")"; +char *argp_program_version = STANDARD_HURD_VERSION (vmstat); static const struct argp_option options[] = { {"terse", 't', 0, 0, "Use short one-line output format", 1 }, @@ -29,6 +29,7 @@ #include <pwd.h> #include <grp.h> #include <netdb.h> +#include <version.h> #include <sys/fcntl.h> @@ -48,7 +49,7 @@ extern char *canon_host (char *host); extern char *shared_domain (char *host1, char *host2); extern char *localhost (); -char *argp_program_version = "w 1.0 (GNU " HURD_RELEASE ")"; +char *argp_program_version = STANDARD_HURD_VERSION (w); #define OA OPTION_ARG_OPTIONAL diff --git a/version.h b/version.h new file mode 100644 index 00000000..b8f63ac0 --- /dev/null +++ b/version.h @@ -0,0 +1,30 @@ +/* Hurd version + Copyright (C) 1996 Free Software Foundation, Inc. + Written by Thomas Bushnell, n/BSG. + + This file is part of the GNU Hurd. + + The GNU Hurd is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2, or (at + your option) any later version. + + The GNU Hurd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + 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, USA. */ + +/* See sh-version.sed for duplicates of this information. */ + +#ifndef HURD_VERSION +#define HURD_VERSION "0.1" +#endif + +/* The standard way to print versions for --version */ +#define STANDARD_HURD_VERSION(s) #s " - GNU Hurd-" HURD_VERSION + + |