Subject: [alpine-aports] [PATCH] testing/wimlib: new aport

From: Bradley Saulteaux <[email-masked]>
Date: Wed, 21 Nov 2018 01:17:23 +0000

Empty Message

From f85341ffe5e882cd4cff1d0de68302c086199103 Mon Sep 17 00:00:00 2001
From: Bradley Saulteaux <[email-masked]>
Date: Tue, 20 Nov 2018 07:56:01 -0800
Subject: [PATCH] testing/wimlib: new aport

https://wimlib.net/
the open source Windows Imaging (WIM) library
---
 testing/wimlib/10-patch1.patch | 91 ++++++++++++++++++++++++++++++++++
 testing/wimlib/APKBUILD        | 33 ++++++++++++
 2 files changed, 124 insertions(+)
 create mode 100644 testing/wimlib/10-patch1.patch
 create mode 100644 testing/wimlib/APKBUILD

diff --git a/testing/wimlib/10-patch1.patch b/testing/wimlib/10-patch1.patch
new file mode 100644
index 0000000000..c012657f6f
--- /dev/null
+++ b/testing/wimlib/10-patch1.patch
@@ -0,0 +1,91 @@
+diff -ruN wimlib-1.12.0/tests/test-imagex wimlib-1.12.0/tests/test-imagex
+--- wimlib-1.12.0/tests/test-imagex   2016-11-27 01:30:38.000000000 -0800
++++ wimlib-1.12.0/tests/test-imagex   2018-11-20 01:52:57.996525408 -0800
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env bash
++#!/usr/bin/env sh
+ 
+ # This script does some sanity testing of the 'wimlib-imagex' program.  It by no
+ # means tests every aspect of wimlib comprehensively.
+@@ -305,7 +305,7 @@
+ 
+ echo "Creating random files to test WIM splitting on"
+ mkdir tmp
+-for ((i = 0; i < 100; i++)); do
++for i in `seq 0 99`; do
+ 	dd if=/dev/urandom of=tmp/file$i bs=4096 count=10 &> /dev/null
+ done
+ for flag in "--compress=none" "--compress=maximum" "--compress=fast"; do 
+diff -ruN wimlib-1.12.0/tests/test-imagex-capture_and_apply wimlib-1.12.0/tests/test-imagex-capture_and_apply
+--- wimlib-1.12.0/tests/test-imagex-capture_and_apply	2017-07-16 09:57:39.000000000 -0700
++++ wimlib-1.12.0/tests/test-imagex-capture_and_apply	2018-11-20 01:24:04.353291679 -0800
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env bash
++#!/usr/bin/env ash
+ 
+ # Test capturing and applying a WIM image in the normal (non-NTFS) capture mode
+ #
+@@ -75,7 +75,7 @@
+ 
+ 		# Can we export the image to another WIM, apply it, and get the
+ 		# same results?
+-		(( image_name++ )) || true
++		image_name=$((image_name+1)) || true
+ 		if ! wimexport test.wim 1 test2.wim "$image_name"; then
+ 			error "Failed to export WIM image"
+ 		fi
+diff -ruN wimlib-1.12.0/tests/test-imagex-mount wimlib-1.12.0/tests/test-imagex-mount
+--- wimlib-1.12.0/tests/test-imagex-mount	2016-11-27 01:30:38.000000000 -0800
++++ wimlib-1.12.0/tests/test-imagex-mount	2018-11-20 01:24:03.599958392 -0800
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env bash
++#!/usr/bin/env ash
+ 
+ # Test WIM mounting
+ 
+diff -ruN wimlib-1.12.0/tests/test-imagex-ntfs wimlib-1.12.0/tests/test-imagex-ntfs
+--- wimlib-1.12.0/tests/test-imagex-ntfs	2016-11-27 01:30:38.000000000 -0800
++++ wimlib-1.12.0/tests/test-imagex-ntfs	2018-11-20 01:24:02.119958478 -0800
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env bash
++#!/usr/bin/env ash
+ 
+ # This script does some sanity testing of the 'imagex' program, specifically
+ # checking the NTFS capture and apply features.
+@@ -17,7 +17,7 @@
+ TEST_SUBDIR=tmpdir_test-imagex-ntfs
+ 
+ __do_unmount() {
+-	for ((i = 0; i < 10; i++)); do
++	for i in `seq 0 9`; do
+ 		if fusermount -z -u $1; then
+ 			return 0
+ 		else
+diff -ruN wimlib-1.12.0/tests/test-imagex-update_and_extract wimlib-1.12.0/tests/test-imagex-update_and_extract
+--- wimlib-1.12.0/tests/test-imagex-update_and_extract	2017-07-15 13:49:06.000000000 -0700
++++ wimlib-1.12.0/tests/test-imagex-update_and_extract	2018-11-20 01:24:00.843291883 -0800
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env bash
++#!/usr/bin/env ash
+ 
+ # Test `wimupdate' and `wimextract'.
+ 
+@@ -280,7 +280,7 @@
+ msg "Testing case insensitivity"
+ prepare_empty_wim
+ wimupdate test.wim 1 << EOF
+-	add hello1 /HELLO1
++	add hello1 /hello1
+ EOF
+ cat > pathlist << EOF
+ hello1
+@@ -290,7 +290,7 @@
+ ! WIMLIB_IMAGEX_IGNORE_CASE=0 wimextract test.wim 1 @pathlist --dest-dir=out.dir --no-wildcards
+ WIMLIB_IMAGEX_IGNORE_CASE=1 wimextract test.wim 1 @pathlist --dest-dir=out.dir
+ WIMLIB_IMAGEX_IGNORE_CASE=1 wimextract test.wim 1 @pathlist --dest-dir=out.dir --no-wildcards
+-../tree-cmp hello1 out.dir/HELLO1
++../tree-cmp hello1 out.dir/hello1
+ [ ! -e out.dir/topdir/hello1 ]
+ 
+ 
+
diff --git a/testing/wimlib/APKBUILD b/testing/wimlib/APKBUILD
new file mode 100644
index 0000000000..16a73d9dff
--- /dev/null
+++ b/testing/wimlib/APKBUILD
@@ -0,0 +1,33 @@
+# Contributor: Bradley Saulteaux <[email-masked]>
+# Maintainer: Bradley Saulteaux <[email-masked]>
+pkgname=wimlib
+pkgver=1.12.0
+pkgrel=0
+pkgdesc="the open source Windows Imaging (WIM) library"
+url="https://wimlib.net/"
+arch="all"
+license="GPL"
+depends="libxml2"
+makedepends="libxml2-dev"
+install=""
+subpackages="$pkgname-doc"
+source="https://wimlib.net/downloads/$pkgname-$pkgver.tar.gz 10-patch1.patch"
+builddir="$srcdir"/$pkgname-$pkgver
+prepare() {
+	default_prepare
+}
+build() {
+	cd $builddir
+	./configure --prefix=/usr --without-ntfs-3g --without-fuse --without-libcrypto
+	make
+}
+check() {
+	cd $builddir
+	make check
+}
+package() {
+	cd $builddir
+	make DESTDIR="$pkgdir" install
+}
+sha512sums="0343b37550366f07fd6a6689f4445f390187beddde677f4d6d831c07936d03b613ae95f612ec7a75e978a5e678f33ab766d0f3b3d942886df56e4ef77d4b07b9  wimlib-1.12.0.tar.gz
+f36b006f5acae81bcbf1446622006406ff85e228b93023cb1c70557d539f6c823667b0f09910452ca2a28401190d489472b7bc500b5223b2ffd3b4fa6e445227  10-patch1.patch"
-- 
2.18.1

---

From: Bradley Saulteaux <[email-masked]>
Date: Wed, 21 Nov 2018 03:12:02 +0000

Empty Message

diff -ruN wimlib-1.12.0/tests/test-imagex wimlib-1.12.0/tests/test-imagex
--- wimlib-1.12.0/tests/test-imagex   2016-11-27 01:30:38.000000000 -0800
+++ wimlib-1.12.0/tests/test-imagex   2018-11-20 01:52:57.996525408 -0800
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
 
 # This script does some sanity testing of the 'wimlib-imagex' program.  It by no
 # means tests every aspect of wimlib comprehensively.
@@ -305,7 +305,7 @@
 
 echo "Creating random files to test WIM splitting on"
 mkdir tmp
-for ((i = 0; i < 100; i++)); do
+for i in `seq 0 99`; do
 	dd if=/dev/urandom of=tmp/file$i bs=4096 count=10 &> /dev/null
 done
 for flag in "--compress=none" "--compress=maximum" "--compress=fast"; do 
diff -ruN wimlib-1.12.0/tests/test-imagex-capture_and_apply wimlib-1.12.0/tests/test-imagex-capture_and_apply
--- wimlib-1.12.0/tests/test-imagex-capture_and_apply	2017-07-16 09:57:39.000000000 -0700
+++ wimlib-1.12.0/tests/test-imagex-capture_and_apply	2018-11-20 01:24:04.353291679 -0800
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env ash
 
 # Test capturing and applying a WIM image in the normal (non-NTFS) capture mode
 #
@@ -75,7 +75,7 @@
 
 		# Can we export the image to another WIM, apply it, and get the
 		# same results?
-		(( image_name++ )) || true
+		image_name=$((image_name+1)) || true
 		if ! wimexport test.wim 1 test2.wim "$image_name"; then
 			error "Failed to export WIM image"
 		fi
diff -ruN wimlib-1.12.0/tests/test-imagex-mount wimlib-1.12.0/tests/test-imagex-mount
--- wimlib-1.12.0/tests/test-imagex-mount	2016-11-27 01:30:38.000000000 -0800
+++ wimlib-1.12.0/tests/test-imagex-mount	2018-11-20 01:24:03.599958392 -0800
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env ash
 
 # Test WIM mounting
 
diff -ruN wimlib-1.12.0/tests/test-imagex-ntfs wimlib-1.12.0/tests/test-imagex-ntfs
--- wimlib-1.12.0/tests/test-imagex-ntfs	2016-11-27 01:30:38.000000000 -0800
+++ wimlib-1.12.0/tests/test-imagex-ntfs	2018-11-20 01:24:02.119958478 -0800
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env ash
 
 # This script does some sanity testing of the 'imagex' program, specifically
 # checking the NTFS capture and apply features.
@@ -17,7 +17,7 @@
 TEST_SUBDIR=tmpdir_test-imagex-ntfs
 
 __do_unmount() {
-	for ((i = 0; i < 10; i++)); do
+	for i in `seq 0 9`; do
 		if fusermount -z -u $1; then
 			return 0
 		else
diff -ruN wimlib-1.12.0/tests/test-imagex-update_and_extract wimlib-1.12.0/tests/test-imagex-update_and_extract
--- wimlib-1.12.0/tests/test-imagex-update_and_extract	2017-07-15 13:49:06.000000000 -0700
+++ wimlib-1.12.0/tests/test-imagex-update_and_extract	2018-11-20 01:24:00.843291883 -0800
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env ash
 
 # Test `wimupdate' and `wimextract'.
 
@@ -280,7 +280,7 @@
 msg "Testing case insensitivity"
 prepare_empty_wim
 wimupdate test.wim 1 << EOF
-	add hello1 /HELLO1
+	add hello1 /hello1
 EOF
 cat > pathlist << EOF
 hello1
@@ -290,7 +290,7 @@
 ! WIMLIB_IMAGEX_IGNORE_CASE=0 wimextract test.wim 1 @pathlist --dest-dir=out.dir --no-wildcards
 WIMLIB_IMAGEX_IGNORE_CASE=1 wimextract test.wim 1 @pathlist --dest-dir=out.dir
 WIMLIB_IMAGEX_IGNORE_CASE=1 wimextract test.wim 1 @pathlist --dest-dir=out.dir --no-wildcards
-../tree-cmp hello1 out.dir/HELLO1
+../tree-cmp hello1 out.dir/hello1
 [ ! -e out.dir/topdir/hello1 ]

---

From: Leonardo Arena <[email-masked]>
Date: Tue, 5 Feb 2019 15:25:58 +0100

Hi,

could you please send these patches with git-sendmail?

https://wiki.alpinelinux.org/wiki/Creating_patches

Thanks!