"Fossies" - the Fresh Open Source Software Archive

Member "aoe-aoe6-86/conf/pairs.sh" (4 Jul 2015, 999 Bytes) of archive /linux/misc/aoe-aoe6-86.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 # Given a set of tags representing kernel states, you don't need to
    2 # have patches that go from one state to the same state, nor do you
    3 # need a patch for each direction, since patch takes "-R".
    4 # 
    5 # If I had had more sleep lately, I probably wouldn't have written
    6 # this script.  As it stands, it will print out all the patches you'd
    7 # need as pairs of tags.
    8 # 
    9 # ecashin@kokone 25$ pwd
   10 # /home/ecashin/aoe-2.6-devel/conf-states/25
   11 # ecashin@kokone 25$ ls
   12 # fs5  none  relay5  relay6
   13 # ecashin@kokone 25$ for i in `ls`; do echo $i; done | sh ~/aoe6-stand/conf/pairs.sh | while read a b; do diff -upr $a $b > ~/aoe6-stand/conf/25-patches/$a-$b.diff; done
   14 # ecashin@kokone 25$ 
   15 # 
   16 
   17 awk 'BEGIN{
   18     i=0
   19     done["available"] = "yes"
   20 }
   21 {
   22     a[i] = $0
   23     b[i] = $0
   24     i += 1
   25 }
   26 END {
   27     n = i
   28     for (i=0; i<n; ++i) {
   29         aa = a[i]
   30         for (j=0; j<n; ++j) {
   31                 bb = b[j]
   32             s1 = aa ":" bb
   33             s2 = bb ":" aa
   34             if (aa != bb && !(s1 in done) && !(s2 in done)) {
   35                 done[s1] = "yes"
   36                 print aa " " bb
   37             }
   38         }
   39     }
   40 }
   41 '