-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api: add add_external_repo and rm_external_repo #1902
Conversation
We already have a remove repo if unused function. You should extend that to remove the key if used as well. Line 214 in d20a633
|
I just made a few changes. If everything looks good, I can go ahead and change the scripts for each of the apps that need the functions in this branch, so we can get it all done at once. |
Alright @theofficialgman I changed the Just in case the repo would need to be removed no matter what, I added a |
this might be overkill, but spaces are not allowed in apt repo at minimum some documents should be made to specify that reponame (the second input) should never contain spaces |
I added a check for spaces and updated documentation. |
marking this as draft since I have been doing some testing and found that some repos need the signed-by to specify the key location, and some others don't need dearmor (depending on if the key is hardened or not)... this is going to be complicated to do universally because of this and it might be best to have a set of guidelines and something done on a script by script basis extensive documentation here: https://wiki.debian.org/DebianRepository/UseThirdParty if you read the documentation, you will find that repo/keyname combination is also standardized, so we need to use this as well instead of making out own format |
Deb822 format (.sources) has been supported for many years now (and all modern distros are switching to it) and it is probably best that if we were to add functions for adding and removing repos that we also do this with the Deb822 format rather than the older .list format. One nice thing about deb822 is it supported external public key files as well as embedding the public key directly within the .sources file. |
9aa632b
to
e523164
Compare
I have revived this PR. |
This comment was marked as outdated.
This comment was marked as outdated.
8b08d49
to
b290182
Compare
I have switched all applications that can be switched to use these generic functions. The other applications (vivaldi and brave) cannot use these generic functions as they use their own custom non-standard key and repofile names and update them themselves as part of other debs. |
786afc6
to
fa0c563
Compare
fa0c563
to
39b5c7c
Compare
39b5c7c
to
a1367e5
Compare
A new test case (based on deb822 edits): add_external_repo "adoptium" "https://adoptium.jfrog.io/artifactory/api/security/keypair/default-gpg-key/public" "https://adoptium.jfrog.io/artifactory/deb" "bionic" "main" || exit 1
rm_external_repo "adoptium" || exit 1 # this will remove the repo if nothing is used in it
rm_external_repo "adoptium" "force" || exit 1 # this will remove the repo even if software is installed from it the original test case now becomes: add_external_repo "box64" "https://ryanfortner.github.io/box64-debs/KEY.gpg" "https://ryanfortner.github.io/box64-debs/debian" "./" || exit 1
rm_external_repo "box64" || exit 1 # this will remove the repo if nothing is used in it
rm_external_repo "box64" "force" || exit 1 # this will remove the repo even if software is installed from it |
0fb8d39
to
241a8e0
Compare
…_repo` also extend `remove_repofile_if_unused` to be able to read .sources files in addition to .list files
241a8e0
to
cb85f59
Compare
@ryanfortner thanks for your original contribution! I will merge the current iteration of this PR. Sorry it took so long to get back around to this. Between when this PR was opened and now pi-apps moved documentation from this repo to our website so I will rewrite that information there soon. |
As suggested in #1889, this is a function that adds external apt repositories when provided:
https://ryanfortner.github.io/box64-debs/debian ./
)box64
)https://ryanfortner.github.io/box64-debs/KEY.gpg
)Example of the usage of these functions:
This is my first try at creating a function for pi-apps and I would appreciate any feedback I receive!