summaryrefslogtreecommitdiff
path: root/filesystems/squashfs/patches
diff options
context:
space:
mode:
Diffstat (limited to 'filesystems/squashfs/patches')
-rw-r--r--filesystems/squashfs/patches/patch-Makefile42
-rw-r--r--filesystems/squashfs/patches/patch-action.c37
-rw-r--r--filesystems/squashfs/patches/patch-fnm__extmatch.h15
-rw-r--r--filesystems/squashfs/patches/patch-mksquashfs.c13
-rw-r--r--filesystems/squashfs/patches/patch-unsquashfs.c32
5 files changed, 139 insertions, 0 deletions
diff --git a/filesystems/squashfs/patches/patch-Makefile b/filesystems/squashfs/patches/patch-Makefile
new file mode 100644
index 00000000000..cc097dd1335
--- /dev/null
+++ b/filesystems/squashfs/patches/patch-Makefile
@@ -0,0 +1,42 @@
+$NetBSD: patch-Makefile,v 1.1 2016/09/09 15:40:17 scole Exp $
+Add fnm_extmatch.h dependency
+
+--- Makefile.orig 2014-05-11 18:56:00.000000000 +0000
++++ Makefile
+@@ -15,7 +15,7 @@
+ # Obviously, you must select at least one of the available gzip, lzma, lzo
+ # compression types.
+ #
+-GZIP_SUPPORT = 1
++#GZIP_SUPPORT = 1
+
+ ########### Building XZ support #############
+ #
+@@ -229,7 +229,8 @@ mksquashfs: $(MKSQUASHFS_OBJS)
+
+ mksquashfs.o: Makefile mksquashfs.c squashfs_fs.h squashfs_swap.h mksquashfs.h \
+ sort.h pseudo.h compressor.h xattr.h action.h error.h progressbar.h \
+- info.h caches-queues-lists.h read_fs.h restore.h process_fragments.h
++ info.h caches-queues-lists.h read_fs.h restore.h process_fragments.h \
++ fnm_extmatch.h
+
+ read_fs.o: read_fs.c squashfs_fs.h squashfs_swap.h compressor.h xattr.h \
+ error.h mksquashfs.h
+@@ -247,7 +248,7 @@ xattr.o: xattr.c squashfs_fs.h squashfs_
+
+ read_xattrs.o: read_xattrs.c squashfs_fs.h squashfs_swap.h xattr.h error.h
+
+-action.o: action.c squashfs_fs.h mksquashfs.h action.h error.h
++action.o: action.c squashfs_fs.h mksquashfs.h action.h error.h fnm_extmatch.h
+
+ progressbar.o: progressbar.c error.h
+
+@@ -279,7 +280,7 @@ unsquashfs: $(UNSQUASHFS_OBJS)
+ $(CC) $(LDFLAGS) $(EXTRA_LDFLAGS) $(UNSQUASHFS_OBJS) $(LIBS) -o $@
+
+ unsquashfs.o: unsquashfs.h unsquashfs.c squashfs_fs.h squashfs_swap.h \
+- squashfs_compat.h xattr.h read_fs.h compressor.h
++ squashfs_compat.h xattr.h read_fs.h compressor.h fnm_extmatch.h
+
+ unsquash-1.o: unsquashfs.h unsquash-1.c squashfs_fs.h squashfs_compat.h
+
diff --git a/filesystems/squashfs/patches/patch-action.c b/filesystems/squashfs/patches/patch-action.c
new file mode 100644
index 00000000000..50f080671e3
--- /dev/null
+++ b/filesystems/squashfs/patches/patch-action.c
@@ -0,0 +1,37 @@
+$NetBSD: patch-action.c,v 1.1 2016/09/09 15:40:17 scole Exp $
+Do not use alloca and strdupa which some platforms may not have
+
+--- action.c.orig 2014-05-10 04:54:13.000000000 +0000
++++ action.c
+@@ -43,6 +43,7 @@
+ #include "mksquashfs.h"
+ #include "action.h"
+ #include "error.h"
++#include "fnm_extmatch.h"
+
+ /*
+ * code to parse actions
+@@ -1953,9 +1954,22 @@ static char *get_start(char *s, int n)
+
+ static int subpathname_fn(struct atom *atom, struct action_data *action_data)
+ {
+- return fnmatch(atom->argv[0], get_start(strdupa(action_data->subpath),
++ /* XXX some platforms might not have alloca, strdupa */
++ int ret_val;
++ char *copy_str;
++
++ if ((copy_str = strdup(action_data->subpath)) == NULL) {
++ fprintf(stderr, "Out of mem\n");
++ exit(1);
++ }
++
++ ret_val = fnmatch(atom->argv[0],get_start(copy_str,
+ count_components(atom->argv[0])),
+ FNM_PATHNAME|FNM_PERIOD|FNM_EXTMATCH) == 0;
++
++ free(copy_str);
++
++ return ret_val;
+ }
+
+ TEST_VAR_FN(filesize, ACTION_REG, action_data->buf->st_size)
diff --git a/filesystems/squashfs/patches/patch-fnm__extmatch.h b/filesystems/squashfs/patches/patch-fnm__extmatch.h
new file mode 100644
index 00000000000..92b37935fb0
--- /dev/null
+++ b/filesystems/squashfs/patches/patch-fnm__extmatch.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-fnm__extmatch.h,v 1.1 2016/09/09 15:40:17 scole Exp $
+Define FNM_EXTMATCH if not already defined
+
+--- fnm_extmatch.h.orig 2016-09-09 14:49:14.000000000 +0000
++++ fnm_extmatch.h
+@@ -0,0 +1,9 @@
++/*
++ * this is defined in external/gpl[23]/gnulib various fnmatch_.h
++ * with _GNU_SOURCE or various _POSIX_C_SOURCE but not
++ * pksrgc/pkgtools/libnbcompat pkg/include/nbcompat/fnmatch.h or
++ * usr/include/fnmatch.h, what is best way to fix?
++ */
++#ifndef FNM_EXTMATCH
++# define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching. */
++#endif
diff --git a/filesystems/squashfs/patches/patch-mksquashfs.c b/filesystems/squashfs/patches/patch-mksquashfs.c
new file mode 100644
index 00000000000..f7381184501
--- /dev/null
+++ b/filesystems/squashfs/patches/patch-mksquashfs.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-mksquashfs.c,v 1.1 2016/09/09 15:40:17 scole Exp $
+Include fnm_extmatch.h
+
+--- mksquashfs.c.orig 2014-05-12 22:18:20.000000000 +0000
++++ mksquashfs.c
+@@ -76,6 +76,7 @@
+ #include "read_fs.h"
+ #include "restore.h"
+ #include "process_fragments.h"
++#include "fnm_extmatch.h"
+
+ int delete = FALSE;
+ int fd;
diff --git a/filesystems/squashfs/patches/patch-unsquashfs.c b/filesystems/squashfs/patches/patch-unsquashfs.c
new file mode 100644
index 00000000000..0823a127af1
--- /dev/null
+++ b/filesystems/squashfs/patches/patch-unsquashfs.c
@@ -0,0 +1,32 @@
+$NetBSD: patch-unsquashfs.c,v 1.1 2016/09/09 15:40:17 scole Exp $
+Some workarounds for not using autoconf and include fnm_extmatch.h
+
+--- unsquashfs.c.orig 2014-05-12 22:18:35.000000000 +0000
++++ unsquashfs.c
+@@ -31,13 +31,25 @@
+ #include "unsquashfs_info.h"
+ #include "stdarg.h"
+
+-#include <sys/sysinfo.h>
++/* XXX need autoconf */
++#if ( defined(__linux__) )
++ #include <sys/sysinfo.h>
++#endif
++
++/* XXX need autoconf HAVE_SYS_SYSCTL_H */
++#if ( defined(__NetBSD__) || defined(__DragonFly__) || defined(__APPLE__) || \
++ defined(__FreeBSD__) || defined(__OpenBSD__) )
++ #include <sys/sysctl.h>
++#endif
++
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+ #include <limits.h>
+ #include <ctype.h>
+
++#include "fnm_extmatch.h"
++
+ struct cache *fragment_cache, *data_cache;
+ struct queue *to_reader, *to_inflate, *to_writer, *from_writer;
+ pthread_t *thread, *inflator_thread;