The debdiff
a.

diff -Nru debdelta-0.50+2/debdelta debdelta-0.55/debdelta
--- debdelta-0.50+2/debdelta    2012-11-07 11:09:14.000000000 +0100
+++ debdelta-0.55/debdelta      2014-11-30 18:31:13.000000000 +0100
@@ -62,6 +62,7 @@
             possible values are: xdelta xdelta-bzip xdelta3 bsdiff
  -M Mb      maximum memory to use (for 'bsdiff' or 'xdelta')
 --clean-deltas     delete deltas if newer deb is not in archive
+--cache     cache parsed version of Packages.bz2 as Packages.debdelta_cache
 """)
 
 ## implement : --search    search in the directory of the above debs for older 
versions
@@ -119,13 +120,23 @@
 
 ####################################################################
 
-import sys , os , tempfile , string ,getopt , tarfile , shutil , time, 
traceback, ConfigParser, subprocess, time, tarfile, stat, hashlib, random
+import sys , os , tempfile , string ,getopt , tarfile , shutil , time, 
traceback, ConfigParser, subprocess, time, tarfile, stat, hashlib, random, gzip
+
+try:
+    import debian.deb822 
+    debian_deb822 = debian.deb822
+except ImportError:
+    debian_deb822 = None
+
+import cPickle as pickle
 
 from stat    import ST_SIZE, ST_MTIME, ST_MODE, S_IMODE, S_IRUSR, S_IWUSR, 
S_IXUSR 
 from os.path import abspath, expanduser
 from copy    import copy
 
-from types import StringType, UnicodeType, FunctionType, TupleType, ListType, 
DictType
+from types import FunctionType
+
+string_types = (str, unicode)  # change this for python3
 
 def get_termsize():
   import termios, fcntl, struct
@@ -208,6 +219,8 @@
 
 DO_PREDICTOR = False
 
+DO_CACHE = False #cache parsed version of Packages.bz2 as 
Packages.debdelta_cache
+
 #see README.features
 DISABLEABLE_FEATURES=['xz', 'lzma', 'xdelta3-fifo']
 DISABLED_FEATURES=[]
@@ -217,7 +230,10 @@
 
 DPKG_MULTIARCH=( 0 == os.system('dpkg --assert-multi-arch 2> /dev/null') )
 
-if os.path.dirname(sys.argv[0]) == '/usr/lib/apt/methods' :
+
+if __name__ != "__main__":
+  action = None
+elif os.path.dirname(sys.argv[0]) == '/usr/lib/apt/methods' :
   action = None
 else:
   action=(os.path.basename(sys.argv[0]))[3:]
@@ -238,7 +254,7 @@
     ( opts, argv ) = getopt.getopt(sys.argv[1:], 'vkhdM:n:A' ,
                  
('help','info','needsold','dir=','no-act','alt=','old=','delta-algo=',
                     
'max-percent=','deb-policy=','clean-deltas','clean-alt','no-md5','debug','forensicdir=','forensic=',
-                    'signing-key=', "accept-unsigned", "gpg-home=", 
"disable-feature=", "test", "format=") )
+                    'signing-key=', "accept-unsigned", "gpg-home=", 
"disable-feature=", "test", "format=","cache") )
   except getopt.GetoptError,a:
       sys.stderr.write(sys.argv[0] +': '+ str(a)+'\n')
       raise SystemExit(3)
@@ -328,6 +344,7 @@
         sys.stderr.write(_("Error: output format `%s' is unknown.") % v + '\n')
         raise SystemExit(3)
       DEB_FORMAT=v
+    elif o == '--cache': DO_CACHE=True
     else:
       sys.stderr.write(_("Error: option `%s' is unknown, try --help") % o + 
'\n')
       raise SystemExit(3)
@@ -346,6 +363,11 @@
     print ' Warning, /proc not mounted, using bogus BOGOMIPS'
   BOGOMIPS=3000.0
 
+SP=subprocess.Popen(['hostname','-f'], shell=False, stdout=subprocess.PIPE)
+HOSTID=hashlib.md5( SP.stdout.read() ).hexdigest()
+SP.wait()
+del SP
+
 TMPDIR = ( os.getenv('TMPDIR') or '/tmp' ).rstrip('/')
 
 if KEEP:
@@ -376,7 +398,7 @@
 #################################################### various routines
 
 def my_popen_read(cmd):
-  return subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout
+  return subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, 
stdin=open(os.devnull), close_fds=True).stdout
 
 def freespace(w):
   assert(os.path.exists(w))
@@ -478,6 +500,88 @@
   p.close()
   return ar_list
 
+
+
+class cache_sequence(object):
+  cache_filename=None
+  cache=None
+  exists=None
+  broken=None
+  def __init__(self, filename):
+    "manages a cache file that store a sequence of python object"
+    self.cache_filename=os.path.splitext(filename)[0]+'.debdelta_cache'
+    self.cache=None
+    self.broken=None
+    self.exists=os.path.isfile(self.cache_filename) and \
+      os.path.getmtime(filename) < os.path.getmtime(self.cache_filename)
+  
+  def __iter__(self):
+    assert self.exists and not self.cache
+    self.cache=gzip.GzipFile(self.cache_filename)
+    return self
+  
+  def next(self):
+    assert self.cache
+    try:
+      return pickle.load(self.cache)
+    except EOFError:
+      self.cache=None
+      raise StopIteration
+    except Exception, e:
+      print 'Cache file is broken (%r), deleting %r' % (e, self.cache_filename)
+      if ACT: os.unlink(self.cache_filename)
+      self.cache=None
+      self.broken=True
+      # do not kill program
+      raise StopIteration
+  
+  def __prepare_for_write__(self):
+    if not self.cache:
+      if DEBUG: print ' Creating cache file :', self.cache_filename
+      self.cache=gzip.GzipFile(self.cache_filename,'w')
+  
+  def close(self):
+    if self.cache:
+      try:
+        self.cache.close()
+      except Exception,e:
+        print 'Cannot close the cache file (%r)' %  (self.cache_filename,)
+        self.broken=True
+      try:
+        self.cache=None
+      except:
+        pass
+  
+  __del__=close
+  
+  def write(self,s):
+    " write one object"
+    assert not self.exists
+    if self.broken:
+      return
+    self.__prepare_for_write__()   
+    try:
+      self.cache.write(pickle.dumps(s))
+    except Exception,e:
+      print 'Cannot write to cache file (%r), deleting %r' % (e, 
self.cache_filename)
+      self.close()
+      if ACT: os.unlink(self.cache_filename)
+      self.broken=True
+
+class cache_same_dict(cache_sequence):
+  "cache occurrences of a dict that uses always the same keys; omit the keys 
to optimize"
+  def __init__(self, filename, keys):
+    super(cache_same_dict, self).__init__(filename)
+    self.keys=keys
+  
+  def write(self, s):
+    n=[s[k] for k in self.keys]
+    super(cache_same_dict, self).write(n)
+  
+  def next(self):
+    n=super(cache_same_dict, self).next()
+    return dict(map(lambda x,y: (x,y) , self.keys, n)) # dict comprehension 
may be used instead
+
 #####################################################################
 
 ALLOWED = '<>()[]{}.,;:!_-+/ 
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
@@ -499,7 +603,7 @@
 """
 
 def prepare_for_echo__(s):
