On Wed, Jan 17, 2007 at 04:50:48PM +0100, Marc Haber wrote: > I have found that the _apt_ rules are a horrible mess and will re-work > them completely in the next version. Don't submit any patches agains > the current versions as it is likely that the new rules will not > remotely resemble the current ones.
I have rewritten the apt rule as a script and implemented a small /etc/apt/sources.list parser. This, as a convenience, eliminated the need for separate stable and unstable rules, and also caters correctly for the arch. Here is a preliminary version: #!/bin/bash SOURCESLIST="/etc/apt/sources.list" LISTSDIR="/var/lib/apt/lists" ARCH="$(dpkg --print-architecture)" cat $SOURCESLIST | while read deb uri dist comp; do PROTOCOL="$(echo $uri | sed 's|\([^:]\+\).*|\1|')" if [ "$PROTOCOL" = "http" ] || [ "$PROTOCOL" = "ftp" ]; then HOST="$(echo $uri | sed 's|.*//\([^/[:space:]]\+\).*|\1|')" HOSTPATH="$(echo $uri | sed 's|.*//[^/[:space:]]\+/\?||;s|/|_|g;s|^\(.\+\)$|_\1|')" dist="${dist//\//_}" if [ -n "$DEBUG" ]; then echo "uri $uri" echo "HOST $HOST" echo "HOSTPATH $HOSTPATH" fi if [ "$deb" = "deb" ]; then for c in $comp; do echo "$LISTSDIR/${HOST}${HOSTPATH}_dists_${dist}_${c}_binary-${ARCH}_Packages(\.IndexDiff)?$ VarFile" echo "$LISTSDIR/${HOST}${HOSTPATH}_dists_${dist}_Release(\.gpg)?$ VarFile" done elif [ "$deb" = "deb-src" ]; then : fi else : # other protocols are not supported. If you feel like they should : # please give a good reason and probably a patch. fi echo -e "\n\n" done echo "${LISTSDIR}(/partial)?$ VarDir" echo "${LISTSDIR}/lock$ VarFile" If you want to, give it a try. Greetings Marc -- ----------------------------------------------------------------------------- Marc Haber | "I don't trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]