From b2065c1fcbea1e102a6739f1a422d45f70b9b267 Mon Sep 17 00:00:00 2001
From: ballen4705 <ballen4705@4ea69e1a-61f1-4043-bf83-b5c94c648137>
Date: Thu, 10 Oct 2002 13:21:18 +0000
Subject: [PATCH] Made sure that executables printed version numbers OK.
 Corrected URL of project home page everywhere. Put VERSION strings in a
 single place

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@14 4ea69e1a-61f1-4043-bf83-b5c94c648137
---
 sm5/Makefile     |  5 +++--
 sm5/README       |  5 +++--
 sm5/atacmds.h    |  7 ++++++-
 sm5/smartctl.8   |  8 ++++----
 sm5/smartctl.c   | 10 +++++-----
 sm5/smartctl.cpp | 10 +++++-----
 sm5/smartctl.h   |  7 +------
 sm5/smartd.8     |  6 +++---
 sm5/smartd.c     | 17 +++++++++++------
 sm5/smartd.cpp   | 17 +++++++++++------
 sm5/smartd.h     |  6 +-----
 11 files changed, 53 insertions(+), 45 deletions(-)

diff --git a/sm5/Makefile b/sm5/Makefile
index ccfa79870..58ecd39ae 100644
--- a/sm5/Makefile
+++ b/sm5/Makefile
@@ -1,6 +1,6 @@
 # Makefile for smartmontools
 #
-# $Id: Makefile,v 1.4 2002/10/10 11:54:13 ballen4705 Exp $
+# $Id: Makefile,v 1.5 2002/10/10 13:21:14 ballen4705 Exp $
 #
 # Copyright (C) 2002 Bruce Allen <ballen@uwm.edu>
 # 
@@ -37,7 +37,7 @@ scsicmds.o: scsicmds.h scsicmds.c
 	${CC} ${CFLAGS} -c scsicmds.c
 
 clean:
-	rm -f *.o smartctl smartd *~
+	rm -f *.o smartctl smartd *~ smartmontools*.tar.gz
 
 install: smartctl smartd smartctl.8 smartd.8 smartd.initd
 	install -m 755 -o root -g root smartctl /usr/sbin
@@ -50,6 +50,7 @@ install: smartctl smartd smartctl.8 smartd.8 smartd.initd
 uninstall:
 	rm -f /usr/sbin/smartctl /usr/sbin/smartd /usr/share/man/man8/smartctl.8 /usr/share/man/man8/smartd.8  /usr/share/man/man8/smartctl.8.gz /usr/share/man/man8/smartd.8.gz
 	/sbin/chkconfig --del smartd
+	/etc/rc.d/init.d/smartd stop
 	rm -f /etc/rc.d/init.d/smartd
 
 releasefiles=atacmds.c atacmds.h ataprint.c ataprint.h CHANGELOG COPYING extern.h Makefile\
diff --git a/sm5/README b/sm5/README
index 2c0f62eb0..9a6db5137 100644
--- a/sm5/README
+++ b/sm5/README
@@ -5,7 +5,8 @@ SMARTMONTOOLS - SMART utility toolset for Linux
 
 == HOME ==
 The home for smartmontools is located at:
-http://sourceforge.net/projects/smartmontools Please see this web site
+http://smartmontools.sourceforge.net
+Please see this web site
 for updates, documentation, and for submitting patches and bug
 reports.
 
@@ -171,4 +172,4 @@ Fax: (408) 867-2115
 E-Mail: 250-1752@mcimail.com.
 
 