-  assert ( type (s) == StringType )
+  assert ( type (s) in string_types )
   r=''
   shortquoted=False
   for a in s:
@@ -587,7 +691,7 @@
   # Subclasses that define an __init__ must call Exception.__init__
   # or define self.args.  Otherwise, str() will fail.
   def __init__(self,s,retriable=False,exitcode=None,logs=None):
-    assert(type(s) == StringType)
+    assert(type(s) in string_types)
     self.retriable = retriable
     if retriable:
       self.args=(s + ' (retriable) ',)
@@ -603,13 +707,13 @@
 
 def die(s):
   #if s : sys.stderr.write(s+'\n')
-  assert(type(s) == StringType)
-  raise DebDeltaError,s
+  assert type(s) in string_types
+  raise DebDeltaError(s)
 
 
 def system(a,TD,saveargs=None,ignore_output=False,return_output=False):
   "a must be a tuple, TD the temporary directory ; if return_output , it will 
return (stdout,stderr,exitcode) regardless"
-  assert type(a) in (ListType, TupleType)
+  assert type(a) in (list, tuple)
   # mvo: compat with python2.5 where tuple does not have index
   a = list(a)
   if VERBOSE and TD[: (len(TMPDIR)+9) ] != TMPDIR+'/debdelta' :
@@ -623,10 +727,10 @@
   pros=[]
   while '|' in a:
     l=a.index('|') ; a1=a[:l] ; a=a[l+1:]
-    
p=subprocess.Popen(args=a1,stdin=old_stdin,stdout=subprocess.PIPE,stderr=temp_err_fd,cwd=TD)
+    p=subprocess.Popen(args=a1, stdin=old_stdin, stdout=subprocess.PIPE, 
stderr=temp_err_fd, cwd=TD, close_fds=True)
     pros.append( p )
     old_stdin=p.stdout
-  final_pro= 
subprocess.Popen(args=a,stdin=old_stdin,stdout=temp_fd,stderr=temp_err_fd,cwd=TD)
+  final_pro= subprocess.Popen(args=a, stdin=old_stdin, stdout=temp_fd, 
stderr=temp_err_fd, cwd=TD, close_fds=True)
   for p in pros:
     p.stdout.close()  # Allow p1 to receive a SIGPIPE if p2 exits.
   pros.append(final_pro)
@@ -699,19 +803,24 @@
 
 ################################################################### GPG
 
-if GPG_HOME:
-  GPG_BASE_CMD_LINE=[GPG_CMD,"--homedir",GPG_HOME]
-else:
-  GPG_BASE_CMD_LINE=[GPG_CMD,"--keyring",GPG_MASTER_PUB_KEYRING]
+def gpg_base_commandline():
+  if GPG_HOME:
+    GPG_BASE_CMD_LINE=[GPG_CMD,"--homedir",GPG_HOME]
+  else:
+    GPG_BASE_CMD_LINE=[GPG_CMD,"--keyring",GPG_MASTER_PUB_KEYRING]
+  
+  if VERBOSE < 1 :
+    GPG_BASE_CMD_LINE+=['--quiet']
+  
+  return GPG_BASE_CMD_LINE
 
-if VERBOSE < 1 :
-  GPG_BASE_CMD_LINE+=['--quiet']
+def gpg_sign_command():
+  return 
gpg_base_commandline()+["--batch","--armor","--clearsign","--default-key",GPG_SIGNING_KEY,"--sign"]
 
-GPG_SIGN=GPG_BASE_CMD_LINE+["--batch","--armor","--clearsign","--default-key",GPG_SIGNING_KEY,"--sign"]
 
 def compute_md5_len(o):
   "hash the file using MD5. 'o' may be a string (in which case the file is 
opened) or a file type; returns MD5 and length"
-  if type(o) in (StringType, UnicodeType):
+  if type(o) in string_types:
     o = open(o)
   m=hashlib.md5()
   a=o.read(1024)
@@ -756,8 +865,8 @@
 
   (temp_fd, temp_name) = tempfile.mkstemp(prefix="debdelta_gpg_verified")
   #(read_end, write_end) = os.pipe()
-  
p=subprocess.Popen(GPG_BASE_CMD_LINE+['--batch','--status-fd',"2",'--output',"-",signature],
-                     stdout=subprocess.PIPE,stderr=temp_fd)
+  p=subprocess.Popen(gpg_base_commandline() + 
['--batch','--status-fd',"2",'--output',"-",signature],
+                     stdout=subprocess.PIPE, stderr=temp_fd, 
stdin=open(os.devnull), close_fds=True)
   r=_verify_signature_no_gpg(p.stdout, DIR, role)
   p.wait()
   
@@ -842,7 +951,7 @@
   TD = abspath(tempfile.mkdtemp(prefix='debdelta',dir=TMPDIR))
   try:
     _write_signature(db,TD+'/_temp',role)
-    p=subprocess.Popen(GPG_SIGN+['--output',TD+'/_gpg'+role,TD+'/_temp'])
+    p=subprocess.Popen(gpg_sign_command() 
+['--output',TD+'/_gpg'+role,TD+'/_temp'], stdin=open(os.devnull), 
close_fds=True)
     p.wait()
     if p.returncode==0:
       r=system(("ar","qS",delta,TD+"/_gpg"+role),TD)
@@ -962,7 +1071,7 @@
 ########### other auxiliary routines
 
 def patch_check_tmp_space(params,olddeb):
-  if type(params) != DictType:
+  if type(params) != dict:
     params=info_2_db(params)
   if 'NEW/Installed-Size' not in params or 'OLD/Installed-Size' not in params:
     print '(Warning... Installed size unknown...)'
@@ -1147,7 +1256,7 @@
 
 def sha1_hash_file(f):
     s=hashlib.sha1()
-    if type(f) == StringType:
+    if type(f) in string_types:
       f=open(f)
     a=f.read(1024)
     while a:
@@ -1594,7 +1703,7 @@
           #unfortunately 'prelink -o' sometimes alters files, see 
http://bugs.debian.org/627932
           shutil.copy2(divert, tmpcopy)
           
proc=subprocess.Popen(["/usr/sbin/prelink","-u",tmpcopy],stdin=open(os.devnull),\
-              stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
+                                
stdout=subprocess.PIPE,stderr=subprocess.STDOUT,close_fds=True)
           out=proc.stdout.read().strip()
           proc.wait()
           if proc.returncode:
@@ -2648,9 +2757,10 @@
     if DEBUG > 1 :
       script.md5_check_file(o, compute_md5(TD+o))
 
-  def guess_xz_parameters(o):
-    "tries to guess the parameters used to compress ; uses lock "
-    par=None
+  def guess_xz_parameters(o, check=True):
+    "tries to guess the parameters used to compress, returns a string of 
options ; if check=True and it fails, returns False "
+    par=''
+    crc=''
     z=tempfile.NamedTemporaryFile(suffix='.xz',delete=False)
     #unfortunately 'xz --list' does not work on pipes!
     shutil.copyfileobj(o,z)
@@ -2662,13 +2772,51 @@
     for a in b.stdout:
       a=a.rstrip('\n')
       a=string.split(a,'\t')
-      #print '------ ',a
       if a[0]=='block':
-        if par and par != a[16]:
-          print "  warning : this xz -- compressed file was compressed with 
variable blocks options ?! '%s' ~= '%s'" & (par,a[16])
-        par=a[-1]
+        if crc and crc != a[9]:
+          print "  warning : this xz -- compressed file was compressed with 
variable blocks crc ?! '%s' != '%s'" & (crc,a[9])
+        crc=a[9]
+        if par and par != a[15]:
+          print "  warning : this xz -- compressed file was compressed with 
variable blocks options ?! '%s' != '%s'" & (par,a[15])
+        par=a[15]
+    #print ' guessed par crc ',par,crc
+    if crc:
+      crc=crc.lower()
+      if crc=='sha-256': crc='sha256'
+      if crc not in ('crc32','crc64','sha256'):
+        print ' Unknown XZ crc ',crc
+        crc=''
+    PARS=['-6e','-9','-9e']
+    if par:
+      PARS.append(par)
+    if check:
+      redo=True
+      while redo and PARS:
+        par=PARS.pop()
+        y=subprocess.Popen(['unxz','-c',z.name],stdout=subprocess.PIPE)
+        w=['xz','-c']
+        if par:
+          w.append(par)
+        if crc:
+          w+=['-C',crc]
+        w.append('-')
+        if VERBOSE > 2 : print '   Testing XZ options ',w
+        
w=subprocess.Popen(w,stdin=y.stdout,stdout=subprocess.PIPE,close_fds=True)
+        y.stdout.close()
+        redo=False
+        
c=subprocess.Popen(['cmp','-',z.name],stdin=w.stdout,stdout=open(os.devnull,'w'),close_fds=True)
+        w.stdout.close()
+        if c.wait() :
+          redo=True
+          if VERBOSE or DEBUG : print ' Tried XZ options but failed: ',par,crc
+        if redo and not PARS:
+          #print '  HO FINITO LE OPZIONI !'
+          os.unlink(z.name)
+          return False
+    if crc:
+      crc=' -C '+crc
     os.unlink(z.name)
-    return par
+    return par+crc
 
   ########### helper sh functions for script, for delta_tar()
 
@@ -2741,9 +2889,9 @@
   def files_similarity_score(oo,nn):
     if oo == nn :
       return 0
-    if type(oo) == StringType:
+    if type(oo) in string_types:
       oo=file_similarity_premangle(oo)
-    if type(nn) == StringType:
+    if type(nn) in string_types:
       nn=file_similarity_premangle(nn)
     return files_similarity_score__(oo,nn)
 
@@ -2786,13 +2934,13 @@
                   skip=[], old_md5={}, new_md5={},\
                   chunked_p=(not delta_uses_infifo) ,debdelta_conf_skip=()):
     " compute delta of two tar files, and prepare the script consequently"
-    assert( type(old_filename) == StringType or type(old_filename) == 
FunctionType )
+    assert( type(old_filename) in string_types or type(old_filename) == 
FunctionType )
 
     script.write('ECR () { $E "$1" ; $E "${FTH}" ; cat OLD/'+CWD+'/"$1" ; rm 
OLD/'+CWD+'/"$1" ;}\n')
     script.write('EC () { $E "$1" ; $E "${FTH}" ; cat OLD/'+CWD+'/"$1" ;}\n')
     
     ###### uncompress and scan the old tar file, extract regular files
-    if type(old_filename) == StringType :
+    if type(old_filename) in string_types :
       (old_filename,old_filename_ext) = unzip(old_filename)
       oldtar = tarfile.open(TD+old_filename, "r")
     else:
@@ -2845,7 +2993,7 @@
                             
[hash_to_hex(sha1_hash_file(os.path.join(TD,"OLD",CWD,oldname)))])
       
     oldtar.close()
-    if type(old_filename) == StringType :
+    if type(old_filename) in string_types :
       unlink(TD+old_filename)
     else:
       while oldfileobj.read(512):
@@ -3196,6 +3344,15 @@
       script.end_member()
     elif not NEEDSOLD and name[:8] == 'data.tar'  :
       script.start_member(ar_line, newname, extrachar)
