[aur-general] My AUR4 migration workflow
Generate .SRCINFO for all packages:
$ while read p; do git -C "$p" filter-branch -f --tree-filter "test -f .SRCINFO || mksrcinfo"; done < ../pkgs
Don't do it like that. This creates a .SRCINFO from the first PKGBUILD of the package and doesn't update the file for later commits anymore. So your .SRCINFO is outdated in all following commits.
The problem was in one of the scripts linked in the wiki but is fixed there, too.
So don't test for .SRCINFO, *always* run mksrcinfo.
Hmm. Instinctively I'd have agreed, but I can't reproduce this.
I think git filter-branch actually checks out each "vanilla" commit from the original branch to apply the given changes, and doesn't base them on the already-changed commits.
I actually didn't know that and it does sound very weird. If the next commit is not based on the previous commit this can potentially "revert" the change made in the previous commit. Although it is difficult to construct a case where this is a problem. (like checking if the commit is the root and only making the change in that case) Thanks for the tests and information. I didn't test this myself, but I was sure just running mksrcinfo works as expected and I was afraid that checking for the file can be *very* wrong. And like mentioned, I was pretty sure filter-branch had to work like I imagined. Like Eli said: There is also no need for the test. mksrcinfo is fairly lightweight (only getting info from PKGBUILD) and doesn't build the whole package or similar. (which is probably the other fear that makes people test for .SRCINFO before creating it) -- JonnyJD
On Fri, Jun 12, 2015 at 3:37 AM, Johannes Dewender <arch@jonnyjd.net> wrote:
I actually didn't know that and it does sound very weird. If the next commit is not based on the previous commit this can potentially "revert" the change made in the previous commit. Although it is difficult to construct a case where this is a problem. (like checking if the commit is the root and only making the change in that case)
Thanks for the tests and information. I didn't test this myself, but I was sure just running mksrcinfo works as expected and I was afraid that checking for the file can be *very* wrong. And like mentioned, I was pretty sure filter-branch had to work like I imagined.
Like Eli said: There is also no need for the test. mksrcinfo is fairly lightweight (only getting info from PKGBUILD) and doesn't build the whole package or similar. (which is probably the other fear that makes people test for .SRCINFO before creating it)
-- JonnyJD
Well, filter-branch is meant to be a scalpel. It's easy enough to change things for all commits, and it's easy also to add something in just one commit -- in case anyone ever needs to do that. So why not let people? It is a powerful tool, not to be confused with rebase. Rebase is probably more your friend. ;) -- Eli Schwartz
participants (2)
-
Eli Schwartz
-
Johannes Dewender