swupd: fix typo in linking logic for packs

We need to check that both old and new file are present to link them
when linking files with the same name.

We were not hitting issues because of the earlier check for hashes
matching. If the old file was deleted, the old hash would either be
all zeros (not match) or will be the same hash as another file we
renamed to in the old manifest (unlikely to match this new file, but
possible).

Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
This commit is contained in:
Caio Marcelo de Oliveira Filho
2018-02-07 13:47:31 -08:00
committed by Matthew Johnson
parent 6c2712c794
commit f05bc7c345
+1 -1
View File
@@ -518,7 +518,7 @@ func linkDeltaPeersForPack(c *config, oldManifest, newManifest *Manifest) error
continue
}
if !nf.Present() || !nf.Present() {
if !nf.Present() || !of.Present() {
continue
}