X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tools%2Fnd_adddist;h=6c3136d43f7fe97230dd5143da07972228bcc4be;hb=50ce9c2131d4282247929546bd020426364dd599;hp=0d9ab920d495652de5cdb6f2ddd6ff48022cd49d;hpb=bb2da21ef0c9bb401570dd6b7c8c22ac15fefd3b;p=neurodebian.git diff --git a/tools/nd_adddist b/tools/nd_adddist index 0d9ab92..6c3136d 100755 --- a/tools/nd_adddist +++ b/tools/nd_adddist @@ -16,29 +16,59 @@ if [ -z "$dist" ]; then fi -. /home/neurodebian/neurodebian.git/tools/nd_cmdsettings.sh +. /etc/neurodebian/cmdsettings.sh # common options 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" +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 for a in i386 amd64; do echo "Building $a base path..." - if [ -d ${cowbuilderroot}/cow/${family}-${dist}-${a}.cow ]; then - echo "${cowbuilderroot}/cow/${family}-${dist}-${a}.cow exists. Ignoring arch." + cow="${cowbuilderroot}/cow/${family}-${dist}-${a}.cow" + if [ -d "$cow" ]; then + echo "${cow} exists. Ignoring arch." continue fi if [ "${family:0:3}" = "nd+" ]; then echo "Including NeuroDebian repository..." - cowbuilder --create --basepath ${cowbuilderroot}/cow/${family}-${dist}-${a}.cow $opts \ + # 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 --debootstrapopts $a \ - --othermirror "deb http://neuro.debian.net/debian $dist main contrib non-free" + --debootstrapopts --arch=$a \ + --othermirror "${updates_apt}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 + 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 ${cowbuilderroot}/cow/${family}-${dist}-${a}.cow $opts \ + cowbuilder --create --basepath ${cow} $opts \ --components "$components" \ --mirror "$mirror" \ - --debootstrapopts --arch --debootstrapopts $a + --debootstrapopts --arch=$a fi done