File: p7zip-full.links

package info (click to toggle)
p7zip 16.02%2Bdfsg-3%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 14,112 kB
  • sloc: cpp: 167,145; ansic: 14,992; python: 1,911; asm: 1,688; sh: 1,132; makefile: 701
file content (24 lines) | stat: -rwxr-xr-x 761 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
22
23
24
#!/bin/sh

# The script generates list of style.css locations pairs for dh_link program, to have
# duplicated files converted into symlinks to make lintian happy.
# Example output:
#   usr/share/doc/p7zip-full/DOC/MANUAL/style.css usr/share/doc/p7zip-full/DOC/MANUAL/cmdline/style.css

set -e
readonly pkg=p7zip-full
readonly file=style.css
readonly maindir="usr/share/doc/$pkg/DOC/MANUAL"

unset CDPATH
cd debian/$pkg >/dev/null
[ -e "$maindir/$file" ]   || { echo "$maindir/$file does not exist" >&2; exit 1; }

for dir in $(find "$maindir" -mindepth 1 -type d -print); do
  set -- "$maindir/$file" "$dir/$file"

  # Sanity check: fail if the file is not a duplicate
  [ ! -e "$2" ] || cmp -s "$@" || { echo "$@ are different" >&2; exit 1;}

  echo "$@"
done