Cyril Brulebois <[EMAIL PROTECTED]> (31/01/2008):
> Without having to modify the current format, one might want
> pristine-tar to assume that all missing files are empty directories,
> first patch. But one might want that only when an option is passed,
> second patch.

I've written a tiny testsuite to see how it goes on some parts of the
archive. I used a box close to a mirror, but with rather low disk space,
so I only ran it against the j/ part of the archive. (I've used lftp
ftp://location/debian/pool/main/$letter ; then mget */*.orig.tar.gz)

I'm attaching the testsuite I used.

Layout:
   $somewhere / mirror / {a, …, z, … } / *.orig.tar.gz
              / testsuite.sh
              / tarballs
              / deltas

   cd $somewhere
   ./testsuite.sh

Results: the following files aren't created successfully by default, but
are created correctly when -e is passed:
  jabber_1.4.3.orig.tar.gz
  jags_0.22.1.orig.tar.gz
  jakarta-log4j1.2_1.2.9.orig.tar.gz
  japitools_0.9.5+cvs20060115.orig.tar.gz
  javacc_4.0+cvs20070207.orig.tar.gz
  javatar_2.5+dfsg.orig.tar.gz
  jaxme_0.5.1+dfsg.orig.tar.gz
  jaxme_0.5.2+dfsg.orig.tar.gz
  jcommon-serializer_0.2.0.orig.tar.gz
  jexcelapi_2.6.6.orig.tar.gz
  jlgui_3.0.orig.tar.gz
  jmagick_6.2.6-0.orig.tar.gz
  jsch_0.1.19.orig.tar.gz
  jsch_0.1.28.orig.tar.gz
  jsch_0.1.36.orig.tar.gz
  jts_1.7.orig.tar.gz
  judy_1.0.1.orig.tar.gz
  judy_1.0.3.orig.tar.gz
  junitperf_1.9.1.orig.tar.gz
  jython_2.2.1.orig.tar.gz
  
The following aren't created by either when using the default or when
using -e:
  jakarta-log4j1.2_1.2.13.orig.tar.gz
  jasmin-sable_1.2.orig.tar.gz
  jlha-utils_0.1.5.orig.tar.gz
  jruby0.9_0.9.9.orig.tar.gz
  jruby1.0_1.0.2.orig.tar.gz

No regression AFAICT (every file generated without -e is also generated
correctly with -e).

I didn't check yet why (remember, I'm very new to pristine-tar) but the
5 above trigger: “paranoia check failed on params file from delta”. I'll
check that later.

I'm conscient the attached test isn't efficient at all, but I'm trying
to figure out how to make it easy to handle git revisions from
pristine-tar (git-archive will help).


I've put the 2 previous patches (the second updated) in a repository on
alioth: git://git.debian.org/git/users/kibi-guest/pristine-tar.git

Cheers,

-- 
Cyril Brulebois
#!/bin/sh

# Where the to-be-tested pristine-tar is located
PRISTINE_TAR=~/hack/pristine-tar.git/pristine-tar

# Where to go an experiment
LAB=lab

# Relative to the lab directory
DELTAS=../deltas
TARBALLS=../tarballs
MIRROR=../mirror
PT_LOG=../pt.log


# Check for previous lab existence
if [ -d $LAB ]; then
        echo "Please clean your lab: $LAB. I won't delete your data."
        exit 1
fi

# Init lab.
mkdir -p $LAB
cd $LAB


for letter in $MIRROR/*; do
        # We don't want git to grow up too much, and to have to git-gc
        rm -rf .git
        git-init

        # Import the tarballs
        for i in $letter/*.orig.tar.gz; do
                # Some feedback
                echo "Importing: $(basename $i)"

                rm -rf *
                tar xfz $i --strip 1
                git-add .
                git-commit -q -a -m $(basename $i)
        
                # This one is problematic for some files
                git-tag $(basename $i)
        done

        # Generate the deltas
        for i in $letter/*.orig.tar.gz; do
                echo "Generating delta: $(basename $i)"
                rm -rf *
                git-checkout -q -f $(basename $i)
                $PRISTINE_TAR gendelta $i $DELTAS/$(basename $i).delta
        done

        # We are not at all efficient when gentar'ing, because .git gets copied
        git-gc --aggressive

        # Generate the tarballs
        for i in $letter/*.orig.tar.gz; do
                echo "Generating tarball: $(basename $i)"
                # Clean environment
                rm -rf * 
                git-checkout -q -f $(basename $i)

                # First pass, default
                # Disabling stderr
                for opt in "" "-e" ; do
                        if $PRISTINE_TAR $opt gentar $DELTAS/$(basename 
$i).delta $TARBALLS/$(basename $i) 2>>$PT_LOG; then
                                if [ $(md5sum $i|awk '{print $1}') != $(md5sum 
$TARBALLS/$(basename $i)| awk '{print $1}') ]; then
                                        echo "MD5SUM ERROR: $i"
                                fi
                        else
                                echo "GENTAR [opt=$opt] ERROR: $(basename $i)"
                        fi
                done

                # Don't keep duplicates
                rm -f $TARBALLS/$(basename $i)
        done
done

Attachment: pgpIhxj6v6twW.pgp
Description: PGP signature

Reply via email to