Subject: [alpine-devel] Moving packages between repositories break systems

From: Alba Pompeo <[email-masked]>
Date: Thu, 25 Aug 2016 23:15:11 -0300

When a package is moved from /testing to /community or /testing to
/unmaintained out of nowhere, users experience system breakage.

That's because it loses the pinning.

What can be done to prevent this?
Post-scripts when a package is moved?

ANOTHER NOTE: someone was asking on IRC today why apk suddenly showed
the error that "xmlstarlet-1.6.1-r0: package mentioned in index not
found" out of nowhere. It's because it moved across repositories, the
same issue from above. But there's something even more weird on this
one. It moved from /testing to /unmaintained! Why? The xmlstarlet
package is in the latest version and has a clear maintainer (Francesco
Colista). Why did it go to unmaintained instead of community? Anyway,
that's a matter for another post. Let's focus on how to solve the main
problem.

tl;dr - how to make apk aware of packages that were moved from one
repository to another.

Ciao!

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Timo Teras <[email-masked]>
Date: Fri, 26 Aug 2016 11:04:02 +0300

On Thu, 25 Aug 2016 23:15:11 -0300

> Post-scripts when a package is moved?

Do you have example logs?

I remember seeing something similar before. And the actual cause was
that abuild and/or lua-aports did not update the index when repository
was updated with package removals only. This left index having stale
entries.

This said, lua-aports fix might be as simple as:

diff --git a/buildrepo.lua b/buildrepo.lua
index c665711..bf0f39a 100755
--- a/buildrepo.lua
+++ b/buildrepo.lua
@@ -239,7 +239,7 @@ for _,repo in pairs(args) do
        end
 
        -- generate new apkindex
-       if not opts.n and built > 0 then
+       if not opts.n and (built > 0 or deleted > 0) then
                info("Updating apk index")
                apkrepo.update_index(("%s/%s"):format(repodest, repo),
                                abuild.arch, db:git_describe())

---