186d7f5d3SJohn Marino#! /bin/sh 286d7f5d3SJohn Marino# 386d7f5d3SJohn Marino# $NetBSD: lvm2netbsd,v 1.2 2009/12/02 00:59:19 haad Exp $ 486d7f5d3SJohn Marino# 586d7f5d3SJohn Marino# Copyright (c) 2003 The NetBSD Foundation, Inc. 686d7f5d3SJohn Marino# All rights reserved. 786d7f5d3SJohn Marino# 886d7f5d3SJohn Marino# Redistribution and use in source and binary forms, with or without 986d7f5d3SJohn Marino# modification, are permitted provided that the following conditions 1086d7f5d3SJohn Marino# are met: 1186d7f5d3SJohn Marino# 1. Redistributions of source code must retain the above copyright 1286d7f5d3SJohn Marino# notice, this list of conditions and the following disclaimer. 1386d7f5d3SJohn Marino# 2. Redistributions in binary form must reproduce the above copyright 1486d7f5d3SJohn Marino# notice, this list of conditions and the following disclaimer in the 1586d7f5d3SJohn Marino# documentation and/or other materials provided with the distribution. 1686d7f5d3SJohn Marino# 1786d7f5d3SJohn Marino# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 1886d7f5d3SJohn Marino# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 1986d7f5d3SJohn Marino# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 2086d7f5d3SJohn Marino# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 2186d7f5d3SJohn Marino# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2286d7f5d3SJohn Marino# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2386d7f5d3SJohn Marino# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2486d7f5d3SJohn Marino# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2586d7f5d3SJohn Marino# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2686d7f5d3SJohn Marino# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2786d7f5d3SJohn Marino# POSSIBILITY OF SUCH DAMAGE. 2886d7f5d3SJohn Marino# 2986d7f5d3SJohn Marino# lvm2netbsd: convert a file source tree into a 3086d7f5d3SJohn Marino# format suitable for import. Works on current dir. 3186d7f5d3SJohn Marino# You can run this only once if you want it to work. 3286d7f5d3SJohn Marino# 3386d7f5d3SJohn Marino# configure.h file in lvm2tools/lib/ was generated with this command 3486d7f5d3SJohn Marino# 3586d7f5d3SJohn Marino# ./configure --with-cluster=none --with-snapshots=internal --with-clvmd=none 3686d7f5d3SJohn Marino# --with-lvm1=none --with-cluster=none --disable-readline --enable-o_direct 3786d7f5d3SJohn Marino# --disable-udev_sync --enable-devmapper 3886d7f5d3SJohn Marino# 3986d7f5d3SJohn Marino# based on texinfo2netbsd 4086d7f5d3SJohn Marino# 4186d7f5d3SJohn Marino 4286d7f5d3SJohn Marino# edit this 4386d7f5d3SJohn Marinolvm2_vers=$(cat VERSION | cut -d ' ' -f 1) 4486d7f5d3SJohn Marino 4586d7f5d3SJohn Marinoimport_date=$(date '+%m-%d-%y'); 4686d7f5d3SJohn Marino# 4786d7f5d3SJohn Marino# (usually) NO NEED TO EDIT BELOW THIS LINE 4886d7f5d3SJohn Marino# 4986d7f5d3SJohn Marino 5086d7f5d3SJohn Marino### Wipe out stuff we don't want 5186d7f5d3SJohn Marinorm -f .cvsignore 5286d7f5d3SJohn Marino 5386d7f5d3SJohn Marinoecho "Installing header files." 5486d7f5d3SJohn Marino( 5586d7f5d3SJohn Marino cd include/ 5686d7f5d3SJohn Marino cp `cat .symlinks | xargs` .; 5786d7f5d3SJohn Marino 5886d7f5d3SJohn Marino cat > version.h <<EOF 5986d7f5d3SJohn Marino#ifndef _LVM_VERSION_H 6086d7f5d3SJohn Marino#define LVM_VERSION "$lvm2_vers-cvs ($import_date)" 6186d7f5d3SJohn Marino#endif 6286d7f5d3SJohn MarinoEOF 6386d7f5d3SJohn Marino cd ../ 6486d7f5d3SJohn Marino) 6586d7f5d3SJohn Marinoecho done 6686d7f5d3SJohn Marino 6786d7f5d3SJohn Marinoecho "Adding NetBSD RCS ID tags to lvm2 sources" 6886d7f5d3SJohn Marino 6986d7f5d3SJohn Marino### Add NetBSD RCS Id 7086d7f5d3SJohn Marinofind . -type f -name '*.[chly]' -print | while read c; do 7186d7f5d3SJohn Marino sed -e '1{/$NetBSD/!{i\ 7286d7f5d3SJohn Marino/* \$NetBSD\$ */\ 7386d7f5d3SJohn Marino 7486d7f5d3SJohn Marino};} 7586d7f5d3SJohn Marino/#ifndef[ ]lint/{N;/FILE_RCSID/s/\n/\ 7686d7f5d3SJohn Marino#if 0\ 7786d7f5d3SJohn Marino/ 7886d7f5d3SJohn Marinoa\ 7986d7f5d3SJohn Marino#else\ 8086d7f5d3SJohn Marino__RCSID("\$NetBSD\$");\ 8186d7f5d3SJohn Marino#endif 8286d7f5d3SJohn Marino}' $c > /tmp/file3$$ 8386d7f5d3SJohn Marinomv /tmp/file3$$ $c && echo did source mods for $c 8486d7f5d3SJohn Marinodone 8586d7f5d3SJohn Marino 8686d7f5d3SJohn Marinoecho "Adding NetBSD RCS ID tags to manual pages" 8786d7f5d3SJohn Marino#### Add RCS tags to man pages 8886d7f5d3SJohn Marinofind . -type f -name '*.[0-9].in' -print | while read m; do 8986d7f5d3SJohn Marino base=`basename $m .in` 9086d7f5d3SJohn Marino sed -e '1{/$NetBSD/!i\ 9186d7f5d3SJohn Marino.\\" \$NetBSD\$\ 9286d7f5d3SJohn Marino.\\" 9386d7f5d3SJohn Marino 9486d7f5d3SJohn Marino}' -e 's/__CSECTION__/1/g' \ 9586d7f5d3SJohn Marino -e 's/__FSECTION__/5/g' \ 9686d7f5d3SJohn Marino -e 's/__VERSION__/'"${file_vers}/g" \ 9786d7f5d3SJohn Marino -e 's,__MAGIC__,/usr/share/misc/magic,g' \ 9886d7f5d3SJohn Marino -e "s/#VERSION#/$lvm2_vers-cvs ($import_date)/" \ 9986d7f5d3SJohn Marino $m > `dirname $m`/$base && echo did manpage mods for $base 10086d7f5d3SJohn Marinodone 10186d7f5d3SJohn Marino 10286d7f5d3SJohn Marinoecho done 10386d7f5d3SJohn Marino 10486d7f5d3SJohn Marino### Clean up any CVS directories that might be around. 10586d7f5d3SJohn Marinoecho "cleaning up CVS residue." 10686d7f5d3SJohn Marino( 10786d7f5d3SJohn Marino find . -type d -name "CVS" -print | xargs rm -r 10886d7f5d3SJohn Marino find . -type f -name ".gitignore" -print | xargs rm -r 10986d7f5d3SJohn Marino rm -rf config.log 11086d7f5d3SJohn Marino rm -rf config.status 11186d7f5d3SJohn Marino) 11286d7f5d3SJohn Marinoecho done 11386d7f5d3SJohn Marino 11486d7f5d3SJohn Marino 11586d7f5d3SJohn Marinover=`echo ${lvm2_vers} | sed -e 's/\./-/g'` 11686d7f5d3SJohn Marinoecho You can import now. Use the following command: 11786d7f5d3SJohn Marinoecho cvs import src/external/gpl2/lvm2/dist REDHAT LVM${ver} 11886d7f5d3SJohn Marino 11986d7f5d3SJohn Marinoexit 0 120