X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tools%2Fnd_adddist;h=bf079b71376def4266166ac3e1597c9a750edd4c;hb=HEAD;hp=f5aa64d6d5ce3f9727f36f2b1b42efb6de2c0783;hpb=1a15034c275479b62d7f63fb981fee443ecca4c1;p=neurodebian.git diff --git a/tools/nd_adddist b/tools/nd_adddist index f5aa64d..bf079b7 100755 --- a/tools/nd_adddist +++ b/tools/nd_adddist @@ -22,8 +22,13 @@ fi opts="--distribution $dist --debootstrap debootstrap --aptcache $aptcache" if echo $family | grep -q ubuntu; then - # Use ubuntu's keyring since otherwise debootstrap would fail - opts+=" --debootstrapopts --keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg" + # Use ubuntu's keyring since otherwise debootstrap would fail + opts+=" --debootstrapopts --keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg" +fi + +if echo $family | grep -q debian; then + # Use debian keyring since otherwise debootstrap would fail (on Ubuntu) + opts+=" --debootstrapopts --keyring=/usr/share/keyrings/debian-archive-keyring.gpg" fi mkdir -p ${cowbuilderroot}/cow @@ -37,14 +42,29 @@ for a in i386 amd64; do fi if [ "${family:0:3}" = "nd+" ]; then echo "Including NeuroDebian repository..." + # If it has updates -- enable them + if wget -q -O/dev/null $mirror/dists/$dist-updates; then + updates_apt="deb $mirror $dist-updates $components |" + updates_apt+="#deb-src $mirror $dist-updates $components |" + else + updates_apt="" + fi cowbuilder --create --basepath ${cow} $opts \ --components "$components" \ --mirror "$mirror" \ --debootstrapopts --arch=$a \ - --othermirror "deb http://neuro.debian.net/debian $dist main contrib non-free" - # deploy our key manually since archive with package is not yet - # available at this point - cp --preserve=mode {,${cow}}/etc/apt/trusted.gpg.d/neurodebian-archive-keyring.gpg + --othermirror "${updates_apt}deb http://neuro.debian.net/debian $dist main contrib non-free | deb http://neuro.debian.net/debian data main contrib non-free" + # deploy our key manually since archive with package is not yet + # available at this point + mkdir -p ${cow}/etc/apt/trusted.gpg.d + cp --preserve=mode {,${cow}}/etc/apt/trusted.gpg.d/neurodebian-archive-keyring.gpg + # Old ubuntus might not have capability to read from that key yet, + # so we would need to manually add it + if [ $dist = 'karmic' ] || [ $dist = 'hardy' ]; then + chroot ${cow} bash -c "apt-get install -y --force-yes gnupg \ + && /usr/bin/apt-key add /etc/apt/trusted.gpg.d/neurodebian-archive-keyring.gpg \ + && /usr/bin/apt-get update" + fi else cowbuilder --create --basepath ${cow} $opts \ --components "$components" \