[PATCH] Minor fix for for share/{Makefile,format.pl}

Jan-Benedict Glaw jbglaw at getslash.de
Tue Mar 18 17:41:06 CET 2014


Hi!

While working on my backend, I recognized that the "format" target in
./share doesn't work as expected. This should fix it for the `master'
branch, and probably also applies to the 2.x version.

---
 share/Makefile  | 2 +-
 share/format.pl | 9 +++------
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/share/Makefile b/share/Makefile
index ab342b4..d40c0b5 100644
--- a/share/Makefile
+++ b/share/Makefile
@@ -10,6 +10,6 @@
 #
 format: dictionary*
 	@for x in dictionary* ; do \
-		cat $$x | ./format.pl > tmp; \
+		./format.pl $$x > tmp; \
 		mv tmp $$x; \
 	done
diff --git a/share/format.pl b/share/format.pl
index 8105511..dd259a9 100755
--- a/share/format.pl
+++ b/share/format.pl
@@ -2,7 +2,8 @@
 #
 #  Format the dictionaries according to a standard scheme.
 #
-#  Usage: cat dictionary | ./format.pl > new
+#  Usage: cat dictionary | ./format.pl - > new
+#     or: ./format.pl dictionary > new
 #
 #  We don't over-write the dictionaries in place, so that the process
 #  can be double-checked by hand.
@@ -217,9 +218,5 @@ while (@ARGV) {
 
     close FILE;
 
-    open FILE, ">$filename" or die "Failed to open $filename: $!\n";
-
-    print FILE @output;
-
-    close FILE;
+    print @output;
 }
-- 
1.8.3.2

-- 
Getslash GmbH, Bahnhofstraße 16, 59302 Oelde
Tel: +49-2522-834349-5    Fax:   +49-2522-834349-1
http://www.getslash.de    Mobil: +49-152-33822499
Sitz der Gesellschaft: Oelde
Handelsregister: Amtsgericht Münster, HRB 11911
Ust-Id-Nr.: DE 815060326
Geschäftsführung: Andre Peitz, Tobias Hanisch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.freeradius.org/mailman/private/freeradius-devel/attachments/20140318/335337db/attachment.pgp>


More information about the Freeradius-Devel mailing list