patch_settings.awk 412 B

12345678910111213141516171819
  1. {
  2. if (commit == "")
  3. commit = $0;
  4. else if (substr($1,1,8) == "version(")
  5. {
  6. version = substr($1,10,length($1)-12);
  7. split(version,a,"\.");
  8. if (a[4] != "")
  9. print " version(\""a[1]"."a[2]"."a[3]"."++a[4]"\"),";
  10. else
  11. print " version(\""a[1]"."a[2]"."a[3]"\"),";
  12. }
  13. else if (substr($1,1,12) == "source_hash(")
  14. print " source_hash(\""commit"\"),";
  15. else
  16. print $0;
  17. }