summaryrefslogtreecommitdiff
path: root/scripts/sort_package_license_list.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/sort_package_license_list.pl')
-rw-r--r--scripts/sort_package_license_list.pl18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/sort_package_license_list.pl b/scripts/sort_package_license_list.pl
new file mode 100644
index 0000000..cd20b50
--- /dev/null
+++ b/scripts/sort_package_license_list.pl
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+open (FH, $ARGV[0]);
+my @list;
+
+while (my $line = <FH>){
+ chomp $line;
+ push (@list,$line);
+}
+
+@list = sort { ($b =~ tr /\//\//) <=> ($a =~ tr /\//\//) || $b cmp $a } @list;
+
+foreach my $line(@list){
+ print "$line\n";
+}