#!/bin/bash
# Quick Package Updater
# John Dong <jdong2002@users.sf.net>

#Licensed under the GPL.
echo "CAUTION CAUTION CAUTION: DESTRUCTIVE!!!"
echo "ONLY FOR GENERATING INITIAL DIRECTORY STRUCTURE"
echo "DO NOT RUN UNLESS YOU KNOW WHAT YOU'RE DOING!!"
echo "Exiting for your safety."
#exit
DISTS="intrepid"

SECTIONS="main universe multiverse restricted bleeding"
BINARY_ARCH="binary-i386 binary-ppc binary-amd64"

for a in $DISTS; do
	mkdir ./dists/$a/
	for b in $SECTIONS; do
	mkdir ./dists/$a/$b
	for c in $BINARY_ARCH; do
	mkdir ./dists/$a/$b/$c
		if [ -d dists/$a/$b/$c ]; then
		echo "Updating dists/$a/$b/$c/Packages"
		dpkg-scanpackages dists/$a/$b/$c /dev/null > dists/$a/$b/$c/Packages
		fi
	done
	done

done
