You are not logged in.
I have a project (using git) that contains a set of packages under a tree
such as repo/core/base/kernel26. Using the normal Arch kernel26 PKGBUILD
to build the Linux kernel 2.6.23 runs a script (something
like src/linux-2.6.23/scripts/setlocalversion) that contains (at lines 18-21):
# Are there uncommitted changes?
if git diff-index HEAD | read dummy; then
printf '%s' -dirty
fi
Now the kernel26/PKGBUILD near the bottom (line 282 in 2.6.23-1) edits
in-place the $startdir/kernel26.install script. So building the project
seems to invariably create a kernel with a local version of -dirty!!
I understand that this is not really an ARCH problem, but I am asking
for advice on what to do about this. If I were subscribed to the Linux
Kernel Mail List, I should probably mention the first issue there.
1) I wonder if there is a technique to prevent 'git diff-index HEAD' from
traversing all the way up the tree to the toplevel git repository.
2) I wonder if there is an easy way to change the PKGBUILD so that it need
not edit the kernel26.install script if it is already correct.
Thanks for your consideraton.
rdt
Offline
Thank cactus for this:
Drop an empty git repo in there, say:
build () {
cd $startdir/src
git init
...continue on...
git will not recurse any higher, and will find no uncommitted changes
Offline
thanks, phrakture, where would that go? Say in the repo dir?
Offline
I'm saying - stick that "git init" into the actual PKGBUILD. Just make a git repo *somewhere* up the chain. I'd use $startdir/src just to cover all bases and prevent random cruft from sneaking into the real src directory, or are you using the raw PKGBUILD from abs?
Offline
PKGBUILD came from abs a few days ago - 2.6.23-1 instead of the current 2.6.23-8
making the $startdir/src be a git repo will indeed stop the localversion becoming -dirty, but won't effect the upper git repo having unchecked in changes because of the edit in-place of kernel26.install unless I put one "up above" it also, right?
Offline
Ah I didn't get that the kernel26.install thing was an issue as well. I'm sure you could modify the PKGBUILD so that it only sed's the file when needed. That'd fix that one, and probably be better in the long run for us as well.
Offline
Ok, thanks, phrakture. I _really_ appreciate your comments.
Offline