Розбіжності
Тут показані розбіжності між вибраною ревізією та поточною версією сторінки.
Порівняння попередніх версій Попередня ревізія Наступна ревізія | Попередня ревізія | ||
freebsd:diff [2023/06/09 20:13] – [2] Method | freebsd:diff [2025/03/30 13:54] (поточний) – [Мій приклад] Method | ||
---|---|---|---|
Рядок 41: | Рядок 41: | ||
Ось мої нотатки: | Ось мої нотатки: | ||
- | `# to create patch: | + | to create patch: |
- | # copy < | + | |
- | cp -r < | + | cp -r < |
- | # create/ | + | |
- | # change working directory to < | + | |
- | cd < | + | cd < |
- | # create patch file alongside < | + | |
- | diff -Naru ../< | + | diff -Naru ../< |
# -N --new-file Treat absent files as empty. | # -N --new-file Treat absent files as empty. | ||
+ | |||
# -a --text Treat all files as text. | # -a --text Treat all files as text. | ||
+ | |||
# -r --recursive Recursively compare any subdirectories found. | # -r --recursive Recursively compare any subdirectories found. | ||
+ | |||
# -u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified context. | # -u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified context. | ||
- | # to apply patch: | + | |
- | # change working directory to < | + | to apply patch change working directory to < |
- | cd < | + | cd < |
- | patch -s -p0 < < | + | patch -s -p0 < < |
# -s or --silent or --quiet Work silently, unless an error occurs. | # -s or --silent or --quiet Work silently, unless an error occurs. | ||
+ | |||
# -pN or --strip=N Strip smallest prefix containing num leading slashes from files. | # -pN or --strip=N Strip smallest prefix containing num leading slashes from files. | ||
- | # to undo patch (note that directories created by patch must be removed manually): | + | to undo patch (note that directories created by patch must be removed manually): |
- | # change working directory to < | + | |
- | cd < | + | |
- | patch -Rs -p0 < < | + | cd < |
- | # -R or --reverse Assume that patch was created with the old and new files swapped. | + | patch -Rs -p0 < < |
- | # -s or --silent or --quiet Work silently, unless an error occurs. | + | # -R or --reverse Assume that patch was created with the old and new files swapped. |
- | # -pN or --strip=N Strip smallest prefix containing num leading slashes from files.` | + | # -s or --silent or --quiet Work silently, unless an error occurs. |
+ | # -pN or --strip=N Strip smallest prefix containing num leading slashes from files.` | ||
Рядок 92: | Рядок 99: | ||
+ | ===== Мій приклад ===== | ||
<code bash> | <code bash> | ||
Рядок 99: | Рядок 107: | ||
# make patch | # make patch | ||
- | cd / | + | diff -Naru nodeny.orig/ nodeny/ > ./pon_r710_01.patch |
- | diff -Naru ../nodeny.orig . > ../pon_r677_4.patch | + | |
- | # apply patch | + | # apply patch for nodeny.orig |
- | cd cd / | + | cd /usr/local/ |
- | patch -d nodeny.orig/ -Efu -p=1 --posix -p0 < pon_r677_4.patch | + | patch -d . -Efu --posix -p1 < ../ |
</ | </ | ||