shithub: scc

Download patch

ref: a6846d9088435b0318207241dd85350fa05668d5
parent: 0f5c99c02edde1295a1be0592aaf6844f7c9cacc
author: Roberto E. Vargas Caballero <[email protected]>
date: Thu Feb 22 10:17:02 EST 2018

[tests/ar] Add master.a target

It helps to debug if you have this file.

--- a/tests/ar/execute/Makefile
+++ b/tests/ar/execute/Makefile
@@ -5,8 +5,11 @@
 
 all: tests
 
-tests:
+tests: master.a
 	PATH=$(ROOTDIR)/bin:$$PATH ./chktest.sh
+
+master.a:
+	./mkmaster.sh
 
 clean:
 	rm -f *.a test.log
--- a/tests/ar/execute/chktest.sh
+++ b/tests/ar/execute/chktest.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 ttyflags=`stty -g`
-trap "stty $ttyflags;tabs -8;rm -rf master.a file*" 0 2 3 15
+trap "stty $ttyflags;tabs -8;rm -rf file*" 0 2 3 15
 stty tabs
 tabs 40
 ulimit -c 40
--- /dev/null
+++ b/tests/ar/execute/mkmaster.sh
@@ -1,0 +1,22 @@
+#!/bin/sh
+
+uid=`id -u`
+gid=`id -g`
+
+cat <<EOF >master.a
+!<arch>
+file1           315532800   `printf "%-6d" $uid``printf "%-6d" $gid`100644  79        \`
+This is the first file,
+and it should go in the
+first position in the archive.
+
+file2           315532800   `printf "%-6d" $uid``printf "%-6d" $gid`100644  125       \`
+But this other one is the second one,
+and it shouldn't go in the first position
+because it should go in the second position.
+
+file3           315532800   `printf "%-6d" $uid``printf "%-6d" $gid`100644  118       \`
+and at the end, this is the last file
+that should go at the end of the file,
+thus it should go in the third position.
+EOF