summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2013-08-07 11:53:37 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-22 18:29:59 +0100
commit02c96776de37e8507351f0162a76b082c0ed183c (patch)
tree0e56e09647764c12b7815dbac41178906b3d6541 /meta/recipes-devtools/python
parenta6a3ec1ea0382e8f7d8ded0a2d2c5e9b99f55f9b (diff)
downloadpoky-02c96776de37e8507351f0162a76b082c0ed183c.tar.gz
python-smartpm: Add support for excluding package from the install
Update smart to support a mechanism for excluding specific packages from the install process. An error will be generated if this package is required. (From OE-Core rev: 87660d636c2ebe76cd9dff2a334f135def9a0cf3) 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>
Diffstat (limited to 'meta/recipes-devtools/python')
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-flag-exclude-packages.patch70
-rw-r--r--meta/recipes-devtools/python/python-smartpm_1.4.1.bb1
2 files changed, 71 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-flag-exclude-packages.patch b/meta/recipes-devtools/python/python-smartpm/smart-flag-exclude-packages.patch
new file mode 100644
index 0000000000..21a28746a1
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smart-flag-exclude-packages.patch
@@ -0,0 +1,70 @@
1Add exclude-packages flag support
2
3Allow configuring specific packages to be excluded. This will allow
4users to specify things NOT to install, and if they are attempted an
5error will be generated.
6
7Upstream-Status: Pending
8
9Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
10
11Index: smart-1.4.1/smart/const.py
12===================================================================
13--- smart-1.4.1.orig/smart/const.py
14+++ smart-1.4.1/smart/const.py
15@@ -70,6 +70,7 @@ DATADIR = "/var/lib/smart/"
16 USERDATADIR = "~/.smart/"
17 CONFFILE = "config"
18
19+LOCKED_EXCLUDE = Enum('LOCKED_EXCLUDE')
20 LOCKED_INSTALL = Enum('LOCKED_INSTALL')
21 LOCKED_REMOVE = Enum('LOCKED_REMOVE')
22 LOCKED_CONFLICT = Enum('LOCKED_CONFLICT')
23Index: smart-1.4.1/smart/transaction.py
24===================================================================
25--- smart-1.4.1.orig/smart/transaction.py
26+++ smart-1.4.1/smart/transaction.py
27@@ -19,7 +19,7 @@
28 # along with Smart Package Manager; if not, write to the Free Software
29 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 #
31-from smart.const import INSTALL, REMOVE, UPGRADE, FIX, REINSTALL, KEEP, LOCKED_INSTALL, LOCKED_CONFLICT, LOCKED_CONFLICT_BY, LOCKED_NO_COEXIST, LOCKED_SYSCONF, LOCKED_REMOVE
32+from smart.const import INSTALL, REMOVE, UPGRADE, FIX, REINSTALL, KEEP, LOCKED_EXCLUDE, LOCKED_INSTALL, LOCKED_CONFLICT, LOCKED_CONFLICT_BY, LOCKED_NO_COEXIST, LOCKED_SYSCONF, LOCKED_REMOVE
33 from smart.cache import PreRequires, Package
34 from smart import *
35
36@@ -29,7 +29,9 @@ def lock_reason(pkg, lockvalue):
37 except TypeError:
38 reason = None
39 lockvalue = None
40- if reason == LOCKED_INSTALL:
41+ if reason == LOCKED_EXCLUDE:
42+ return _("%s is to be excluded") % pkg
43+ elif reason == LOCKED_INSTALL:
44 return _("%s is to be installed") % pkg
45 elif reason == LOCKED_CONFLICT:
46 return _("%s conflicts with %s") % (pkg, otherpkg)
47@@ -210,6 +212,10 @@ class Policy(object):
48 self._sysconflocked.append(pkg)
49 self._locked[pkg] = (LOCKED_SYSCONF, None)
50
51+ for pkg in pkgconf.filterByFlag("exclude-packages", cache.getPackages()):
52+ if pkg not in self._locked:
53+ self._locked[pkg] = (LOCKED_EXCLUDE, None)
54+
55 def runFinished(self):
56 self._priorities.clear()
57 for pkg in self._sysconflocked:
58Index: smart-1.4.1/smart/commands/flag.py
59===================================================================
60--- smart-1.4.1.orig/smart/commands/flag.py
61+++ smart-1.4.1/smart/commands/flag.py
62@@ -47,6 +47,8 @@ Currently known flags are:
63 multi-version - Flagged packages may have more than one version
64 installed in the system at the same time
65 (backend dependent).
66+ exclude-packages - Flagged packages will be excluded, if they are
67+ required, an error will be generated.
68 ignore-recommends - Flagged packages will not be installed, if
69 they are only recommended by a package to be
70 installed rather than required.
diff --git a/meta/recipes-devtools/python/python-smartpm_1.4.1.bb b/meta/recipes-devtools/python/python-smartpm_1.4.1.bb
index 70ac8bf288..b3b471a8b1 100644
--- a/meta/recipes-devtools/python/python-smartpm_1.4.1.bb
+++ b/meta/recipes-devtools/python/python-smartpm_1.4.1.bb
@@ -28,6 +28,7 @@ SRC_URI = "\
28 file://smart-channelsdir.patch \ 28 file://smart-channelsdir.patch \
29 file://smart-conflict-provider.patch \ 29 file://smart-conflict-provider.patch \
30 file://smart-flag-ignore-recommends.patch \ 30 file://smart-flag-ignore-recommends.patch \
31 file://smart-flag-exclude-packages.patch \
31 " 32 "
32 33
33SRC_URI[md5sum] = "573ef32ba177a6b3c4bf7ef04873fcb6" 34SRC_URI[md5sum] = "573ef32ba177a6b3c4bf7ef04873fcb6"