On Sat, 15 Aug 2009 22:11:55 +0930 Karl Goetz <[email protected]> wrote:
> On Sat, 15 Aug 2009 21:43:02 +0930 > Karl Goetz <[email protected]> wrote: > > > On Sat, 15 Aug 2009 13:08:54 +0200 > > Christophe Jarry <[email protected]> wrote: > > > > > On Sat, 15 Aug 2009 11:03:08 +0200 > > > Zach Oglesby <[email protected]> wrote: > > > > > > I've had his script for a while since multistanza was set up. You > > > can find it attached. It compares both debian's and ubuntu's repos > > > and download packages which are considered free in debian but are > > > in ubuntu's non-free repo. > > > > Ah, I remember seeing that script. I remember writing a tidied up > > version too. Wonder if I can find it anyware... > > Let me have a look and get back to the list. > > Found it. > You'll notice the for loop is largely untouched - it could probably do > with some functions for readability, but I couldn't be bothered. > kk Or even better, an almost complete rewrite. kk -- Karl Goetz, (Kamping_Kaiser / VK5FOSS) Debian contributor / gNewSense Maintainer http://www.kgoetz.id.au No, I won't join your social networking group
--- bjwebb67-compare.sh 2009-08-15 21:43:20.000000000 +0930 +++ kgoetz-compare.sh 2009-08-15 23:05:22.000000000 +0930 @@ -1,48 +1,49 @@ +#!/bin/bash ## (c) 2008 Ben Webb <[email protected]> +## Modifications (C) 2009 Karl Goetz <[email protected]> ## 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.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 +wget http://packages.debian.org/unstable/allpackages?format=txt.gz -O - |gunzip -f - |tail -n +7 > debian-trim +wget http://packages.ubuntu.com/hardy/allpackages?format=txt.gz -O - |gunzip -f - |tail -n +7 > ubuntu-trim + +wget http://archive.ubuntu.com/ubuntu/dists/hardy/multiverse/binary-i386/Packages.gz -O - |gunzip -f - > Packages +wget http://archive.ubuntu.com/ubuntu/dists/hardy/multiverse/source/Sources.gz -O - |gunzip -f - > Sources +wget http://archive.ubuntu.com/ubuntu/dists/hardy/universe/source/Sources.gz -O - |gunzip -f - > Sources_uni + +grep -v -e contrib -e non-free -e "virtual package" debian-trim | awk '{print $1}' | sort > free +grep -v -e contrib -e non-free -e "virtual package" ubuntu-trim | 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 +rm -R binary-i386 && mkdir binary-i386 +rm -R source && mkdir source + cd binary-i386 -for i in `cat ../packages`; do +for PACKAGE 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}'`" + BIN_PACKAGE_PATH="$(grep -A 14 "^Package: $PACKAGE$" ../Packages | grep "^Filename: " | awk '{print $2}')" + wget -c http://archive.ubuntu.com/ubuntu/$BIN_PACKAGE_PATH + cd ../source - if [ -z "`cat ../Sources | grep -A 20 -r "^Package: $i$"`" ]; then - export sourcelist=Sources_uni + if [ -z "`cat ../Sources | grep -A 20 "^Package: $PACKAGE$"`" ]; then + SRC_PACKAGE_PATH="pool/universe/$(cut -c1 <<<$PACKAGE)/$PACKAGE/$(grep $PACKAGE.*dsc Sources |cut -f 4 -d ' ')" else - export sourcelist=Sources + SRC_PACKAGE_PATH="pool/multiverse/$(cut -c1 <<<$PACKAGE)/$PACKAGE/$(grep $PACKAGE.*dsc Sources |cut -f 4 -d ' ')" 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}'`" + + dget http://archive.ubuntu.com/ubuntu/$PACKAGE_PATH + done -ls | sed "s/_.*$//g" > ../packages-downloaded +\ls | sed "s/_.*$//g" > ../packages-downloaded cd ../ @@ -52,4 +53,3 @@ rm binary/index.html rm source/index.html -
kgoetz-compare.sh
Description: application/shellscript
signature.asc
Description: PGP signature
_______________________________________________ gNewSense-dev mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/gnewsense-dev