+      #
+      if 'data.tar.lzma' == name :
+        info_append('needs-lzma')
+      elif 'data.tar.xz' == name :
+        info_append('needs-xz')
+        script.xz_parameters=guess_xz_parameters(my_popen_read('cd '+TD+'; ar 
p NEW.file data.tar.xz'))
+        if script.xz_parameters==False:
+          raise DebDeltaError('Cannot guess XZ parameters')
+      #
       if 'data.tar.gz' in ar_list_old  :
         def x():
           return my_popen_read('cd '+TD+'; ar p OLD.file data.tar.gz | gzip 
-cd')
@@ -3208,7 +3365,6 @@
           return my_popen_read('cd '+TD+'; ar p OLD.file data.tar.lzma | 
unlzma -c')
       elif 'data.tar.xz' in ar_list_old :
         info_append('needs-xz')
-        script.xz_parameters=guess_xz_parameters(my_popen_read('cd '+TD+'; ar 
p NEW.file data.tar.xz'))
         def x():
           return my_popen_read('cd '+TD+'; ar p OLD.file data.tar.xz | unxz 
-c')
       else: assert(0)
@@ -3330,10 +3486,6 @@
     else: assert 'lopadf' == 0
   except ImportError:
     raise DebDeltaError('python module "apt_pkg" is missing. Please install 
python-apt', retriable=True)
-
-  f=my_popen_read('hostname -f')
-  HOSTID=hashlib.md5( f.read() ).hexdigest()
-  f.close()
   
   info_by_pack_arch={}
   
@@ -3343,11 +3495,14 @@
     if  (pack,arch) not in  info_by_pack_arch :
       info_by_pack_arch[ (pack,arch) ]=[]
     info_by_pack_arch[ (pack,arch) ].append( f )
-    
-  def iterate_Packages(packages):
+
+  def iterate_Packages(packages, use_debian_822=True):
+    fields=('Package','Architecture','Version','Filename')
+    for f in fields: intern(f)
+
     packages=abspath(packages)
     assert os.path.isfile(packages)
-    assert os.path.basename(packages) in  ('Packages', 
'Packages.gz','Packages.bz2')
+    assert os.path.basename(packages) in  ('Packages', 
'Packages.gz','Packages.bz2','Packages.xz')
     dir=os.path.dirname(packages)
     dir=dir.split('/')
     try:
@@ -3356,12 +3511,41 @@
       sys.stderr.write('Error: pathname "%s" does not contain "dists"\n' % 
packages)
       return
     base = string.join(dir[:a],'/')
+    #
+    cache=cache_same_dict(packages, fields)
+    if DO_CACHE and cache.exists:
+      for i in cache:
+        i['Basepath'] = base
+        yield i
+      if not cache.broken:
+        return
+    #
     if packages[-3:] == '.gz':
-      F=subprocess.Popen(["zcat",packages],stdout=subprocess.PIPE).stdout
+      import gzip
+      F=gzip.GzipFile(packages)
+      SP=None
     elif packages[-4:] == '.bz2':
-      F=subprocess.Popen(["bzcat",packages],stdout=subprocess.PIPE).stdout
+      import bz2
+      F=bz2.BZ2File(packages)
+      SP=None
+    elif packages[-3:] == '.xz':
+      SP=subprocess.Popen(["xzcat",packages], stdout=subprocess.PIPE, 
stdin=open(os.devnull), close_fds=True)
+      F=SP.stdout
     else:
       F=open(packages)
+      SP=None
+    #
+    if debian_deb822 and use_debian_822: #use faster implementation
+      #P=debian_deb822.Packages(F,fields=fields)
+      for a in 
debian_deb822.Packages.iter_paragraphs(sequence=F,shared_storage=False,fields=fields):
+        if DO_CACHE and not cache.exists: cache.write(a)
+        a['Basepath'] = base
+        yield a
+      if SP:
+        F.read()
+        SP.wait()
+      return
+    #
     of,pack,vers,arch=None,None,None,None
     for l in F:
       l=l.rstrip('\n')
@@ -3381,16 +3565,20 @@
           if VERBOSE > 2 : print '   skip udeb: '
           continue
         a={}
-        a['Basepath'] = base
         a['Filename'] = of
         a['Package']  = pack
         a['Architecture'] = arch
         a['Version'] = vers
+        if DO_CACHE and not cache.exists: cache.write(a)
+        a['Basepath'] = base
         yield a
         of,pack,vers,arch=None,None,None,None
+    if SP:
+      F.read()
+      SP.wait()
 
   def scan_deb_dir(d, debname, label, lazy):
-    assert (debname == None or type(debname) == StringType) and type(label) == 
StringType
+    assert (debname == None or type(debname) in string_types) and type(label) 
in string_types
     if not os.path.isdir(d):
       print 'Error, skip non dir:',d
       return
@@ -3444,7 +3632,7 @@
       if VERBOSE > 2 and DEBUG : print '   No such delta dir: ',d
       scanned_delta_dirs.add((d,None)) #trick, if aint there no need to retry
       return
-    assert debname == None or type(debname) == StringType
+    assert debname == None or type(debname) in string_types
     scanned_delta_dirs.add((d,debname))
     for n in os.listdir(d):
       if debname != None and debname != n.split('_')[0]:
@@ -3682,6 +3870,7 @@
 
     oldn = newest
     generated=0
+    seen_versions=[]
     while (oldn>0) :
         oldn -= 1
         
@@ -3725,6 +3914,12 @@
           if VERBOSE > 1 : print '  Skip , already exists: ',delta
           continue
         
+        if old['Package']  in seen_versions:
+          if VERBOSE > 3 : print '    Skip , already considered: ',delta
+          continue 
+        
+        seen_versions.append(old['Package'])
+        
         if os.path.exists(delta+'-too-big'):
           if VERBOSE > 1 : print '  Skip , tried and too big: ',delta
           continue
@@ -3980,7 +4175,7 @@
   
   original_cwd = os.getcwd()
 
-  import thread, threading, Queue, pickle, urllib2, fcntl, atexit, signal
+  import thread, threading, Queue, urllib2, fcntl, atexit, signal
 
   proxies=urllib2.getproxies()
   if VERBOSE and proxies:
diff -Nru debdelta-0.50+2/debian/changelog debdelta-0.55/debian/changelog
--- debdelta-0.50+2/debian/changelog    2012-11-07 13:33:08.000000000 +0100
+++ debdelta-0.55/debian/changelog      2014-11-30 18:31:13.000000000 +0100
@@ -1,3 +1,29 @@
+debdelta (0.55) unstable; urgency=medium
+
+  * update git location
+  * add debian backports to sources.conf
+
+ -- A Mennucc1 <mennu...@debian.org>  Sun, 30 Nov 2014 18:30:51 +0100
+
+debdelta (0.54) unstable; urgency=medium
+
+  * [INTL:pt] Portuguese translation, thanks to Américo Monteiro
+  (Closes: #760731).
+  * bump standards version to 3.9.6.0
+  * debian/rules : add build-arch, build-indep
+  * add new keys into keyring
+  * import some code from GIT server branch
+
+ -- A Mennucc1 <mennu...@debian.org>  Sun, 30 Nov 2014 17:00:39 +0100
+
+debdelta (0.53) experimental; urgency=low
+
+  * merge changes uploaded in wheezy, and changelogs as well
+  * Bug fix: "owned and unowned files after purge (policy 6.8 + 10.7.3)",
+    thanks to Holger Levsen (Closes: #617481).
+
+ -- A Mennucc1 <mennu...@debian.org>  Sun, 02 Dec 2012 18:52:15 +0100
+
 debdelta (0.50+2) unstable; urgency=high
 
   * debdelta-upgrade: uses incorrect URL when requesting
@@ -8,12 +34,26 @@
 
  -- A Mennucc1 <mennu...@debian.org>  Wed, 07 Nov 2012 13:31:31 +0100
 
+debdelta (0.52) experimental; urgency=low
+
+  * debpatch, debdelta-upgrade : do not get confused by broken symlinks
+  * enable hardening flags
+
+ -- A Mennucc1 <mennu...@debian.org>  Fri, 02 Nov 2012 10:08:46 +0100
+
 debdelta (0.50+1) unstable; urgency=high
 
   * debpatch, debdelta-upgrade : do not get confused by broken symlinks
   * enable hardening flags
 
  -- A Mennucc1 <mennu...@debian.org>  Wed, 31 Oct 2012 10:40:46 +0100
+  
+debdelta (0.51) experimental; urgency=low
+
+  * debdelta, debdeltas: XZ parameter autodetection, detect CRC choice
+     and compression
+
+ -- A Mennucc1 <mennu...@debian.org>  Wed, 12 Sep 2012 16:34:53 +0200
 
 debdelta (0.50) unstable; urgency=medium
 
diff -Nru debdelta-0.50+2/debian/control debdelta-0.55/debian/control
--- debdelta-0.50+2/debian/control      2011-12-06 13:59:12.000000000 +0100
+++ debdelta-0.55/debian/control        2014-11-30 18:31:13.000000000 +0100
@@ -3,14 +3,14 @@
 Priority: optional
 Build-Depends: zlib1g-dev, libbz2-dev
 Maintainer: A Mennucc1 <mennu...@debian.org>
-Standards-Version: 3.9.1.0
+Standards-Version: 3.9.6.0
 Homepage: http://debdelta.debian.net
-Vcs-git: http://debdelta.debian.net/debdelta-suite.git
+Vcs-git: git://anonscm.debian.org/collab-maint/debdelta.git
 
 Package: debdelta
 Architecture: any
 Depends: python, bzip2, binutils, ${shlibs:Depends}
-Recommends: python-apt, xdelta3, xdelta, lzma, xz-utils, xdelta, bsdiff, 
gnupg2, gnupg-agent
+Recommends: python-apt, xdelta3, xdelta, lzma, xz-utils, xdelta, bsdiff, 
gnupg2, gnupg-agent, python-debian
 Conflicts: xdelta3 (<< 0y.dfsg-1)
 Enhances: cupt
 Suggests: debdelta-doc
diff -Nru debdelta-0.50+2/debian/postinst debdelta-0.55/debian/postinst
--- debdelta-0.50+2/debian/postinst     2011-03-31 11:32:26.000000000 +0200
+++ debdelta-0.55/debian/postinst       2014-11-30 18:31:13.000000000 +0100
@@ -1,19 +1,47 @@
-#!/bin/sh -e
+#!/bin/sh
+
+set  -e
+
+umask 0077
 
 
GPG_MASTER_PUB_KEYRING="/usr/share/keyrings/debian-debdelta-archive-keyring.gpg"
 GPG_HOME="/etc/debdelta/gnupg"
 
+sha1it () {
+ (
+    cd ${GPG_HOME}
+    echo '#if this file is deleted or it does not match, then  ' > 
sha1_hashes.txt
+    echo '# these files will not be removed when purging "debdelta"  ' >> 
sha1_hashes.txt
+    sha1sum pubring.gpg  secring.gpg >> sha1_hashes.txt
+    if test -f trustdb.gpg ; then sha1sum trustdb.gpg >> sha1_hashes.txt ; fi
+ )
+}
+
+check1it () {
+ (
+  cd ${GPG_HOME}
+  test -f sha1_hashes.txt && sha1sum -c --quiet sha1_hashes.txt
+ )
+}
+
 case "$1" in
   configure|reconfigure)
     if test ! -r ${GPG_HOME} ; then
+      echo "Debdelta: creating ${GPG_HOME}"
+      mkdir ${GPG_HOME}
+    fi
+    if test ! -r ${GPG_HOME}/pubring.gpg -a \
+            ! -r ${GPG_HOME}/secring.gpg   ; then
       echo "Debdelta: creating keyrings in ${GPG_HOME}"
-      mkdir  ${GPG_HOME}
-      chmod 0700  ${GPG_HOME}
-      touch   ${GPG_HOME}/secring.gpg   ${GPG_HOME}/pubring.gpg 
-      chmod 0600  ${GPG_HOME}/secring.gpg  ${GPG_HOME}/pubring.gpg
+      touch ${GPG_HOME}/secring.gpg  ${GPG_HOME}/pubring.gpg
+      sha1it
     else
       echo "Debdelta: updating public keyring in ${GPG_HOME}"
     fi
-    gpg --no-tty --batch --no-options --no-auto-check-trustdb --homedir 
${GPG_HOME} --import ${GPG_MASTER_PUB_KEYRING} || true 
+
+    c=0 ;  if  check1it ; then   c=1 ;  fi
+    gpg --no-tty --batch --no-options --no-auto-check-trustdb --homedir 
${GPG_HOME} --import ${GPG_MASTER_PUB_KEYRING} || true
+    if test $c = 1 ; then sha1it ; fi
+
     ;;
 esac
diff -Nru debdelta-0.50+2/debian/postrm debdelta-0.55/debian/postrm
--- debdelta-0.50+2/debian/postrm       2011-03-31 11:32:26.000000000 +0200
+++ debdelta-0.55/debian/postrm 2014-11-30 18:31:13.000000000 +0100
@@ -3,32 +3,28 @@
 
 GPG_HOME=/etc/debdelta/gnupg
 
+check1it () {
+ (
+  cd ${GPG_HOME}
+  test -f sha1_hashes.txt && sha1sum -c --quiet sha1_hashes.txt
+ )
+}
+
 if [ "$1" = purge ] ; then
   if  [ -r /var/lib/debdelta ] ; then
     rm -r /var/lib/debdelta
   fi
 
-  if test -f "${GPG_HOME}/secring.gpg" ; then 
-    if test -s "${GPG_HOME}/secring.gpg" ; then
-      echo debdelta: does not delete nonempty  ${GPG_HOME}/secring.gpg
-    else
-      rm ${GPG_HOME}/secring.gpg 
-    fi
-  fi
-
-  if test -f "${GPG_HOME}/pubring.gpg" ; then
-      if  echo "4509b7260dc7aee6ec8dac68263bc662  ${GPG_HOME}/pubring.gpg" | 
md5sum -c --quiet ; then 
-      rm ${GPG_HOME}/pubring.gpg 
-    else
-      echo debdelta: does not delete modified  ${GPG_HOME}/pubring.gpg
-    fi
+  if check1it ; then
+    (
+      cd ${GPG_HOME}
+      rm -f pubring.gpg  secring.gpg  trustdb.gpg
+      if test -f pubring.gpg~ ; then
+          rm -f pubring.gpg~
+      fi
+      rm -f sha1_hashes.txt
+    )
+    rmdir ${GPG_HOME} || true
   fi
 
-  if test -f "${GPG_HOME}/pubring.gpg~" ; then
-    rm ${GPG_HOME}/pubring.gpg~
-  fi
-
-  #unfortunately I could not spot a good way to detect if the
-  # trustdb does contain useful info
-
 fi
diff -Nru debdelta-0.50+2/debian/rules debdelta-0.55/debian/rules
--- debdelta-0.50+2/debian/rules        2012-11-02 09:56:49.000000000 +0100
+++ debdelta-0.55/debian/rules  2014-11-30 18:31:13.000000000 +0100
@@ -32,10 +32,14 @@
 minigzip: minigzip.c
        $(CC) $(CFLAGS) $(CPPFLAGS) minigzip.c -o minigzip $(LDFLAGS) -lz
 
-build: minibzip2 minigzip
+build-arch: minibzip2 minigzip
        $(checkdir)
        touch build
 
+build-indep:
+
+build: build-arch build-indep
+
 clean:
        $(checkdir)
        rm -f build *~ */*~ debian/files* debian/substvars
diff -Nru debdelta-0.50+2/etc/sources.conf debdelta-0.55/etc/sources.conf
--- debdelta-0.50+2/etc/sources.conf    2011-03-31 11:32:26.000000000 +0200
+++ debdelta-0.55/etc/sources.conf      2014-11-30 18:31:13.000000000 +0100
@@ -23,6 +23,11 @@
 Label=Debian
 delta_uri=http://debdeltas.debian.net/debian-deltas
 
+[backports debian archive]
+Origin=Debian Backports
+Label=Debian Backports
+delta_uri=http://debdeltas.debian.net/debian-deltas
+
 
 [stable security debian archive]
 Origin=Debian

Attachment: signature.asc
Description: Digital signature

Reply via email to