#!/bin/sh set -e [ "$1" = "configure" ] || exit 0 [ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx repos_regexp=" ^deb .*tp://security.debian.org.*squeeze/updates main contrib non-free ^deb .*tp://ftp.hr.debian.org/.*debian.*squeeze main contrib non-free ^deb .*tp://ftp.carnet.hr/carnet-debian.*squeeze main non-free" repos=" 1 deb http://security.debian.org/ squeeze/updates main contrib non-free 2 deb http://ftp.hr.debian.org/debian/ squeeze main contrib non-free 3 deb http://ftp.carnet.hr/carnet-debian/ carnet-squeeze main non-free" notneeded_repos_regexp="^deb.*tp://.*debian-non-US" IFS=" " counter=1 for i in $repos_regexp; do if ! grep -q "$i" /etc/apt/sources.list; then needed="$needed $counter" fi counter=$(($counter + 1)) done if grep -q "$notneeded_repos_regexp" /etc/apt/sources.list; then echo "CN: Following repositories are obsolete:" grep "$notneeded_repos_regexp" /etc/apt/sources.list echo "" fi if [ ! -z "$needed" ]; then echo "CN: Following repositories are not found in your sources list:" IFS=" " for i in $needed; do echo $repos | grep ^$i | cut -c3-300 done echo "" echo "CN: You can add the above to /etc/apt/sources.list or just:" echo "CN: # install-carnet-sources.list" fi