]> arthur.barton.de Git - bup.git/commitdiff
Officially drop support for Python 2.4.
authorRob Browning <rlb@defaultvalue.org>
Mon, 18 Feb 2013 20:42:34 +0000 (14:42 -0600)
committerRob Browning <rlb@defaultvalue.org>
Fri, 1 Mar 2013 01:44:18 +0000 (19:44 -0600)
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Alexander Barton <alex@barton.de>
README.md
cmd/midx-cmd.py
lib/bup/git.py
lib/bup/helpers.py

index 29b096e8daec55ccb6664f61f6720326a68cb549..0b740ec42c1cacc0ed1f8ad43af7fe6867686171 100644 (file)
--- a/README.md
+++ b/README.md
@@ -71,7 +71,7 @@ Reasons you might want to avoid bup
    for you, but we don't know why.  It is also missing some
    probably-critical features.
    
- - It requires python >= 2.4, a C compiler, and an installed git version >=
+ - It requires python >= 2.5, a C compiler, and an installed git version >=
    1.5.3.1.
  
  - It currently only works on Linux, MacOS X >= 10.4,
@@ -99,9 +99,8 @@ From source
             apt-get install python-pyxattr python-pylibacl
             apt-get install linux-libc-dev
 
-   Substitute python2.5-dev or python2.4-dev if you have an older
-   system.  Alternately, on newer Debian/Ubuntu versions, you can try
-   this:
+   Substitute python2.5-dev if you have an older system.  Alternately,
+   on newer Debian/Ubuntu versions, you can try this:
     
             apt-get build-dep bup
 
index bbbee079f6097b6083f1ba60571aa8ee3499a04d..1243c8d5e63b6f65531a4beb8ee3b491f6486a62 100755 (executable)
@@ -123,7 +123,7 @@ def _do_midx(outdir, outfilename, infilenames, prefixstr):
     count = merge_into(fmap, bits, total, inp)
     del fmap
 
-    f.seek(0, git.SEEK_END)
+    f.seek(0, os.SEEK_END)
     f.write('\0'.join(allfilenames))
     f.close()
     os.rename(outfilename + '.tmp', outfilename)
index 671be137ae760d36dc45804db14dc6523d5aa7a5..ad4668b2a388a423ad6dcb4ae12c93e3066ef0c5 100644 (file)
@@ -8,7 +8,6 @@ from bup import _helpers, path, midx, bloom, xstat
 
 max_pack_size = 1000*1000*1000  # larger packs will slow down pruning
 max_pack_objects = 200*1000  # cache memory usage is about 83 bytes per object
-SEEK_END=2  # os.SEEK_END is not defined in python 2.4
 
 verbose = 0
 ignore_midx = 0
@@ -662,7 +661,7 @@ class PackWriter:
         idx_f.truncate(ofs64_ofs)
         idx_f.seek(0)
         idx_map = mmap_readwrite(idx_f, close=False)
-        idx_f.seek(0, SEEK_END)
+        idx_f.seek(0, os.SEEK_END)
         count = _helpers.write_idx(idx_f, idx_map, idx, self.count)
         assert(count == self.count)
         idx_map.close()
index fad48faa5f5f8db577f3920751a06977a86da218..d3eea3777676294a04c25e57e5ae0503ecd2919b 100644 (file)
@@ -1,7 +1,7 @@
 """Helper functions and classes for bup."""
 
 import sys, os, pwd, subprocess, errno, socket, select, mmap, stat, re, struct
-import heapq, operator, time, platform, grp
+import hashlib, heapq, operator, time, platform, grp
 from bup import _version, _helpers
 import bup._helpers as _helpers
 
@@ -800,18 +800,7 @@ def grafted_path_components(graft_points, path):
             return result
     return path_components(clean_path)
 
-# hashlib is only available in python 2.5 or higher, but the 'sha' module
-# produces a DeprecationWarning in python 2.6 or higher.  We want to support
-# python 2.4 and above without any stupid warnings, so let's try using hashlib
-# first, and downgrade if it fails.
-try:
-    import hashlib
-except ImportError:
-    import sha
-    Sha1 = sha.sha
-else:
-    Sha1 = hashlib.sha1
-
+Sha1 = hashlib.sha1
 
 def version_date():
     """Format bup's version date string for output."""