From owner-freebsd-current Wed Jun 21 14:41: 5 2000 Delivered-To: freebsd-current@freebsd.org Received: from lafontaine.cybercable.fr (lafontaine.cybercable.fr [212.198.0.202]) by hub.freebsd.org (Postfix) with SMTP id 809DD37B788 for ; Wed, 21 Jun 2000 14:41:01 -0700 (PDT) (envelope-from root@gits.dyndns.org) Received: (qmail 220221 invoked from network); 21 Jun 2000 21:40:59 -0000 Received: from r224m65.cybercable.tm.fr (HELO gits.dyndns.org) ([195.132.224.65]) (envelope-sender ) by lafontaine.cybercable.fr (qmail-ldap-1.03) with SMTP for ; 21 Jun 2000 21:40:59 -0000 Received: (from root@localhost) by gits.dyndns.org (8.9.3/8.9.3) id XAA21563; Wed, 21 Jun 2000 23:40:57 +0200 (CEST) (envelope-from root) Posted-Date: Wed, 21 Jun 2000 23:40:57 +0200 (CEST) To: current@FreeBSD.ORG Subject: Re: kernel config format migration script References: Reply-To: clefevre@citeweb.net X-Face: V|+c;4!|B?E%BE^{E6);aI.[<97Zd*>^#%Y5Cxv;%Y[PT-LW3;A:fRrJ8+^k"e7@+30g0YD0*^^3jgyShN7o?a]C la*Zv'5NA,=963bM%J^o]C From: Cyrille Lefevre Date: 21 Jun 2000 23:40:55 +0200 In-Reply-To: Brian Fundakowski Feldman's message of "Wed, 21 Jun 2000 08:47:24 -0700 (PDT)" Message-ID: Lines: 51 X-Mailer: Gnus v5.6.45/XEmacs 21.1 - "Canyonlands" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Brian Fundakowski Feldman writes: > I made a sed script to ease migration of kernel configuration files from > the few-weeks-ago-CURRENT to current-CURRENT, and thought I might as well > share it since it makes things easy (autonomous :) > > You can find it at > http://people.freebsd.org/~green/oldconfig2new > It requires extended regular expression support (because old regexps > are so cumbersome to actually _use_), so for example: > mv GREEN GREEN.old > perl gethints.pl GREEN > sed -Ef oldconfig2new GREEN.old > GREEN this one seems to be working w/ a standard sed : ==========----------========== CUT HERE ==========----------========== #!/usr/bin/sed -f # since ata[0-9] requires ata alone, delete them. /^#*[ \t]*device[ \t]\{1,\}ata[0-9]\{1,\}/d # delete fd[0-9] and fd alone. /^#*[ \t]*device[ \t]\{1,\}fd[0-9]\{1,\}/d /^#*[ \t]*device[ \t]\{1,\}fd$/d # get rid of terminal spaces s/[ \t]\{1,\}$// # hints stuffs /^ident[ \t]\{1,\}/ { h s/^ident\([ \t]\{1,\}\)\([a-zA-Z0-9_]\{1,\}\)/hints\1"\2.hints"/ # ^^^^^^^^^^ I'm not sure about this # are underscore and digits valid characters here ? H x } s/^\(#*[ \t]*\)pseudo-device\([ \t]\{1,\}\)/\1device\2/ s/^\(#*[ \t]*\)device\([ \t]\{1,\}\)\([a-zA-Z_]\{1,\}\)\([0-9]\{1,\}\)\([ \t]*\)\([^#]*\)\(.*\)$/\1device\2\3\5\7/ # ^^^^^^^ also, here ? ==========----------========== CUT HERE ==========----------========== \t need to be replaced w/ real tabs (under vi, :%s/\\t//g) just in case, I put them here to be reliable (and visible :) via email. Cyrille. -- home:mailto:clefevre@no-spam.citeweb.net Supprimer "no-spam." pour me repondre. work:mailto:Cyrille.Lefevre@no-spam.edf.fr Remove "no-spam." to answer me back. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message