head	1.14;
access;
symbols
	perseant-exfatfs-base-20250801:1.14
	perseant-exfatfs-base-20240630:1.14
	perseant-exfatfs:1.14.0.46
	perseant-exfatfs-base:1.14
	cjep_sun2x:1.14.0.44
	cjep_sun2x-base:1.14
	cjep_staticlib_x-base1:1.14
	cjep_staticlib_x:1.14.0.42
	cjep_staticlib_x-base:1.14
	phil-wifi-20200421:1.14
	phil-wifi-20200411:1.14
	phil-wifi-20200406:1.14
	pgoyette-compat-merge-20190127:1.14
	pgoyette-compat-20190127:1.14
	pgoyette-compat-20190118:1.14
	pgoyette-compat-1226:1.14
	pgoyette-compat-1126:1.14
	pgoyette-compat-1020:1.14
	pgoyette-compat-0930:1.14
	pgoyette-compat-0906:1.14
	pgoyette-compat-0728:1.14
	pgoyette-compat-0625:1.14
	pgoyette-compat-0521:1.14
	pgoyette-compat-0502:1.14
	pgoyette-compat-0422:1.14
	pgoyette-compat-0415:1.14
	pgoyette-compat-0407:1.14
	pgoyette-compat-0330:1.14
	pgoyette-compat-0322:1.14
	pgoyette-compat-0315:1.14
	pgoyette-compat:1.14.0.40
	pgoyette-compat-base:1.14
	perseant-stdc-iso10646:1.14.0.38
	perseant-stdc-iso10646-base:1.14
	prg-localcount2-base3:1.14
	prg-localcount2-base2:1.14
	prg-localcount2-base1:1.14
	prg-localcount2:1.14.0.36
	prg-localcount2-base:1.14
	pgoyette-localcount-20170426:1.14
	bouyer-socketcan-base1:1.14
	pgoyette-localcount-20170320:1.14
	bouyer-socketcan:1.14.0.34
	bouyer-socketcan-base:1.14
	pgoyette-localcount-20170107:1.14
	pgoyette-localcount-20161104:1.14
	localcount-20160914:1.14
	pgoyette-localcount-20160806:1.14
	pgoyette-localcount-20160726:1.14
	pgoyette-localcount:1.14.0.32
	pgoyette-localcount-base:1.14
	netbsd-5-2-3-RELEASE:1.14
	netbsd-5-1-5-RELEASE:1.14
	yamt-pagecache-base9:1.14
	yamt-pagecache-tag8:1.14
	tls-earlyentropy:1.14.0.28
	tls-earlyentropy-base:1.14
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.14
	riastradh-drm2-base3:1.14
	netbsd-5-2-2-RELEASE:1.14
	netbsd-5-1-4-RELEASE:1.14
	netbsd-5-2-1-RELEASE:1.14
	netbsd-5-1-3-RELEASE:1.14
	agc-symver:1.14.0.30
	agc-symver-base:1.14
	tls-maxphys-base:1.14
	yamt-pagecache-base8:1.14
	netbsd-5-2:1.14.0.26
	yamt-pagecache-base7:1.14
	netbsd-5-2-RELEASE:1.14
	netbsd-5-2-RC1:1.14
	yamt-pagecache-base6:1.14
	yamt-pagecache-base5:1.14
	yamt-pagecache-base4:1.14
	netbsd-5-1-2-RELEASE:1.14
	netbsd-5-1-1-RELEASE:1.14
	yamt-pagecache-base3:1.14
	yamt-pagecache-base2:1.14
	yamt-pagecache:1.14.0.24
	yamt-pagecache-base:1.14
	bouyer-quota2-nbase:1.14
	bouyer-quota2:1.14.0.22
	bouyer-quota2-base:1.14
	matt-nb5-pq3:1.14.0.20
	matt-nb5-pq3-base:1.14
	netbsd-5-1:1.14.0.18
	netbsd-5-1-RELEASE:1.14
	netbsd-5-1-RC4:1.14
	netbsd-5-1-RC3:1.14
	netbsd-5-1-RC2:1.14
	netbsd-5-1-RC1:1.14
	netbsd-5-0-2-RELEASE:1.14
	netbsd-5-0-1-RELEASE:1.14
	jym-xensuspend-nbase:1.14
	netbsd-5-0:1.14.0.16
	netbsd-5-0-RELEASE:1.14
	netbsd-5-0-RC4:1.14
	netbsd-5-0-RC3:1.14
	netbsd-5-0-RC2:1.14
	jym-xensuspend:1.14.0.14
	jym-xensuspend-base:1.14
	netbsd-5-0-RC1:1.14
	netbsd-5:1.14.0.12
	netbsd-5-base:1.14
	mjf-devfs2:1.14.0.10
	mjf-devfs2-base:1.14
	yamt-pf42-base4:1.14
	yamt-pf42-base3:1.14
	hpcarm-cleanup-nbase:1.14
	yamt-pf42-base2:1.14
	yamt-pf42:1.14.0.8
	yamt-pf42-base:1.14
	keiichi-mipv6-nbase:1.14
	keiichi-mipv6:1.14.0.6
	keiichi-mipv6-base:1.14
	cube-autoconf:1.14.0.4
	cube-autoconf-base:1.14
	hpcarm-cleanup:1.14.0.2
	hpcarm-cleanup-base:1.14
	netbsd-1-6-PATCH002-RELEASE:1.12
	netbsd-1-6-PATCH002:1.12
	netbsd-1-6-PATCH002-RC4:1.12
	netbsd-1-6-PATCH002-RC3:1.12
	netbsd-1-6-PATCH002-RC2:1.12
	netbsd-1-6-PATCH002-RC1:1.12
	netbsd-1-6-PATCH001:1.12
	netbsd-1-6-PATCH001-RELEASE:1.12
	netbsd-1-6-PATCH001-RC3:1.12
	netbsd-1-6-PATCH001-RC2:1.12
	netbsd-1-6-PATCH001-RC1:1.12
	fvdl_fs64_base:1.13
	netbsd-1-6-RELEASE:1.12
	netbsd-1-6-RC3:1.12
	netbsd-1-6-RC2:1.12
	netbsd-1-6-RC1:1.12
	netbsd-1-6:1.12.0.2
	netbsd-1-6-base:1.12
	netbsd-1-5-PATCH003:1.4.4.1
	netbsd-1-5-PATCH002:1.4.4.1
	netbsd-1-5-PATCH001:1.4.4.1
	netbsd-1-5-RELEASE:1.4.4.1
	netbsd-1-5-BETA2:1.4.4.1
	netbsd-1-5-BETA:1.4.4.1
	netbsd-1-4-PATCH003:1.2
	netbsd-1-5-ALPHA2:1.4
	netbsd-1-5:1.4.0.4
	netbsd-1-5-base:1.4
	minoura-xpg4dl-base:1.4
	minoura-xpg4dl:1.4.0.2
	netbsd-1-4-PATCH002:1.2
	wrstuden-devbsize-19991221:1.3
	wrstuden-devbsize:1.2.0.4
	wrstuden-devbsize-base:1.3
	comdex-fall-1999:1.3.0.2
	comdex-fall-1999-base:1.3
	FILE3_28:1.1.1.2
	netbsd-1-4-PATCH001:1.2
	netbsd-1-4-RELEASE:1.2
	netbsd-1-4:1.2.0.2
	netbsd-1-4-base:1.2
	FILE3_26:1.1.1.1
	CHRISTOS:1.1.1
	FILE:1.1.1;
