pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

enchant: Add patches to avoid possible `rm -rf' of the root file system



Module Name:	pkgsrc-wip
Committed By:	Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By:	leot
Date:		Sat Oct 27 15:11:12 2018 +0200
Changeset:	09ffcc6a2ab2621cc61779e242a86d4326442947

Modified Files:
	enchant/Makefile
	enchant/distinfo
Added Files:
	enchant/patches/patch-tests_Makefile.am
	enchant/patches/patch-tests_Makefile.in
	enchant/patches/patch-tests_enchant__providers_Makefile.am
	enchant/patches/patch-tests_enchant__providers_Makefile.in
Removed Files:
	enchant/TODO

Log Message:
enchant: Add patches to avoid possible `rm -rf' of the root file system

Unfortunately the tests needs unittest-cpp as a test dependency,
so disable them for now.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=09ffcc6a2ab2621cc61779e242a86d4326442947

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 enchant/Makefile                                   | 13 ++----
 enchant/TODO                                       | 34 ----------------
 enchant/distinfo                                   |  4 ++
 enchant/patches/patch-tests_Makefile.am            | 29 +++++++++++++
 enchant/patches/patch-tests_Makefile.in            | 29 +++++++++++++
 .../patch-tests_enchant__providers_Makefile.am     | 39 ++++++++++++++++++
 .../patch-tests_enchant__providers_Makefile.in     | 47 ++++++++++++++++++++++
 7 files changed, 152 insertions(+), 43 deletions(-)

diffs:
diff --git a/enchant/Makefile b/enchant/Makefile
index ab3d7030f7..e07ecf66c5 100644
--- a/enchant/Makefile
+++ b/enchant/Makefile
@@ -22,15 +22,8 @@ INSTALLATION_DIRS+=	share/examples
 MAKE_DIRS+=		${PREFIX}/share/enchant
 CONF_FILES=		${PREFIX}/share/examples/enchant.ordering ${PREFIX}/share/enchant/enchant.ordering
 
-#
-# XXX: DO NOT ADD A TEST_TARGET!
-# XXX: IT SEEMS THAT CAN LEAD TO `rm -rf /', i.e.:
-# XXX:
-# XXX:    /usr/bin/make libenchant-copy
-# XXX:    rm -rf /
-# XXX:
-# XXX: Please investigate why this happens!
-#
+# XXX: needs unittest-cpp as a test dependency
+#TEST_TARGET=		check
 
 post-install:
 	cd ${DESTDIR}${PREFIX}/share && ${MV} enchant/enchant.ordering examples/enchant.ordering
@@ -39,4 +32,6 @@ post-install:
 .include "options.mk"
 
 .include "../../devel/glib2/buildlink3.mk"
