You are not logged in.

#1 2014-10-20 21:58:55

GreenRaccoon23
Member
Registered: 2014-09-27
Posts: 33

Problem Creating .install File for AUR Package

I uploaded an icon theme to the AUR, but I'm having a problem getting a command to work within the .install file. If I run this command in a shell script, it works fine. (The package also installs fine, but a command in the .install file doesn't seem to run.)

Here's the background. The xfce4-mixer plugin requires icons to be placed in the /usr/share/xfce4-mixer directory, so I'm trying to copy some files to that directory. It'd be nice if I could put this in the .install file so that pacman does it automatically for me.

Here's my current .install file. The if statement is the one that doesn't run when I install the package:

post-install() {
	{
  		if [ -e "/usr/share/xfce4-mixer/icons/hicolor" ] ; then
  			gnomi="/usr/share/icons/gnomintu/status"
  			xfcmi="/usr/share/xfce4-mixer/icons/hicolor"
  			sudo cp $(ls $gnomi/48/xfce4-mixer*) $xfcmi/16x16/status/	
  			sudo cp $(ls $gnomi/scalable/xfce4-mixer*) $xfcmi/scalable/status/
  		fi
  	}
  	{
  		gtk-update-icon-cache -ftq usr/share/icons/gnomintu
  	}
}

post-upgrade() {
  post-install
}

post-remove() {
	{
  		if [ -e "/usr/share/xfce4-mixer/icons/hicolor" ] ; then
  			gnomi="/usr/share/icons/gnomintu/status"
  			xfcmi="/usr/share/xfce4-mixer/icons/hicolor"
  			sudo rm $xfcmi/16x16/status/$(basename $gnomi/48/xfce4-mixer*)
  			sudo rm $xfcmi/scalable/status/$(basename $gnomi/scalable/xfce4-mixer*)
  		fi
  	}
  	{
  		gtk-update-icon-cache -ftq usr/share/icons/Numix
  	} 
}

# vim: ts=2 sw=2 et:

Offline

#2 2014-10-20 22:07:01

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,787
Website

Re: Problem Creating .install File for AUR Package

1) Don't use sudo in an .install script, they're run as root anyway.
2) Don't copy files about in an .install script, that's what the package() function is for.
3) Don't copy files when symbolic links would probably work just as well.
4) What's with all the brackets, are you putting up shelves?

Edit bonus:
5) It's post_install, etc. with an underscore, not a dash.

Last edited by WorMzy (2014-10-20 22:13:57)


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.

Online

#3 2014-10-25 16:43:17

GreenRaccoon23
Member
Registered: 2014-09-27
Posts: 33

Re: Problem Creating .install File for AUR Package

WorMzy wrote:

1) Don't use sudo in an .install script, they're run as root anyway.
2) Don't copy files about in an .install script, that's what the package() function is for.
3) Don't copy files when symbolic links would probably work just as well.
4) What's with all the brackets, are you putting up shelves?

Edit bonus:
5) It's post_install, etc. with an underscore, not a dash.

Well that explains it! Thanks!

I also figured out I didn't need to do all this for the xfce4-mixer plugin. I just reinstalled it and it started to show the custom icons.

Last edited by GreenRaccoon23 (2014-10-25 16:58:59)

Offline

Board footer

Powered by FluxBB