nixpkgs-suyu/pkgs/tools/filesystems
Ruud van Asseldonk f6e8ee7533 squashfsTools: use updated Darwin patch
This new patch is the patch between 4.4, and commit [1], a pull request
at [2] to upsteam Mac and BSD compatibility. That pull request is
itself a rebase of an older pull request for an earlier version of
squashfs-tools. I squashed all commits between 4.4 and [1], apart from
the BSD-specific ones, and exported the new patch from that. Attached
below is the git diff --ignore-space-change between squashfs-tools 4.4
with the previous patch applied, and with the new patch applied.

[1]: 7d31beec53e6245d3405d6ef2b96e9811ae07044
[2]: https://github.com/plougher/squashfs-tools/pull/69

---

diff --git a/squashfs-tools/info.c b/squashfs-tools/info.c
index 8efefe6..5c2f835 100644
--- a/squashfs-tools/info.c
+++ b/squashfs-tools/info.c
@@ -159,7 +159,7 @@ void *info_thrd(void *arg)
 			case EINTR:
 				continue;
 			default:
-				BAD_ERROR("sigwaitfailed "
+				BAD_ERROR("sigwait failed "
 					"because %s\n", strerror(errno));
 			}
 		}
diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
index 67d86a5..3607448 100644
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
@@ -35,7 +35,10 @@
 #include <stddef.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#ifdef linux
+#ifndef linux
+#include <sys/sysctl.h>
+#else
+#include <sys/sysinfo.h>
 #include <sys/sysmacros.h>
 #endif
 #include <fcntl.h>
@@ -52,7 +55,6 @@
 #include <sys/wait.h>
 #include <limits.h>
 #include <ctype.h>
-#include <sys/sysinfo.h>

 #ifndef FNM_EXTMATCH /* glibc extension */
 	#define FNM_EXTMATCH 0
@@ -5191,7 +5193,17 @@ int parse_mode(char *arg, mode_t *res)

 int get_physical_memory()
 {
+	/*
+	 * Long longs are used here because with PAE, a 32-bit
+	 * machine can have more than 4GB of physical memory
+	 *
+	 * sysconf(_SC_PHYS_PAGES) relies on /proc being mounted.
+	 * If it fails use sysinfo, if that fails return 0
+	 */
+	long long num_pages = sysconf(_SC_PHYS_PAGES);
+	long long page_size = sysconf(_SC_PAGESIZE);
 	int phys_mem;
+
 #ifndef linux
 	#ifdef HW_MEMSIZE
 		#define SYSCTL_PHYSMEM HW_MEMSIZE
@@ -5221,16 +5233,6 @@ int get_physical_memory()
 	}
   #undef SYSCTL_PHYSMEM
 #else
-	/*
-	 * Long longs are used here because with PAE, a 32-bit
-	 * machine can have more than 4GB of physical memory
-	 *
-	 * sysconf(_SC_PHYS_PAGES) relies on /proc being mounted.
-	 * If it fails use sysinfo, if that fails return 0
-	 */
-	long long num_pages = sysconf(_SC_PHYS_PAGES);
-	long long page_size = sysconf(_SC_PAGESIZE);
-
 	if(num_pages == -1 || page_size == -1) {
 		struct sysinfo sys;
 		int res = sysinfo(&sys);
diff --git a/squashfs-tools/mksquashfs.h b/squashfs-tools/mksquashfs.h
index 88d0b5c..1beefef 100644
--- a/squashfs-tools/mksquashfs.h
+++ b/squashfs-tools/mksquashfs.h
@@ -24,7 +24,6 @@
  * mksquashfs.h
  *
  */
-#include <pthread.h>

 struct dir_info {
 	char			*pathname;
diff --git a/squashfs-tools/pseudo.c b/squashfs-tools/pseudo.c
index f8fd529..48e6b27 100644
--- a/squashfs-tools/pseudo.c
+++ b/squashfs-tools/pseudo.c
@@ -30,7 +30,6 @@
 #include <errno.h>
 #include <string.h>
 #include <stdlib.h>
-#include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <sys/stat.h>
diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
index 00615ce..c1a6183 100644
--- a/squashfs-tools/unsquashfs.c
+++ b/squashfs-tools/unsquashfs.c
@@ -38,7 +38,6 @@
 #include <sys/sysinfo.h>
 #include <sys/sysmacros.h>
 #endif
-
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/resource.h>
@@ -1085,7 +1084,7 @@ int create_inode(char *pathname, struct inode *i)
 			break;
 		case SQUASHFS_SYMLINK_TYPE:
 		case SQUASHFS_LSYMLINK_TYPE: {
-			struct timespec times[2] = {
+			struct timeval times[2] = {
 				{ i->time, 0 },
 				{ i->time, 0 }
 			};
@@ -1104,8 +1103,7 @@ int create_inode(char *pathname, struct inode *i)
 				goto failed;
 			}

-			res = utimensat(AT_FDCWD, pathname, times,
-					AT_SYMLINK_NOFOLLOW);
+			res = lutimes(pathname, times);
 			if(res == -1) {
 				EXIT_UNSQUASH_STRICT("create_inode: failed to set time on "
 					"%s, because %s\n", pathname,
2019-09-10 21:02:51 +02:00
..
9pfs treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
aefs treewide: Change URLs to HTTPS 2019-04-22 10:19:54 +02:00
afpfs-ng treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
android-file-transfer android-file-transfer: fix building with qt 2019-07-31 18:47:47 +02:00
apfs-fuse treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
archivemount
avfs treewide: Remove unnecessary --disable-static (#66759) 2019-08-31 08:10:53 -04:00
bashmount treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
bcache-tools treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
bcachefs-tools treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
bees treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
bindfs treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
blobfuse treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
bonnie
boxfs treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
btrfs-dedupe treewide: name -> pname (#67513) 2019-08-31 07:41:22 -04:00
btrfs-progs Merge master into staging-next 2019-08-18 12:53:44 +02:00
buttersink
ceph ceph: 14.2.1 -> 14.2.3 2019-09-05 14:33:29 +02:00
chunkfs treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
ciopfs
convoy treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
cpcfs cpcfs: init at 0.85.4 2019-05-18 14:41:13 +02:00
cryfs treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
curlftpfs
darling-dmg treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
davfs2
dislocker treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
disorderfs treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
djmount treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
dosfstools treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
duff treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
duperemove treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
e2fsprogs e2fsprogs: disable failing tests (#65471) 2019-08-31 10:27:57 +02:00
e2tools treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
encfs treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
exfat treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
ext4magic treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
extundelete treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
f2fs-tools treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
f3 treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
fatresize treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
fatsort treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
file-rename buildPerlPackage: name -> (pname, version) 2019-06-20 15:56:50 +00:00
fsfs
fuse-7z-ng treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
fuse-overlayfs fuse-overlayfs: 0.4.1 -> 0.5.1 2019-08-19 01:55:14 -07:00
fuseiso treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
fusesmb
gcsfuse treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
genext2fs
genimage treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
genromfs treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
gitfs treewide: name -> pname (#67513) 2019-08-31 07:41:22 -04:00
glusterfs treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
go-mtpfs treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
gocryptfs gocryptfs: 1.6.1 -> 1.7 2019-07-16 08:17:17 +02:00
gpart treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
grive2 treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
hfsprogs treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
httpfs
hubicfuse treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
idsk idsk: unstable-2018-02-11 -> 0.19 2019-05-11 22:02:51 +02:00
ifuse treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
irods treewide: Change URLs to HTTPS 2019-04-22 10:19:54 +02:00
jfsutils
jmtpfs treewide: name -> pname 2019-08-17 10:54:38 +00:00
lizardfs treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
mergerfs mergerfs: 2.27.1 -> 2.28.1 2019-06-17 01:09:50 -07:00
mhddfs treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
mkspiffs treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
moosefs Merge pull request #62182 from dtzWill/update/moosefs-3.0.105 2019-08-12 19:52:08 +02:00
mp3fs treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
mtdutils treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
mtools
mtpfs
netatalk
nilfs-utils treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
nixpart Merge staging-next into staging 2019-08-31 10:04:20 +02:00
ntfs-3g treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
rdfind treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
reiser4progs treewide: name -> pname 2019-08-17 10:54:38 +00:00
reiserfsprogs treewide: name -> pname 2019-08-17 10:54:38 +00:00
relfs treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
rmount treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
s3backer treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
s3fs treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
securefs treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
simg2img treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
smbnetfs treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
snapraid treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
squashfs squashfsTools: use updated Darwin patch 2019-09-10 21:02:51 +02:00
squashfuse treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
sshfs-fuse treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
svnfs
tmsu treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
u3-tool treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
udftools treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
unionfs-fuse treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
vmfs-tools treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
wdfs treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
xfsprogs treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
xtreemfs treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
yandex-disk treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
zerofree treewide: name -> pname (easy cases) (#66585) 2019-08-15 13:41:18 +01:00
zfstools treewide: name -> pname 2019-08-17 10:54:38 +00:00
zkfuse treewide: remove redundant rec 2019-08-28 11:07:32 +00:00