File: test_neurodebian-repository-deployment

package info (click to toggle)
neurodebian 0.43.0
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,960 kB
  • sloc: sh: 2,419; python: 1,978; perl: 412; makefile: 207; javascript: 63
file content (49 lines) | stat: -rwxr-xr-x 1,866 bytes parent folder | download | duplicates (7)
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
#/bin/bash
set -ex

# minimal installation with few of those packages
apt_file=/etc/apt/sources.list.d/local.list
apt_nd_file=/etc/apt/sources.list.d/neurodebian.sources.list

# clean up from a previous test
dpkg --purge neurodebian neurodebian-archive-keyring || :
echo PURGE | debconf-communicate neurodebian || :
rm -rf /tmp/apt $apt_file;

mkdir -p /tmp/apt; cd /tmp/apt;
rm -f neurodebian-*deb; apt-get update -y; apt-get install -y wget;
wget http://www.onerussian.com/tmp/neurodebian_0.34_all.deb;
wget http://www.onerussian.com/tmp/neurodebian-archive-keyring_0.34_all.deb;

# generate APT repo
apt-get install -y dpkg-dev ;  dpkg-scanpackages  . /dev/null > Packages
# Add it to the list of available
echo "deb file:///tmp/apt ./" >| $apt_file; apt-get update
# Install the beast
DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated neurodebian
# By default should not get enabled
[ ! -e "$apt_nd_file" ]

DEBIAN_FRONTEND=noninteractive NEURODEBIAN_ENABLE=yes apt-get install -y --allow-unauthenticated --reinstall neurodebian

# Verify that it has correct entries
# Very cruel way to figure out the default release. Would fail if
# options, such as multiarch, are specified after deb
release=$(grep -e '^\s*deb\s' /etc/apt/sources.list | head -1 | awk '{print $3;}')
grep -E "^deb\s+http.* $release main\s*\$" $apt_nd_file
grep -E '^deb\s+http.* data main\s*$'      $apt_nd_file
# May be even retrospect stored debconf configuration
apt-get install debconf-utils
debconf-get-selections | grep neurodebian/release.*select.*auto
# And apt-get must be working
apt-get update
# Make sure it is active
apt-cache policy | grep o=NeuroDebian,.*,n=data
apt-cache policy | grep o=NeuroDebian,.*,n=$release

# Now lets remove
dpkg --purge neurodebian
[ ! -e $apt_nd_file ]
apt-cache policy | grep o=NeuroDebian && exit 1 || :

echo "I: success"