Debian Codegraph @

debian/din-wrapper

raw symbols SCIP
1 #!/bin/bash
2
3 set -e
4
5 UPSTREAM_VERSION=$(dpkg -s din | grep Version | cut -d' ' -f2 | cut -d- -f1)
6
7 if ! [ -d "$HOME/.din-$UPSTREAM_VERSION" ]; then
8 # move old dir ouf of the way
9 if [ -d "$HOME/.din" ]; then
10 rm -fr "$HOME/.din-backup";
11 mv "$HOME/.din" "$HOME/.din-backup";
12 fi
13 # remove old links
14 find $HOME -maxdepth 1 -name '.din-[5-9][0-9.]*' -exec rm -rf {} \;
15 # create new dir
16 mkdir -p "$HOME/.din"
17 # copy the data files
18 cp -fr /usr/share/din/factory/* $HOME/.din
19 # and symlink it
20 ln -sf $HOME/.din $HOME/.din-$UPSTREAM_VERSION
21 fi
22
23 exec /usr/bin/din "$@"