Patch: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== Overview == Linux utility patch 사용법 정리. == Basic == <pre> patch [options] [originalfile [patchfile]] but usually just patch -pnum <patchfi...") |
No edit summary |
||
| Line 32: | Line 32: | ||
</source> | </source> | ||
[[category: | [[category:command/utility]] | ||
Latest revision as of 14:31, 25 July 2016
Overview
Linux utility patch 사용법 정리.
Basic
patch [options] [originalfile [patchfile]]
but usually just
patch -pnum <patchfile
-p
-p 옵션은 패치 적용의 Depth 를 지정하는 옵션이다. 패치파일을 살펴보면 제일 윗줄에 다음과 같이 파일에 관한 정보가 나타나있다. 여기에 맞춰서 -p 옵션을 이용해여 Depth 를 조절하여 패치 파일을 적용하면 된다.
--- config/util/lndir.c (revision 9)
+++ config/util/lndir.c (working copy)
@@ -222,6 +222,8 @@
continue;
if (!strcmp (dp->d_name, "CVS.adm"))
continue;
+ if (!strcmp (dp->d_name, ".svn"))
+ continue;
}
ocurdir = rcurdir;
rcurdir = buf;
만약 현재 디렉토리에서 적용시킨다면, 다음과 같이 한다. <source lang=bash> $ patch -p0 < /path/to/lndir.diff </source>