Reply
Thread Tools
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#1
Hi
Someone know how to prevent installation of RPM file with the same files structure ?
For example I have 3 hebrew vkb RPM files, all of them have the same structure:
/usr/share/jolla-hebrewvkb/jolla/layouts
/usr/share/jolla-hebrewvkb/font
/usr/share/jolla-hebrewvkb/backup

If one of packages already installed and I trying to install another one, it installed without any problem over the same files... How to prevent it ?

I tried to add this lines to .spec file before packaging:
Code:
%pre
if [ ! -d /usr/share/jolla-hebrewvkb ]; then
:
else
exit 0
fi
or

Code:
%pre
status=$(rpm -qa hebrewvkb*|wc -l)
if [ "$status" > "0" ]; then
exit 0
fi
But it just don't do nothing...
Maybe I need to add something else ? Please, any advice ?

Last edited by Schturman; 2014-01-30 at 19:22.
 
coderus's Avatar
Posts: 6,436 | Thanked: 12,699 times | Joined on Nov 2011 @ Ängelholm, Sweden
#2
@Schturman exit 1
__________________
Telegram | Openrepos | GitHub | Revolut donations
 

The Following User Says Thank You to coderus For This Useful Post:
Guest | Posts: n/a | Thanked: 0 times | Joined on
#3
hmm
maybe somthing like
%pre
%if [ -d /usr/share/jolla-hebrewvkb ]
exit 0
%endif
 

The Following User Says Thank You to For This Useful Post:
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#4
 
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#5
Ok tested...
nieldk, you method not work at all..

coderus, You method work, but not so good...
It's good, I can't install another vkb:
Code:
Installing packages           [=========================]
Fatal error: Installation aborted by user
But I also can't reinstall the same package (same error), maybe my command is wrong ?:
Code:
pkcon install-local -y /home/nemo/Downloads/hebrewvkb-4ar-0.1-1.armv7hl.rpm
Also I can't uninstall this package, used:
Code:
pkcon remove hebrewvkb-4ar
:
Code:
Downloading packages          [=========================]
Fatal error: Specified path '/var/tmp/TmpDir.szc6vD' is not a directory: dir:///var/tmp/TmpDir.szc6vD
Needed to reinstall previous build and only after this remove.

 
Posts: 1,067 | Thanked: 2,383 times | Joined on Jan 2012 @ Finland
#6
Just use .spec file.

Obsoletes: - if you want to uninstall other versions

Conflicts: - if you want to keep 1st installed rpm package and stop 2 other packages from installing

(And you all 3 packages can use Provides: hebvbk for example so depending packages dont care which one of the 3 packages is installed).
__________________
IRC: jonni@freenode
Sailfish: ¤ Qt5 SailfishTouchExample ¤ Qt5 MultiPointTouchArea Example ¤ ipaddress ¤ stoken ¤ Sailbox (Dropbox client) ¤
Harmattan: ¤ Presence VNC for Harmattan ¤ Live-F1 ¤ BTinput-terminal ¤ BabyLock ¤ BabyLock Trial ¤ QML TextTV ¤
Disclaimer: all my posts in this forum are personal trolling and I never post in any official capacity on behalf of any company.
 

The Following User Says Thank You to rainisto For This Useful Post:
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#7
Originally Posted by rainisto View Post
Just use .spec file.

Obsoletes: - if you want to uninstall other versions

Conflicts: - if you want to keep 1st installed rpm package and stop 2 other packages from installing

(And you all 3 packages can use Provides: hebvbk for example so depending packages dont care which one of the 3 packages is installed).
Thank you very much ! Conflicts:work like a charm!
Wanted to ask you about Provides: if I understand it right..

For example I have 3 packages named:
hebrewvkb-4ar
hebrewvkb-2ar-3lang
hebrewvkb-2ar-2lang

I'm going to create another/different app/package and I know it can be conflicted with this 3 packages.
I will add:
Provides: hebrewvkb to new package and that mean, when I will try to install new package and I already have one of 3 packages (vkb) installed - it just will not allow me to install new package ? I'm right ?
 
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#8
Shouldn't the pkg mgr refuse to overwrite files, as dpkg does?
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#9
Hmmm, I have also another question, why when I try to update to new version of my app, the install command show me that all installed ok, but when I check /usr/share/ the folder of my package is not here. Looks like it just uninstalled my previous version but not installed new one and I need run install command again to get it.
Something missing my spec file ?


EDIT:
Nevermind, I found where is my problem, I added this line to spec file:
Code:
%postun
rm -rf /usr/share/jolla-adrestart
But the problem is when I uninstall package, it remove all files but leave the folder /usr/share/jolla-adrestart
How I can completely remove package (include folder of my app) ?

Last edited by Schturman; 2014-01-31 at 23:03.
 
Posts: 144 | Thanked: 242 times | Joined on Nov 2007 @ Finland
#10
Is there something in /usr/share/jolla-adrestart that your application writes there in installation scripts or after installation during runtime? All files in that directory must be included into the rpm otherwise it will not remove it as there are files not belonging to the rpm package uninstalled.
 
Reply


 
Forum Jump


All times are GMT. The time now is 13:47.