summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2012-11-15 15:31:11 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-12-06 12:31:03 +0000
commit80ad2af71b3c9d66f7688ec4583873135d2d3af4 (patch)
treed09294d1ba78e7d62227c32daa060466c32ffa51
parent990a17c6758834aefcd5f828b8a67d15e9f88723 (diff)
downloadpoky-80ad2af71b3c9d66f7688ec4583873135d2d3af4.tar.gz
package_rpm.bbclass: Add the runtime dependencies to the pre/post scriptlets
When the scriptlets are processed in RPM, they have a different dependency set then the core package. OE has no way to specify dependencies for the pre/post scriptlists, so we simply make the runtime dependencies scriptlets as well. (From OE-Core rev: c1acac8c46aa75d78634c30de773b28a1466070c) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/package_rpm.bbclass86
1 files changed, 55 insertions, 31 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 1ff92cea5f..200a941177 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -730,10 +730,10 @@ python write_specfile () {
730 srcrconflicts = [] 730 srcrconflicts = []
731 srcrobsoletes = [] 731 srcrobsoletes = []
732 732
733 srcpreinst = [] 733 srcrpreinst = []
734 srcpostinst = [] 734 srcrpostinst = []
735 srcprerm = [] 735 srcrprerm = []
736 srcpostrm = [] 736 srcrpostrm = []
737 737
738 spec_preamble_top = [] 738 spec_preamble_top = []
739 spec_preamble_bottom = [] 739 spec_preamble_bottom = []
@@ -792,6 +792,11 @@ python write_specfile () {
792 splitrconflicts = strip_multilib_deps(localdata.getVar('RCONFLICTS', True), d) 792 splitrconflicts = strip_multilib_deps(localdata.getVar('RCONFLICTS', True), d)
793 splitrobsoletes = [] 793 splitrobsoletes = []
794 794
795 splitrpreinst = localdata.getVar('pkg_preinst', True)
796 splitrpostinst = localdata.getVar('pkg_postinst', True)
797 splitrprerm = localdata.getVar('pkg_prerm', True)
798 splitrpostrm = localdata.getVar('pkg_postrm', True)
799
795 # Gather special src/first package data 800 # Gather special src/first package data
796 if srcname == splitname: 801 if srcname == splitname:
797 srcrdepends = splitrdepends 802 srcrdepends = splitrdepends
@@ -801,10 +806,10 @@ python write_specfile () {
801 srcrreplaces = splitrreplaces 806 srcrreplaces = splitrreplaces
802 srcrconflicts = splitrconflicts 807 srcrconflicts = splitrconflicts
803 808
804 srcpreinst = localdata.getVar('pkg_preinst', True) 809 srcrpreinst = splitrpreinst
805 srcpostinst = localdata.getVar('pkg_postinst', True) 810 srcrpostinst = splitrpostinst
806 srcprerm = localdata.getVar('pkg_prerm', True) 811 srcrprerm = splitrprerm
807 srcpostrm = localdata.getVar('pkg_postrm', True) 812 srcrpostrm = splitrpostrm
808 813
809 file_list = [] 814 file_list = []
810 walk_files(root, file_list, conffiles) 815 walk_files(root, file_list, conffiles)
@@ -850,6 +855,15 @@ python write_specfile () {
850 splitrprovides = bb.utils.join_deps(rprovides, commasep=False) 855 splitrprovides = bb.utils.join_deps(rprovides, commasep=False)
851 856
852 print_deps(splitrdepends, "Requires", spec_preamble_bottom, d) 857 print_deps(splitrdepends, "Requires", spec_preamble_bottom, d)
858 if splitrpreinst:
859 print_deps(splitrdepends, "Requires(pre)", spec_preamble_bottom, d)
860 if splitrpostinst:
861 print_deps(splitrdepends, "Requires(post)", spec_preamble_bottom, d)
862 if splitrprerm:
863 print_deps(splitrdepends, "Requires(preun)", spec_preamble_bottom, d)
864 if splitrpostrm:
865 print_deps(splitrdepends, "Requires(postun)", spec_preamble_bottom, d)
866
853 # Suggests in RPM are like recommends in OE-core! 867 # Suggests in RPM are like recommends in OE-core!
854 print_deps(splitrrecommends, "Suggests", spec_preamble_bottom, d) 868 print_deps(splitrrecommends, "Suggests", spec_preamble_bottom, d)
855 # While there is no analog for suggests... (So call them recommends for now) 869 # While there is no analog for suggests... (So call them recommends for now)
@@ -880,21 +894,22 @@ python write_specfile () {
880 spec_preamble_bottom.append('') 894 spec_preamble_bottom.append('')
881 895
882 # Now process scriptlets 896 # Now process scriptlets
883 for script in ["preinst", "postinst", "prerm", "postrm"]: 897 if splitrpreinst:
884 scriptvar = localdata.getVar('pkg_%s' % script, True) 898 spec_scriptlets_bottom.append('%%pre -n %s' % splitname)
885 if not scriptvar: 899 spec_scriptlets_bottom.append(splitrpreinst)
886 continue 900 spec_scriptlets_bottom.append('')
887 if script == 'preinst': 901 if splitrpostinst:
888 spec_scriptlets_bottom.append('%%pre -n %s' % splitname) 902 spec_scriptlets_bottom.append('%%post -n %s' % splitname)
889 elif script == 'postinst': 903 spec_scriptlets_bottom.append(splitrpostinst)
890 spec_scriptlets_bottom.append('%%post -n %s' % splitname) 904 spec_scriptlets_bottom.append('')
891 elif script == 'prerm': 905 if splitrprerm:
892 spec_scriptlets_bottom.append('%%preun -n %s' % splitname) 906 spec_scriptlets_bottom.append('%%preun -n %s' % splitname)
893 scriptvar = wrap_uninstall(scriptvar) 907 scriptvar = wrap_uninstall(splitrprerm)
894 elif script == 'postrm': 908 spec_scriptlets_bottom.append(scriptvar)
895 spec_scriptlets_bottom.append('%%postun -n %s' % splitname) 909 spec_scriptlets_bottom.append('')
896 scriptvar = wrap_uninstall(scriptvar) 910 if splitrpostrm:
897 spec_scriptlets_bottom.append('# %s - %s' % (splitname, script)) 911 spec_scriptlets_bottom.append('%%postun -n %s' % splitname)
912 scriptvar = wrap_uninstall(splitrpostrm)
898 spec_scriptlets_bottom.append(scriptvar) 913 spec_scriptlets_bottom.append(scriptvar)
899 spec_scriptlets_bottom.append('') 914 spec_scriptlets_bottom.append('')
900 915
@@ -943,6 +958,15 @@ python write_specfile () {
943 958
944 print_deps(srcdepends, "BuildRequires", spec_preamble_top, d) 959 print_deps(srcdepends, "BuildRequires", spec_preamble_top, d)
945 print_deps(srcrdepends, "Requires", spec_preamble_top, d) 960 print_deps(srcrdepends, "Requires", spec_preamble_top, d)
961 if srcrpreinst:
962 print_deps(srcrdepends, "Requires(pre)", spec_preamble_top, d)
963 if srcrpostinst:
964 print_deps(srcrdepends, "Requires(post)", spec_preamble_top, d)
965 if srcrprerm:
966 print_deps(srcrdepends, "Requires(preun)", spec_preamble_top, d)
967 if srcrpostrm:
968 print_deps(srcrdepends, "Requires(postun)", spec_preamble_top, d)
969
946 # Suggests in RPM are like recommends in OE-core! 970 # Suggests in RPM are like recommends in OE-core!
947 print_deps(srcrrecommends, "Suggests", spec_preamble_top, d) 971 print_deps(srcrrecommends, "Suggests", spec_preamble_top, d)
948 # While there is no analog for suggests... (So call them recommends for now) 972 # While there is no analog for suggests... (So call them recommends for now)
@@ -972,26 +996,26 @@ python write_specfile () {
972 996
973 spec_preamble_top.append('') 997 spec_preamble_top.append('')
974 998
975 if srcpreinst: 999 if srcrpreinst:
976 spec_scriptlets_top.append('%pre') 1000 spec_scriptlets_top.append('%pre')
977 spec_scriptlets_top.append('# %s - preinst' % srcname) 1001 spec_scriptlets_top.append('# %s - preinst' % srcname)
978 spec_scriptlets_top.append(srcpreinst) 1002 spec_scriptlets_top.append(srcrpreinst)
979 spec_scriptlets_top.append('') 1003 spec_scriptlets_top.append('')
980 if srcpostinst: 1004 if srcrpostinst:
981 spec_scriptlets_top.append('%post') 1005 spec_scriptlets_top.append('%post')
982 spec_scriptlets_top.append('# %s - postinst' % srcname) 1006 spec_scriptlets_top.append('# %s - postinst' % srcname)
983 spec_scriptlets_top.append(srcpostinst) 1007 spec_scriptlets_top.append(srcrpostinst)
984 spec_scriptlets_top.append('') 1008 spec_scriptlets_top.append('')
985 if srcprerm: 1009 if srcrprerm:
986 spec_scriptlets_top.append('%preun') 1010 spec_scriptlets_top.append('%preun')
987 spec_scriptlets_top.append('# %s - prerm' % srcname) 1011 spec_scriptlets_top.append('# %s - prerm' % srcname)
988 scriptvar = wrap_uninstall(srcprerm) 1012 scriptvar = wrap_uninstall(srcrprerm)
989 spec_scriptlets_top.append(scriptvar) 1013 spec_scriptlets_top.append(scriptvar)
990 spec_scriptlets_top.append('') 1014 spec_scriptlets_top.append('')
991 if srcpostrm: 1015 if srcrpostrm:
992 spec_scriptlets_top.append('%postun') 1016 spec_scriptlets_top.append('%postun')
993 spec_scriptlets_top.append('# %s - postrm' % srcname) 1017 spec_scriptlets_top.append('# %s - postrm' % srcname)
994 scriptvar = wrap_uninstall(srcpostrm) 1018 scriptvar = wrap_uninstall(srcrpostrm)
995 spec_scriptlets_top.append(scriptvar) 1019 spec_scriptlets_top.append(scriptvar)
996 spec_scriptlets_top.append('') 1020 spec_scriptlets_top.append('')
997 1021