update-patches.1 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. .\" $OpenBSD: update-patches.1,v 1.6 2017/05/26 10:50:28 espie Exp $
  2. .\"
  3. .\" Copyright (c) 2010 Marc Espie <espie@openbsd.org>
  4. .\"
  5. .\" Permission to use, copy, modify, and distribute this software for any
  6. .\" purpose with or without fee is hereby granted, provided that the above
  7. .\" copyright notice and this permission notice appear in all copies.
  8. .\"
  9. .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. .\"
  17. .Dd $Mdocdate: May 26 2017 $
  18. .Dt UPDATE-PATCHES 1
  19. .Os
  20. .Sh NAME
  21. .Nm update-patches
  22. .Nd create or update patches for a given port.
  23. .Sh SYNOPSIS
  24. .Nm update-patches
  25. .Sh DESCRIPTION
  26. .Nm
  27. is a helper script for the target
  28. .Ar update-patches
  29. in
  30. .Xr bsd.port.mk 5 .
  31. It takes no argument, but uses quite a few environment variables as
  32. implicit parameters.
  33. .Pp
  34. .Nm
  35. looks under
  36. .Ev WRKDIST
  37. for patched files.
  38. Those are files with extension
  39. .Ev PATCHORIG ,
  40. except for those matching also
  41. .Ev DISTORIG .
  42. .Pp
  43. Once those files are found, they are matched against the contents of
  44. directory
  45. .Ev PATCHDIR ,
  46. most specifically files matching wildcard
  47. .Ev PATCH_LIST .
  48. Matching files are regenerated on the basis of
  49. .Pp
  50. .Dl $ diff -u -p -a ${DIFF_ARGS} $file$PATCHORIG $file
  51. .Pp
  52. and compared.
  53. Modified patches are updated and reported, new patches are generated,
  54. and old patches that no longer seem to exist are also reported.
  55. .Pp
  56. As an exception, if a
  57. .Pa $file.beforesubst
  58. original file is found, it is used instead of $file in the diff line:
  59. .Pp
  60. .Dl $ diff -u -p -a ${DIFF_ARGS} $file$PATCHORIG $file.beforesubst
  61. .Pp
  62. The patch header is normalized to always be:
  63. .Bd -literal -offset indent
  64. Index: $file
  65. --- $file.orig
  66. +++ $file
  67. .Ed
  68. .Pp
  69. Patches with problematic
  70. .Xr cvs 1
  71. keywords may be fixed if possible, and reported if not.
  72. .Pp
  73. .Nm
  74. prints the list of changed patches for further study.
  75. .Sh ENVIRONMENT
  76. .Bl -tag -width FORCE_REGEN
  77. .It Ev DIFF_ARGS
  78. Extra parameters to insert into
  79. .Xr diff 1 .
  80. .It Ev DISTORIG
  81. Extension to original files to ignore entirely.
  82. .It Ev FORCE_REGEN
  83. Force patches to be regenerated even if they didn't change.
  84. .It Ev PATCHDIR
  85. Path to existing and generated patches.
  86. .It Ev PATCHORIG
  87. Extension to match for finding original files.
  88. .It Ev PATCH_LIST
  89. Only compare new patches to existing patches matching that pattern.
  90. .It Ev PATCH_VERBOSE
  91. Force
  92. .Nm
  93. to tell about everything it does.
  94. .It Ev WRKDIST
  95. Directory to scan for files to compare.
  96. .El
  97. .Sh SEE ALSO
  98. .Xr cvs 1 ,
  99. .Xr diff 1 ,
  100. .Xr patch 1