]> thyrsus.com Git - hexdump.git/commitdiff
Version 1.2
authorEric S. Raymond <esr@thyrsus.com>
Tue, 14 Sep 1999 02:17:14 +0000 (02:17 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 14 Sep 1999 02:17:14 +0000 (02:17 +0000)
Makefile
README
hexdump.c
hexdump.spec
hexdump.xml

index 816c629e8409f0f97a12e1ed28638b20e63b553b..9b5c4ade901b5803304c51432de15fd76e92ab5f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,29 +1,30 @@
 # Makefile for Eric Raymond's silly hex dumper
 
-# Note: When the version changes, you also have to change
-#  * the name of the containing directory
-#  * the RPM spec file
-VERS=1.1
+# Note: When the version changes, you also have to change the RPM spec file
+VERS=1.2
 
 hex: hex.c
+       $(CC) -DVERSION=\"$(VERS)\" -O hex.c -o hex
 
 SOURCES = READ.ME Makefile hex.c hex.1 hex.lsm hex.spec
 
-hex-$(VERS).tar: $(SOURCES)
-       tar --name-prefix "hex-$(VERS)/" -cvf hex-$(VERS).tar $(SOURCES)
-hex-$(VERS).tar.gz: hex-$(VERS).tar
-       gzip -f hex-$(VERS).tar
-
-hex.shar: $(SOURCES)
-       shar $(SOURCES) >hex.shar
+hex-$(VERS).tar.gz:
+       @ls $(SRC) | sed s:^:hex-$(VERS)/: >MANIFEST
+       @(cd ..; ln -s hex hex-$(VERS))
+       (cd ..; tar -czvf hex/hex-$(VERS).tar.gz `cat hex/MANIFEST`)
+       @(cd ..; rm hex-$(VERS))
 
 clean:
-       rm -f hex hex.tar hex.shar
+       rm -f hex hex-$(VERS).tar.gz *.rpm
+
+dist: hex-$(VERS).tar.gz
 
 RPMROOT=/usr/src/redhat
 RPM = rpm
 RPMFLAGS = -ba
-rpm: hex-$(VERS).tar.gz
-       cp hex-$(VERS).tar.gz $(RPMROOT)/SOURCES/hex-$(VERS).tar.gz
-       cp hex.spec $(RPMROOT)/SPECS/hex.spec
-       $(RPM) $(RPMFLAGS) hex.spec
+rpm: dist
+       cp hex-$(VERS).tar.gz $(RPMROOT)/SOURCES;
+       cp hex.spec $(RPMROOT)/SPECS
+       cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) hex.spec        
+       cp $(RPMROOT)/RPMS/`arch|sed 's/i[4-9]86/i386/'`/hex-$(VERS)*.rpm .
+       cp $(RPMROOT)/SRPMS/hex-$(VERS)*.src.rpm .
diff --git a/README b/README
index 217e5ef5ccdc19fb86c0526d7687b0488261041a..57e1f9205e4c7f1c1ee858fb0ac66f11bb6a36e7 100644 (file)
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-                               HEX 1.1
+                               HEX 1.2
                (by Eric S. Raymond <esr@snark.thyrsus.com>)
 
 This hex dumper was born because
index ac01b8371bcc807dfe5a036d1efec85ae96a0b45..784ae73bb90257892d2467f417920eb695755711 100644 (file)
--- a/hexdump.c
+++ b/hexdump.c
@@ -1,4 +1,29 @@
-/* hex.c -- generate CP/M style hex dumps */
+/*****************************************************************************
+
+hex.c -- generate CP/M style hex dumps
+
+Copyright (c) 1999 by Eric S. Raymond<P>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:<P>
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.<P>
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.<P>
+
+*****************************************************************************/
+
 
 #include <stdio.h>
 #include <ctype.h>
@@ -151,7 +176,7 @@ char *cp;
            base = 10;
            break;
        }
-        else if (*cp = 'x' || *cp == 'X' || *cp == 'h' || *cp == 'H')
+        else if (*cp == 'x' || *cp == 'X' || *cp == 'h' || *cp == 'H')
        {
            base = 16;
            cp++;
@@ -206,6 +231,10 @@ char *argv[];
 
            switch (c)
            {
+           case 'V':
+               printf("hex " VERSION " by Eric S. Raymond.\n");
+               exit(0);
+
            case 'e': eflag = (s == '-'); continue;
            case 'c': cflag = (s == '-'); continue;
            case 'g': gflag = (s == '-'); continue;
index 7d84d5aa8ca4e33b1076ea3bda8260ffce54805f..29507929e112be2e0d3fc43966513f15b08349bf 100644 (file)
@@ -1,8 +1,8 @@
 Name: hex
-Version: 1.1
+Version: 1.2
 Release: 1
 Summary: yet another hex dumper
-Source: locke.ccil.org:/pub/esr/hex-1.1.tar.gz
+Source: locke.ccil.org:/pub/esr/hex-1.2.tar.gz
 Copyright: BSD-like
 Group: Development/Tools
 
index a7640549d09b47b844e4c2786144618fce5b67a2..9485c101c323bb4177536caf071ecb52e9029f06 100644 (file)
@@ -2,7 +2,7 @@
 .SH NAME
 hex.c \- dump a file to stdout in CP/M-like hex format
 .SH SYNOPSIS
-.B hex [-w] [-e] [-c] [-g] [-s] [filename...]
+.B hex [-V] [-w] [-e] [-c] [-g] [-s] [filename...]
 .SH DESCRIPTION
 This program provides a facility for obtaining a dump of a binary file
 to stdout.  The default format is a CP/M style hex dump with byte
@@ -21,6 +21,8 @@ The program accepts the following options to control its output:
 -g -- don't output mid-page gutter
 .TP 10
 -s -- dump file section
+.TP 10
+-V -- print version number and exit
 .PP
 The command line is scanned left-to-right for filenames and options, and
 each file dumped according to the format defined by preceding options. To