-pNUM ¿É¼ÇÀº ÆÐÄ¡ ÆÄÀÏ¿¡ ¸í½ÃµÇ¾î ÀÖ´Â 'ÆÐÄ¡ÇÒ ÆÄÀÏÀÇ À§Ä¡'¸¦ Á¦´ë·Î ã¾ÆÁÖ°Ô ÇϱâÀ§ÇÑ, 'path¿¡¼ Á¦°ÅÇÒ prefixÀÇ °³¼ö'Á¤µµÀÇ Àǹ̸¦ Áö´Ñ´Ù°í ÇÒ ¼ö ÀÖ½À´Ï´Ù. --strip=NUM °ú °°½À´Ï´Ù.
-pnum or --strip=num
Strip the smallest prefix containing num leading slashes from each file name found in the patch file. A sequence of one or more adjacent slashes is counted as a single slash. This controls how file names found in the patch file are treated, in case you keep your files in a different directory than the person who sent out the patch. For example, supposing the file name in the patch file was
¿¹¸¦ µé¾î, ÆÐÄ¡ ÆÄÀÏ¿¡ 'ÆÐÄ¡ÇÒ ÆÄÀÏÀÇ À§Ä¡(À̸§)'°¡ /home/dcpark/idst/src/test.c ¿Í °°ÀÌ ÀûÇô ÀÖÀ» °æ¿ì.......
-p0 ´Â 'Çϳªµµ ¼öÁ¤ÇÏÁö ¾ÊÀº' Àü path°¡ Æ÷ÇÔµÈ °ÍÀ»,
-p1 Àº 'ù¹ø° ½½·¡½¬°¡ ºüÁø' home/dcpark/idst/src/test.c¸¦,
-p4 ´Â '³»¹ø° ½½·¡½¬ ¾Õ±îÁö ºüÁø' src/test.c¸¦
'ÆÐÄ¡ÇÒ ÆÄÀÏÀÇ À̸§'À¸·Î ÀνÄÇÏ°Ô ÇÕ´Ï´Ù.
-p ¿É¼ÇÀ» ÁÖÁö¾Ê´Â ´Ù¸é, test.c ¸¸ ÆÄÀÏÀ̸§À¸·Î °£ÁÖÇÏ°í ÆÐÄ¡¸¦ ½ÃµµÇÕ´Ï´Ù.
º¸ÅëÀÇ °æ¿ì, ¼Ò½º µð·ºÅ丮 Àüü¸¦ ¹é¾÷Çصΰí
(cp -rf /home/dcpark/package /home/dcpark/package.orig)
¼Ò½º(¿¹: /home/dcpark/package/src/test.c)¸¦ ¼öÁ¤Çؼ ÆÐÄ¡ÆÄÀÏÀ» ¸¸µé±â¶§¹®¿¡
(diff -uNr package.orig package > patch.diff)...
ÆÐÄ¡ÇÒ ¼Ò½º ÆÐÅ°ÁöÀÇ ·çÆ®µð·ºÅ丮¿¡¼ -p1 À» »ç¿ëÇÏ¿© ÆÐÄ¡¸¦ ÇÏ´Â °ÍÀÔ´Ï´Ù.
(cd /home/dcpark/package/ && pach -p1 < where/patch.diff)
±×¸®°í ÆÐÄ¡ÈÄ¿¡ ³ª¿À´Â ¸Þ½ÃÁöÁß¿¡
: Hunk #1 succeeded at 1 with fuzz 2
: Hunk #2 failed at 353
: Hunk #3 failed at 374
: 2 out of 3 hunks failed
Hunk´Â ÆÐÄ¡ÆÄÀÏ¿¡ ±â·ÏµÇ¾î ÀÖ´Â 'ÆÐÄ¡ÇÒ Á¶°¢(µ¢¾î¸®)'ÀÔ´Ï´Ù.
º¸Åë ÆÐÄ¡ÇÒ ¶§, À§¿Í °°Àº ¸Þ½ÃÁö°¡ ¾ø¾î¾ß ¹®Á¦¾øÀÌ Á¤»óÀûÀ¸·Î
󸮰¡ µÈ °ÍÀÌÁö¸¸, fuzz(ÆÛÁö, ²¸¸ÂÃß±â)·Î ½ÃµµÇÏ¿© ¼º°øÇÏ´Â
°æ¿ì¿¡´Â À§ÀÇ Ã¹¹ø° ¸Þ½ÃÁö¿Í °°Àº °ÍÀ» º¸¿©ÁÖ°Ô µË´Ï´Ù.
À§ÀÇ ¸Þ½ÃÁö¿¡¼ 'µÎ¹ø°¿Í ¼¼¹ø° ÆÐÄ¡ Á¶°¢'Àº ½ÇÆи¦ Ç߳׿ä. :)
ÀÚ¼¼ÇÑ °ÍÀº man patch ¸¦ Âü°íÇϼ¼¿ä.
patch man ÆäÀÌÁö´Â PDF ÆÄÀÏ·Î º¯È¯ÇÏ¿© ÷ºÎÇصξú½À´Ï´Ù..