/
niceSOFT
/
patch
Обзор
Документация
Войти
/
niceSOFT
/
patch
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
v2.6
tests/create-delete
115 строк
3 KB
Andreas Gruenbacher
Fix the "patch would create" fix from 2009-03-28
06 апр 2009, 07:47
06 апр 2009, 07:47
b3a9ff4
Код
Авторство
О чём код?
# Copyright (C) 2009 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # in any medium, are permitted without royalty provided the copyright # notice and this notice are preserved. . $srcdir/test-lib.sh require_cat require_diff use_local_patch use_tmpdir # ============================================================== # Bug #25970: intuit_diff_type: Assertion `i0 != NONE' failed. cat > f.diff <<EOF --- f +++ f @@ -1 +0,0 @@ -one EOF echo one > f check 'patch -f -p1 < f.diff || echo "Status: $?"' <<EOF can't find file to patch at input line 3 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |--- f |+++ f -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored Status: 1 EOF # ============================================================== echo one > f diff -u /dev/null f > f.diff check 'patch -f < f.diff || echo "Status: $?"' <<EOF The next patch would create the file f, which already exists! Applying it anyway. patching file f Hunk #1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file f.rej Status: 1 EOF # ============================================================== echo one > f diff -u f /dev/null > f.diff rm f check 'patch -p0 < f.diff || echo "Status: $?"' <<EOF The next patch would delete the file f, which does not exist! Assume -R? [n] Apply anyway? [n] Skipping patch. 1 out of 1 hunk ignored Status: 1 EOF # ============================================================== echo one > f diff -u f /dev/null > f.diff rm f check 'patch -p0 -f < f.diff || echo "Status: $?"' <<EOF The next patch would delete the file f, which does not exist! Applying it anyway. patching file f Hunk #1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file f.rej Status: 1 EOF # ============================================================== umask 022 echo one > f diff -u f /dev/null > f.diff rm f check 'patch -f f < f.diff || echo "Status: $?"' <<EOF The next patch would delete the file f, which does not exist! Applying it anyway. patching file f Hunk #1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file f.rej Status: 1 EOF check 'ls -l f.orig | sed "s,\(..........\).*,\1,"' <<EOF -rw-r--r-- EOF # ============================================================== rm f.orig echo f > f.orig rm -f f touch f diff -u f.orig f > f.diff check 'patch -f < f.diff || echo "Status: $?"' <<EOF The next patch would empty out the file f, which is already empty! Applying it anyway. patching file f Hunk #1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file f.rej Status: 1 EOF