head	1.5;
access;
symbols
	netbsd-11-0-RC6:1.5
	netbsd-11-0-RC5:1.5
	netbsd-11-0-RC4:1.5
	netbsd-11-0-RC3:1.5
	netbsd-11-0-RC2:1.5
	netbsd-11-0-RC1:1.5
	perseant-exfatfs-base-20250801:1.5
	netbsd-11:1.5.0.46
	netbsd-11-base:1.5
	netbsd-10-1-RELEASE:1.5
	perseant-exfatfs-base-20240630:1.5
	perseant-exfatfs:1.5.0.44
	perseant-exfatfs-base:1.5
	netbsd-8-3-RELEASE:1.5
	netbsd-9-4-RELEASE:1.5
	netbsd-10-0-RELEASE:1.5
	netbsd-10-0-RC6:1.5
	netbsd-10-0-RC5:1.5
	netbsd-10-0-RC4:1.5
	netbsd-10-0-RC3:1.5
	netbsd-10-0-RC2:1.5
	netbsd-10-0-RC1:1.5
	netbsd-10:1.5.0.42
	netbsd-10-base:1.5
	netbsd-9-3-RELEASE:1.5
	cjep_sun2x-base1:1.5
	cjep_sun2x:1.5.0.40
	cjep_sun2x-base:1.5
	cjep_staticlib_x-base1:1.5
	netbsd-9-2-RELEASE:1.5
	cjep_staticlib_x:1.5.0.38
	cjep_staticlib_x-base:1.5
	netbsd-9-1-RELEASE:1.5
	phil-wifi-20200421:1.5
	phil-wifi-20200411:1.5
	is-mlppp:1.5.0.36
	is-mlppp-base:1.5
	phil-wifi-20200406:1.5
	netbsd-8-2-RELEASE:1.5
	netbsd-9-0-RELEASE:1.5
	netbsd-9-0-RC2:1.5
	netbsd-9-0-RC1:1.5
	phil-wifi-20191119:1.5
	netbsd-9:1.5.0.34
	netbsd-9-base:1.5
	phil-wifi-20190609:1.5
	netbsd-8-1-RELEASE:1.5
	netbsd-8-1-RC1:1.5
	pgoyette-compat-merge-20190127:1.5
	pgoyette-compat-20190127:1.5
	pgoyette-compat-20190118:1.5
	pgoyette-compat-1226:1.5
	pgoyette-compat-1126:1.5
	pgoyette-compat-1020:1.5
	pgoyette-compat-0930:1.5
	pgoyette-compat-0906:1.5
	netbsd-7-2-RELEASE:1.5
	pgoyette-compat-0728:1.5
	netbsd-8-0-RELEASE:1.5
	phil-wifi:1.5.0.32
	phil-wifi-base:1.5
	pgoyette-compat-0625:1.5
	netbsd-8-0-RC2:1.5
	pgoyette-compat-0521:1.5
	pgoyette-compat-0502:1.5
	pgoyette-compat-0422:1.5
	netbsd-8-0-RC1:1.5
	pgoyette-compat-0415:1.5
	pgoyette-compat-0407:1.5
	pgoyette-compat-0330:1.5
	pgoyette-compat-0322:1.5
	pgoyette-compat-0315:1.5
	netbsd-7-1-2-RELEASE:1.5
	pgoyette-compat:1.5.0.30
	pgoyette-compat-base:1.5
	netbsd-7-1-1-RELEASE:1.5
	matt-nb8-mediatek:1.5.0.28
	matt-nb8-mediatek-base:1.5
	perseant-stdc-iso10646:1.5.0.26
	perseant-stdc-iso10646-base:1.5
	netbsd-8:1.5.0.24
	netbsd-8-base:1.5
	prg-localcount2-base3:1.5
	prg-localcount2-base2:1.5
	prg-localcount2-base1:1.5
	prg-localcount2:1.5.0.22
	prg-localcount2-base:1.5
	pgoyette-localcount-20170426:1.5
	bouyer-socketcan-base1:1.5
	pgoyette-localcount-20170320:1.5
	netbsd-7-1:1.5.0.20
	netbsd-7-1-RELEASE:1.5
	netbsd-7-1-RC2:1.5
	netbsd-7-nhusb-base-20170116:1.5
	bouyer-socketcan:1.5.0.18
	bouyer-socketcan-base:1.5
	pgoyette-localcount-20170107:1.5
	netbsd-7-1-RC1:1.5
	pgoyette-localcount-20161104:1.5
	netbsd-7-0-2-RELEASE:1.5
	localcount-20160914:1.5
	netbsd-7-nhusb:1.5.0.16
	netbsd-7-nhusb-base:1.5
	pgoyette-localcount-20160806:1.5
	pgoyette-localcount-20160726:1.5
	pgoyette-localcount:1.5.0.14
	pgoyette-localcount-base:1.5
	netbsd-7-0-1-RELEASE:1.5
	netbsd-7-0:1.5.0.12
	netbsd-7-0-RELEASE:1.5
	netbsd-7-0-RC3:1.5
	netbsd-7-0-RC2:1.5
	netbsd-7-0-RC1:1.5
	netbsd-6-0-6-RELEASE:1.2.4.1
	netbsd-6-1-5-RELEASE:1.2.4.1
	netbsd-7:1.5.0.10
	netbsd-7-base:1.5
	yamt-pagecache-base9:1.5
	yamt-pagecache-tag8:1.2.2.2
	netbsd-6-1-4-RELEASE:1.2.4.1
	netbsd-6-0-5-RELEASE:1.2.4.1
	tls-earlyentropy:1.5.0.8
	tls-earlyentropy-base:1.5
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.5
	riastradh-drm2-base3:1.5
	netbsd-6-1-3-RELEASE:1.2.4.1
	netbsd-6-0-4-RELEASE:1.2.4.1
	netbsd-6-1-2-RELEASE:1.2.4.1
	netbsd-6-0-3-RELEASE:1.2.4.1
	netbsd-6-1-1-RELEASE:1.2.4.1
	riastradh-drm2-base2:1.5
	riastradh-drm2-base1:1.5
	riastradh-drm2:1.5.0.2
	riastradh-drm2-base:1.5
	netbsd-6-1:1.2.4.1.0.6
	netbsd-6-0-2-RELEASE:1.2.4.1
	netbsd-6-1-RELEASE:1.2.4.1
	khorben-n900:1.5.0.6
	netbsd-6-1-RC4:1.2.4.1
	netbsd-6-1-RC3:1.2.4.1
	agc-symver:1.5.0.4
	agc-symver-base:1.5
	netbsd-6-1-RC2:1.2.4.1
	netbsd-6-1-RC1:1.2.4.1
	yamt-pagecache-base8:1.5
	netbsd-6-0-1-RELEASE:1.2.4.1
	yamt-pagecache-base7:1.3
	matt-nb6-plus-nbase:1.2.4.1
	yamt-pagecache-base6:1.3
	netbsd-6-0:1.2.4.1.0.4
	netbsd-6-0-RELEASE:1.2.4.1
	netbsd-6-0-RC2:1.2.4.1
	tls-maxphys:1.3.0.2
	tls-maxphys-base:1.5
	matt-nb6-plus:1.2.4.1.0.2
	matt-nb6-plus-base:1.2.4.1
	netbsd-6-0-RC1:1.2.4.1
	yamt-pagecache-base5:1.3
	yamt-pagecache-base4:1.3
	netbsd-6:1.2.0.4
	netbsd-6-base:1.2
	yamt-pagecache-base3:1.2
	yamt-pagecache-base2:1.2
	yamt-pagecache:1.2.0.2
	yamt-pagecache-base:1.2;
