before, we only set this for regular files, but we better also set this
for block/char devices and fifos also, so we have it for all item types
borg 1.x considers "hardlinkable".
this is important for sequential processing of items in an archive:
if we encounter a hardlinkable item and .source is not set (that
would make it a hardlink slave), it could be a hardlink master or not:
- hardlink_master == False # this item is not part of a hl group
- hardlink_master == True # this item is a hardlink master
This will also be important when items are converted to borg2.
hashindex_index returns the perfect hashtable index, but does not
check what's in the bucket there, so we had these loops afterwards
to search for an empty or deleted bucket.
problem: if the HT were completely filled with no empty and no deleted
buckets, that loop would never end. due to our HT resizing, it can
never happen, but still not pretty.
when using hashindex_lookup (as also used some lines above), the code
is easier to understand, because (after we resized the HT), we freshly
create the same situation as after the first call of that function:
- return value < 0, because we (still) can not find the key
- start_idx will point to an empty bucket
Thus, we do not need the problematic loops we had there.
Modified the checks to make sure we really have an empty or deleted
bucket before overwriting it with data.
Added some additional asserts to make sure the code behaves.
this is an incompatible change:
before:
borg debug put-obj :: path1 path2 ...
(and borg computed all IDs automatically) (*)
after:
borg debug put-obj :: id path
(id must be given)
(*) the code just using sha256(data) was outdated and incorrect anyway.
also: fix error handling in get-obj.
The tests assumed a specific compressed results size, which
is bad, because it might vary depending on the zlib implementation.
Now the "auto" compressor tests just check if it is the same size
as when unconditionally using the zlib compressor.
before the fix, it triggered rechunking if an archive
was created with non-default chunker params.
but it only should rechunk if borg recreate is invoked with explicitly giving --chunker-params=....
using "differenthost" (== not the current hostname) makes
the process_alive check always return True (to play safe,
because in can not check for processes on other hosts).