]> git.donarmstrong.com Git - neurodebian.git/blob - tools/tests/test_neurodebian-repository-deployment
0a4583ab137d32cc1fda62b78b76b6d3996f3211
[neurodebian.git] / tools / tests / test_neurodebian-repository-deployment
1 #/bin/bash
2 set -ex
3
4 # minimal installation with few of those packages
5 apt_file=/etc/apt/sources.list.d/local.list
6
7 # clean up from a previous test
8 dpkg --purge neurodebian neurodebian-keyring || :
9 echo PURGE | debconf-communicate neurodebian || :
10 rm -rf /tmp/apt $apt_file;
11
12 mkdir -p /tmp/apt; cd /tmp/apt;
13 rm -f neurodebian-*deb; apt-get update -y; apt-get install -y wget;
14 wget http://www.onerussian.com/tmp/neurodebian_0.33~a1_all.deb;
15 wget http://www.onerussian.com/tmp/neurodebian-keyring_0.33~a1_all.deb;
16
17 # generate APT repo
18 apt-get install -y dpkg-dev ;  dpkg-scanpackages  . /dev/null > Packages
19 # Add it to the list of available
20 echo "deb file:///tmp/apt ./" >| $apt_file; apt-get update
21 # Install the beast
22 apt-get install -y --allow-unauthenticated neurodebian
23 # Verify that it has correct entries
24 # Very cruel way to figure out the default release. Would fail if
25 # options, such as multiarch, are specified after deb
26 release=$(grep -e '^\s*deb\s' /etc/apt/sources.list | head -1 | awk '{print $3;}')
27 grep -E "^deb\s+http.* $release main\s*\$" /etc/apt/sources.list.d/neurodebian.sources.list
28 grep -E '^deb\s+http.* data main\s*$' /etc/apt/sources.list.d/neurodebian.sources.list
29 # May be even retrospect stored debconf configuration
30 apt-get install debconf-utils
31 debconf-get-selections | grep neurodebian/release.*select.*auto
32 # And apt-get must be working
33 apt-get update
34 # Make sure it is active
35 apt-cache policy | grep o=NeuroDebian,.*,n=data
36 apt-cache policy | grep o=NeuroDebian,.*,n=$release
37
38 echo "I: success"