-$Id: README,v 1.2 2002/10/09 18:07:17 ballen4705 Exp $
+$Id: README,v 1.3 2002/10/10 13:21:14 ballen4705 Exp $
diff --git a/sm5/atacmds.h b/sm5/atacmds.h
index 981282c2a..9849efa30 100644
--- a/sm5/atacmds.h
+++ b/sm5/atacmds.h
@@ -1,4 +1,4 @@
-//  $Id: atacmds.h,v 1.1 2002/10/09 17:56:58 ballen4705 Exp $
+//  $Id: atacmds.h,v 1.2 2002/10/10 13:21:15 ballen4705 Exp $
 /*
  * atacmds.h
  *
@@ -18,6 +18,11 @@
 #ifndef _ATACMDS_H_
 #define _ATACMDS_H_
 
+// These are the major and minor versions for smartd and smartctl
+#define PROJECTHOME "http://smartmontools.sourceforge.net/"
+#define VERSION_MAJOR 5
+#define VERSION_MINOR 0
+
 #include <sys/ioctl.h>
 #include <linux/hdreg.h>
 #include <sys/fcntl.h>
diff --git a/sm5/smartctl.8 b/sm5/smartctl.8
index 2042f2c20..c75272f99 100644
--- a/sm5/smartctl.8
+++ b/sm5/smartctl.8
@@ -1,6 +1,6 @@
 \# Copyright (C) 2002 Bruce Allen <ballen@uwm.edu>
 \#
-\# $Id: smartctl.8,v 1.3 2002/10/09 19:23:00 ballen4705 Exp $
+\# $Id: smartctl.8,v 1.4 2002/10/10 13:21:15 ballen4705 Exp $
 \# 
 \# 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
@@ -10,7 +10,7 @@
 \# You should have received a copy of the GNU General Public License (for
 \# example COPYING); if not, write to the Free Software Foundation, Inc., 675
 \# Mass Ave, Cambridge, MA 02139, USA.
-.TH SMARTCTL 8  "$Date: 2002/10/09 19:23:00 $" "smartmontools-5.0"
+.TH SMARTCTL 8  "$Date: 2002/10/10 13:21:15 $" "smartmontools-5.0"
 .SH NAME
 smartctl \- S.M.A.R.T. control utility 
 .SH SYNOPSIS
@@ -246,7 +246,7 @@ Please see the following web site for updates, further documentation, bug
 reports and patches:
 .nf
 .B
-http://sourceforge.net/projects/smartmontools
+http://smartmontools.sourceforge.net/
 
 .SH
 SEE ALSO:
@@ -296,4 +296,4 @@ Please let us know if there is an on\-line source for this document.
 
 .SH
 CVS ID OF THIS PAGE:
-$Id: smartctl.8,v 1.3 2002/10/09 19:23:00 ballen4705 Exp $
+$Id: smartctl.8,v 1.4 2002/10/10 13:21:15 ballen4705 Exp $
diff --git a/sm5/smartctl.c b/sm5/smartctl.c
index 2ffda10f4..082d5e4ca 100644
--- a/sm5/smartctl.c
+++ b/sm5/smartctl.c
@@ -1,4 +1,4 @@
-//  $Id: smartctl.c,v 1.1 2002/10/09 17:56:58 ballen4705 Exp $
+//  $Id: smartctl.c,v 1.2 2002/10/10 13:21:15 ballen4705 Exp $
 /*
  * smartctl.c
  *
@@ -60,7 +60,7 @@ void Usage ( void){
 
   printf( "smartctl version %i.%i - S.M.A.R.T. Control Program\n", 
 	  VERSION_MAJOR, VERSION_MINOR);
-  printf("Home page of project is http://sourceforge.net/projects/smartmontools\n\n");
+  printf("Home page of project is " PROJECTHOME "/\n\n");
   printf( "usage: smartctl -[options] [device]\n");
   printf( "Read Only Options:\n");
   printf( "\t\t%c\t\tPrint Copyright and License information\n", 
@@ -226,12 +226,12 @@ int main (int argc, char **argv){
   // Print Copyright/License info if needed
   if (printcopyleft){
     printf("smartctl version %d.%d Copyright (C) 2002 Bruce Allen\n",VERSION_MAJOR,VERSION_MINOR);
-    printf("CVS version ID %s\n","$Id: smartctl.c,v 1.1 2002/10/09 17:56:58 ballen4705 Exp $");
-    printf("Home page of project is http://sourceforge.net/projects/smartmontools\n\n");
+    printf("Home page of project is %s\n\n",PROJECTHOME);
     printf("smartctl comes with ABSOLUTELY NO WARRANTY. This\n");
     printf("is free software, and you are welcome to redistribute it\n");
     printf("under the terms of the GNU General Public License Version 2.\n");
-    printf("See http://www.gnu.org for further details.\n");
+    printf("See http://www.gnu.org for further details.\n\n");
+    printf("CVS version ID %s\n","$Id: smartctl.c,v 1.2 2002/10/10 13:21:15 ballen4705 Exp $");
     exit(0);
  }
 
diff --git a/sm5/smartctl.cpp b/sm5/smartctl.cpp
index 898f916e4..75e248dc4 100644
--- a/sm5/smartctl.cpp
+++ b/sm5/smartctl.cpp
@@ -1,4 +1,4 @@
-//  $Id: smartctl.cpp,v 1.1 2002/10/09 17:56:58 ballen4705 Exp $
+//  $Id: smartctl.cpp,v 1.2 2002/10/10 13:21:15 ballen4705 Exp $
 /*
  * smartctl.c
  *
@@ -60,7 +60,7 @@ void Usage ( void){
 
   printf( "smartctl version %i.%i - S.M.A.R.T. Control Program\n", 
 	  VERSION_MAJOR, VERSION_MINOR);
-  printf("Home page of project is http://sourceforge.net/projects/smartmontools\n\n");
+  printf("Home page of project is " PROJECTHOME "/\n\n");
   printf( "usage: smartctl -[options] [device]\n");
   printf( "Read Only Options:\n");
   printf( "\t\t%c\t\tPrint Copyright and License information\n", 
@@ -226,12 +226,12 @@ int main (int argc, char **argv){
   // Print Copyright/License info if needed
   if (printcopyleft){
     printf("smartctl version %d.%d Copyright (C) 2002 Bruce Allen\n",VERSION_MAJOR,VERSION_MINOR);
-    printf("CVS version ID %s\n","$Id: smartctl.cpp,v 1.1 2002/10/09 17:56:58 ballen4705 Exp $");
-    printf("Home page of project is http://sourceforge.net/projects/smartmontools\n\n");
+    printf("Home page of project is %s\n\n",PROJECTHOME);
     printf("smartctl comes with ABSOLUTELY NO WARRANTY. This\n");
     printf("is free software, and you are welcome to redistribute it\n");
     printf("under the terms of the GNU General Public License Version 2.\n");
-    printf("See http://www.gnu.org for further details.\n");
+    printf("See http://www.gnu.org for further details.\n\n");
+    printf("CVS version ID %s\n","$Id: smartctl.cpp,v 1.2 2002/10/10 13:21:15 ballen4705 Exp $");
     exit(0);
  }
 
diff --git a/sm5/smartctl.h b/sm5/smartctl.h
index b1feba87d..f76ca57a5 100644
--- a/sm5/smartctl.h
+++ b/sm5/smartctl.h
@@ -1,4 +1,4 @@
-//  $Id: smartctl.h,v 1.1 2002/10/09 17:56:58 ballen4705 Exp $
+//  $Id: smartctl.h,v 1.2 2002/10/10 13:21:17 ballen4705 Exp $
 /*
  * smartctl.h
  *
@@ -18,11 +18,6 @@
 #ifndef __SMARTCTL_H_
 #define __SMARTCTL_H_
 
-/* smartctl version number */
-#define VERSION_MAJOR 5
-#define VERSION_MINOR 0
-
-
 /* Defines for command line options */ 
 #define DRIVEINFO		'i'
 #define CHECKSMART		'c'