locks; strict;
comment	@# @;


1.14
date	2003.03.26.00.05.08;	author pooka;	state dead;
branches;
next	1.13;

1.13
date	2002.07.09.15.01.36;	author pooka;	state Exp;
branches;
next	1.12;

1.12
date	2002.05.18.07.11.14;	author pooka;	state Exp;
branches;
next	1.11;

1.11
date	2002.03.24.22.22.03;	author pooka;	state Exp;
branches;
next	1.10;

1.10
date	2001.09.09.10.48.34;	author pooka;	state Exp;
branches;
next	1.9;

1.9
date	2001.07.22.23.01.30;	author pooka;	state Exp;
branches;
next	1.8;

1.8
date	2001.03.17.11.32.15;	author pooka;	state Exp;
branches;
next	1.7;

1.7
date	2001.01.01.12.13.58;	author pooka;	state Exp;
branches;
next	1.6;

1.6
date	2000.11.23.23.22.58;	author pooka;	state Exp;
branches;
next	1.5;

1.5
date	2000.09.22.16.53.39;	author pooka;	state Exp;
branches;
next	1.4;

1.4
date	2000.05.14.22.53.38;	author christos;	state Exp;
branches
	1.4.4.1;
next	1.3;

1.3
date	99.11.01.17.39.26;	author christos;	state Exp;
branches;
next	1.2;

