1. 27 Apr, 2019 1 commit
  2. 22 Apr, 2019 1 commit
  3. 18 Apr, 2019 7 commits
  4. 16 Apr, 2019 3 commits
  5. 15 Apr, 2019 3 commits
    • Niels Thykier's avatar
      cruft-report: Refactor to improve looping over dicts · 9a4d7e56
      Niels Thykier authored
      This commit aims to pre-empty some of the 2to3 delta while also
      using more concise constructs.
      Examples include:
         y = x.keys()
      is rewritten into:
         y = sorted(x.keys(), ...)
      (Except in one case, where we really wanted "max" rather than "sort".)
      Signed-off-by: Niels Thykier's avatarNiels Thykier <niels@thykier.net>
    • Niels Thykier's avatar
      Replace most calls to "map" with comprehensions · 6e24f59a
      Niels Thykier authored
      They are compatible with python2 + python3 and the 2to3 rewrite will
      do a similar transformation.  However, with this rewrite, we can
      improve the generated results a bit to avoid some suboptimal cases
      while also reducing the delta for the py2 and py3 variants of dak.
      As an example:
          filelist = []
          for ... in ...:
              filelist += map(lambda x: os.path.join(r, x),
                               filter(lambda x: x.endswith('.changes'), f))
      Here 2to3 offers the following rewrite:
          filelist = []
          for ... in ...:
              filelist += [os.path.join(r, x) for x in [x for x in f if x.endswith('.changes')]]
      But this is performance-wise much better written as:
           filelist = []
           for ... in ...:
               filelist.extend(os.path.join(r, x) for x in f if x.endswith('.changes'))
      The original code and the 2to3 variant produces a lot of temporary
      lists only to discard them again (in python2 filter + map generates a
      list each).  In the optimized variant, we avoid all the temporary
      lists by using a generator-comprehension.
      Signed-off-by: Niels Thykier's avatarNiels Thykier <niels@thykier.net>
    • Niels Thykier's avatar
      Rewrite some uses of keys() in if-statements · fb37242e
      Niels Thykier authored
      This rewrites the following statements:
          if a in b.keys():
          if a in b:
      At the moment, both variants are cheap (i.e. O(1)) operations.
      However, the 2to3 will blindly rewrite the former into a more
      expensive variant, namely:
          if a in list(b.keys()):
      Sadly, this becomes O(|b|) as __contains__ on a list is a lot more
      expensive than it is on a directory/set-like structure.
      Signed-off-by: Niels Thykier's avatarNiels Thykier <niels@thykier.net>
  6. 13 Apr, 2019 1 commit
  7. 06 Apr, 2019 1 commit
  8. 03 Apr, 2019 8 commits
  9. 29 Mar, 2019 1 commit
  10. 24 Mar, 2019 1 commit
  11. 30 Jan, 2019 2 commits
  12. 25 Jan, 2019 2 commits
  13. 13 Jan, 2019 3 commits
  14. 12 Dec, 2018 1 commit
    • Guillem Jover's avatar
      Stop requiring a Binary field in .changes files in the database · d48ebfac
      Guillem Jover authored
      The changes table requires a not NULL binaries column. But we should not
      be requiring a Binary field for source-only uploads. There have been
      other changes to accommodate that, but the schema still requires the
      values, and uploading such .changes files returns this misleading
      rejection message:
        source_version_arch.changes is already known.
      from daklib/archive.py:_install_changes() due to an exception when
      inserting the DBChange() into the database.
  15. 23 Oct, 2018 1 commit
    • Emilio Pozuelo Monfort's avatar
      process-upload: catch InvalidChangesException · 5d4721ff
      Emilio Pozuelo Monfort authored
      Creating a Changes object doesn't parse it immediately, so we
      were not catching InvalidChangesException here. Force the
      parsing so we can detect invalid changes and stop processing
      them, otherwise process-upload explodes and no further changes
      are processed after the broken one.
  16. 20 Sep, 2018 1 commit
  17. 18 Sep, 2018 2 commits
  18. 17 Sep, 2018 1 commit