s243a

distro_pkgs_specs__to__compat_pkg.awk

Dec 26th, 2020 (edited)
489
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Awk 0.35 KB | None | 0 0
  1. #!/usr/bin/gawk -f
  2. BEGIN {FS="|"
  3.        mode="parse_var"}
  4. /PKGS_SPECS_TABLE=[[:space:]]*$/ {mode="PKGS_SPECS_TABLE";next}
  5. /'[[:space:]]*$/ {mode="parse_var"; next}
  6. {
  7. if ($1 == "yes"){
  8.       if (length($3)==0){
  9.         print $2 "|" $2  
  10.       } else {
  11.           split($3, pkgs , ",")
  12.           for (a_key in pkgs){
  13.             print pkgs[a_key] "|" $2
  14.           }
  15.       }
  16.     }
  17. }
Add Comment
Please, Sign In to add comment