Commit e33ea8c1 authored by Antonio Terceiro's avatar Antonio Terceiro

Use package indexes from inside the chroot

parent 5b3e0921
[_] use Packages/Sources indexes from chroot instead of the ones in the system
[X] use Packages/Sources indexes from chroot instead of the ones in the system
[X] automate creation/maintainance of chroot
[X] wrapper script to be called from cron
[X] updates chroot
......
#!/bin/sh
suite=unstable # FIXME should be an optional parameter
chroot_path="$(pwd)/data/chroots/${suite}"
grep-dctrl -n -s Package -F Testsuite autopkgtest /var/lib/apt/lists/*dists_${suite}_main_source_Sources | sort | uniq
grep-dctrl -n -s Package -F Testsuite autopkgtest "$chroot_path"/var/lib/apt/lists/*dists_${suite}_main_source_Sources | sort | uniq
......@@ -7,6 +7,7 @@ root=$(pwd)
data_root=$(pwd)/data
log_root=$(pwd)/data/log
status_root=$(pwd)/data/status
chroot_root=$(pwd)/data/chroots
date=$(date --rfc-3339=date)
global_tmp_dir=$(mktemp -d)
......@@ -124,11 +125,11 @@ list_binaries() {
}
grep_packages() {
grep-dctrl "$@" /var/lib/apt/lists/*_debian_dists_${suite}_main_binary-`dpkg-architecture -qDEB_HOST_ARCH`_Packages
grep-dctrl "$@" "$chroot_root"/"$suite"/var/lib/apt/lists/*_debian_dists_${suite}_main_binary-`dpkg-architecture -qDEB_HOST_ARCH`_Packages
}
grep_sources() {
grep-dctrl "$@" /var/lib/apt/lists/*_debian_dists_${suite}_main_source_Sources
grep-dctrl "$@" "$chroot_root"/"$suite"/var/lib/apt/lists/*_debian_dists_${suite}_main_source_Sources
}
first_banner=
......
#!/bin/sh
if [ $(whoami) != root ]; then
echo "This script mus be run as root"
exit 1
fi
suite='unstable' # FIXME
chroot_root=$(pwd)/data/chroots
......@@ -18,6 +24,11 @@ create_chroot() {
# do not download translations
echo 'Acquire::Languages "none";' > "${path}/etc/apt/apt.conf.d/99translations"
# add APT Source URIs
sed -e 's/^deb\s/deb-src /' "${path}/etc/apt/sources.list" > "${path}/etc/apt/sources.list.d/sources.list"
chroot "$path" apt-get update
}
update_chroot() {
......@@ -62,7 +73,7 @@ setup_suite() {
fi
chroot_name="dep8-${suite}"
chroot_path="${chroot_root}/${chroot_name}"
chroot_path="${chroot_root}/${suite}"
if schroot --list --all | grep -q "^source:dep8-$suite\$"; then
echo "Suite ${suite} already set up, skipping"
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment