diff --git a/debdelta b/debdelta
index 8be8c27..946999f 100755
--- a/debdelta
+++ b/debdelta
@@ -529,6 +529,8 @@ def _delta_info_unzip_(TD):
     system('gunzip PATCH/patch.sh.gz',TD)
   elif os.path.exists(TD+'PATCH/patch.sh.bz2'):
     system('bunzip2 PATCH/patch.sh.bz2',TD)  
+  elif os.path.exists(TD+'PATCH/patch.sh.lzma'):
+    system('unlzma PATCH/patch.sh.lzma',TD)
 
 def get_info_slow(delta,T=None):
   if T:
@@ -844,8 +846,11 @@ def do_patch_(delta,olddeb,newdeb, TD, info=None, diversions=None):
         ar_list_old= list_ar(TD+'OLD.file')
         if 'data.tar.bz2' in ar_list_old:
           system('ar p '+TD+'OLD.file data.tar.bz2 | tar -x --bzip2 -p -f - -C '+TD+'OLD/DATA', TD)
-        else:
+        elif 'data.tar.gz' in ar_list_old:
           system('ar p '+TD+'OLD.file data.tar.gz | tar -x -z -p -f - -C '+TD+'OLD/DATA', TD)
+        elif 'data.tar.lzma' in ar_list_old:
+          system('ar p '+TD+'OLD.file data.tar.lzma | unlzma | tar -x -p -f - -C '+TD+'OLD/DATA', TD)
+        else: assert(0)
         _fix_data_tree_(TD)
     elif 'old-control-tree' == a:
         if olddeb == '/':
@@ -1118,6 +1123,12 @@ def do_delta_(olddeb,newdeb,delta,TD):
         script.write('bzip2 '+f+'\n')
       f=f[:-4]
       c='.bz2'
+    elif f[-5:] == '.lzma' :
+      system('unlzma '+f,TD)
+      if in_script_as_well or ( in_script_as_well == None and f[:3] != 'NEW' ):
+        script.write('unlzma '+f+'\n')
+      f=f[:-5]
+      c='.lzma'
     else: assert(0)
     return (f,c)
 
@@ -1127,6 +1138,8 @@ def do_delta_(olddeb,newdeb,delta,TD):
       script.write("$echo  '"+ s +"' >> "+n+cn +' && ./minigzip -9 < '+n+' | tail -c +'+str(len(newhead)+1)+' >> '+n+cn+' && rm '+n+' \n')
     elif  cn == '.bz2' :
       script.write(' ./minibzip2 -9 < '+n+' >> '+n+cn+' && rm '+n+' \n')
+    elif cn == '.lzma' :
+      script.write('lzma -9 < '+n+' >> '+n+cn+' && rm '+n+' \n')
     else: assert(0)
 
   def delta_files__(o,n,p,algo='bsdiff'):
@@ -1807,6 +1820,9 @@ def do_delta_(olddeb,newdeb,delta,TD):
         info.append('needs-minibzip2')
         def x():
           return os.popen('cd '+TD+'; ar p OLD.file '+name+' | bzip2 -cd')
+      elif name[-5:] == '.lzma' :
+        def x():
+          return os.popen('cd '+TD+'; ar p OLD.file '+name+' | unlzma -c')
       else: assert(0)
       delta_tar(x,n,'DATA',old_conffiles,old_md5,new_md5,\
                 debdelta_conf_skip=debdelta_conf_skip)
@@ -1847,14 +1863,18 @@ def do_delta_(olddeb,newdeb,delta,TD):
   patchsize = os.stat(TD+'PATCH/patch.sh')[ST_SIZE]
   v=''
   #if VERBOSE > 1 :v ='-v' #disabled... it does not look good inlogs
+  patch_files = []
+  system('lzma -q -9 -k '+v+' PATCH/patch.sh', TD)
+  patch_files.append((os.path.getsize(TD+'PATCH/patch.sh.lzma'), 'lzma', 'patch.sh.lzma'))
   system('bzip2 -q --keep -9  '+v+'  PATCH/patch.sh', TD)
-  system('gzip -q -9 -n '+v+' PATCH/patch.sh', TD)  
-  if  os.path.getsize(TD+'PATCH/patch.sh.gz') > os.path.getsize(TD+'PATCH/patch.sh.bz2') :
-    if VERBOSE > 1 : print '  bzip2 wins on patch.sh  '
-    patch_append('patch.sh.bz2')
-  else:
-    if VERBOSE > 1 : print '  gzip wins on patch.sh  '
-    patch_append('patch.sh.gz')
+  patch_files.append((os.path.getsize(TD+'PATCH/patch.sh.bz2'), 'bzip2', 'patch.sh.bz2'))
+  system('gzip -q -9 -n '+v+' PATCH/patch.sh', TD)
+  patch_files.append((os.path.getsize(TD+'PATCH/patch.sh.gz'), 'gzip', 'patch.sh.gz'))
+
+  # Use the smallest compressed patch.sh
+  patch_files.sort()
+  if VERBOSE > 1 : print ' '+patch_files[0][1]+' wins on patch.sh'
+  patch_append(patch_files[0][2])
   
   #OK, OK... this is not yet correct, since I will add the info file later on
   elaps =  time.time() - start_sec
diff --git a/debian/control b/debian/control
index 597a7e6..dc37214 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Standards-Version: 3.7.3
 
 Package: debdelta
 Architecture: any
-Depends: python, xdelta, bsdiff, bzip2, ${shlibs:Depends}
+Depends: python, xdelta, bsdiff, bzip2, lzma, ${shlibs:Depends}
 Recommends: python-apt, xdelta3
 Description: diff and patch utilities which work with Debian packages
  debdelta is a program suite designed to compute changes between
