-
Notifications
You must be signed in to change notification settings - Fork 15
Preliminary work on refactoring svn into private functions #12
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
Conversation
Tests passed yesterday :/ Ah, this breaks because #9 |
db-remove
Outdated
|
||
if [[ -d ${WORKDIR}/svn/$pkgbase/repos/$svnrepo ]]; then | ||
remove_pkgs+=($(. "${WORKDIR}/svn/$pkgbase/repos/$svnrepo/PKGBUILD"; echo ${pkgname[@]})) | ||
if remove_pkgs+=($(. source_pkgbuild "${pkgbase}" "repos/${svnrepo}" && echo ${pkgname[@]})); then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have an extra .
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouch. Does this mean we didn't have any testing of this whole script until yesterday :p
5b90230
to
3bb6775
Compare
087de6a
to
5913a8b
Compare
Pushed another commit refactoring lots of the remaining logic, the only thing left is the actual db-move bits for editing the VCS. |
a66b632
to
6626b81
Compare
This has some of the same problems that older versions of #10 had. The first 5 commits of #10 are currently improvements to the test suite, checking for those issues. I'm seeing 7 test failures when I cherry pick them on top of this. Should I submit those as a separate PR, so that you can work on top of them? |
The only one which errors, is See https://github.com/eli-schwartz/dbscripts/commits/lukeshu-pr10-plus-refactor |
So that means that there were several tests whose conditions were failing, but the tests erroneously passed because they were mistakenly written in a way that didn't trigger the err trap when their conditions failed. Put another way, several of your changes broke test-cases that use |
eb63f09
to
b3dca23
Compare
My last commit was flawed, but should be fixed now. |
Obviously, I prefer my approach. But this looks... fine. I have no real objections. |
b3dca23
to
a0bd5c8
Compare
Introduce "db-functions-$VCS" which will eventually contain all VCS-specific code, and make this configurable in config. Move private arch_svn function and svn acl handling here, and introduce a new source_pkgbuild function to handle discovering PKGBUILDs from the configured VCS and sourcing them to extract metadata. The PKGBUILD is the only file we ever check out from version control, and only ever to scrape information from it, except for when we actually want to db-move a whole directory (which is by necessity considerably dependent on the VCS in use). source_pkgbuild is inspired by commits from the dbscripts rewrite, authored by Florian Pritz <bluewind@xinu.at>
As of the source_pkgbuild rewrite, this is only ever done once.
d4b4dd3
to
d6b48bd
Compare
Hopefully one step closer to the dbscripts-rewrite.
/cc @gbsf