1
0
Fork 0
arangodb/Installation/archive-de-thinner.sh

13 lines
445 B
Bash
Executable File

#!/bin/bash
# this shell script takes all current .ar - archives it finds.
# if they're thin (only contain references to the object files)
# it creates a new .ar - archive with the referenced objects
# and overwrites the original .a
# takes one argument: the directory to spider the .a files.
for lib in `find $1 -name '*.a'`; do
(for file in `ar -t ${lib}`; do
find -name ${file}
done) |ar rvs ${lib}.new ${FN} ||exit 1
done