Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openwrt/buildscripts.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-04-08 14:30:12 +0300
committerJo-Philipp Wich <jow@openwrt.org>2015-04-08 14:30:20 +0300
commita5fe5ac9c916f0954456904ce6943b42a38dd756 (patch)
treec7e1306216ceca1e9ba3af3acdaa7a9991480ada
parentadd9056c370442beae9213e5e5a85859f745ee90 (diff)
make-index.pl: force C locale and use sort explicitely
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
-rwxr-xr-xshared/make-index.pl12
1 files changed, 11 insertions, 1 deletions
diff --git a/shared/make-index.pl b/shared/make-index.pl
index a72b4d7..54d3299 100755
--- a/shared/make-index.pl
+++ b/shared/make-index.pl
@@ -2,11 +2,13 @@
use strict;
use warnings;
+use POSIX;
my $dir = $ARGV[0];
die "Usage: $0 <package directory>\n" unless -d $dir;
+setlocale(LC_ALL, "C");
sub pkg_metadata
{
@@ -64,13 +66,21 @@ sub pkg_metadata
return $meta;
}
+
+my @packages;
+
if (opendir D, $dir)
{
while (defined(my $e = readdir D))
{
next unless -f "$dir/$e" && $e =~ m{\.ipk$};
- print pkg_metadata("$dir/$e");
+ push @packages, $e;
}
closedir D;
}
+
+foreach my $package (sort @packages)
+{
+ print pkg_metadata("$dir/$package");
+}