summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2000-06-23 18:53:25 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2000-06-23 18:53:25 +0000
commitf66e691f9fd13033727195f6865dec32501a22ef (patch)
treef2504833da95ea9fd65a81192aadea0f18c4eded
parentc9c47f4d245baa03a7825335f85432cfc2cd05fe (diff)
implement bubble sort in ksh instead of using sort(1).
i think i'll fix sparc next week to use it.
-rw-r--r--distrib/i386/floppies/common/install.md6
-rw-r--r--distrib/i386/floppies/common/instbin-nokrb.conf4
-rw-r--r--distrib/i386/floppies/common/instbin.conf4
-rw-r--r--distrib/i386/floppies/common/list3
-rw-r--r--distrib/miniroot/install.sub29
5 files changed, 36 insertions, 10 deletions
diff --git a/distrib/i386/floppies/common/install.md b/distrib/i386/floppies/common/install.md
index 29218803b0f..1dfe38db4f9 100644
--- a/distrib/i386/floppies/common/install.md
+++ b/distrib/i386/floppies/common/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.7 1999/10/08 03:55:42 millert Exp $
+# $OpenBSD: install.md,v 1.8 2000/06/23 18:53:24 mickey Exp $
#
#
# Copyright rc) 1996 The NetBSD Foundation, Inc.
@@ -61,12 +61,12 @@ md_machine_arch() {
md_get_diskdevs() {
# return available disk devices
- cat /kern/msgbuf | egrep "^[sw]d[0-9]+ " | cutword 1 | sort -u
+ bsort `cat /kern/msgbuf | egrep "^[sw]d[0-9]+ " | cutword 1`
}
md_get_cddevs() {
# return available CDROM devices
- cat /kern/msgbuf | egrep "^cd[0-9]+ " | cutword 1 | sort -u
+ bsort `cat /kern/msgbuf | egrep "^cd[0-9]+ " | cutword 1`
}
md_get_partition_range() {
diff --git a/distrib/i386/floppies/common/instbin-nokrb.conf b/distrib/i386/floppies/common/instbin-nokrb.conf
index 6df822b86d2..ce71ab2cb33 100644
--- a/distrib/i386/floppies/common/instbin-nokrb.conf
+++ b/distrib/i386/floppies/common/instbin-nokrb.conf
@@ -1,4 +1,4 @@
-# $OpenBSD: instbin-nokrb.conf,v 1.3 2000/06/09 17:42:53 mickey Exp $
+# $OpenBSD: instbin-nokrb.conf,v 1.4 2000/06/23 18:53:24 mickey Exp $
#
# instbin-nokrb.conf - unified binary for the inst/upgr floppies
#
@@ -12,7 +12,7 @@ progs ifconfig init less ln ls mkdir mknod mount mount_cd9660
progs mount_ffs mount_msdos mount_nfs mount_kernfs mount_ext2fs
progs mv newfs pax ksh ping reboot rm route
progs sed sleep stty tip umount
-progs rsh restore gzip sort grep installboot
+progs rsh restore gzip grep installboot
ln chmod chgrp
ln chmod chown
diff --git a/distrib/i386/floppies/common/instbin.conf b/distrib/i386/floppies/common/instbin.conf
index 5a5d542f6b6..afd9435ebd9 100644
--- a/distrib/i386/floppies/common/instbin.conf
+++ b/distrib/i386/floppies/common/instbin.conf
@@ -1,4 +1,4 @@
-# $OpenBSD: instbin.conf,v 1.10 2000/06/09 17:42:53 mickey Exp $
+# $OpenBSD: instbin.conf,v 1.11 2000/06/23 18:53:24 mickey Exp $
#
# instbin.conf - unified binary for the inst/upgr floppies
#
@@ -12,7 +12,7 @@ progs ifconfig init less ln ls mkdir mknod mount mount_cd9660
progs mount_ffs mount_msdos mount_nfs mount_kernfs mount_ext2fs
progs mv newfs pax ksh ping reboot rm route
progs sed sleep stty tip umount
-progs rsh restore gzip sort grep installboot
+progs rsh restore gzip grep installboot
ln chmod chgrp
ln chmod chown
diff --git a/distrib/i386/floppies/common/list b/distrib/i386/floppies/common/list
index 7d774050c97..29487d2338b 100644
--- a/distrib/i386/floppies/common/list
+++ b/distrib/i386/floppies/common/list
@@ -1,4 +1,4 @@
-# $OpenBSD: list,v 1.12 2000/06/09 17:42:53 mickey Exp $
+# $OpenBSD: list,v 1.13 2000/06/23 18:53:24 mickey Exp $
# copy the crunched binary, link to it, and kill it
COPY ${OBJDIR}/instbin instbin
@@ -47,7 +47,6 @@ LINK instbin usr/bin/gzip usr/bin/gunzip usr/bin/gzcat
LINK instbin usr/bin/less usr/bin/more
LINK instbin usr/bin/rsh
LINK instbin usr/bin/sed
-LINK instbin usr/bin/sort
LINK instbin usr/mdec/installboot
SPECIAL /bin/rm instbin
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 2c2d6914e6f..a2677728487 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,5 +1,5 @@
#!/bin/sh
-# $OpenBSD: install.sub,v 1.154 2000/06/16 03:19:42 deraadt Exp $
+# $OpenBSD: install.sub,v 1.155 2000/06/23 18:53:24 mickey Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1997,1998 Todd Miller, Theo de Raadt
@@ -265,6 +265,33 @@ get_ifdevs() {
/sbin/ifconfig -a | egrep -v '^([[:space:]]|(lo|enc|gre|ppp|sl|tun|bridge)[[:digit:]])' | cutword -t: 1
}
+bsort() {
+ local _a=$1
+
+ if [ $# == 0 ]; then
+ return
+ fi
+
+ if [ $# == 1 ]; then
+ echo $1; return
+ fi
+
+ shift
+ while [ $# != 0 ]; do
+ local _b=$1
+ if [[ "$_a" != "$_b" ]] ; then
+ if [[ "$_a" > "$_b" ]] ; then
+ _l="$_a $_l"; _a=$_b
+ else
+ _l="$_b $_l"
+ fi
+ fi
+ shift
+ done
+
+ echo -n "$_a "; bsort $_l
+}
+
dir_has_sets() {
# return true when the directory $1 contains a set for $2...$n
local _dir=$1 _file