You are not logged in.
To install an application called Yellowcot, typically I have used a Makefile with these lines,
install -m 755 yellowcot /usr/bin
rm -r /usr/share/yellowcot > /dev/null 2>&1
mkdir /usr/share/yellowcot
cp yellowcot.svg /usr/share/yellowcot/.
cp yellowcot.desktop /usr/share/applications/.
The "rm -r" line removes an old installation of the application, if possible. If it's not possible, it's supposed to suppress the error. However, I just tried installing the application on a new Arch setup and got this error,
[root@nikolai yellowcot-1.1.9]# make install
install -m 755 yellowcot /usr/bin
rm -r /usr/share/yellowcot > /dev/null 2>&1
make: *** [install] Error 1
When I took out the "rm -r" line, I didn't have a problem. So my question is, how can I disable error output in a Makefile? Piping it to /dev/null isn't working. Does anyone have any ideas? Thanks!
Last edited by tony5429 (2010-02-27 18:18:54)
Offline
make is probably checking the return codes of the commands rather than seeing if anything goes to stderr. you could probably just do
if test -d /usr/share/yellowcot; then
rm -r /usr/share/yellowcot &>/dev/null
fi
might not work though, I usually use automake so I don't know what I am doing
"You can watch for your administrator to install the latest kernel with watch uname -r" - From the watch man page
Offline
Thanks! PirateJonno's suggestion worked! Ghost1227, the reason Makefile removes the directory if possible is to remove any previous installation (i.e. an old version of the software) before installing the new version. Thanks again!
Offline
Couldn't you just...
rm -rf /usr/share/yellowcot
?
This doesn't really seem appropriate for "make install" to me, anyway. Maybe instead you should advise your users to "make uninstall" on the previous version before installing this one?
Last edited by cmtptr (2010-02-28 16:08:48)
Offline