Розбіжності
Тут показані розбіжності між вибраною ревізією та поточною версією сторінки.
Порівняння попередніх версій Попередня ревізія Наступна ревізія | Попередня ревізія | ||
freebsd:diff [2023/06/09 20:29] – [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.` | ||
Рядок 100: | Рядок 107: | ||
# make patch | # make patch | ||
- | diff -Naru ./nodeny.orig | + | diff -Naru nodeny.orig/ |
# apply patch for nodeny.orig | # apply patch for nodeny.orig | ||
- | patch -d nodeny.orig/ | + | cd /usr/local/nodeny.orig/ |
+ | patch -d . -Efu --posix -p1 < ../ | ||
</ | </ | ||