~thomir-deactivatedaccount/sloecode/package-testing

« back to all changes in this revision

Viewing changes to test_package.sh

  • Committer: Thomi Richards
  • Date: 2012-04-09 04:44:52 UTC
  • Revision ID: thomi.richards@canonical.com-20120409044452-c3tmlqdiuzmrvy1q
Initial version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
set -e
 
4
 
 
5
# The PPA you want to install as a base for the upgrade test.
 
6
# This should probably be one of the stable PPAs.
 
7
BASE_PPA="ppa:sloecode/stable-testing"
 
8
 
 
9
# The PPA you want to upgrade to:
 
10
DAILY_PPA="ppa:sloecode"
 
11
 
 
12
###############################################################################
 
13
# Nothing to see below this line:
 
14
###############################################################################
 
15
 
 
16
# set selection answers:
 
17
debconf-set-selections ./debconf_answers
 
18
 
 
19
# TODO: if anyone finds a better way of doing this, please be my guest and fix
 
20
# this next line:
 
21
dpkg -l sloecode | grep ii
 
22
sloecode_installed=$?
 
23
 
 
24
if [[ $sloecode_installed ]]; then
 
25
    echo "Sloecode package is already installed. Purging it before running tests."
 
26
    sudo apt-get remove --purge sloecode
 
27
fi
 
28
 
 
29
sudo rm -rf /etc/apt/sources.list.d/sloecode*
 
30
 
 
31
echo "Adding base ppa ($BASE_PPA)."
 
32
sudo add-apt-repository -y $BASE_PPA
 
33
echo "Updating package lists."
 
34
sudo apt-get update
 
35
echo "Installing base sloecode package."
 
36
sudo apt-get install -y sloecode
 
37
echo "Adding daily builds ppa ($DAILY_PPA)."
 
38
sudo add-apt-repository -y $DAILY_PPA
 
39
echo "Updating package lists."
 
40
sudo apt-get update
 
41
echo "Installing base sloecode package."
 
42
sudo apt-get install -y sloecode