ref: bd06ba3a5ea0f122fbb6b7c284c32068220dd33b
parent: 2e8217b7eced5b5af1048a3ba7144c0adb5b46c2
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sun Jan 19 08:17:28 EST 2020
test-ar: Add test for -ru
--- /dev/null
+++ b/tests/ar/execute/0039-update.sh
@@ -1,0 +1,38 @@
+#!/bin/sh
+
+set -e
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+
+trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3
+
+############################################################################
+#Update one member that already exist
+
+echo First > file1
+
+cp master.a file.a
+sleep 1
+touch file1
+ar -ruv file.a file1
+
+ar -p file.a file1 > $tmp1
+
+cat <<EOF > $tmp2
+First
+EOF
+
+cmp $tmp1 $tmp2
+
+echo Second > file1
+touch -t 197001010000 file.1
+ar -ruv file.a file1
+
+ar -p file.a file1 > $tmp1
+
+cat <<EOF > $tmp2
+First
+EOF
+
+cmp $tmp1 $tmp2