Skip to content
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

add option to specify local repo outside of clean-chroot #68

Merged
merged 1 commit into from
Mar 22, 2021
Merged

add option to specify local repo outside of clean-chroot #68

merged 1 commit into from
Mar 22, 2021

Conversation

Taijian
Copy link
Contributor

@Taijian Taijian commented Mar 21, 2021

As discussed in #67, here are the changes I made to my local build in order to facilitate my workflow.

This adds an option (defaulting to the current setting) of specifying a name and a location for a local pacman repo. If set in the config, this repo will be used by ccm to store and recall build packages. If unmodified, the current behaviour of ccm persists.

I have tested and used these patches for a bit now and they seem to be working - I use paru with a local repo to manage my AUR packages and my modified ccm build the packages I maintain myself (locally and on the AUR) into that same local repo. Seems to work fine, but I am always open to learning opportunities regarding my ... questionable ... coding skills.

@graysky2
Copy link
Owner

graysky2 commented Mar 22, 2021

  • We will want to add a read/write check to where the user defines REPO= in case he/she makes a typo or defines a path that isn't available. Something like the if used to check for CCACHE might work.
  • Have to adjust syncup function to not run if the custom repo is external.

@graysky2
Copy link
Owner

When you fixed the above, please squash into one commit and force push.

@Taijian
Copy link
Contributor Author

Taijian commented Mar 22, 2021

Ah, sorry, did not see your comment regarding syncup() before pushing, will do that then try again.

@graysky2
Copy link
Owner

Now that I've had some coffee, this is going to require a significant modification since the check function and others makes assumptions about having the repo internally located. For example, if there isn't a buildroot, but there is an external repo, running the l or d options would fail. Need to think about this more.

@Taijian
Copy link
Contributor Author

Taijian commented Mar 22, 2021

Well, I guess that depends on how much handholding of users you want to do. I think there's three options:

  1. Just remove check2() from l and d. repocheck() will still check whether or not the repo exists before trying to read/manipulate it. Downside: Users who try to use the default config will get the "wrong" error message if they failed to create the chroot so far.
  2. Leave as is. This will error out for people trying to check on the content of their local repo with ccm without creating a chroot first, even though having a chroot is not strictly necessary for checking on the repo. On the other hand, one could argue that ccm is not meant to be a package manager, but a chroot manager, so simply creating a chroot in order to properly use it might be an acceptable ask.
  3. Come up with more code to accomodate both use cases by being able differentiate between the two and give the "correct" error message in each case.

Your call, you are the maintainer :-)

@graysky2 graysky2 closed this in 1d135b4 Mar 22, 2021
@graysky2
Copy link
Owner

graysky2 commented Mar 22, 2021

Please pull from master and test. More testing needs to take place.

EDIT: dammit, I'm not sure how to cause github to credit you with the initial commit from this without formally merging it. I will have to play with it.

@graysky2 graysky2 reopened this Mar 22, 2021
@graysky2 graysky2 merged commit 5120d98 into graysky2:master Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants