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"
|