1.2
date	98.09.20.15.36.46;	author christos;	state Exp;
branches
	1.2.4.1;
next	1.1;

1.1
date	98.09.19.18.07.41;	author christos;	state Exp;
branches
	1.1.1.1;
next	;

1.4.4.1
date	2000.09.30.06.20.45;	author simonb;	state Exp;
branches;
next	;

1.2.4.1
date	99.12.27.18.36.51;	author wrstuden;	state Exp;
branches;
next	;

1.1.1.1
date	98.09.19.18.07.41;	author christos;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	99.11.01.17.30.12;	author christos;	state Exp;
branches;
next	;


desc
@@


1.14
log
@use file from dist
@
text
@#!/usr/pkg/bin/perl
#
#	$NetBSD: file2netbsd,v 1.13 2002/07/09 15:01:36 pooka Exp $
#
#  Perl script to convert a standard distribution directory for file into
#	a NetBSD source tree.
#
#  This is done as a script so that as each distribution is released,
#	only changes from the previous one need to be dealt with as
#	modifications to this script and related files.  This should
#	reduce the cost of updating from a new release of file by an
#	order of magnitude (or more?)
#
#  This script requires two environment variables set:
#	SRCDIR - file source directory
#	TARGETDIR - name of the high level directory to make
#
#  Written by Christos Zoulas July 17, 1997 for file-3.26
#

$version = "3.39";

# definitions ...

@@subdirs = ("usr.bin/file", "usr.bin/file/magdir");


@@filef = ("LEGAL.NOTICE", "MAINT",
	  "README", "apprentice.c", "ascmagic.c",
	  "compress.c", "file.c", "file.h", "fsmagic.c",
	  "is_tar.c", "names.h", "patchlevel.h",
	  "print.c", "readelf.c", "readelf.h", "softmagic.c", "tar.h");
#
# Utility Subroutines
#

sub makedir {
    system("mkdir -p @@_");
}

