오류가 발생했습니다.보고서패치를 적용하라는 요청을 받았습니다.~에작동하는지 확인하세요. 이 작업을 수행하는 방법에 대한 문서를 찾으려고 노력했지만 명확하지 않습니다.
내가 알아낼 수 있는 가장 가까운 것은http://www.thegeekstuff.com/2014/12/patch-command-examples/.
dpkg라는 디렉토리에 있는 apt-get을 통해 최신 소스 코드를 다운로드했습니다.
$ sudo apt-get source dpkg
그것은 다음과 같습니다 -
[shirish@debian] - [~/games/dpkg] - [5692]
└─[$] pwd
/home/shirish/games/dpkg
길은 바로 여기-
┌─[shirish@debian] - [~/games/dpkg] - [5691]
└─[$] ls
d-m-h-verbose-version-check.patch dpkg-1.18.15 dpkg_1.18.15.dsc dpkg_1.18.15.tar.xz
패치를 적용하기 전에 백업하고 테스트 실행을 하고 싶지만 어떤 명령과 출력을 기대해야 하는지 알아야 합니다. 또한, 나는 보통 -
$ fakeroot debian/rules build
$ fakeroot debian/rules binary
로컬 deb 패키지를 빌드합니다. 이 정도면 괜찮은 걸까?
업데이트 1- 그건 소용없어요 -
┌─[shirish@debian] - [~/games/dpkg] - [5710]
└─[$] cd dpkg-1.18.15
┌─[shirish@debian] - [~/games/dpkg/dpkg-1.18.15] - [5711]
└─[$] dch -n "Apply d-m-h fix from #844701."
dch: fatal error at line 569:
debian/changelog is not writable!
따라서 쓰기 액세스 권한을 가지려면 sudo를 사용해야 하고, 권한/권한을 변경하려면 chmod를 사용해야 합니다. 나는 올바른 방법으로 하고 싶다.
업데이트 2- 전체를 다시 수정했는데, 이번에는 올바른 방법으로 패치 단계에서 멈췄습니다. -
┌─[shirish@debian] - [~/games] - [5750]
└─[$] apt-get source dpkg
Reading package lists... Done
NOTICE: 'dpkg' packaging is maintained in the 'Git' version control system at:
https://anonscm.debian.org/git/dpkg/dpkg.git
Please use:
git clone https://anonscm.debian.org/git/dpkg/dpkg.git
to retrieve the latest (possibly unreleased) updates to the package.
Skipping already downloaded file 'dpkg_1.18.15.dsc'
Skipping already downloaded file 'dpkg_1.18.15.tar.xz'
Need to get 0 B of source archives.
dpkg-source: info: extracting dpkg in dpkg-1.18.15
dpkg-source: info: unpacking dpkg_1.18.15.tar.xz
그 다음에 -
┌─[shirish@debian] - [~] - [5755]
└─[$] cp d-m-h-verbose-version-check.patch games/dpkg-1.18.15
그 다음에 -
┌─[shirish@debian] - [~/games/dpkg-1.18.15] - [5758]
└─[$] ls
ABOUT-NLS ChangeLog configure debian dpkg-split m4 NEWS run-script t-func
aclocal.m4 ChangeLog.old configure.ac d-m-h-verbose-version-check.patch dselect Makefile.am po scripts THANKS
AUTHORS check.am COPYING doc get-version Makefile.in README src TODO
build-aux config.h.in data dpkg-deb lib man README.l10n t utils
그런 다음 -
┌─[shirish@debian] - [~/games/dpkg-1.18.15] - [5757]
└─[$] patch < ./d-m-h-verbose-version-check.patch
(Stripping trailing CRs from patch; use --binary to disable.)
can't find file to patch at input line 5
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git i/scripts/dpkg-maintscript-helper.sh w/scripts/dpkg-maintscript-helper.sh
|index f20d82647..8db4a4088 100755
|--- i/scripts/dpkg-maintscript-helper.sh
|+++ w/scripts/dpkg-maintscript-helper.sh
--------------------------
File to patch:
지금 혼란스럽다면 어떻게 해야 할까요?
업데이트 3-
-p1
매개변수를 사용하여 나머지 단계를 완료 하고 완료하세요.
빌드의 마지막 5개 홀수 라인을 공유하세요 -
dh_md5sums -i
dh_builddeb -i
dpkg-deb: building package 'dpkg-dev' in '../dpkg-dev_1.18.15+nmu1_all.deb'.
dpkg-deb: building package 'libdpkg-perl' in '../libdpkg-perl_1.18.15+nmu1_all.deb'.
dpkg-genchanges >../dpkg_1.18.15+nmu1_amd64.changes
dpkg-genchanges: info: including full source code in upload
dpkg-source --after-build dpkg-1.18.15+nmu1
dpkg-source: info: using options from dpkg-1.18.15+nmu1/debian/source/options: --compression=xz
dpkg-buildpackage: info: full upload; Debian-native package (full source is included)
최신 버전을 설치할 수 있었습니다.
┌─[shirish@debian] - [~/games] - [5812]
└─[$] sudo dpkg -i dpkg_1.18.15+nmu1_amd64.deb dpkg-dev_1.18.15+nmu1_all.deb dpkg-dbgsym_1.18.15+nmu1_amd64.deb dselect_1.18.15+nmu1_amd64.deb dselect-dbgsym_1.18.15+nmu1_amd64.deb libdpkg-perl_1.18.15+nmu1_all.deb libdpkg-dev_1.18.15+nmu1_amd64.deb
D000001: ensure_diversions: new, (re)loading
D000001: ensure_statoverrides: new, (re)loading
(Reading database ... 1207494 files and directories currently installed.)
Preparing to unpack dpkg_1.18.15+nmu1_amd64.deb ...
D000001: process_archive oldversionstatus=installed
D000001: cmpversions a='0:1.18.15+nmu1' b='0:1.16.1' r=2
D000001: cmpversions a='0:1.18.15+nmu1' b='0:1.16.2' r=2
D000001: ensure_diversions: same, skipping
Unpacking dpkg (1.18.15+nmu1) over (1.18.10) ...
D000001: cmpversions a='0:1.18.15+nmu1' b='0:1.16.2' r=2
D000001: ensure_diversions: same, skipping
D000001: process_archive updating info directory
D000001: generating infodb hashfile
Preparing to unpack dpkg-dev_1.18.15+nmu1_all.deb ...
D000001: process_archive oldversionstatus=unpacked but not configured
D000001: ensure_diversions: same, skipping
Unpacking dpkg-dev (1.18.15+nmu1) over (1.18.15+nmu1) ...
D000001: process_archive updating info directory
D000001: generating infodb hashfile
Preparing to unpack dpkg-dbgsym_1.18.15+nmu1_amd64.deb ...
D000001: process_archive oldversionstatus=unpacked but not configured
Unpacking dpkg-dbgsym (1.18.15+nmu1) over (1.18.15+nmu1) ...
D000001: process_archive updating info directory
D000001: generating infodb hashfile
Preparing to unpack dselect_1.18.15+nmu1_amd64.deb ...
D000001: process_archive oldversionstatus=installed
D000001: ensure_diversions: same, skipping
Unpacking dselect (1.18.15+nmu1) over (1.18.15+nmu1) ...
D000001: process_archive updating info directory
D000001: generating infodb hashfile
Preparing to unpack dselect-dbgsym_1.18.15+nmu1_amd64.deb ...
D000001: process_archive oldversionstatus=installed
Unpacking dselect-dbgsym (1.18.15+nmu1) over (1.18.15+nmu1) ...
D000001: process_archive updating info directory
D000001: generating infodb hashfile
Preparing to unpack libdpkg-perl_1.18.15+nmu1_all.deb ...
D000001: process_archive oldversionstatus=unpacked but not configured
Unpacking libdpkg-perl (1.18.15+nmu1) over (1.18.15+nmu1) ...
D000001: process_archive updating info directory
D000001: generating infodb hashfile
Preparing to unpack libdpkg-dev_1.18.15+nmu1_amd64.deb ...
D000001: process_archive oldversionstatus=installed
Unpacking libdpkg-dev:amd64 (1.18.15+nmu1) over (1.18.15+nmu1) ...
D000001: process_archive updating info directory
D000001: generating infodb hashfile
D000001: process queue pkg dpkg:amd64 queue.len 6 progress 1, try 1
Setting up dpkg (1.18.15+nmu1) ...
D000001: deferred_configure updating conffiles
D000001: ensure_diversions: same, skipping
D000001: process queue pkg dpkg-dev:all queue.len 5 progress 1, try 1
D000001: process queue pkg dpkg-dbgsym:amd64 queue.len 5 progress 2, try 1
Setting up dpkg-dbgsym (1.18.15+nmu1) ...
D000001: deferred_configure updating conffiles
D000001: process queue pkg dselect:amd64 queue.len 4 progress 1, try 1
Setting up dselect (1.18.15+nmu1) ...
D000001: deferred_configure updating conffiles
D000001: process queue pkg dselect-dbgsym:amd64 queue.len 3 progress 1, try 1
Setting up dselect-dbgsym (1.18.15+nmu1) ...
D000001: deferred_configure updating conffiles
D000001: process queue pkg libdpkg-perl:all queue.len 2 progress 1, try 1
Setting up libdpkg-perl (1.18.15+nmu1) ...
D000001: deferred_configure updating conffiles
D000001: process queue pkg libdpkg-dev:amd64 queue.len 1 progress 1, try 1
Setting up libdpkg-dev:amd64 (1.18.15+nmu1) ...
D000001: deferred_configure updating conffiles
D000001: process queue pkg dpkg-dev:all queue.len 0 progress 1, try 1
Setting up dpkg-dev (1.18.15+nmu1) ...
D000001: deferred_configure updating conffiles
Processing triggers for man-db (2.7.5-1) ...
D000001: ensure_diversions: same, skipping
D000001: cmpversions a='0:2016.03.30' b='0:2016.05.24' r=-2
D000001: cmpversions a='0:1.18.15+nmu1' b='0:1.16' r=2
D000001: cmpversions a='0:1.18.15+nmu1' b='0:1.16' r=2
D000001: cmpversions a='0:1.18.15+nmu1' b='0:1.16' r=2
마침내 -
┌─[shirish@debian] - [/usr/share/doc/dpkg] - [5815]
└─[$] zcat changelog.Debian.gz | less
dpkg (1.18.15+nmu1) UNRELEASED; urgency=medium
* Non-maintainer upload.
* Apply d-m-h fix from #844701
-- shirish <shirish@debian> Mon, 21 Nov 2016 01:04:02 +0530
dpkg (1.18.15) unstable; urgency=medium
이는 올바르게 설치되었음을 의미합니다.
[$] apt-show-versions dpkg dpkg-dbgsym dpkg-dev libdpkg-perl libdpkg-dev dselect dselect-dbgsym
dpkg:amd64 1.18.15+nmu1 newer than version in archive
dpkg-dbgsym:amd64 1.18.15+nmu1 newer than version in archive
dpkg-dev:all 1.18.15+nmu1 newer than version in archive
dselect:amd64 1.18.15+nmu1 newer than version in archive
dselect-dbgsym:amd64 1.18.15+nmu1 newer than version in archive
libdpkg-dev:amd64 1.18.15+nmu1 newer than version in archive
libdpkg-perl:all 1.18.15+nmu1 newer than version in archive
답변1
현재 상황부터 시작하세요.
cd dpkg-1.18.15
patch -p1 < ../d-m-h-verbose-version-check.patch
패치가 적용됩니다. 빌드하기 전에 NMU 변경 로그 항목을 추가하세요(이렇게 하면 dpkg
& co.가 패치 버전을 덮어쓰는 것을 방지할 수 있지만 사용 가능한 경우 버전이 apt
다음 버전으로 업그레이드됩니다).dpkg
dch -n "Apply d-m-h fix from #844701."
그러면 현재 디렉터리의 이름이 바뀌므로( dpkg
네이티브 패키지이기 때문에) 디렉터리를 다시 변경해야 합니다.
cd ../dpkg-1.18.15+nmu1
빌드하려면 다음을 사용하는 경향이 있습니다.
dpkg-buildpackage -us -uc
.deb
그러면 상위 디렉토리에 다양한 파일이 생성됩니다. dpkg
정상적으로 설치할 수 있습니다.
( debian/rules
명시적으로 대상을 호출하는 것도 가능합니다. 그러나 fakeroot
for 는 사용하지 말고 debian/rules build
for debian/rules clean
and 만 사용하면 됩니다 debian/rules binary
.)
NMU 변경 로그 항목을 추가하면 다운로드한 소스 코드가 변경되지 않은 상태로 유지되므로 백업 문제가 해결됩니다. 이는 또한 1.18.15 버전을 다시 설치하면 패치 없이 Debian 버전이 복원된다는 의미입니다.