]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/blobdiff - src/stripper
man: Update to version 2.10.2
[people/mfischer/ipfire-2.x.git] / src / stripper
index fa624815bb1b81267a8f8c0762cc7563a1067e24..fadbc514b86eabe78e8d7564120f8a702238f52e 100755 (executable)
@@ -2,11 +2,21 @@
 
 paths=()
 excludes=()
+strip="strip"
+break_on_error="1"
 
 while [ $# -gt 0 ]; do
        case "${1}" in
+               --strip=*)
+                       strip="${1#*=}"
+                       ;;
                --exclude=*)
-                       excludes+=( "!" "-path" "${1#*=}/*" )
+                       if [ -n "${1#*=}" ]; then
+                               excludes+=( "!" "-path" "${1#*=}" "!" "-path" "${1#*=}/*" )
+                       fi
+                       ;;
+               --ignore-errors)
+                       break_on_error="0"
                        ;;
                *)
                        paths+=( "${1}" )
@@ -49,11 +59,10 @@ function _strip() {
                --absolute-names --dump "${file}" 2>/dev/null)"
 
        echo "Stripping ${file}..."
-       if ! strip "${args[@]}" "${file}"; then
-               return 1
+       if ! "${strip}" "${args[@]}" "${file}"; then
+               return ${break_on_error}
        fi
 
-
        # Restore capabilities
        if [ -n "${capabilities}" ]; then
                setfattr --no-dereference --restore=<(echo "${capabilities}")