locks; strict;
comment	@# @;


1.5
date	2013.01.04.15.34.47;	author christos;	state Exp;
branches;
next	1.4;

1.4
date	2013.01.03.23.04.52;	author christos;	state Exp;
branches;
next	1.3;

1.3
date	2012.02.22.17.47.25;	author christos;	state Exp;
branches
	1.3.2.1;
next	1.2;

1.2
date	2011.10.08.19.28.39;	author christos;	state Exp;
branches
	1.2.2.1
	1.2.4.1;
next	1.1;

1.1
date	2011.09.16.20.38.12;	author christos;	state Exp;
branches;
next	;

1.3.2.1
date	2013.02.25.00.26.03;	author tls;	state Exp;
branches;
next	;

1.2.2.1
date	2012.04.17.00.03.07;	author yamt;	state Exp;
branches;
next	1.2.2.2;

1.2.2.2
date	2013.01.23.00.04.31;	author yamt;	state Exp;
branches;
next	;

1.2.4.1
date	2012.03.07.23.18.22;	author riz;	state Exp;
branches;
next	;


desc
@@


1.5
log
@fix version detection
@
text
@#! /bin/sh
#
#	$NetBSD: file2netbsd,v 1.4 2013/01/03 23:04:52 christos Exp $
#
# Copyright (c) 2003, 2011 The NetBSD Foundation, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# file2netbsd:  convert a file source tree into a
# format suitable for import.  Works on current dir.
# You can run this only once if you want it to work.
#
# based on texinfo2netbsd
#
PROG="$(basename "$0")"

