## (c) 2008 Ben Webb ## Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: ## 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. ## 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. ## 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. ## THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. wget http://packages.debian.org/unstable/allpackages?format=txt.gz -O debian.gz gunzip -f debian.gz wget http://packages.ubuntu.com/hardy/allpackages?format=txt.gz -O ubuntu.gz gunzip -f ubuntu.gz wget http://archive.ubuntu.com/ubuntu/dists/hardy/multiverse/binary-i386/Packages.gz -O Packages.gz gunzip -f Packages.gz wget http://archive.ubuntu.com/ubuntu/dists/hardy/multiverse/source/Sources.gz -O Sources_uni.gz gunzip -f Sources.gz wget http://archive.ubuntu.com/ubuntu/dists/hardy/universe/source/Sources.gz -O Sources_uni.gz gunzip -f Sources_uni.gz tail -n +7 debian > debian-trim tail -n +7 ubuntu > ubuntu-trim cat debian-trim | grep -v contrib | grep -v non-free | grep -v "virtual package" | awk '{print $1}' | sort > free cat ubuntu-trim | grep multiverse | awk '{print $1}' | sort > multiverse comm -12 free multiverse > packages1 cat extra >> packages1 cat packages1 | tr '\n' ' ' > packages rm -R binary-i386 mkdir binary-i386 rm -R source mkdir source cd binary-i386 for i in `cat ../packages`; do cd ../binary-i386 wget -c "http://archive.ubuntu.com/ubuntu/`cat ../Packages | grep -A 14 -r "^Package: $i$" | grep -r "^Filename: " | awk '{print $2}'`" cd ../source if [ -z "`cat ../Sources | grep -A 20 -r "^Package: $i$"`" ]; then export sourcelist=Sources_uni else export sourcelist=Sources fi wget -c "http://archive.ubuntu.com/ubuntu/`cat ../$sourcelist | grep -A 20 -r "^Package: $i$" | grep -r "^Directory:" | awk '{print $2}'`/`cat ../$sourcelist | grep -A 20 -r "^Package: $i$" | grep -r "\.dsc$" | awk '{print $3}'`" wget -c "http://archive.ubuntu.com/ubuntu/`cat ../$sourcelist | grep -A 20 -r "^Package: $i$" | grep -r "^Directory:" | awk '{print $2}'`/`cat ../$sourcelist | grep -A 20 -r "^Package: $i$" | grep -r "\.orig.tar.gz$" | awk '{print $3}'`" wget -c "http://archive.ubuntu.com/ubuntu/`cat ../$sourcelist | grep -A 20 -r "^Package: $i$" | grep -r "^Directory:" | awk '{print $2}'`/`cat ../$sourcelist | grep -A 20 -r "^Package: $i$" | grep -r "\.diff.gz$" | awk '{print $3}'`" done ls | sed "s/_.*$//g" > ../packages-downloaded cd ../ dpkg-scanpackages binary-i386 /dev/null | gzip -9c > binary-i386/Packages.gz dpkg-scansources source /dev/null | gzip -9c > source/Sources.gz rm binary/index.html rm source/index.html