File: test_duplicate_mime_types.sh

package info (click to toggle)
shared-mime-info 2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 15,348 kB
  • sloc: ansic: 3,791; xml: 2,177; sh: 118; javascript: 113; lisp: 28; python: 25; cobol: 20; makefile: 14; cs: 13; perl: 11; java: 7; objc: 6; php: 1
file content (15 lines) | stat: -rwxr-xr-x 424 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env bash

xml_db_file="${1}"

duplicated=$(
    grep '<mime-type' ${xml_db_file} | tr -d '[:blank:]' | sort | uniq -d
)

if [[ -n "${duplicated}" ]]; then
    echo "*************************************************************"
    echo "** Some mime-types are duplicated, fix before committing:  **"
    echo "${duplicated}"
    echo "*************************************************************"
    exit 1
fi