patch-ppds.sh 304 B

12345678910111213141516171819
  1. #!/bin/bash
  2. PATCH=$1
  3. # Decompress the relevant PPD files
  4. for ppd_file in $(grep '^diff' $PATCH | cut -d " " -f 4);
  5. do
  6. gunzip ${ppd_file#*/}.gz
  7. done
  8. # Patch the PPD files
  9. patch -p1 < $PATCH
  10. # Recompress back
  11. for ppd_file in $(grep '^diff' $PATCH | cut -d " " -f 4);
  12. do
  13. gzip -n ${ppd_file#*/}
  14. done