if [ -z "$1" ]
then
	echo "Usage: $PROG <directory>" 1>&2
	exit 1
fi
FILE="$1"

file_vers="$(awk -F',' '/AC_INIT\(/ { print $2 }' "$FILE/configure.ac" | tr -d '[' | tr -d ']' | tr -d ' ')"

case $file_vers in
[0-9].[0-9][0-9]) ;;
*)	echo "$PROG: Cannot determine file version: $file_vers" 1>&2
	exit 1;;
esac

### Wipe out stuff we don't want
find "$FILE" -name .cvsignore -delete

### Remove the $'s around RCS tags
cleantags "$FILE"

### Add NetBSD RCS Id
find "$FILE" -type f -name '*.[chly]' -print | while read c; do
	sed -e '1{/$NetBSD/!{i\
/*	\$NetBSD\$	*/\

};}
/#ifndef[ 	]lint/{N;/FILE_RCSID/s/\n/\
#if 0\
/
a\
#else\
__RCSID("\$NetBSD\$");\
#endif
}' $c > /tmp/file3$$
mv /tmp/file3$$ $c && echo did source mods for $c
done

#### Move files to proper names
mv -f $FILE/doc/file.man $FILE/doc/file.1
mv -f $FILE/doc/libmagic.man $FILE/doc/libmagic.3
mv -f $FILE/doc/magic.man $FILE/doc/magic.5

#### Add RCS tags to man pages
find "$FILE" -type f -name '*.[0-9]' -print | while read m; do
	sed -e '1{/$NetBSD/!i\
.\\"	\$NetBSD\$\
.\\"

}'	    -e 's/__CSECTION__/1/g' \
	    -e 's/__FSECTION__/5/g' \
	    -e 's/__VERSION__/'"${file_vers}/g" \
	    -e 's,__MAGIC__,/usr/share/misc/magic,g' \
	    $m > /tmp/file4$$
mv /tmp/file4$$ $m && echo did manpage mods for $m
done

#### de-"capsize" the magdir
mv $FILE/magic/Magdir $FILE/magic/magdir

#### Make building easier, don't build magic and doc
echo '/^SUBDIRS/
t.
s/^/#/
-
s/ magic.*//
wq' | ed Makefile.in > /dev/null 2>&1

echo done