diff --git a/sm5/smartd.8 b/sm5/smartd.8
index 5fdb9e26c..5a16877f8 100644
--- a/sm5/smartd.8
+++ b/sm5/smartd.8
@@ -8,7 +8,7 @@
 \# You should have received a copy of the GNU General Public License (for
 \# example COPYING); if not, write to the Free Software Foundation, Inc., 675
 \# Mass Ave, Cambridge, MA 02139, USA.
-.TH SMARTD 8  "$Date: 2002/10/09 19:23:00 $" "smartmontools-5.0"
+.TH SMARTD 8  "$Date: 2002/10/10 13:21:17 $" "smartmontools-5.0"
 .SH NAME
 smartd \- S.M.A.R.T. Daemon
 .SH SYNOPSIS
@@ -99,7 +99,7 @@ Please see the following web site for updates, further documentation, bug
 reports and patches:
 .nf
 .B
-http://sourceforge.net/projects/smartmontools
+http://smartmontools.sourceforge.net/
 
 .SH
 SEE ALSO:
@@ -149,4 +149,4 @@ Please let us know if there is an on\-line source for this document.
 
 .SH
 CVS ID OF THIS PAGE:
-$Id: smartd.8,v 1.3 2002/10/09 19:23:00 ballen4705 Exp $
+$Id: smartd.8,v 1.4 2002/10/10 13:21:17 ballen4705 Exp $
diff --git a/sm5/smartd.c b/sm5/smartd.c
index d3a04ad36..b2963057a 100644
--- a/sm5/smartd.c
+++ b/sm5/smartd.c
@@ -1,4 +1,4 @@
-//  $Id: smartd.c,v 1.2 2002/10/09 18:01:18 ballen4705 Exp $
+//  $Id: smartd.c,v 1.3 2002/10/10 13:21:17 ballen4705 Exp $
 /*
  * smartd.c
  *
@@ -259,12 +259,13 @@ void CheckDevices (  atadevices_t *atadevices, scsidevices_t *scsidevices)
 }
 
 char copyleftstring[]=
-"\nHome page of smartd is http://sourceforge.net/projects/smartmontools\n\n"
-"CVS Version ID $Id: smartd.c,v 1.2 2002/10/09 18:01:18 ballen4705 Exp $\n"
+"Home page of smartd is " PROJECTHOME "\n\n"
 "smartd comes with ABSOLUTELY NO WARRANTY. This\n"
 "is free software, and you are welcome to redistribute it\n"
 "under the terms of the GNU General Public License Version 2.\n"
-"See http://www.gnu.org for further details.\n";
+"See http://www.gnu.org for further details.\n\n"
+"CVS Version ID $Id: smartd.c,v 1.3 2002/10/10 13:21:17 ballen4705 Exp $\n";
+
 
 /* Main Program */
 int main (int argc, char **argv){
@@ -294,17 +295,21 @@ int main (int argc, char **argv){
       break;
     case '?':
     default:
+      debugmode=1;
       Usage();
       exit(-1);	
     }
   }
   
   if (printcopyleft){
+    debugmode=1;
+    printout(LOG_INFO,"smartd version %d.%d Copyright (C) Bruce Allen 2002\n",VERSION_MAJOR,VERSION_MINOR);
     printout(LOG_INFO,copyleftstring);
     exit(0);
   }
