bktr2netbsd revision 1.5
11.1Swiz#! /bin/sh 21.1Swiz# 31.5Sisaki# $NetBSD: bktr2netbsd,v 1.5 2007/03/21 15:02:08 isaki Exp $ 41.1Swiz# 51.4Swiz# Copyright (c) 2000-2003 The NetBSD Foundation, Inc. 61.1Swiz# All rights reserved. 71.1Swiz# 81.1Swiz# Redistribution and use in source and binary forms, with or without 91.1Swiz# modification, are permitted provided that the following conditions 101.1Swiz# are met: 111.1Swiz# 1. Redistributions of source code must retain the above copyright 121.1Swiz# notice, this list of conditions and the following disclaimer. 131.1Swiz# 2. Redistributions in binary form must reproduce the above copyright 141.1Swiz# notice, this list of conditions and the following disclaimer in the 151.1Swiz# documentation and/or other materials provided with the distribution. 161.1Swiz# 3. All advertising materials mentioning features or use of this software 171.1Swiz# must display the following acknowledgement: 181.1Swiz# This product includes software developed by the NetBSD 191.1Swiz# Foundation, Inc. and its contributors. 201.1Swiz# 4. Neither the name of The NetBSD Foundation nor the names of its 211.1Swiz# contributors may be used to endorse or promote products derived 221.1Swiz# from this software without specific prior written permission. 231.1Swiz# 241.1Swiz# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 251.1Swiz# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 261.1Swiz# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 271.1Swiz# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 281.1Swiz# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 291.1Swiz# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 301.1Swiz# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 311.1Swiz# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 321.1Swiz# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 331.1Swiz# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 341.1Swiz# POSSIBILITY OF SUCH DAMAGE. 351.1Swiz# 361.4Swiz# bktr2netbsd: convert sourceforge bktr source directory tree into 371.1Swiz# netbsd bktr source tree, under sys/dev/pci/bktr 381.4Swiz# originally based on bind2netbsd by Bernd Ernesti 391.1Swiz 401.1Swizif [ $# -ne 2 ]; then echo "bktr2netbsd src dest"; exit 1; fi 411.1Swiz 421.1Swizr=$1 431.1Swizd=$2/sys/dev/pci/bktr 441.1Swiz 451.1Swizcase "$d" in 461.1Swiz /*) 471.1Swiz ;; 481.1Swiz *) 491.1Swiz d=`/bin/pwd`/$d 501.1Swiz ;; 511.1Swizesac 521.1Swiz 531.1Swizcase "$r" in 541.1Swiz /*) 551.1Swiz ;; 561.1Swiz *) 571.1Swiz r=`/bin/pwd`/$r 581.1Swiz ;; 591.1Swizesac 601.1Swiz 611.1Swizecho preparing directory $d 621.1Swizrm -rf $d 631.1Swizmkdir -p $d 641.1Swiz 651.1Swiz### Copy the files 661.1Swizecho copying $r to $d 671.1Swizcd $r 681.1Swizpax -rw * $d 691.1Swiz 701.1Swizecho removing unneeded files 711.1Swiz 721.1Swiz### Remove unneeded files 731.1Swizcd $d 741.4Swizrm -f CHANGELOG.TXT README.* bktr_i2c.[ch] 751.1Swiz 761.1Swiz### Remove the $'s around RCS tags 771.4Swizfind $d -type f -print | xargs egrep -l '\$Id:' | while read f; do 781.5Sisaki sed -e 's/\$\(Id:\)\(.*\) \$/SourceForge:\2/' \ 791.1Swiz < $f > /tmp/bktr1f$$ && mv /tmp/bktr1f$$ $f && \ 801.4Swiz echo quoted \$RCS tag from $f 811.1Swizdone 821.1Swiz 831.1Swiz### create bt8xx.h from ioctl_meteor.h and ioctl_bt848.h 841.1Swizecho merging ioctl_meteor.h and ioctl_bt848.h to bt8xx.h 851.1Swizecho "/* This file is merged from ioctl_meteor.h and ioctl_bt848.h from FreeBSD. */" > bt8xx.h 861.1Swizecho "/* The copyright below only applies to the ioctl_meteor.h part of this file. */" >> bt8xx.h 871.2Swizecho "" >> bt8xx.h 881.2Swizecho "#ifndef _DEV_IC_BT8XX_H_" >> bt8xx.h 891.2Swizecho "#define _DEV_IC_BT8XX_H_" >> bt8xx.h 901.1Swizcat ioctl_meteor.h ioctl_bt848.h | grep -v _MACHINE_IOCTL_METEOR_H_ | \ 911.1Swiz grep -v _MACHINE_IOCTL_BT848_H >> bt8xx.h 921.2Swizecho "#endif /* _DEV_IC_BT8XX_H_ */" >> bt8xx.h 931.1Swizrm ioctl_meteor.h ioctl_bt848.h 941.1Swiz 951.1Swizecho done 961.1Swiz 971.1Swiz### move bt8xx.h to correct place 981.1Swizecho moving bt8xx.h to dev/ic 991.1Swizmkdir -p $d/../../ic 1001.1Swizmv bt8xx.h $d/../../ic 1011.1Swiz 1021.1Swiz### Clean up any CVS directories that might be around. 1031.1Swizecho "cleaning up CVS residue." 1041.1Swiz( 1051.1Swiz cd $d 1061.1Swiz find . -type d -name "CVS" -print | xargs rm -r 1071.1Swiz) 1081.1Swizecho done 1091.1Swiz 1101.1Swiz### Fixing file and directory permissions. 1111.1Swizecho "Fixing file/directory permissions." 1121.1Swiz( 1131.1Swiz cd $d 1141.1Swiz find . -type f -print | xargs chmod u+rw,go+r 1151.1Swiz find . -type d -print | xargs chmod u+rwx,go+rx 1161.1Swiz) 1171.1Swizecho done 1181.1Swiz 1191.4Swizecho Now do: 1201.4Swizecho cd $d/../.. 1211.4Swizecho and import into src/sys/dev with 1221.4Swizecho Vendor: BKTR_SF 1231.4Swizecho Release: BKTR_YYYY_MM_DD 1241.4Swiz 1251.4Swizecho Do not forget to tag the imported version in the sourceforge repository! 1261.1Swizexit 0 127