Re-write repo-add in V #1

Closed
opened 2022-01-09 22:38:43 +01:00 by Jef Roosens · 3 comments

The repo-add source code is "just" a 600 line shell script, but a lot of time is spent parsing arguments etc. This means that it shouldn't be too much work to re-write this in V, with the goal of completely removing any os.execute calls.

Advantages

  • Cleaner than just running a shell script
  • Ability to run inside non-Arch container
  • More granular control over when to lock -> better performance

Tasks

  • Retrieve .PKGINFO & files list from package archive
  • Export serialized .PKGINFO & files into desc & files
  • Check if package is already present
  • Check if newer package is already present
  • Calculate md5, sha256 & filesize of new packages
The repo-add [source code](https://gitlab.archlinux.org/pacman/pacman/-/blob/master/scripts/repo-add.sh.in) is "just" a 600 line shell script, but a lot of time is spent parsing arguments etc. This means that it shouldn't be too much work to re-write this in V, with the goal of completely removing any os.execute calls. ## Advantages * Cleaner than just running a shell script * Ability to run inside non-Arch container * More granular control over when to lock -> better performance ## Tasks - [ ] Retrieve .PKGINFO & files list from package archive - [ ] Export serialized .PKGINFO & files into desc & files - [ ] Check if package is already present - [ ] Check if newer package is already present - [ ] Calculate md5, sha256 & filesize of new packages

Another big advantage of this would be the ability to run this program without having to rely on an archlinux Docker image. This would make the images much more reliable and a lot smaller.

Another big advantage of this would be the ability to run this program without having to rely on an archlinux Docker image. This would make the images much more reliable and a lot smaller.
Jef Roosens added this to the (deleted) milestone 2022-01-12 09:13:50 +01:00
Jef Roosens added the
enhancement
label 2022-01-12 09:47:51 +01:00

Having this completely inside the binary will require us to link libarchive, as we need the bsdtar functionality.

Having this completely inside the binary will require us to link [libarchive](https://libarchive.org/), as we need the bsdtar functionality.

We might be able to make our repo-add implementation more efficient by not always deleting the unpackages directories after adding a package to the repository. This would take up a bit more space, but it's just text, so it's not much of an issue.

We might be able to make our repo-add implementation more efficient by not always deleting the unpackages directories after adding a package to the repository. This would take up a bit more space, but it's just text, so it's not much of an issue.
Jef Roosens added this to the 0.1.0 milestone 2022-01-13 20:55:44 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vieter-v/vieter#1
There is no content yet.