-
-  printout(LOG_INFO, "smartd started\n");
+  
+  printout(LOG_INFO,"smartd version %d.%d Copyright (C) Bruce Allen 2002\n",VERSION_MAJOR,VERSION_MINOR);
+  
   if (!debugmode){
     daemon_init();
   }
diff --git a/sm5/smartd.cpp b/sm5/smartd.cpp
index c86122a32..c4ed1c744 100644
--- a/sm5/smartd.cpp
+++ b/sm5/smartd.cpp
@@ -1,4 +1,4 @@
-//  $Id: smartd.cpp,v 1.2 2002/10/09 18:01:18 ballen4705 Exp $
+//  $Id: smartd.cpp,v 1.3 2002/10/10 13:21:17 ballen4705 Exp $
 /*
  * smartd.c
  *
@@ -259,12 +259,13 @@ void CheckDevices (  atadevices_t *atadevices, scsidevices_t *scsidevices)
 }
 
 char copyleftstring[]=
-"\nHome page of smartd is http://sourceforge.net/projects/smartmontools\n\n"
-"CVS Version ID $Id: smartd.cpp,v 1.2 2002/10/09 18:01:18 ballen4705 Exp $\n"
+"Home page of smartd is " PROJECTHOME "\n\n"
 "smartd comes with ABSOLUTELY NO WARRANTY. This\n"
 "is free software, and you are welcome to redistribute it\n"
 "under the terms of the GNU General Public License Version 2.\n"
-"See http://www.gnu.org for further details.\n";
+"See http://www.gnu.org for further details.\n\n"
+"CVS Version ID $Id: smartd.cpp,v 1.3 2002/10/10 13:21:17 ballen4705 Exp $\n";
+
 
 /* Main Program */
 int main (int argc, char **argv){
@@ -294,17 +295,21 @@ int main (int argc, char **argv){
       break;
     case '?':
     default:
+      debugmode=1;
       Usage();
       exit(-1);	
     }
   }
   
   if (printcopyleft){
+    debugmode=1;
+    printout(LOG_INFO,"smartd version %d.%d Copyright (C) Bruce Allen 2002\n",VERSION_MAJOR,VERSION_MINOR);
     printout(LOG_INFO,copyleftstring);
     exit(0);
   }
-
-  printout(LOG_INFO, "smartd started\n");
+  
+  printout(LOG_INFO,"smartd version %d.%d Copyright (C) Bruce Allen 2002\n",VERSION_MAJOR,VERSION_MINOR);
+  
   if (!debugmode){
     daemon_init();
   }
diff --git a/sm5/smartd.h b/sm5/smartd.h
index 54e0ba59e..95fb91976 100644
--- a/sm5/smartd.h
+++ b/sm5/smartd.h
@@ -1,4 +1,4 @@
-//  $Id: smartd.h,v 1.1 2002/10/09 17:56:58 ballen4705 Exp $
+//  $Id: smartd.h,v 1.2 2002/10/10 13:21:18 ballen4705 Exp $
 /*
  * smartd.h
  *
@@ -15,10 +15,6 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-/* smartctl version number */
-#define VERSION_MAJOR 5
-#define VERSION_MINOR 0
-
 /* Defines for command line options */ 
 #define DEBUGMODE 		'X'
 #define EMAILNOTIFICATION	'e'
-- 
GitLab