# &fixrcs (fromfile, tofile);
sub fixrcs
{
    my ($f, $t) = @@_;
    my @@keywords = ("Author", "Date", "Header", "Id", "Locker", "Log",
		    "Name", "RCSfile", "Revision", "Source", "State");
    my %mansubst = ('__CSECTION__', '1',
                    '__FSECTION__', '5',
                    '__VERSION__', $version,
                    '__MAGIC__', '/usr/share/misc/magic');
    my $state = 0;
    my $hdr = 0;

    open(IFILE, "<$f") || die "Cannot open $f";
    open(OFILE, ">$t") || die "Cannot create $t";

    if ($t =~ /.*\.[0-9]/) {
	print OFILE '.\\" $', 'NetBSD',  '$', "\n", '.\\"', "\n";
    }
    elsif ($t =~ /.*\.[ch]/) {
	print OFILE "/*\t", '$', 'NetBSD', '$', "\t*/\n\n";
    }
    elsif ($t =~ /.*\.[yl]/) {
	$hdr = 1;
    }
    else {
	print OFILE '$', 'NetBSD', '$', "\n";
    }
    while (<IFILE>) {
	if ($hdr == 1) {
	    if (/%{/) {
		print OFILE "%{\n/*\t", '$', 'NetBSD', '$', "\t*/\n\n";
		$hdr = 0;
		next;
	    }
	}
	if ($state == 2) {
	    if (/#endif/) {
		print OFILE "#else\n__RCSID(", '"$', 'NetBSD', '$"',
		    ");\n#endif\n";
		$state = 0;
	    }
	}
	if ($state == 1) {
	    print OFILE "#if 0\n";
	    $state = 2;
	}
	if (/#ifndef lint/) {
	    print OFILE "#include <sys/cdefs.h>\n";
	    $state = 1;
	}
	foreach $key (@@keywords) {
	    s/\$$key\$/$key/g;
	    s/\$$key:(.*)\$/$key:$1/g;
	}
	while (($from, $to) = each %mansubst) {
	    s/$from/$to/g;
	}
	print OFILE $_;
    }
    close(IFILE) || die "closing input file";
    close(OFILE) || die "closing output file";
}

# &copyfiles (fromdir, todir, list of files);
sub copyfiles {
    local ($fdir, $tdir, @@list) = @@_;
    local ($f);

    foreach $f (@@list) {
	print "  $fdir/$f --> $tdir/$f\n";
	&fixrcs("$fdir/$f", "$tdir/$f");
    }
}

# &copyfile (fromfile, tofile);
sub copyfile {
    local ($f, $t) = @@_;

    print "  $f --> $t\n";
    &fixrcs("$f", "$t");
}

sub uniq {
    local (@@inlist) = @@_;
    local (@@outlist);

    @@outlist = ($inlist[0]);
    for ( $i=1; $i < @@inlist; $i++ ) {
	if ($inlist[$i] ne $inlist[$i-1]) {
	    push (@@outlist, $inlist[$i]);
	}
    }

    @@outlist;
}

sub dumpsrcs {
    local (@@names) = @@_;
    local ($count);

    print ODATA "SRCS=\t";
    $count = 0;
    while ($f = pop(@@names)) {
        print ODATA "$f ";
	if ($count == 5 && @@names > 0) {
	    print ODATA "\\\n";
	    $count = 0;
	} else {
	    $count += 1;
	}
    }
    if ($count != 0) {
	print ODATA "\n";
    }
}

#
# Main progarm.
# 

$srcdir = $ENV{'SRCDIR'};
$targetdir = $ENV{'TARGETDIR'};
$incdirs = "-I. -I$srcdir/config -I$srcdir";

if (!$srcdir | !targetdir) {
    die "You must define the environment variables SRCDIR and TARGETDIR.\n"
} 
print "Making the NetBSD directory tree.\n";
foreach $f (@@subdirs) { 
    print "   -->$f\n";
    makedir ("$targetdir/$f");
}

print "Populating the usr.bin/file directory.\n";
&copyfiles ("$srcdir", "$targetdir/usr.bin/file", @@filef);
&copyfile("$srcdir/file.man", "$targetdir/usr.bin/file/file.1");
&copyfile("$srcdir/magic.man", "$targetdir/usr.bin/file/magic.5");
&copyfile("$srcdir/magic.mime", "$targetdir/usr.bin/file/magic.mime.in");
system("cat $srcdir/Header > $targetdir/usr.bin/file/Header");
system("cat $srcdir/Localstuff > $targetdir/usr.bin/file/Localstuff");

print "Populating the usr.bin/file/magdir directory.\n";
system("cp -rp $srcdir/Magdir/* $targetdir/usr.bin/file/magdir; chmod -R ug+w $targetdir/usr.bin/file/magdir");

#
# Build makefiles
#

$first = "True";
while ($line = <DATA>) {
    chop ($line);
    if (substr($line,0,2) eq "%%") {
	@@cmd = split (/ /,$line);
	if ($cmd[1] eq "file") {
	    print "Building $targetdir/$cmd[2]\n";
	    if ($first eq "") {
		close (ODATA);
	    } else {
		$first = "";
	    }
	    open (ODATA, ">$targetdir/$cmd[2]") ||
		die "Could not create $targetdir/$cmd[2]";
	} elsif ($cmd[1] eq "srcs") {
	    print "  Defining SRCS for $cmd[2]\n";
	    if ($first) {
		die "Data file must start with a %% file!";
	    }
	} elsif ($cmd[1] eq "NetBSD") {
	    if ($first) {
		die "Data section must start with a %% file!";
	    }
	    print ODATA "$cmd[2]	\$"."NetBSD".": \$\n";
	}
    } else {
	if ($first) {
	    die "Data file must start with a %% file!";
	}
	print ODATA "$line\n";
    }
}    
close (ODATA);

#
# Sed transformations of files
#

foreach $n (keys(%sedlist)) {
    print "Modifying $n\n";
    system ("cd $targetdir; sed $sedlist{$n} $n > tmp;  mv -f tmp $n");
}

#
# end of the script
#

# what follows is the data for makefiles and other special files
# that need to be created.

__END__
%% file usr.bin/file/Makefile
%% NetBSD #

.include <bsd.own.mk>

MFILESDIR=	/usr/share/misc
MFILES=		magic magic.mime
MAGIC=		${MFILESDIR}/magic
.if ${MKSHARE} != "no"
FILESDIR=	${MFILESDIR}
FILES=		${MFILES}
.endif

PROG=		file
SRCS=		file.c apprentice.c fsmagic.c softmagic.c ascmagic.c is_tar.c \
		print.c compress.c readelf.c 
CPPFLAGS+=	-DMAGIC='"$(MAGIC)"' -DHAVE_CONFIG_H -I${.CURDIR}
CPPFLAGS+=	-DBUILTIN_ELF -DELFCORE
MAN=		file.1 magic.5

CLEANFILES+=	magic
all:		file magic

MAGDIRF:sh=	echo $(.CURDIR)/magdir/[0-9a-z]*
MAGFILES=	$(.CURDIR)/Header \
		$(.CURDIR)/Localstuff \
		$(.CURDIR)/magdir/netbsd \
		${MAGDIRF}

.if ${MKSHARE} != "no"
magic:		$(MAGFILES)
	cat $(MAGFILES) > $(.TARGET)
.else
magic:
.endif

.include <bsd.prog.mk>
%% file usr.bin/file/config.h
/* config.h.  Generated automatically by configure.  */
/* config.h.in.  Generated automatically from configure.in by autoheader.  */

/* Define to empty if the keyword does not work.  */
/* #undef const */

/* Define if your struct stat has st_rdev.  */
#define HAVE_ST_RDEV 1

/* Define if you have <sys/wait.h> that is POSIX.1 compatible.  */
#define HAVE_SYS_WAIT_H 1

/* Define if major, minor, and makedev are declared in <mkdev.h>.  */
/* #undef MAJOR_IN_MKDEV */

/* Define if major, minor, and makedev are declared in <sysmacros.h>.  */
/* #undef MAJOR_IN_SYSMACROS */

/* Define to `long' if <sys/types.h> doesn't define.  */
/* #undef off_t */

/* Define to `unsigned' if <sys/types.h> doesn't define.  */
/* #undef size_t */

/* Define if you have the ANSI C header files.  */
#define STDC_HEADERS 1

/* Define if your <sys/time.h> declares struct tm.  */
/* #undef TM_IN_SYS_TIME */

/* Define if builtin ELF support is enabled.  */
#define BUILTIN_ELF 1

/* Define if ELF core file support is enabled.  */
#define ELFCORE 1

/* Define if the `long long' type works.  */
#define HAVE_LONG_LONG 1

/* Define if we have "tm_isdst" in "struct tm".  */
#define HAVE_TM_ISDST 1

/* Define if we have a global "int" variable "daylight".  */
#define HAVE_DAYLIGHT 1

/* Define to `unsigned char' if standard headers don't define.  */
/* #undef uint8_t */

/* Define to `unsigned short' if standard headers don't define.  */
/* #undef uint16_t */

/* Define to `unsigned int' if standard headers don't define.  */
/* #undef uint32_t */

/* Define to `unsigned long long', if available, or `unsigned long', if
   standard headers don't define.  */
/* #undef uint64_t */

/* The number of bytes in a uint8_t.  */
#define SIZEOF_UINT8_T 1

/* The number of bytes in a uint16_t.  */
#define SIZEOF_UINT16_T 2

/* The number of bytes in a uint32_t.  */
#define SIZEOF_UINT32_T 4

/* The number of bytes in a uint64_t.  */
#define SIZEOF_UINT64_T 8

/* Define if you have the mkstemp function.  */
#define HAVE_MKSTEMP 1

/* Define if you have the mmap function.  */
#define HAVE_MMAP 1

/* Define if you have the strerror function.  */
#define HAVE_STRERROR 1

/* Define if you have the strtoul function.  */
#define HAVE_STRTOUL 1

/* Define if you have the <fcntl.h> header file.  */
#define HAVE_FCNTL_H 1

/* Define if you have the <getopt.h> header file.  */
#define HAVE_GETOPT_H 1

/* Define if you have the <locale.h> header file.  */
#define HAVE_LOCALE_H 1

/* Define if you have the <stdint.h> header file.  */
#define HAVE_STDINT_H 1

/* Define if you have the <sys/mman.h> header file.  */
#define HAVE_SYS_MMAN_H 1

/* Define if you have the <sys/stat.h> header file.  */
#define HAVE_SYS_STAT_H 1

/* Define if you have the <sys/types.h> header file.  */
#define HAVE_SYS_TYPES_H 1

/* Define if you have the <unistd.h> header file.  */
#define HAVE_UNISTD_H 1

/* Define if you have the z library (-lz).  */
#define HAVE_LIBZ 1

/* Name of package */
#define PACKAGE "file"

/* Version number of package */
#define VERSION "3.39"

/* HAVE_TM_ZONE */
#define HAVE_TM_ZONE 1

/* HAVE_TZNAME */
#define HAVE_TZNAME 1
@


1.13
log
@change versions for file 3.39
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.12 2002/05/18 07:11:14 pooka Exp $
@


1.12
log
@adapt to 3.38
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.11 2002/03/24 22:22:03 pooka Exp $
d21 1
a21 1
$version = "3.38";
d392 1
a392 1
#define VERSION "3.38"
@


1.11
log
@reflect magic.mime -> magic.mime.in change also here

+ fix an ooold typo ;)
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.10 2001/09/09 10:48:34 pooka Exp $
d21 1
a21 1
$version = "3.37";
d306 3
d318 6
d325 1
a325 1
#define uint8_t unsigned char
d328 1
a328 1
#define uint16_t unsigned short
d331 1
a331 1
#define uint32_t unsigned int
d335 1
a335 1
#define uint64_t unsigned long long
d349 6
d361 6
d370 12
d385 3
d392 7
a398 1
#define VERSION "3.37"
@


