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

Have option to *not* upload when using cpan2aur --check #19

Open
harleypig opened this issue Jun 1, 2012 · 10 comments
Open

Have option to *not* upload when using cpan2aur --check #19

harleypig opened this issue Jun 1, 2012 · 10 comments

Comments

@harleypig
Copy link

It makes me nervous to have 'cpan2aur --check' auto upload a new module before I have an opportunity to check it. I don't mind having cpan2aur generate things for me automatically, but I'd rather do at least a quick spot check before uploading to aur.

I haven't made a patch yet, I wanted to get some input first, but it seems like it would be a simple addition. If you're amenable, I'll fork and submit a pull request.

@juster
Copy link
Owner

juster commented Jun 1, 2012

How would you envision the user experience to be? Would the script pause to let you check the package in another terminal? Would the script open up a shell to poke around? Would this be tedious when many packages are being checked? Consider how it would impact people who don't want to check. Just curious. I consider making a good and simple interface more difficult than the coding.

In any case I'm more than happy to let you fix it how you want it. I made cpan2aur for myself and didn't know if anyone used it. I also have another package generator called genpkg that I created to deal with deficiencies in cpan2aur. I'm trying to get it in shape to where others can use it more easily and have been using it myself instead of cpan2aur/C::D::A.

@harleypig
Copy link
Author

I was thinking just adding a --noupload option to --check that would just return from update_if_old right before upload_pkgdir if set. It shouldn't cause any noticeable changes to anyone currently using it.

As for someone with a lot of packages (and it looks like I'm going to end up with a lot because perl doesn't seem to be getting much love) it would just be broken up into a two step process:

cpan2aur --check --noupdate perl-*
# run tests, etc.
for i in perl-*; do cpan2aur --upload $i ; done

@juster
Copy link
Owner

juster commented Jun 1, 2012

Ah okay. In principle I don't like adding more options to solve a problem. Smells too much like feature creep. The less options the better IMO and cpan2aur already has alot.

Could you just make --check only upload if --upload is explicitly specified? That way cpan2aur --check will only build packages that are OOD. and cpan2aur --check --upload will upload packages too. That might actually make more sense and be more predictable behavior in any case.

cpan2aur --upload on everything is kind of wasteful because it will upload everything even if it is not OOD, btw. I suppose it doesn't matter much in the grand scheme of things.

@harleypig
Copy link
Author

I don't see any technical issues with doing --check --upload instead. But it would break the way the program currently handles this and might cause some users some issues.

I hadn't thought about the uploading everything problem ... not sure how to resolve this.

Ideally, cpan2aur --upload would check the current PKGBUILD against what's on AUR and refuse to upload it if they matched, or the local copy was an earlier version. Perhaps --check could drop a temp file in the dir that --upload could use, but now I am getting into feature creep...

If genpkg is more mature this may be a non-issue ...

@juster
Copy link
Owner

juster commented Jun 2, 2012

genpkg actually does less. There is no AUR uploading or version checking but it generates packages better I think.

Yes changing the logic would confuse people but if they are paying attention they will probably figure it out. It's always possible to throw in a warning message or something when only --check is used.

@juster
Copy link
Owner

juster commented Jun 17, 2012

Any progress? Want help? Change your mind?

@harleypig
Copy link
Author

I'm sorry ... a few days after I made this request I hit the perfect storm (work, family and personal tasks) and frankly forgot about this until your bump yesterday.

I just committed and pushed the change I originally experimented with. You can see them at http://goo.gl/wyWWH . After a quick test this morning I see three problems I'm not quite sure how to resolve.

  1. pkgrel wasn't updated the way I've done this in the new PKGBUILD file.

  2. If the type of $thing is file, the upload will occur anyway. I haven't used this aspect of cpan2aur so I only happened to notice it in passing just now. I suspect that the same "if ( $UPLOAD )" idea can be used.

  3. There needs to be some way of checking against what's in the AUR for reporting purposes. Not really critical, I think, but it would certainly be convenient. I'm just not sure how I'd go about doing this.

I'll keep working on it, but my tuits are sparse atm.

@juster
Copy link
Owner

juster commented Jun 20, 2012

That's alright I was just curious. I wanted to be encouraging. I don't have much free time either and just looked over this before bed.

  1. I'm not sure what is going on there with the pkgrel. At first glance there should be no reason that is affected. I'll have to test this later.

  2. Right I noticed that in the code the if block for files was unchanged.

  3. I would suggest creating a new, separate utility for checking the AUR for reporting purpose. I have created the WWW::AUR module that would make something like this easier. I'm not sure what ideas you had but that is my suggestion. I do not want to add a major feature to cpan2aur.

Try to keep the style consistent. I noticed you use two-space indent and have the else on the same line as if's closing bracket. Honestly my style has changed since I wrote cpan2aur and I don't like the style anymore but I would like to keep it consistent.

@harleypig
Copy link
Author

:] I am encourage-able.

I traced execution through ... pkrel is never incremented, but I don't know enough about the internals yet to figure out why.

I added the check to the file type handling, but I haven't actually run anything against that. As for style, I'm not sure how I missed the else setup. I try to match the surrounding code. As for the spacing, well, I was just being lazy. Sorry about that.

I notice you have the ALPM as well. I think I might just use cpan2aur as is until I can get a better understanding of ALPM and WWW::AUR and hack something together (I'm not a fan of CPANPLUS).

@juster
Copy link
Owner

juster commented Jun 21, 2012

Yeah CPANPLUS sucks. ALPM is broke right now, I still haven't updated it. I've updated it like 3 times and I am kind of sick of it. WWW::AUR still works, though.

I'm rewriting cpan2aur right now because I am in a boring class.

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

No branches or pull requests

2 participants