X-Git-Url: https://ruderich.org/simon/gitweb/?p=config%2Fdotfiles.git;a=blobdiff_plain;f=os%2Fdebian%2Fbin%2Finit-reprepro.sh;fp=os%2Fdebian%2Fbin%2Finit-reprepro.sh;h=0000000000000000000000000000000000000000;hp=4014dc4b3a708b2efc6f3c1a8771ed6e622b7b2c;hb=7e0091dd9b0fe43ba8d078772d82174d861faed0;hpb=2add0d25a030ae29da75d19a958643466f25b8ab diff --git a/os/debian/bin/init-reprepro.sh b/os/debian/bin/init-reprepro.sh deleted file mode 100755 index 4014dc4..0000000 --- a/os/debian/bin/init-reprepro.sh +++ /dev/null @@ -1,90 +0,0 @@ -# Setup a reprepro repository in /root/apt and add it to -# /etc/apt/sources.list. - -# Copyright (C) 2013 Simon Ruderich -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -set -eu - -sources=/etc/apt/sources.list -repo=/root/apt - -# Don't look for exact "file://$repo" match to allow modifications on the -# system. -if grep -E '^deb file:///' "$sources" >/dev/null 2>&1; then - echo "file:/// already present in '$sources'!" >&2 - exit 1 -fi - -# Create signing key for the repository if necessary. -email="apt@`hostname`" -if ! gpg --list-keys "$email" >/dev/null 2>&1; then - # See doc/DETAILS in the gpg source tree for documentation. - gpg --gen-key --batch </dev/null \ - || grep -E '^deb' "$sources" | head -n1 | awk '{ print $3 }'` - -# Create reprepro repository. -if test ! -d "$repo"; then - echo "creating reprepro repository in '$repo'" >&2 - mkdir -p "$repo/conf" - mkdir -p "$repo/morgue" - - arch="`dpkg --print-architecture` `dpkg --print-foreign-architectures`" - cat >"$repo/conf/distributions" <"$repo/conf/options" <&2 - ( cd "$repo" && reprepro export ) || true - - # Does nothing if the same key is imported multiple times. - echo 'Adding key with apt-key.' >&2 - gpg --export "$keyid" | apt-key add - -fi - -echo "deb file://$repo $codename main" >>"$sources" - -echo 'Finished successfully'. >&2