1.10
log
@tweak for 3.37
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.9 2001/07/22 23:01:30 pooka Exp $
d11 1
a11 1
#	reduce the cost of updating from a new release of xntp by an
d28 1
a28 1
@@filef = ("LEGAL.NOTICE", "MAINT", "magic.mime",
d179 1
@


1.9
log
@adapt to file 3.36
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.8 2001/03/17 11:32:15 pooka Exp $
d21 1
a21 1
$version = "3.36";
d355 1
a355 1
#define VERSION "3.36"
@


1.8
log
@update for file 3.34
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.7 2001/01/01 12:13:58 pooka Exp $
d21 1
a21 1
$version = "3.34";
d355 1
a355 1
#define VERSION "3.34"
@


1.7
log
@make this substitute __VARIBLES__ to correct values
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.6 2000/11/23 23:22:58 pooka Exp $
d21 1
a21 1
$version = "3.33";
d355 1
a355 1
#define VERSION "3.33"
@


1.6
log
@tweak for 3.33
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.5 2000/09/22 16:53:39 pooka Exp $
d47 4
d95 3
@


1.5
log
@tweak for file 3.32
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.4 2000/05/14 22:53:38 christos Exp $
d21 1
a21 1
$version = "3.32";
d348 1
a348 2
#define VERSION "3.32"

@


1.4
log
@Resolve conflicts
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.3 1999/11/01 17:39:26 christos Exp $
d21 1
a21 1
$version = "3.31";
d31 1
a31 1
	  "internat.c", "is_tar.c", "names.h", "patchlevel.h",
d176 1
a176 1
system("cp -rp $srcdir/Magdir/* $targetdir/usr.bin/file/magdir; chmod -R ug+w magdir");
d248 1
a248 1
		print.c compress.c readelf.c internat.c
d348 1
a348 1
#define VERSION "3.31"
@


1.4.4.1
log
@Pull up file 3.32 (requested by christos, approved by thorpej).
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.4 2000/05/14 22:53:38 christos Exp $
d21 1
a21 1
$version = "3.32";
d31 1
a31 1
	  "is_tar.c", "names.h", "patchlevel.h",
d176 1
a176 1
system("cp -rp $srcdir/Magdir/* $targetdir/usr.bin/file/magdir; chmod -R ug+w $targetdir/usr.bin/file/magdir");
d248 1
a248 1
		print.c compress.c readelf.c 
d348 1
a348 1
#define VERSION "3.32"
@


1.3
log
@Resolve corn flakes.
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.1.1.2 1999/11/01 17:30:12 christos Exp $
d21 1
a21 1
$version = "3.28";
d28 1
a28 1
@@filef = ("LEGAL.NOTICE", "MAINT", 
a200 23
	    if ($cmd[2] eq "amd") {
		&dumpsrcs (@@amdf, @@amdef);
	    } elsif ($cmd[2] eq "amq") {
		&dumpsrcs (@@amqf, @@amqef);
	    } elsif ($cmd[2] eq "pawd") {
		&dumpsrcs (@@pawdf, @@pawdef);
	    } elsif ($cmd[2] eq "hlfsd") {
		&dumpsrcs (@@hlfsdf, @@hlfsdef);
	    } elsif ($cmd[2] eq "fixmount") {
		&dumpsrcs (@@fixmountf, @@fixmountef);
	    } elsif ($cmd[2] eq "fsinfo") {
		&dumpsrcs (@@fsinfof, @@fsinfoef);
	    } elsif ($cmd[2] eq "libamu") {
		&dumpsrcs (@@libamuf, @@libamuef);
	    } elsif ($cmd[2] eq "mk-amd-map") {
		&dumpsrcs (@@mkamdmapf, @@mkamdmapef);
	    } elsif ($cmd[2] eq "wire-test") {
		&dumpsrcs (@@wiretestf, @@wiretestef);
	    } elsif ($cmd[2] eq "doc") {
		&dumpsrcs (@@docf, @@docef);
	    } else {
		die "Unknown SRCS command";
	    }
d239 2
a240 2
MFILES=		magic
MAGIC=		${MFILESDIR}/${MFILES}
a297 6
/* Autoheader needs me */
#define PACKAGE "file"

/* Autoheader needs me */
#define VERSION "3.28"

d338 3
d343 7
@


1.2
log
@Turn on ELF and other NetBSD features.
@
text
@d1 1
a1 1
#!/usr/local/bin/perl
d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.1.1.1 1998/09/19 18:07:41 christos Exp $
d21 1
a21 1
$version = "3.26";
d29 1
a29 1
	  "PORTING", "README", "apprentice.c", "ascmagic.c",
a32 1

d176 1
a176 1
system("cp -rp $srcdir/Magdir/* $targetdir/usr.bin/file/magdir; chmod -r ug+w magdir");
d259 9
a267 3
FILESDIR=	/usr/share/misc
FILES=		magic
MAGIC=		${FILESDIR}/${FILES}
d272 1
a272 1
CPPFLAGS+=	-DMAGIC='"$(MAGIC)"' -DHAVE_SYS_WAIT_H -DHAVE_ST_RDEV
d285 1
d288 3
d293 76
@


1.2.4.1
log
@Pull up to last week's -current.
@
text
@d1 1
a1 1
#!/usr/pkg/bin/perl
d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.3 1999/11/01 17:39:26 christos Exp $
d21 1
a21 1
$version = "3.28";
d29 1
a29 1
	  "README", "apprentice.c", "ascmagic.c",
d33 1
d177 1
a177 1
system("cp -rp $srcdir/Magdir/* $targetdir/usr.bin/file/magdir; chmod -R ug+w magdir");
d260 3
a262 9
.include <bsd.own.mk>

MFILESDIR=	/usr/share/misc
MFILES=		magic
MAGIC=		${MFILESDIR}/${MFILES}
.if ${MKSHARE} != "no"
FILESDIR=	${MFILESDIR}
FILES=		${MFILES}
.endif
d267 1
a267 1
CPPFLAGS+=	-DMAGIC='"$(MAGIC)"' -DHAVE_CONFIG_H -I${.CURDIR}
a279 1
.if ${MKSHARE} != "no"
a281 3
.else
magic:
.endif
a283 76
%% file usr.bin/file/config.h
/* config.h.  Generated automatically by configure.  */
/* config.h.in.  Generated automatically from configure.in by autoheader.  */

/* Define to empty if the keyword does not work.  */
/* #undef const */

/* Define if your struct stat has st_rdev.  */
#define HAVE_ST_RDEV 1

/* Define if you have <sys/wait.h> that is POSIX.1 compatible.  */
#define HAVE_SYS_WAIT_H 1

/* Define if major, minor, and makedev are declared in <mkdev.h>.  */
/* #undef MAJOR_IN_MKDEV */

/* Define if major, minor, and makedev are declared in <sysmacros.h>.  */
/* #undef MAJOR_IN_SYSMACROS */

/* Define to `long' if <sys/types.h> doesn't define.  */
/* #undef off_t */

/* Define to `unsigned' if <sys/types.h> doesn't define.  */
/* #undef size_t */

/* Define if you have the ANSI C header files.  */
#define STDC_HEADERS 1

/* Autoheader needs me */
#define PACKAGE "file"

/* Autoheader needs me */
#define VERSION "3.28"

/* Define if builtin ELF support is enabled.  */
#define BUILTIN_ELF 1

/* Define if ELF core file support is enabled.  */
#define ELFCORE 1

/* Define if the `long long' type works.  */
#define HAVE_LONG_LONG 1

/* Define to `unsigned char' if standard headers don't define.  */
#define uint8_t unsigned char

/* Define to `unsigned short' if standard headers don't define.  */
#define uint16_t unsigned short

/* Define to `unsigned int' if standard headers don't define.  */
#define uint32_t unsigned int

/* Define to `unsigned long long', if available, or `unsigned long', if
   standard headers don't define.  */
#define uint64_t unsigned long long

/* The number of bytes in a uint8_t.  */
#define SIZEOF_UINT8_T 1

/* The number of bytes in a uint16_t.  */
#define SIZEOF_UINT16_T 2

/* The number of bytes in a uint32_t.  */
#define SIZEOF_UINT32_T 4

/* The number of bytes in a uint64_t.  */
#define SIZEOF_UINT64_T 8

/* Define if you have the strerror function.  */
#define HAVE_STRERROR 1

/* Define if you have the strtoul function.  */
#define HAVE_STRTOUL 1

/* Define if you have the <unistd.h> header file.  */
#define HAVE_UNISTD_H 1
@


1.1
log
@Initial revision
@
text
@d3 1
a3 1
#	$NetBSD: amd2netbsd,v 1.16 1998/08/08 22:33:27 christos Exp $
d267 2
a268 1
CPPFLAGS+=	-DMAGIC='"$(MAGIC)"'
@


1.1.1.1
log
@file-3.26
@
text
@@


1.1.1.2
log
@new version of file(1)
@
text
@d1 1
a1 1
#!/usr/pkg/bin/perl
d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.2 1998/09/20 15:36:46 christos Exp $
d21 1
a21 1
$version = "3.28";
d29 1
a29 1
	  "README", "apprentice.c", "ascmagic.c",
d33 1
d177 1
a177 1
system("cp -rp $srcdir/Magdir/* $targetdir/usr.bin/file/magdir; chmod -R ug+w magdir");
d260 3
a262 9
.include <bsd.own.mk>

MFILESDIR=	/usr/share/misc
MFILES=		magic
MAGIC=		${MFILESDIR}/${MFILES}
.if ${MKSHARE} != "no"
FILESDIR=	${MFILESDIR}
FILES=		${MFILES}
.endif
d267 1
a267 2
CPPFLAGS+=	-DMAGIC='"$(MAGIC)"' -DHAVE_CONFIG_H -I${.CURDIR}
CPPFLAGS+=	-DBUILTIN_ELF -DELFCORE
a278 1
.if ${MKSHARE} != "no"
a280 3
.else
magic:
.endif
a282 76
%% file usr.bin/file/config.h
/* config.h.  Generated automatically by configure.  */
/* config.h.in.  Generated automatically from configure.in by autoheader.  */

/* Define to empty if the keyword does not work.  */
/* #undef const */

/* Define if your struct stat has st_rdev.  */
#define HAVE_ST_RDEV 1

/* Define if you have <sys/wait.h> that is POSIX.1 compatible.  */
#define HAVE_SYS_WAIT_H 1

/* Define if major, minor, and makedev are declared in <mkdev.h>.  */
/* #undef MAJOR_IN_MKDEV */

/* Define if major, minor, and makedev are declared in <sysmacros.h>.  */
/* #undef MAJOR_IN_SYSMACROS */

/* Define to `long' if <sys/types.h> doesn't define.  */
/* #undef off_t */

/* Define to `unsigned' if <sys/types.h> doesn't define.  */
/* #undef size_t */

/* Define if you have the ANSI C header files.  */
#define STDC_HEADERS 1

/* Autoheader needs me */
#define PACKAGE "file"

/* Autoheader needs me */
#define VERSION "3.28"

/* Define if builtin ELF support is enabled.  */
#define BUILTIN_ELF 1

/* Define if ELF core file support is enabled.  */
#define ELFCORE 1

/* Define if the `long long' type works.  */
#define HAVE_LONG_LONG 1

/* Define to `unsigned char' if standard headers don't define.  */
#define uint8_t unsigned char

/* Define to `unsigned short' if standard headers don't define.  */
#define uint16_t unsigned short

/* Define to `unsigned int' if standard headers don't define.  */
#define uint32_t unsigned int

/* Define to `unsigned long long', if available, or `unsigned long', if
   standard headers don't define.  */
#define uint64_t unsigned long long

/* The number of bytes in a uint8_t.  */
#define SIZEOF_UINT8_T 1

/* The number of bytes in a uint16_t.  */
#define SIZEOF_UINT16_T 2

/* The number of bytes in a uint32_t.  */
#define SIZEOF_UINT32_T 4

/* The number of bytes in a uint64_t.  */
#define SIZEOF_UINT64_T 8

/* Define if you have the strerror function.  */
#define HAVE_STRERROR 1

/* Define if you have the strtoul function.  */
#define HAVE_STRTOUL 1

/* Define if you have the <unistd.h> header file.  */
#define HAVE_UNISTD_H 1
@

