如何在 mapserver 上应用补丁?

如何在 mapserver 上应用补丁?

实际上我在 php5.6 上安装 php mapscript 时遇到了问题,我在 oerdnj github 上询问了这个问题(https://github.com/oerdnj/deb.sury.org/issues/461)。他给了我编译 mapserver 源代码的答案,但因为他真的很忙,我卡在了在 mapserver 上应用补丁的步骤上。我尝试复制补丁并将其存储在 mapserver-6.4.1 目录中的“oerdnj.patch”文件中。以下是文件内容

--- debian/rules~   2014-02-28 15:54:20.000000000 +0000
+++ debian/rules    2016-09-26 14:19:52.177217057 +0000
@@ -22,7 +22,7 @@ CFLAGS+=$(CPPFLAGS)
 CFLAGS+=$(LDFLAGS)

 RUBYVERSIONS=$(shell dh_ruby --print-supported)
-PHP5API=$(shell php-config5 --phpapi)
+PHP5API=$(shell php-config5.6 --phpapi)
 MANPAGES:=$(wildcard debian/man/*.*.xml)

 MS_VERSION=$(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p')
--- debian/control~ 2014-02-28 15:54:20.000000000 +0000
+++ debian/control  2016-09-26 14:20:28.385182799 +0000
@@ -21,7 +21,7 @@ Build-Depends: debhelper (>= 9),
                libgif-dev,
                librsvg2-dev,
                libpq-dev,
-               php5-dev,
+               php5.6-dev,
                swig,
                libperl-dev,
                python-all (>= 2.6.6-3~),

我尝试像这样应用补丁:

teddy@teddy-K43SJ:~/mapserver-6.4.1$ patch -p1 < oerdnj.patch
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:
--------------------------
|--- debian/rules~   2014-02-28 15:54:20.000000000 +0000
|+++ debian/rules    2016-09-26 14:19:52.177217057 +0000
--------------------------
File to patch:

我遇到了上述错误,而且我也不知道要修补什么文件。那么如何让补丁工作呢?我以前从未这样做过

答案1

似乎我可以按照建议用参数 -p0 而不是 -p1 来修补它这里

teddy@teddy-K43SJ:~/mapserver-6.4.1$ patch -p0 < oerdnj.patch
patching file debian/rules
patching file debian/control

我不确定,但无论如何我都没有收到任何错误

相关内容