You are not logged in.
The problem I'm having is a systemd unit in my PKGBUILD is trying to reference the wrong location with
ExecStart=/usr/local/bin/${pkgname}
instead of
ExecStart=/usr/bin/${pkgname}
The file i'm trying to edit is in "${pkgname}-${pkgver}/init/${pkgname}.service"
sed -i 's:ExecStart=/usr/local/bin/${pkgname}:ExecStart=/usr/bin/${pkgname}:' "init/${pkgname}.service"
and then install it
install "init/${pkgname}.service" "${pkgdir}/etc/systemd/system/${pkgname}.service"
but while sed changes the original file, the file that gets copied to "${pkgdir}/etc/systemd/system/" is empty. What am I doing wrong?
package() {
cd "${pkgname}-${pkgver}"
sed -i 's:ExecStart=/usr/local/bin/${pkgname}:ExecStart=/usr/bin/${pkgname}:' "init/${pkgname}.service"
install "init/${pkgname}.service" "${pkgdir}/etc/systemd/system/${pkgname}.service"
# Other stuff
}
Offline
This wouldn't lead to an empty file, but your sed command definitely will not work. The pkgname variable will not be expanded in single quotes.
If you post the full PKGBUILD we will be able to test too.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
This wouldn't lead to an empty file, but your sed command definitely will not work. The pkgname variable will not be expanded in single quotes.
If you post the full PKGBUILD we will be able to test too.
Whoops, my original wasn't using a variable. I'm getting the original edited correctly, but in the directory "pkg" that's made, the file "${pkgdir}/etc/systemd/system/${pkgname}.service" is empty. The pkg directory should show the final version, right?
Offline
Crap. The "pkg" directory isn't the final version. I tried installing my package and it worked.
Thanks for your help.
Offline