File: clean.sh

package info (click to toggle)
nixnote2 2.0~beta11-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 9,448 kB
  • ctags: 7,058
  • sloc: cpp: 68,338; java: 1,096; sh: 834; makefile: 27
file content (57 lines) | stat: -rwxr-xr-x 1,126 bytes parent folder | download
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh

version="2.0-beta9"

# Determine which platform we are on
arch="i386"
case "$(uname -m)" in
   "x86_64" ) arch="amd64";;
esac

pkgarch="i386"
case "$(uname -m)" in
   "x86_64" ) pkgarch="x86_64";;
esac

#Do any parameter overrides
while [ -n "$*" ]
do
   eval $1
   shift
done

package_dir=$(cd `dirname $0` && pwd)
destination="$package_dir/nixnote/share/nixnote"


# Check that we are runinng as root
if [ "$(id -u)" != "0" ]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi


# Delete the tar.gz file if it exists
if [ -e "$package_dir/nixnote2-${version}_${arch}.tar.gz" ]
then
   rm $package_dir/nixnote2-${version}_${arch}.tar.gz
fi

#delete the debif it exists
if [ -e "$package_dir/nixnote2-${version}_${arch}.deb" ]
then
   rm $package_dir/nixnote2-${version}_${arch}.deb
fi

#delete the rpm if it exists
rpmversion=`echo $version | sed -e 's/[-]/_/g'`
if [ -e "$package_dir/nixnote2-${rpmversion}-0.${pkgarch}.rpm" ]
then
   rm $package_dir/nixnote2-${rpmversion}-0.${pkgarch}.rpm
fi

# Cleanup any directory info
if [ -d "$package_dir/nixnote2" ]
then
   rm -rf $package_dir/nixnote2
fi