Skip to content
  • anonym's avatar
    Use a more (line) diff friendly way to store the uBlock Origin database dump. · 6ffd8e94
    anonym authored
    The command I used for generating our dump was:
    
        echo '.dump' | sqlite3 ublock0.sqlite | \
          grep -v "cached_asset_content://cache://compiled-" | \
          awk '!/^INSERT/; /^INSERT/ {print $0 | "sort -n"}' | \
          sed 's_\\n_\\n\r\n_g' | \
          sed "/^INSERT INTO \"settings\" VALUES('\(remoteBlacklists\|cached_asset_entries\)'/"'s_,_,\r\n_g' > \
          config/chroot_local-includes/usr/share/tails/ublock-origin/ublock0.dump
    
    The idea is to split lists (including huge strings with escaped
    newlines) into separate lines, leaving a CRLF at the end of the line
    as a marker -- removing these markers completely restores the file. We
    also have to sort the "INSERT" lines since uBlock Origin doesn't save
    them in the same order.
    6ffd8e94