Update of /cvsroot/fink/dists/10.4/stable/main/finkinfo/devel
In directory vz-cvs-3.sog:/tmp/cvs-serv9555/stable/main/finkinfo/devel

Modified Files:
        flag-sort.info flag-sort.patch 
Log Message:
latest flag-sort to stable


Index: flag-sort.info
===================================================================
RCS file: /cvsroot/fink/dists/10.4/stable/main/finkinfo/devel/flag-sort.info,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- flag-sort.info      15 Nov 2009 08:20:26 -0000      1.1
+++ flag-sort.info      20 Jul 2011 00:54:29 -0000      1.2
@@ -1,12 +1,12 @@
 Package: flag-sort
-Version: 0.3
+Version: 0.4
 Revision: 1
 
 BuildDepends: fink (>= 0.24.12-1)
 
 Source: none
 PatchFile: %n.patch
-PatchFile-MD5: 7d4dd243454a1093c2cf98ece467d326
+PatchFile-MD5: c19f51d7f84fb9c08453912d92b229c4
 PatchScript: sed 's,@PREFIX@,%p,' < %{PatchFile} | patch -p1
 
 CompileScript: #
@@ -16,7 +16,7 @@
 <<
 
 DescUsage: <<
-       flag-sort [-v] CMD ARG1 ARG2 ...
+       flag-sort [-r] [-v] CMD ARG1 ARG2 ...
 
 The command CMD is launched with ARG1 ARG2 ... as arguments. The
 arguments are re-ordered to put compiler search-path flags (-I and -L)
@@ -36,6 +36,18 @@
 lib/ and include/ because the rooted packages need not put those
 in any well-defined place)
 
+The -r flag causes flag-sort to print relative paths before absolute
+paths.  Order is preserved within each class of path.  For example,
+the following command:
+
+  flag-sort -r echo -L/absolute -Lrelative -L../relative \
+    -I/absolute -I../relative -Irelative
+
+...would result in:
+
+  -I../relative -Irelative -I/absolute \
+    -Lrelative -L../relative -L/absolute
+
 The -v flag causes flag-sort to print the command that will be
 launched and all the flags in order on STDOUT.
 <<

Index: flag-sort.patch
===================================================================
RCS file: /cvsroot/fink/dists/10.4/stable/main/finkinfo/devel/flag-sort.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- flag-sort.patch     15 Nov 2009 08:20:26 -0000      1.1
+++ flag-sort.patch     20 Jul 2011 00:54:29 -0000      1.2
@@ -1,7 +1,6 @@
-diff -Nurd flag-sort-0.3.orig/flag-sort flag-sort-0.3/flag-sort
---- flag-sort-0.3.orig/flag-sort       1969-12-31 19:00:00.000000000 -0500
-+++ flag-sort-0.3/flag-sort    2009-07-09 01:10:53.000000000 -0400
-@@ -0,0 +1,94 @@
+--- /dev/null  2011-05-16 09:30:15.000000000 -0400
++++ tmp/flag-sort      2011-05-16 09:34:13.000000000 -0400
+@@ -0,0 +1,136 @@
 +#!/usr/bin/perl
 +# -*- mode: Perl; tab-width: 4; -*-
 +
@@ -34,19 +33,56 @@
 +my @other_queue = ();  # things not fitting into any of %flag_queues
 +
 +my $verbose = 0;
-+if (@ARGV && $ARGV[0] eq '-v') {
-+      $verbose = 1;
-+      shift;
++my $relative_first = 0;
++
++while ($ARGV[0] =~ /^-(v|r)/) {
++      if ($ARGV[0] eq '-v') {
++              $verbose = 1;
++              shift;
++      } elsif ($ARGV[0] eq '-r') {
++              $relative_first = 1;
++              shift;
++      }
 +}
 +
 +if (!@ARGV) {
-+      warn "Usage: $0 [-v] cmd [flags for cmd]\n";
++      warn "Usage: $0 [-v] [-r] cmd [flags for cmd]\n";
 +      warn "  resort [flags for cmd] and call cmd with them\n";
++      warn "  -r causes sort to put relative paths before absolute paths\n";
 +      warn "  -v causes display of some diagnostics on STDOUT\n";
 +      exit 1;
 +}
 +
++# full paths should be after relative paths
++sub bypath {
++      my ($a_path) = $a =~ /^-(?:I|L)(.*)$/;
++      my ($b_path) = $b =~ /^-(?:I|L)(.*)$/;
++
++      #print "a_path = $a_path\n";
++      #print "b_path = $b_path\n";
++
++      if (not defined $a_path or not defined $b_path) {
++              return 0;
++      }
++
++      if ($a_path =~ /^\//) {
++              if ($b_path =~ /^\//) {
++                      return 0;
++              } else {
++                      return 1;
++              }
++      } else {
++              if ($b_path =~ /^[\/]/) {
++                      return -1;
++              } else {
++                      return 0;
++              }
++      }
++
++      return 0;
++}
 +# what we will launch after organizing the flags
++
 +my @subcmd = ();
 +
 +# separate the args according to flag
@@ -88,11 +124,16 @@
 +      # now reconstruct list of paths according to prefix priority
 +      @path_list = @other_paths;  # assume unknowns are "very important"
 +      foreach my $prefix (@prefix_order) {
-+              push @path_list, @{$sorted_paths{$prefix}} if exists 
$sorted_paths{$prefix};
++              push(@path_list, @{$sorted_paths{$prefix}}) if exists 
$sorted_paths{$prefix};
 +      }
 +      #warn "$0: now $flag: @path_list\n";
-+      push @subcmd, map "$flag$_", @path_list;
++      if ($relative_first) {
++              push @subcmd, sort bypath map "$flag$_", @path_list;
++      } else {
++              push @subcmd, map "$flag$_", @path_list;
++      }
 +}
 +
 +print "$0: @subcmd\n" if $verbose;
 +exec {$subcmd[0]} @subcmd or die "Could not exec $subcmd[0]: $!\n";
++


------------------------------------------------------------------------------
10 Tips for Better Web Security
Learn 10 ways to better secure your business today. Topics covered include:
Web security, SSL, hacker attacks & Denial of Service (DoS), private keys,
security Microsoft Exchange, secure Instant Messaging, and much more.
http://www.accelacomm.com/jaw/sfnl/114/51426210/
_______________________________________________
Fink-commits mailing list
[email protected]
http://news.gmane.org/gmane.os.apple.fink.cvs

Reply via email to