diff options
-rw-r--r-- | meta/recipes-devtools/python/python-smartpm/smart-flag-exclude-packages.patch | 70 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python-smartpm_1.4.1.bb | 1 |
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 @@ | |||
1 | Add exclude-packages flag support | ||
2 | |||
3 | Allow configuring specific packages to be excluded. This will allow | ||
4 | users to specify things NOT to install, and if they are attempted an | ||
5 | error will be generated. | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
10 | |||
11 | Index: 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') | ||
23 | Index: 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: | ||
58 | Index: 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 | ||
33 | SRC_URI[md5sum] = "573ef32ba177a6b3c4bf7ef04873fcb6" | 34 | SRC_URI[md5sum] = "573ef32ba177a6b3c4bf7ef04873fcb6" |