From 2aacf1d353976cc5b3fd478115a591667c90d25c Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Wed, 25 Aug 2004 11:43:21 +0000 Subject: [PATCH] problems: asort() is not available in all awk implementations --- tests/scripts/acfiltersort.sh | 18 ------------ tests/scripts/defines.sh | 2 -- tests/scripts/ldifsort.awk | 51 --------------------------------- tests/scripts/sql-test900-write | 6 ++-- 4 files changed, 3 insertions(+), 74 deletions(-) delete mode 100755 tests/scripts/acfiltersort.sh delete mode 100644 tests/scripts/ldifsort.awk diff --git a/tests/scripts/acfiltersort.sh b/tests/scripts/acfiltersort.sh deleted file mode 100755 index fe7b9474cc..0000000000 --- a/tests/scripts/acfiltersort.sh +++ /dev/null @@ -1,18 +0,0 @@ -#! /bin/sh -# $OpenLDAP$ -## This work is part of OpenLDAP Software . -## -## Copyright 1998-2004 The OpenLDAP Foundation. -## All rights reserved. -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted only as authorized by the OpenLDAP -## Public License. -## -## A copy of this license is available in the file LICENSE in the -## top-level directory of the distribution or, alternatively, at -## . -# -# Strip comments -# -egrep -iv '^#' | awk -f $LDIFSORT diff --git a/tests/scripts/defines.sh b/tests/scripts/defines.sh index ec2c62f8a9..2a4aca3887 100755 --- a/tests/scripts/defines.sh +++ b/tests/scripts/defines.sh @@ -93,8 +93,6 @@ CLIENTDIR=../clients/tools LDIFFILTER=$SRCDIR/scripts/acfilter.sh CONFFILTER=$SRCDIR/scripts/conf.sh -LDIFFILTERSORT=$SRCDIR/scripts/acfiltersort.sh -LDIFSORT=$SRCDIR/scripts/ldifsort.awk SLAPADD="../servers/slapd/slapd -Ta $LDAP_VERBOSE" SLAPCAT="../servers/slapd/slapd -Tc $LDAP_VERBOSE" diff --git a/tests/scripts/ldifsort.awk b/tests/scripts/ldifsort.awk deleted file mode 100644 index 5e8f9f619b..0000000000 --- a/tests/scripts/ldifsort.awk +++ /dev/null @@ -1,51 +0,0 @@ -# Parses LDIF files, eliminating contnuations, and sorts -# Author: Pierangelo Masarati - -func parse_line( line ) { - getline; - - while ($0 != "") { - c = substr($0, 1, 1); - if (c == "#") { - continue; - } - if (c != " ") { - break; - } - - line = line substr($0, 2, length($0)); - - getline; - } - - return line; -} - -/^dn: / { - /* FIXME: works only if DN is on one line... */ - dn = $0; - dn = parse_line(dn); - - while (1) { - if ($0 == "") { - break; - } - line = $0; - line = parse_line(line); - attrs[line] = line - } - - entry[dn] = dn "\n"; - n = asort(attrs); - for (i = 1; i <= n; i++) { - entry[dn] = entry[dn] attrs[i] "\n" - } - delete attrs -} - -END { - n = asort(entry); - for (i = 1; i <= n; i++) { - print entry[i]; - } -} diff --git a/tests/scripts/sql-test900-write b/tests/scripts/sql-test900-write index bb85af0f83..37e8eefa78 100755 --- a/tests/scripts/sql-test900-write +++ b/tests/scripts/sql-test900-write @@ -304,7 +304,7 @@ EOMODS fi echo "Using ldapsearch to retrieve all the entries..." - $LDAPSEARCH -h $LOCALHOST -p $PORT1 -b "$BASEDN" \ + $LDAPSEARCH -S "" -h $LOCALHOST -p $PORT1 -b "$BASEDN" \ "objectClass=*" > $SEARCHOUT 2>&1 RC=$? @@ -315,9 +315,9 @@ EOMODS fi echo "Filtering ldapsearch results..." - . $LDIFFILTERSORT < $SEARCHOUT > $SEARCHFLT + . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT echo "Filtering modified ldif..." - . $LDIFFILTERSORT < $SQLWRITE > $LDIFFLT + . $LDIFFILTER < $SQLWRITE > $LDIFFLT echo "Comparing filter output..." $CMP $SEARCHFLT $LDIFFLT > $CMPOUT -- 2.39.5