Closed StarterX4 closed 8 months ago
Hey @StarterX4 thanks for raising the issue. I'm sorry about your data loss. I'll see if I can reproduce this issue. It looks like it should be fairly straightforward.
So I can't reproduce it, but I notice I also don't get the error either.
Can you please give me the output from repoctl version
. Please redact any part of the configuration you don't want to expose.
[starterx4@doadgrz ~]$ repoctl version
repoctl version 0.21 (30 August, 2020)
Copyright 2016-2020, Ben Morgan <cassava@iexu.de>
You may find repoctl on the Internet at
https://github.com/cassava/repoctl
Please report any bugs you may encounter.
The source code of repoctl is licensed under the MIT license.
Current configuration:
columnate = false
color = "auto"
quiet = false
current_profile = "stx4-x64"
default_profile = "stx4-x64"
[profiles.stx4-any]
repo = "/run/user/1000/keybase/kbfs/public/starterx4/repos/arch/any/stx4/stx4-any.db.tar.zst"
add_params = []
rm_params = []
ignore_aur = []
require_signature = false
backup = false
backup_dir = ""
interactive = false
pre_action = ""
post_action = "cd /run/user/1000/keybase/kbfs/public/starterx4/repos/arch/any/stx4/; rm stx4-any.{db,files}; cp stx4-any.db.tar.zst stx4-any.db; cp stx4-any.files.tar.zst stx4-any.files"
[profiles.stx4-x64]
repo = "/run/user/1000/keybase/kbfs/public/starterx4/repos/arch/x86_64/stx4/stx4-x86_64.db.tar.zst"
add_params = []
rm_params = []
ignore_aur = []
require_signature = false
backup = false
backup_dir = ""
interactive = false
pre_action = ""
post_action = "cd /run/user/1000/keybase/kbfs/public/starterx4/repos/arch/x86_64/stx4/; rm stx4-x86_64.{db,files}; cp stx4-x86_64.db.tar.zst stx4-x86_64.db; cp stx4-x86_64.files.tar.zst stx4-x86_64.files"
@cassava I can reproduce this repeatedly (albeit with a different unknown field, namely xdata
as written by makepkg 6.1.0).
To reproduce, try building a split package with makepkg 6.1.0 and adding it to a non-empty repo with repoctl add
.
(Note that this is on the 0.21 release, not master. The master seems to verify the file prior to any operations on the repository.)
Okay, so what happens is this encounters an error and returns nothing (empty pkgs
), but also no error (because it is eaten by the handler):
Then, when this function receives an empty list, it returns all packages in the directory:
And then we happily delete every file because we treat the returns of Repo.ReadNames()
as similar packages.
Thanks @intelfx for your stellar analysis. I'll get onto creating a fix for this ASAP!
Take a look at #73, I believe I have a fix there.
Repoctl wiped my whole repo because one package (rebuilt with fakepkg) contained "base" (same as the package name) entry in the .PKGINFO.