You are not logged in.
Pages: 1
I build -git packages rather often. To ensure they are build against the latest version of their deps I increase the pkgrel by 1 before starting build .
This goes like follows (from within the directory the PKGBUILD resides in)
nano PKGBUILD
adjust cursor until pkgrel is reached
increase value by 1
save
close
if I was replacing one value with another, sed would be first choice.
Which tools are usable to increase an integer value inside of a file ?
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Not used it myself, but 'pkgctl build' has a '--rebuild' flag which claims to do this: https://man.archlinux.org/man/pkgctl-bu … LD_OPTIONS
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Thanks, but last time I checked pkgctl-build doesn't support custom pacman.conf and/or makepkg.conf.
I use makepkg and graysky' Clean Chroot Manager .
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
sed -i -r 's/pkgrel=([0-9]+)/echo "pkgrel=$((\1+1))"/ge' PKGBUILDStolen and adapted from https://stackoverflow.com/questions/143 … th-sed-awk
Offline
awk -F= '!/^pkgrel/;/^pkgrel/{print "pkgrel=" $2+1;}' PKGBUILDThough if you know that pkgrel is never greater than 8, a simpler version could work:
sed '/^pkgrel/y/012345678/123456789/' PKGBUILDBut if you are doing this regularly, I doubt it is safe to assume the pkgrel remains that low.
But this really isn't needed. Just rebuild the package with makepkg. What do you think incrementing pkgrel does for you that simply running `makepkg -f` would not? Contrary to your claim, increasing the pkgrel has no effect on whether or not the package is built against the newest version of the dependencies: it is build against whatever is installed on the build machine completely independent of what the pkgrel is set to.
Last edited by Trilby (2024-05-14 12:55:32)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
What do you think incrementing pkgrel does for you that simply running `makepkg -f` would not? A1 = installed version, A2 = new version .
The situation i want to prevent is this :
A has dependencies that have been updated with invasive changes
A upstream has no new commits
using makepkg -f will force a rebuild but not change pkgver / pkgrel . this produces A2 .
A2 is added to custom repo , run pacman -Syu .
A1 and A2 have same pkgver.pkgrel >> pacman sees no reason to upgrade.
increasing pkgrel when I know / strongly suspect dep changes require rebuild is the simplest way to ensure pacman will note the difference between A1 and A2.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Ah yes, increasing the pkgrel is called for here for deploying the package to a repo to be used by others.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Not perfect but maybe helps: rebuild-detector
Offline
It does help, but detects soname changes .
Some (many ?) projects don't change sonames between releases but do break stuff in trunk.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
The sed command from #4 works, the awk command from #5 outputs the new PKGBUILD content to standard output, but doesn't change the PKGBUILD.
But if you are doing this regularly, I doubt it is safe to assume the pkgrel remains that low.
correct, at one time pkgrel was 12 for one of those packages.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
the awk command from #5 outputs the new PKGBUILD content to standard output, but doesn't change the PKGBUILD.
Well of course not - that's how awk and sed work. Sed has the -i flag which just outputs to a temporary file then moves the file back in place all behind the scenes. Allegedly, gnu's awk can have a similar behavior with the "-i inplace" passed on the command line - or you could just move the new content into place as a separate step:
awk -F= '!/^pkgrel/;/^pkgrel/{print "pkgrel=" $2+1;}' PKGBUILD > tmp
mv tmp PKGBUILD
# or, only with gnu's awk:
awk -i inplace -F= '!/^pkgrel/;/^pkgrel/{print "pkgrel=" $2+1;}' PKGBUILD"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Pages: 1