File: debianize-binary-tree

package info (click to toggle)
qmail 1.02-1
  • links: PTS
  • area: non-free
  • in suites: slink
  • size: 2,268 kB
  • ctags: 1,721
  • sloc: ansic: 14,071; makefile: 1,923; sh: 583; perl: 452
file content (27 lines) | stat: -rw-r--r-- 638 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

set -e 

function startofpath() {
    if [ -f usr/man/man8/`basename $1`.8 ]; then
	echo usr/sbin
    elif [ -f usr/man/man1/`basename $1`.1 ]; then
	echo usr/bin
    else
	case `basename $1` in
	    elq|pinq|qail|qlist2) echo usr/bin;;
	    datemail|predate|qmail-home|qsmhook|sendmail) echo usr/sbin;;
	    *) echo 1>&2 Cannot determine if $1 belongs in sbin or bin;exit 2;;
	esac
    fi
}

test -d debian/tmp || (echo "Could not find debian/tmp directory.";exit 1)

cd debian/tmp

for f in var/qmail/bin/*; do
    mv $f `startofpath $f`
done

rmdir var/qmail/bin || ( echo "Could not remove qmail/bin directory!"; exit 3)