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