+#BUILDLINK_DEPMETHOD.unittest-cpp=	build	# XXX: for tests
+#.include "../../wip/unittest-cpp/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/enchant/TODO b/enchant/TODO
deleted file mode 100644
index 70211d7e33..0000000000
--- a/enchant/TODO
+++ /dev/null
@@ -1,34 +0,0 @@
-Running the test target can lead to a `rm -rf /'!:
-
- |    /usr/bin/make libenchant-copy
- |    rm -rf /
-
-All `rm -rf' incantantions should be inspected.
-After a quick skim of the code it seems that, in tests/Makefile.am:
-
-    35  libenchant-copy:
-    36          rm -rf $(libdir_subdir)/
-    37          $(MKDIR_P) $(libdir_subdir)/enchant-@ENCHANT_MAJOR_VERSION@
-    38          cp -r $(top_builddir)/src/@objdir@ $(libdir_subdir)/
-    39          cp $(top_builddir)/src/libenchant-@ENCHANT_MAJOR_VERSION@.la $(libdir_subdir)/
-
-...and in tests/enchant_providers/Makefile.am
-
-    30  libenchant-copy:
-    31          rm -rf $(libdir_subdir)/
-    32          $(MKDIR_P) $(libdir_subdir)/enchant-@ENCHANT_MAJOR_VERSION@
-    33          cp -r $(top_builddir)/src/@objdir@ $(libdir_subdir)/
-    34          cp $(top_builddir)/src/libenchant-@ENCHANT_MAJOR_VERSION@.la $(libdir_subdir)/
-
-Both `rm -rf' can be problematic if $(libdir_subdir) is not defined.
-
-
-It seems that this was reported upstream via:
-
- <https://github.com/AbiWord/enchant/issues/185>
-
-...but probably still not properly fixed (at least in 2.2.3).
-
-A new issue tracking that was opened as:
-
- <https://github.com/AbiWord/enchant/issues/201>
diff --git a/enchant/distinfo b/enchant/distinfo
index 2c2c4124b6..314be693a3 100644
--- a/enchant/distinfo
+++ b/enchant/distinfo
@@ -4,3 +4,7 @@ SHA1 (enchant-2.2.3.tar.gz) = 181d5563d282af0f30c7ab68c5d432271b6fd11e
 RMD160 (enchant-2.2.3.tar.gz) = 87ac76b00ed54d47d246b0938d493d2a82180de6
 SHA512 (enchant-2.2.3.tar.gz) = abde9d6fec25edff694570455fd4c6e8e2e2c41a6b133bbb31a344761137a354cc1c655e53374cf712bf311c3732dc721e9ffd2dc933d78ec8ccf224350635d6
 Size (enchant-2.2.3.tar.gz) = 957451 bytes
+SHA1 (patch-tests_Makefile.am) = 32474d4a5cba8657d7bf4bcd1fdaa5969e7c4e35
+SHA1 (patch-tests_Makefile.in) = 68ee795e4f55d3d982a6f255ec67e87d84058068
+SHA1 (patch-tests_enchant__providers_Makefile.am) = 70b0b9dfbc32526900a9cb55b8016b6ee7032f26
+SHA1 (patch-tests_enchant__providers_Makefile.in) = 52b5022231a09cfa770b2de389e8a8d6e3774c21
diff --git a/enchant/patches/patch-tests_Makefile.am b/enchant/patches/patch-tests_Makefile.am
new file mode 100644
index 0000000000..a4520203a6
--- /dev/null
+++ b/enchant/patches/patch-tests_Makefile.am
@@ -0,0 +1,29 @@
+$NetBSD$
+
+Avoid possible `rm -rf' of the entire file system when running `make check':
+
+ <https://github.com/AbiWord/enchant/pull/203>
+
+--- tests/Makefile.am.orig	2018-02-04 17:01:08.000000000 +0000
++++ tests/Makefile.am
+@@ -1,11 +1,7 @@
+ SUBDIRS = enchant_providers
+ 
+ # Get libdir suffix
+-if GNU_MAKE
+-libdir_subdir=$(shell echo "$(libdir)" | sed -e 's|^$(exec_prefix)/||' | sed -e 's|^/||')
+-else
+ libdir_subdir=lib
+-endif
+ 
+ AM_CPPFLAGS = -I$(top_srcdir)/src $(ENCHANT_CFLAGS) -DENCHANT_MAJOR_VERSION=\"@ENCHANT_MAJOR_VERSION@\"
+ 
+@@ -33,7 +29,7 @@ $(LIBENCHANT_COPY): $(top_builddir)/src/
+ 	$(MAKE) libenchant-copy
+ 
+ libenchant-copy:
+-	rm -rf $(libdir_subdir)/
++	rm -rf $(libdir_subdir)
+ 	$(MKDIR_P) $(libdir_subdir)/enchant-@ENCHANT_MAJOR_VERSION@
+ 	cp -r $(top_builddir)/src/@objdir@ $(libdir_subdir)/
+ 	cp $(top_builddir)/src/libenchant-@ENCHANT_MAJOR_VERSION@.la $(libdir_subdir)/
diff --git a/enchant/patches/patch-tests_Makefile.in b/enchant/patches/patch-tests_Makefile.in
new file mode 100644
index 0000000000..00a0eac858
--- /dev/null
+++ b/enchant/patches/patch-tests_Makefile.in
@@ -0,0 +1,29 @@
+$NetBSD$
+
+Avoid possible `rm -rf' of the entire file system when running `make check'.
+
+ <https://github.com/AbiWord/enchant/pull/203>
+
+--- tests/Makefile.in.orig	2018-02-04 17:01:19.000000000 +0000
++++ tests/Makefile.in
+@@ -1017,10 +1017,9 @@ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ SUBDIRS = enchant_providers
+-@GNU_MAKE_FALSE@libdir_subdir = lib
+ 
+ # Get libdir suffix
+-@GNU_MAKE_TRUE@libdir_subdir = $(shell echo "$(libdir)" | sed -e 's|^$(exec_prefix)/||' | sed -e 's|^/||')
++libdir_subdir = lib
+ AM_CPPFLAGS = -I$(top_srcdir)/src $(ENCHANT_CFLAGS) -DENCHANT_MAJOR_VERSION=\"@ENCHANT_MAJOR_VERSION@\"
+ ENCHANT_CONFIG_DIR = config
+ AM_TESTS_ENVIRONMENT = \
+@@ -2284,7 +2283,7 @@ $(LIBENCHANT_COPY): $(top_builddir)/src/
+ 	$(MAKE) libenchant-copy
+ 
+ libenchant-copy:
+-	rm -rf $(libdir_subdir)/
++	rm -rf $(libdir_subdir)
+ 	$(MKDIR_P) $(libdir_subdir)/enchant-@ENCHANT_MAJOR_VERSION@
+ 	cp -r $(top_builddir)/src/@objdir@ $(libdir_subdir)/
+ 	cp $(top_builddir)/src/libenchant-@ENCHANT_MAJOR_VERSION@.la $(libdir_subdir)/
diff --git a/enchant/patches/patch-tests_enchant__providers_Makefile.am b/enchant/patches/patch-tests_enchant__providers_Makefile.am
new file mode 100644
index 0000000000..fde1ce4ca9
--- /dev/null
+++ b/enchant/patches/patch-tests_enchant__providers_Makefile.am
@@ -0,0 +1,39 @@
+$NetBSD$
+
+Avoid possible `rm -rf' of the entire file system when running `make check'.
+
+ <https://github.com/AbiWord/enchant/pull/203>
+
+--- tests/enchant_providers/Makefile.am.orig	2018-02-04 17:01:08.000000000 +0000
++++ tests/enchant_providers/Makefile.am
+@@ -1,11 +1,7 @@
+ # FIXME: common up with tests/Makefile.am
+ 
+ # Get libdir suffix
+-if GNU_MAKE
+-libdir_subdir=$(shell echo "$(libdir)" | sed -e 's|^$(exec_prefix)/||' | sed -e 's|^/||')
+-else
+ libdir_subdir=lib
+-endif
+ 
+ AM_CPPFLAGS = -I$(top_srcdir)/src $(ENCHANT_CFLAGS)
+ 
+@@ -28,15 +24,17 @@ $(LIBENCHANT_COPY): $(top_builddir)/src/
+ 	$(MAKE) libenchant-copy
+ 
+ libenchant-copy:
+-	rm -rf $(libdir_subdir)/
++	rm -rf $(libdir_subdir)
+ 	$(MKDIR_P) $(libdir_subdir)/enchant-@ENCHANT_MAJOR_VERSION@
+ 	cp -r $(top_builddir)/src/@objdir@ $(libdir_subdir)/
+ 	cp $(top_builddir)/src/libenchant-@ENCHANT_MAJOR_VERSION@.la $(libdir_subdir)/
+ 
++if WITH_APPLESPELL
+ APPLESPELL_CONFIG = config/AppleSpell.config
+ $(APPLESPELL_CONFIG): $(top_srcdir)/providers/AppleSpell.config
+ 	$(MKDIR_P) config
+ 	cp $< config/
++endif
+ 
+ LDADD = $(LIBENCHANT_COPY) $(ENCHANT_LIBS)
+ LIBADD = $(LIBENCHANT_COPY)
diff --git a/enchant/patches/patch-tests_enchant__providers_Makefile.in b/enchant/patches/patch-tests_enchant__providers_Makefile.in
new file mode 100644
index 0000000000..b037dceba1
--- /dev/null
+++ b/enchant/patches/patch-tests_enchant__providers_Makefile.in
@@ -0,0 +1,47 @@
+$NetBSD$
+
+Avoid possible `rm -rf' of the entire file system when running `make check'.
+
+ <https://github.com/AbiWord/enchant/pull/203>
+
+--- tests/enchant_providers/Makefile.in.orig	2018-02-04 17:01:19.000000000 +0000
++++ tests/enchant_providers/Makefile.in
+@@ -901,10 +901,9 @@ target_alias = @target_alias@
+ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+-@GNU_MAKE_FALSE@libdir_subdir = lib
+ 
+ # Get libdir suffix
+-@GNU_MAKE_TRUE@libdir_subdir = $(shell echo "$(libdir)" | sed -e 's|^$(exec_prefix)/||' | sed -e 's|^/||')
++libdir_subdir = lib
+ AM_CPPFLAGS = -I$(top_srcdir)/src $(ENCHANT_CFLAGS)
+ ENCHANT_CONFIG_DIR = config
+ AM_TESTS_ENVIRONMENT = \
+@@ -916,7 +915,7 @@ AM_TESTS_ENVIRONMENT = \
+ 
+ DISTCLEANFILES = *@shlibext@
+ LIBENCHANT_COPY = $(builddir)/$(libdir_subdir)/libenchant-@ENCHANT_MAJOR_VERSION@.la
+-APPLESPELL_CONFIG = config/AppleSpell.config
++@WITH_APPLESPELL_TRUE@APPLESPELL_CONFIG = config/AppleSpell.config
+ LDADD = $(LIBENCHANT_COPY) $(ENCHANT_LIBS)
+ LIBADD = $(LIBENCHANT_COPY)
+ DEPS = $(LIBENCHANT_COPY)
+@@ -1551,13 +1550,13 @@ $(LIBENCHANT_COPY): $(top_builddir)/src/
+ 	$(MAKE) libenchant-copy
+ 
+ libenchant-copy:
+-	rm -rf $(libdir_subdir)/
++	rm -rf $(libdir_subdir)
+ 	$(MKDIR_P) $(libdir_subdir)/enchant-@ENCHANT_MAJOR_VERSION@
+ 	cp -r $(top_builddir)/src/@objdir@ $(libdir_subdir)/
+ 	cp $(top_builddir)/src/libenchant-@ENCHANT_MAJOR_VERSION@.la $(libdir_subdir)/
+-$(APPLESPELL_CONFIG): $(top_srcdir)/providers/AppleSpell.config
+-	$(MKDIR_P) config
+-	cp $< config/
++@WITH_APPLESPELL_TRUE@$(APPLESPELL_CONFIG): $(top_srcdir)/providers/AppleSpell.config
++@WITH_APPLESPELL_TRUE@	$(MKDIR_P) config
++@WITH_APPLESPELL_TRUE@	cp $< config/
+ 
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.


Home | Main Index | Thread Index | Old Index