From f05bc7c345cb06e773acce769a35ffc254ae3ce7 Mon Sep 17 00:00:00 2001 From: Caio Marcelo de Oliveira Filho Date: Wed, 7 Feb 2018 12:07:23 -0800 Subject: [PATCH] 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 --- swupd/manifest.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swupd/manifest.go b/swupd/manifest.go index 38135a2..d1e753b 100644 --- a/swupd/manifest.go +++ b/swupd/manifest.go @@ -518,7 +518,7 @@ func linkDeltaPeersForPack(c *config, oldManifest, newManifest *Manifest) error continue } - if !nf.Present() || !nf.Present() { + if !nf.Present() || !of.Present() { continue }