문제

-P0으로 적용 할 수있는 패치가 있다고 가정 해 봅시다.이 패치를 -P1 패치로 자동 변환하는 도구가 있습니까? 예를 들어 변환

Index: stdio-common/_i18n_number.h
===================================================================
--- stdio-common/_i18n_number.h (revision 8348)
+++ stdio-common/_i18n_number.h (working copy)
@@ -116,7 +116,7 @@ _i18n_number_rewrite (CHAR_T *w, CHAR_T
 #else

 static CHAR_T *
-_i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr)
+_i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr, CHAR_T *end)
 {
   return w;
 }

경로 앞에 다른 디렉토리 이름 (A, B를 알아 차리기)으로 동일한 패치로

Index: stdio-common/_i18n_number.h
===================================================================
--- a/stdio-common/_i18n_number.h (revision 8348)
+++ b/stdio-common/_i18n_number.h (working copy)
@@ -116,7 +116,7 @@ _i18n_number_rewrite (CHAR_T *w, CHAR_T
 #else

 static CHAR_T *
-_i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr)
+_i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr, CHAR_T *end)
 {
   return w;
 }
도움이 되었습니까?

해결책

Diff Chunk 헤더에서 파일 이름을 단순히 변환하는 것만으로도 충분합니다.

sed \
    -e 's!^--- !&a/!' \
    -e 's!^+++ !&b/!' \
    < p0.patch \
    > p1.patch

다른 패치 망설링 도구의 경우 제안합니다 Patchutils, 그러나 이것은 너무 간단하여 기존 유틸리티가 없습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top