File: test_and_link.sh

package info (click to toggle)
metakernel 0.30.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,372 kB
  • sloc: python: 5,099; makefile: 179; sh: 18
file content (21 lines) | stat: -rwxr-xr-x 546 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
set -e

PKGDIR=/usr/lib/python3/dist-packages/sphinx_bootstrap_theme/bootstrap/static

FILE="$*"
STEM=${FILE#*static/}
PKGFILE=$PKGDIR/$STEM
printf "Checking '%s'..." "$FILE"
if [ -f "$PKGFILE" ]; then
    if cmp -s "$FILE" "$PKGFILE"; then
        printf 'Identical file found in PKGDIR, replacing with a symlink...'
        rm -f "$FILE"
        ln -s "$PKGFILE" "$FILE"
        printf 'done.\n'
    else
        printf 'Differing file found in PKGDIR!\n'
    fi
else
    printf 'No matching filename found in PKGDIR, skipping.\n'
fi