echo You can import now.  Use the following command:
echo cvs -d cvs.netbsd.org:/cvsroot import src/external/bsd/file/dist CHRISTOS FILE${file_vers%.*}_${file_vers#*.}

exit 0
@


1.4
log
@make it work if $1 != .
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.3 2012/02/22 17:47:25 christos Exp $
d44 7
a50 1
file_vers="$(awk -F', ' '/AC_INIT\(/ { print $2 }' "$FILE/configure.ac")"
@


1.3
log
@fix wrong variable, import command
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.2 2011/10/08 19:28:39 christos Exp $
d70 3
a72 3
mv -f doc/file.man doc/file.1
mv -f doc/libmagic.man doc/libmagic.3
mv -f doc/magic.man doc/magic.5
d89 1
a89 1
mv magic/Magdir magic/magdir
@


1.3.2.1
log
@resync with head
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.3 2012/02/22 17:47:25 christos Exp $
d44 1
a44 7
file_vers="$(awk -F',' '/AC_INIT\(/ { print $2 }' "$FILE/configure.ac" | tr -d '[' | tr -d ']' | tr -d ' ')"

case $file_vers in
[0-9].[0-9][0-9]) ;;
*)	echo "$PROG: Cannot determine file version: $file_vers" 1>&2
	exit 1;;
esac
d70 3
a72 3
mv -f $FILE/doc/file.man $FILE/doc/file.1
mv -f $FILE/doc/libmagic.man $FILE/doc/libmagic.3
mv -f $FILE/doc/magic.man $FILE/doc/magic.5
d89 1
a89 1
mv $FILE/magic/Magdir $FILE/magic/magdir
@


1.2
log
@use cleantags, instead of home grown copy.
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.1 2011/09/16 20:38:12 christos Exp $
d50 1
a50 1
cleantags $d
d102 1
a102 1
echo cvs import src/external/bsd/file/dist CHRISTOS FILE${file_vers%.*}_${file_vers#*.}
@


1.2.2.1
log
@sync with head
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.2 2011/10/08 19:28:39 christos Exp $
d50 1
a50 1
cleantags "$FILE"
d102 1
a102 1
echo cvs -d cvs.netbsd.org:/cvsroot import src/external/bsd/file/dist CHRISTOS FILE${file_vers%.*}_${file_vers#*.}
@


1.2.2.2
log
@sync with head
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.2.2.1 2012/04/17 00:03:07 yamt Exp $
d44 1
a44 7
file_vers="$(awk -F',' '/AC_INIT\(/ { print $2 }' "$FILE/configure.ac" | tr -d '[' | tr -d ']' | tr -d ' ')"

case $file_vers in
[0-9].[0-9][0-9]) ;;
*)	echo "$PROG: Cannot determine file version: $file_vers" 1>&2
	exit 1;;
esac
d70 3
a72 3
mv -f $FILE/doc/file.man $FILE/doc/file.1
mv -f $FILE/doc/libmagic.man $FILE/doc/libmagic.3
mv -f $FILE/doc/magic.man $FILE/doc/magic.5
d89 1
a89 1
mv $FILE/magic/Magdir $FILE/magic/magdir
@


1.2.4.1
log
@Pull up following revision(s) (requested by christos in ticket #30):
	Update file to 5.11 (CDF security fixes)
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.3 2012/02/22 17:47:25 christos Exp $
d50 1
a50 1
cleantags "$FILE"
d102 1
a102 1
echo cvs -d cvs.netbsd.org:/cvsroot import src/external/bsd/file/dist CHRISTOS FILE${file_vers%.*}_${file_vers#*.}
@


1.1
log
@restore from the dead.
@
text
@d3 1
a3 1
#	$NetBSD: file2netbsd,v 1.20 2008/08/30 12:18:55 christos Exp $
d50 1
a50 10
find "$FILE" -type f -print | xargs egrep -l '\$(Id|Date|Header|Log|Revision)'\
    | while read f; do
	sed -e 's/\$\(Id.*\) \$/\1/' \
	    -e 's/\$\(Date.*\) \$/\1/' \
	    -e 's/\$\(Header.*\) \$/\1/' \
	    -e 's/\$\(Log.*\) \$/\1/' \
	    -e 's/\$\(Revision.*\) \$/\1/' \
	    $f > /tmp/file2$$ && mv /tmp/file2$$ $f && \
	echo removed RCS tag from $f
done
@

