Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 881636 Details for
Bug 903068
packages in spacewalk are allways for "apt-get upgrade"
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch with dedicated tables
fix_bug903068_2.patch (text/plain), 29.85 KB, created by
Carsten Menzel
on 2014-04-02 05:31:07 UTC
(
hide
)
Description:
patch with dedicated tables
Filename:
MIME Type:
Creator:
Carsten Menzel
Created:
2014-04-02 05:31:07 UTC
Size:
29.85 KB
patch
obsolete
>diff --git a/backend/common/rhn_deb.py b/backend/common/rhn_deb.py >index 4dd78d5..a43ec2a 100644 >--- a/backend/common/rhn_deb.py >+++ b/backend/common/rhn_deb.py >@@ -57,7 +57,12 @@ class deb_Header: > for hdr_k, deb_k in [('requires', 'Depends'), > ('provides', 'Provides'), > ('conflicts', 'Conflicts'), >- ('obsoletes', 'Replaces')]: >+ ('obsoletes', 'Replaces'), >+ ('recommends', 'Recommends'), >+ ('suggests', 'Suggests'), >+ ('breaks', 'Breaks'), >+ ('predepends', 'Pre-Depends'), >+ ('payload_size', 'Installed-Size')]: > if debcontrol.has_key(deb_k): > self.hdr[hdr_k] = debcontrol.get_as_string(deb_k) > for k in debcontrol.keys(): >diff --git a/backend/satellite_tools/exporter/exportLib.py b/backend/satellite_tools/exporter/exportLib.py >index aeb1c08..3108f48 100644 >--- a/backend/satellite_tools/exporter/exportLib.py >+++ b/backend/satellite_tools/exporter/exportLib.py >@@ -841,6 +841,10 @@ class _PackageDumper(BaseRowDumper): > 'rhn-package-supplements-entry'], > ['rhnPackageEnhances', 'rhn-package-enhances', > 'rhn-package-enhances-entry'], >+ ['rhnPackageBreaks', 'rhn-package-breaks', >+ 'rhn-package-breaks-entry'], >+ ['rhnPackagePredepends', 'rhn-package-predepends', >+ 'rhn-package-predepends-entry'], > ] > for table_name, container_name, entry_name in mappings: > h = rhnSQL.prepare(""" >diff --git a/backend/satellite_tools/spacewalk-remove-channel b/backend/satellite_tools/spacewalk-remove-channel >index e40b288..2089960 100755 >--- a/backend/satellite_tools/spacewalk-remove-channel >+++ b/backend/satellite_tools/spacewalk-remove-channel >@@ -497,6 +497,8 @@ def _delete_rpm_group(packageIds): > 'rhnPackageSuggests', > 'rhnPackageSupplements', > 'rhnPackageEnhances', >+ 'rhnPackageBreaks', >+ 'rhnPackagePredepends', > 'rhnServerNeededCache', > ] > deleteStatement = "delete from %s where package_id = :package_id" >diff --git a/backend/server/importlib/backend.py b/backend/server/importlib/backend.py >index 797079b..5bb0cc6 100644 >--- a/backend/server/importlib/backend.py >+++ b/backend/server/importlib/backend.py >@@ -733,6 +733,8 @@ class Backend: > 'rhnPackageSuggests': 'package_id', > 'rhnPackageSupplements':'package_id', > 'rhnPackageEnhances' :'package_id', >+ 'rhnPackageBreaks': 'package_id', >+ 'rhnPackagePredepends': 'package_id', > 'rhnPackageFile': 'package_id', > 'rhnPackageChangeLogRec': 'package_id', > } >diff --git a/backend/server/importlib/backendOracle.py b/backend/server/importlib/backendOracle.py >index 4c118f3..5c1d8dd 100644 >--- a/backend/server/importlib/backendOracle.py >+++ b/backend/server/importlib/backendOracle.py >@@ -110,6 +110,26 @@ class OracleBackend(Backend): > attribute = 'enhances', > map = { 'sense' : 'flags', }, > ), >+ Table('rhnPackageBreaks', >+ fields = { >+ 'package_id' : DBint(), >+ 'capability_id' : DBint(), >+ 'sense' : DBint(), >+ }, >+ pk = ['package_id', 'capability_id', 'sense'], >+ attribute = 'breaks', >+ map = { 'sense' : 'flags', }, >+ ), >+ Table('rhnPackagePredepends', >+ fields = { >+ 'package_id' : DBint(), >+ 'capability_id' : DBint(), >+ 'sense' : DBint(), >+ }, >+ pk = ['package_id', 'capability_id', 'sense'], >+ attribute = 'predepends', >+ map = { 'sense' : 'flags', }, >+ ), > Table('rhnPackageChangeLogRec', > fields = { > 'id' : DBint(), >diff --git a/backend/server/importlib/debPackage.py b/backend/server/importlib/debPackage.py >index b799e3b..61348db 100644 >--- a/backend/server/importlib/debPackage.py >+++ b/backend/server/importlib/debPackage.py >@@ -122,6 +122,10 @@ class debBinaryPackage(headerSource.rpmBinaryPackage): > 'requires' : headerSource.rpmRequires, > 'conflicts' : headerSource.rpmConflicts, > 'obsoletes' : headerSource.rpmObsoletes, >+ 'suggests' : headerSource.rpmSuggests, >+ 'recommends': headerSource.rpmRecommends, >+ 'breaks' : headerSource.rpmBreaks, >+ 'predepends': headerSource.rpmPredepends, > } > for k, dclass in mapping.items(): > l = [] >@@ -129,14 +133,15 @@ class debBinaryPackage(headerSource.rpmBinaryPackage): > if values != None: > val = string.join(values.split(), "") # remove whitespaces > val = val.split(',') # split packages >+ i = 0 > for v in val: > version = '' > if '|' in v: > # TODO: store alternative-package-names semantically someday >- name = v >+ name = v + '_' + str(i) > else: > nv = v.split('(') >- name = nv[0] >+ name = nv[0] + '_' + str(i) > # TODO FIX VERSION AND FLAGS > if (len(nv) > 1): > version = nv[1].rstrip(')') >@@ -144,6 +149,7 @@ class debBinaryPackage(headerSource.rpmBinaryPackage): > finst = dclass() > finst.populate(hash) > l.append(finst) >+ i += 1 > self[k] = l > > def _populateChangeLog(self, header): >diff --git a/backend/server/importlib/headerSource.py b/backend/server/importlib/headerSource.py >index fc33691..82ab8b9 100644 >--- a/backend/server/importlib/headerSource.py >+++ b/backend/server/importlib/headerSource.py >@@ -120,6 +120,8 @@ class rpmBinaryPackage(Package, rpmPackage): > 'supplements' : None, > 'enhances' : None, > 'recommends' : None, >+ 'breaks' : None, >+ 'predepends' : None, > 'files' : None, > 'changelog' : None, > 'channels' : None, >@@ -165,7 +167,9 @@ class rpmBinaryPackage(Package, rpmPackage): > 'supplements' : rpmSupplements, > 'enhances' : rpmEnhances, > 'suggests' : rpmSuggests, >- 'recommends' : rpmRecommends, >+ 'recommends': rpmRecommends, >+ 'breaks' : rpmBreaks, >+ 'predepends': rpmPredepends, > } > for k, v in mapping.items(): > self._populateTag(header, k, v) >@@ -215,7 +219,7 @@ class rpmBinaryPackage(Package, rpmPackage): > hash[k] = v[i] > > # RPMSENSE_STRONG(1<<27) indicate recommends; if not set it is suggests only >- if tag in ['recommends', 'supplements'] and not(hash['flags'] & (1 << 27)): >+ if tag in ['recommends', 'supplements', 'break', 'predepends'] and not(hash['flags'] & (1 << 27)): > continue > if tag in ['suggests', 'enhances'] and (hash['flags'] & (1 << 27)): > continue >@@ -223,7 +227,7 @@ class rpmBinaryPackage(Package, rpmPackage): > obj = Class() > # Fedora 10+ rpms have duplicate provides deps, > # Lets clean em up before db inserts. >- if tag in ['requires', 'provides', 'obsoletes', 'conflicts', 'recommends', 'suggests', 'supplements', 'enhances']: >+ if tag in ['requires', 'provides', 'obsoletes', 'conflicts', 'recommends', 'suggests', 'supplements', 'enhances', 'breaks', 'predepends']: > if not len(hash['name']): > continue > dep_nv = (hash['name'], hash['version'], hash['flags']) >@@ -378,6 +382,23 @@ class rpmObsoletes(Dependency): > 'flags' : 'obsoleteflags', > } > >+class rpmBreaks(Dependency): >+ # More mappings >+ tagMap = { >+ 'name' : 1159, #'enhancesname' >+ 'version' : 1160, #'enhancesversion' >+ 'flags' : 1161, #'enhancesflags' >+ } >+ >+class rpmPredepends(Dependency): >+ # More mappings >+ tagMap = { >+ 'name' : 1159, #'enhancesname' >+ 'version' : 1160, #'enhancesversion' >+ 'flags' : 1161, #'enhancesflags' >+ } >+ >+ > class rpmChangeLog(ChangeLog): > tagMap = { > 'name' : 'changelogname', >diff --git a/backend/server/importlib/importLib.py b/backend/server/importlib/importLib.py >index 1a8e2eb..7d52c4d 100644 >--- a/backend/server/importlib/importLib.py >+++ b/backend/server/importlib/importLib.py >@@ -376,6 +376,8 @@ class Package(IncompletePackage): > 'supplements' : [Dependency], > 'enhances' : [Dependency], > 'suggests' : [Dependency], >+ 'breaks' : [Dependency], >+ 'predepends' : [Dependency], > 'changelog' : [ChangeLog], > 'channels' : [StringType], > 'checksum_list' : [Checksum], >diff --git a/backend/server/importlib/packageImport.py b/backend/server/importlib/packageImport.py >index 34cb33a..1975702 100644 >--- a/backend/server/importlib/packageImport.py >+++ b/backend/server/importlib/packageImport.py >@@ -226,14 +226,14 @@ class PackageImport(ChannelPackageSubscription): > # XXX > package['copyright'] = self._fix_encoding(package['license']) > >- for tag in ('recommends', 'suggests', 'supplements', 'enhances'): >+ for tag in ('recommends', 'suggests', 'supplements', 'enhances', 'breaks', 'predepends'): > if not package.has_key(tag) or type(package[tag]) != type([]): > # older spacewalk server do not export weak deps. > # lets create an empty list > package[tag] = [] > > # Creates all the data structures needed to insert capabilities >- for tag in ('provides', 'requires', 'conflicts', 'obsoletes', 'recommends', 'suggests', 'supplements', 'enhances'): >+ for tag in ('provides', 'requires', 'conflicts', 'obsoletes', 'recommends', 'suggests', 'supplements', 'enhances', 'breaks', 'predepends'): > depList = package[tag] > if type(depList) != type([]): > sys.stderr.write("!!! packageImport.PackageImport._processPackage: " >@@ -369,7 +369,7 @@ class PackageImport(ChannelPackageSubscription): > package['checksum_id'] = self.checksums[(package['checksum_type'], package['checksum'])] > > # Postprocess the dependency information >- for tag in ('provides', 'requires', 'conflicts', 'obsoletes', 'files', 'recommends', 'suggests', 'supplements', 'enhances'): >+ for tag in ('provides', 'requires', 'conflicts', 'obsoletes', 'files', 'recommends', 'suggests', 'supplements', 'enhances', 'breaks', 'predepends'): > for entry in package[tag]: > nv = entry['capability'] > entry['capability_id'] = self.capabilities[nv] >diff --git a/backend/server/repomd/mapper.py b/backend/server/repomd/mapper.py >index 951b482..eed118b 100644 >--- a/backend/server/repomd/mapper.py >+++ b/backend/server/repomd/mapper.py >@@ -343,6 +343,30 @@ class SqlPackageMapper: > where > po.package_id = :package_id > and po.capability_id = pc.id >+ union all >+ select >+ 'breaks', >+ brks.sense, >+ pc.name, >+ pc.version >+ from >+ rhnPackageCapability pc, >+ rhnPackageBreaks brks >+ where >+ brks.package_id = :package_id >+ and brks.capability_id = pc.id >+ union all >+ select >+ 'predepends', >+ pdep.sense, >+ pc.name, >+ pc.version >+ from >+ rhnPackageCapability pc, >+ rhnPackagePredepends pdep >+ where >+ pdep.package_id = :package_id >+ and pdep.capability_id = pc.id > """) > > self.last_modified_sql = rhnSQL.prepare(""" >@@ -463,6 +487,10 @@ class SqlPackageMapper: > package.enhances.append(dep) > elif item[0] == "suggests": > package.suggests.append(dep) >+ elif item[0] == "breaks": >+ package.breaks.append(dep) >+ elif item[0] == "predepends": >+ package.predepends.append(dep) > else: > assert False, "Unknown PRCO type: %s" % item[0] > >diff --git a/backend/server/rhnChannel.py b/backend/server/rhnChannel.py >index 34455d2..74c89e6 100644 >--- a/backend/server/rhnChannel.py >+++ b/backend/server/rhnChannel.py >@@ -1241,6 +1241,34 @@ def list_all_packages_complete_sql(channel_id): > where > po.package_id = :package_id > and po.capability_id = pc.id >+ union all >+ select >+ brks.package_id, >+ 'breaks' as capability_type, >+ brks.capability_id, >+ brks.sense, >+ pc.name, >+ pc.version >+ from >+ rhnPackageBreaks brks, >+ rhnPackageCapability pc >+ where >+ brks.package_id = :package_id >+ and brks.capability_id = pc.id >+ union all >+ select >+ pdep.package_id, >+ 'predepends' as capability_type, >+ pdep.capability_id, >+ pdep.sense, >+ pc.name, >+ pc.version >+ from >+ rhnPackagePredepends pdep, >+ rhnPackageCapability pc >+ where >+ pdep.package_id = :package_id >+ and pdep.capability_id = pc.id > """) > > h.execute(channel_id = str(channel_id)) >@@ -1260,6 +1288,8 @@ def list_all_packages_complete_sql(channel_id): > pkgi['suggests'] = [] > pkgi['supplements'] = [] > pkgi['enhances'] = [] >+ pkgi['breaks'] = [] >+ pkgi['predepends'] = [] > g.execute(package_id = pkgi["id"]) > deps = g.fetchall_dict() or [] > for item in deps: >@@ -1277,7 +1307,7 @@ def list_all_packages_complete_sql(channel_id): > # process the results > ret = map(lambda a: (a["name"], a["version"], a["release"], a["epoch"], > a["arch"], a["package_size"], a['provides'], >- a['requires'], a['conflicts'], a['obsoletes'], a['recommends'], a['suggests'], a['supplements'], a['enhances']), >+ a['requires'], a['conflicts'], a['obsoletes'], a['recommends'], a['suggests'], a['supplements'], a['enhances'], a['breaks'], a['predepends']), > __stringify(ret)) > return ret > >diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml >index da191e2..b43fd95 100644 >--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml >+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml >@@ -589,6 +589,26 @@ where snc.errata_id = :errata_id > </query> > </mode> > >+<mode name="repomdgenerator_capability_breaks" >+ class="com.redhat.rhn.frontend.dto.PackageCapabilityDto"> >+ <query params="package_id"> >+ SELECT pkgcap.id, pkgcap.name, pkgcap.version, pkgp.sense >+ FROM rhnPackageBreaks pkgp, rhnPackageCapability pkgcap >+ WHERE pkgp.capability_id = pkgcap.id >+ AND pkgp.package_id = :package_id >+ </query> >+</mode> >+ >+<mode name="repomdgenerator_capability_predepends" >+ class="com.redhat.rhn.frontend.dto.PackageCapabilityDto"> >+ <query params="package_id"> >+ SELECT pkgcap.id, pkgcap.name, pkgcap.version, pkgp.sense >+ FROM rhnPackagePredepends pkgp, rhnPackageCapability pkgcap >+ WHERE pkgp.capability_id = pkgcap.id >+ AND pkgp.package_id = :package_id >+ </query> >+</mode> >+ > <mode name="repomdgenerator_package_changelog" > class="com.redhat.rhn.frontend.dto.PackageChangelogDto"> > <query params="package_id"> >diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/TaskConstants.java b/java/code/src/com/redhat/rhn/taskomatic/task/TaskConstants.java >index fada40a..1f422d3 100644 >--- a/java/code/src/com/redhat/rhn/taskomatic/task/TaskConstants.java >+++ b/java/code/src/com/redhat/rhn/taskomatic/task/TaskConstants.java >@@ -160,6 +160,12 @@ public class TaskConstants { > public static final String TASK_QUERY_REPOMD_GENERATOR_CAPABILITY_ENHANCES = > "repomdgenerator_capability_enhances"; > >+ public static final String TASK_QUERY_REPOMD_GENERATOR_CAPABILITY_BREAKS = >+ "repomdgenerator_capability_breaks"; >+ >+ public static final String TASK_QUERY_REPOMD_GENERATOR_CAPABILITY_PREDEPENDS = >+ "repomdgenerator_capability_predepends"; >+ > public static final String TASK_QUERY_REPOMD_GENERATOR_PACKAGE_CHANGELOG = > "repomdgenerator_package_changelog"; > >diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/repomd/DebPackageWriter.java b/java/code/src/com/redhat/rhn/taskomatic/task/repomd/DebPackageWriter.java >index 96cf1e9..97f75d2 100644 >--- a/java/code/src/com/redhat/rhn/taskomatic/task/repomd/DebPackageWriter.java >+++ b/java/code/src/com/redhat/rhn/taskomatic/task/repomd/DebPackageWriter.java >@@ -93,9 +93,12 @@ public class DebPackageWriter { > out.write(pkgDto.getVendor()); > out.newLine(); > >- out.write("Installed-Size: "); >- out.write(pkgDto.getPackageSize().toString()); >- out.newLine(); >+ Long packagePayloadSize = pkgDto.getPayloadSize(); >+ if (packagePayloadSize > 0 ) { >+ out.write("Installed-Size: "); >+ out.write(pkgDto.getPayloadSize().toString()); >+ out.newLine(); >+ } > > // dependencies > addPackageDepData( >@@ -114,6 +117,22 @@ public class DebPackageWriter { > out, > TaskConstants.TASK_QUERY_REPOMD_GENERATOR_CAPABILITY_OBSOLETES, > pkgDto.getId(), "Replaces"); >+ addPackageDepData( >+ out, >+ TaskConstants.TASK_QUERY_REPOMD_GENERATOR_CAPABILITY_SUGGESTS, >+ pkgDto.getId(), "Suggests"); >+ addPackageDepData( >+ out, >+ TaskConstants.TASK_QUERY_REPOMD_GENERATOR_CAPABILITY_RECOMMENDS, >+ pkgDto.getId(), "Recommends"); >+ addPackageDepData( >+ out, >+ TaskConstants.TASK_QUERY_REPOMD_GENERATOR_CAPABILITY_PREDEPENDS, >+ pkgDto.getId(), "Pre-Depends"); >+ addPackageDepData( >+ out, >+ TaskConstants.TASK_QUERY_REPOMD_GENERATOR_CAPABILITY_BREAKS, >+ pkgDto.getId(), "Breaks"); > > out.write("Filename: XMLRPC/GET-REQ/" + channelLabel + "/getPackage/" + > pkgDto.getName() + "-" + pkgDto.getVersion() + "-" + >@@ -186,22 +205,30 @@ public class DebPackageWriter { > int count = 0; > Collection<PackageCapabilityDto> capabilities = TaskManager > .getPackageCapabilityDtos(pkgId, query); >+ int icapcount = capabilities.size(); >+ String[] names = new String[icapcount]; >+ String[] versions = new String[icapcount]; > try { > for (PackageCapabilityDto capability : capabilities) { > if (count == 0) { > out.write(dep + ": "); > } >- else { >- out.write(", "); >- } >+ > count++; >- String name = capability.getName(); >- String version = capability.getVersion(); >- out.write(name); >- if (version != null && !version.isEmpty()) { >- out.write(" (" + version + ")"); >+ int iordernumber = Integer.parseInt(capability.getName().substring(capability.getName().indexOf("_") + 1)); >+ names[iordernumber] = capability.getName().substring(0,capability.getName().indexOf("_")); >+ versions[iordernumber] = capability.getVersion(); >+ } >+ >+ for (int iIndex = 0; iIndex < names.length; iIndex++) { >+ if (iIndex != 0) { >+ out.write(", "); >+ } >+ out.write(names[iIndex]); >+ if (versions[iIndex] != null && !versions[iIndex].isEmpty()) { >+ out.write(" (" + versions[iIndex] + ")"); > } >- } >+ } > } > catch (Exception e) { > log.debug("failed to write DEB dependency " + dep + " " + e.toString()); >diff --git a/schema/spacewalk/common/tables/rhnPackageBreaks.sql b/schema/spacewalk/common/tables/rhnPackageBreaks.sql >index e69de29..4178b99 100644 >--- a/schema/spacewalk/common/tables/rhnPackageBreaks.sql >+++ b/schema/spacewalk/common/tables/rhnPackageBreaks.sql >@@ -0,0 +1,41 @@ >+-- >+-- Copyright (c) 2010 Novell >+-- >+-- This software is licensed to you under the GNU General Public License, >+-- version 2 (GPLv2). There is NO WARRANTY for this software, express or >+-- implied, including the implied warranties of MERCHANTABILITY or FITNESS >+-- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 >+-- along with this software; if not, see >+-- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. >+-- >+-- >+ >+ >+CREATE TABLE rhnPackageBreaks >+( >+ package_id NUMBER NOT NULL >+ CONSTRAINT rhn_pkg_brks_package_fk >+ REFERENCES rhnPackage (id) >+ ON DELETE CASCADE, >+ capability_id NUMBER NOT NULL >+ CONSTRAINT rhn_pkg_brks_capability_fk >+ REFERENCES rhnPackageCapability (id), >+ sense NUMBER >+ DEFAULT (0) NOT NULL, >+ created timestamp with local time zone >+ DEFAULT (current_timestamp) NOT NULL, >+ modified timestamp with local time zone >+ DEFAULT (current_timestamp) NOT NULL >+) >+ENABLE ROW MOVEMENT >+; >+ >+CREATE UNIQUE INDEX rhn_pkg_brks_pid_cid_s_uq >+ ON rhnPackageBreaks (package_id, capability_id, sense) >+ TABLESPACE [[4m_tbs]]; >+ >+CREATE INDEX rhn_pkg_brks_cid_idx >+ ON rhnPackageBreaks (capability_id) >+ NOLOGGING >+ TABLESPACE [[4m_tbs]]; >+ >diff --git a/schema/spacewalk/common/tables/rhnPackagePredepends.sql b/schema/spacewalk/common/tables/rhnPackagePredepends.sql >index e69de29..6749a7d 100644 >--- a/schema/spacewalk/common/tables/rhnPackagePredepends.sql >+++ b/schema/spacewalk/common/tables/rhnPackagePredepends.sql >@@ -0,0 +1,41 @@ >+-- >+-- Copyright (c) 2010 Novell >+-- >+-- This software is licensed to you under the GNU General Public License, >+-- version 2 (GPLv2). There is NO WARRANTY for this software, express or >+-- implied, including the implied warranties of MERCHANTABILITY or FITNESS >+-- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 >+-- along with this software; if not, see >+-- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. >+-- >+-- >+ >+ >+CREATE TABLE rhnPackagePredepends >+( >+ package_id NUMBER NOT NULL >+ CONSTRAINT rhn_pkg_pdep_package_fk >+ REFERENCES rhnPackage (id) >+ ON DELETE CASCADE, >+ capability_id NUMBER NOT NULL >+ CONSTRAINT rhn_pkg_pdep_capability_fk >+ REFERENCES rhnPackageCapability (id), >+ sense NUMBER >+ DEFAULT (0) NOT NULL, >+ created timestamp with local time zone >+ DEFAULT (current_timestamp) NOT NULL, >+ modified timestamp with local time zone >+ DEFAULT (current_timestamp) NOT NULL >+) >+ENABLE ROW MOVEMENT >+; >+ >+CREATE UNIQUE INDEX rhn_pkg_pdep_pid_cid_s_uq >+ ON rhnPackagePredepends (package_id, capability_id, sense) >+ TABLESPACE [[4m_tbs]]; >+ >+CREATE INDEX rhn_pkg_pdep_cid_idx >+ ON rhnPackagePredepends (capability_id) >+ NOLOGGING >+ TABLESPACE [[4m_tbs]]; >+ >diff --git a/schema/spacewalk/common/tables/tables.deps b/schema/spacewalk/common/tables/tables.deps >index 25e79d4..d36fb57 100644 >--- a/schema/spacewalk/common/tables/tables.deps >+++ b/schema/spacewalk/common/tables/tables.deps >@@ -127,6 +127,8 @@ rhnPackageSuggests :: rhnPackage rhnPackageCapability > rhnPackageSupplements :: rhnPackage rhnPackageCapability > rhnPackageEnhances :: rhnPackage rhnPackageCapability > rhnPackageRecommends :: rhnPackage rhnPackageCapability >+rhnPackageBreaks :: rhnPackage rhnPackageCapability >+rhnPackagePredepends :: rhnPackage rhnPackageCapability > rhnPackageSource :: web_customer rhnSourceRPM rhnFile rhnPackageGroup \ > rhnChecksum > rhnPackageSyncBlacklist :: rhnPackageName web_customer >diff --git a/schema/spacewalk/oracle/triggers/rhnPackageBreaks.sql b/schema/spacewalk/oracle/triggers/rhnPackageBreaks.sql >index e69de29..b8a36a5 100644 >--- a/schema/spacewalk/oracle/triggers/rhnPackageBreaks.sql >+++ b/schema/spacewalk/oracle/triggers/rhnPackageBreaks.sql >@@ -0,0 +1,22 @@ >+ >+-- >+-- Copyright (c) 2010 Novell, Inc. >+-- >+-- This software is licensed to you under the GNU General Public License, >+-- version 2 (GPLv2). There is NO WARRANTY for this software, express or >+-- implied, including the implied warranties of MERCHANTABILITY or FITNESS >+-- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 >+-- along with this software; if not, see >+-- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. >+-- >+-- >+ >+create or replace trigger >+rhn_pkg_brks_mod_trig >+before insert or update on rhnPackageBreaks >+for each row >+begin >+ :new.modified := current_timestamp; >+end; >+/ >+show errors >diff --git a/schema/spacewalk/oracle/triggers/rhnPackagePredepends.sql b/schema/spacewalk/oracle/triggers/rhnPackagePredepends.sql >index e69de29..a4ba38e 100644 >--- a/schema/spacewalk/oracle/triggers/rhnPackagePredepends.sql >+++ b/schema/spacewalk/oracle/triggers/rhnPackagePredepends.sql >@@ -0,0 +1,22 @@ >+ >+-- >+-- Copyright (c) 2010 Novell, Inc. >+-- >+-- This software is licensed to you under the GNU General Public License, >+-- version 2 (GPLv2). There is NO WARRANTY for this software, express or >+-- implied, including the implied warranties of MERCHANTABILITY or FITNESS >+-- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 >+-- along with this software; if not, see >+-- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. >+-- >+-- >+ >+create or replace trigger >+rhn_pkg_pdep_mod_trig >+before insert or update on rhnPackagePredepends >+for each row >+begin >+ :new.modified := current_timestamp; >+end; >+/ >+show errors >diff --git a/schema/spacewalk/postgres/triggers/rhnPackageBreaks.sql b/schema/spacewalk/postgres/triggers/rhnPackageBreaks.sql >index e69de29..72f2b68 100644 >--- a/schema/spacewalk/postgres/triggers/rhnPackageBreaks.sql >+++ b/schema/spacewalk/postgres/triggers/rhnPackageBreaks.sql >@@ -0,0 +1,28 @@ >+-- oracle equivalent source sha1 e1adfb8d8046d85ac586a9b8a323c9b1eab76899 >+-- >+-- Copyright (c) 2010 Novell, Inc. >+-- >+-- This software is licensed to you under the GNU General Public License, >+-- version 2 (GPLv2). There is NO WARRANTY for this software, express or >+-- implied, including the implied warranties of MERCHANTABILITY or FITNESS >+-- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 >+-- along with this software; if not, see >+-- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. >+-- >+-- >+ >+create or replace function rhn_pkg_brks_mod_trig_fun() returns trigger as >+$$ >+begin >+ new.modified := current_timestamp; >+ >+ return new; >+end; >+$$ language plpgsql; >+ >+create trigger >+rhn_pkg_brks_mod_trig >+before insert or update on rhnPackageBreaks >+for each row >+execute procedure rhn_pkg_brks_mod_trig_fun(); >+ >diff --git a/schema/spacewalk/postgres/triggers/rhnPackagePredepends.sql b/schema/spacewalk/postgres/triggers/rhnPackagePredepends.sql >index e69de29..03a9d48 100644 >--- a/schema/spacewalk/postgres/triggers/rhnPackagePredepends.sql >+++ b/schema/spacewalk/postgres/triggers/rhnPackagePredepends.sql >@@ -0,0 +1,28 @@ >+-- oracle equivalent source sha1 e1adfb8d8046d85ac586a9b8a323c9b1eab76899 >+-- >+-- Copyright (c) 2010 Novell, Inc. >+-- >+-- This software is licensed to you under the GNU General Public License, >+-- version 2 (GPLv2). There is NO WARRANTY for this software, express or >+-- implied, including the implied warranties of MERCHANTABILITY or FITNESS >+-- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 >+-- along with this software; if not, see >+-- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. >+-- >+-- >+ >+create or replace function rhn_pkg_pdep_mod_trig_fun() returns trigger as >+$$ >+begin >+ new.modified := current_timestamp; >+ >+ return new; >+end; >+$$ language plpgsql; >+ >+create trigger >+rhn_pkg_pdep_mod_trig >+before insert or update on rhnPackagePredepends >+for each row >+execute procedure rhn_pkg_pdep_mod_trig_fun(); >+ >diff --git a/web/modules/rhn/RHN/DB/Package.pm b/web/modules/rhn/RHN/DB/Package.pm >index 2726d9b..c4ad517 100644 >--- a/web/modules/rhn/RHN/DB/Package.pm >+++ b/web/modules/rhn/RHN/DB/Package.pm >@@ -505,6 +505,60 @@ EOQ > return @ret; > } > >+sub breaks { >+ my $self = shift; >+ >+ my @ret; >+ my $dbh = RHN::DB->connect; >+ my $query; >+ my $sth; >+ >+ $query = <<EOQ; >+SELECT DISTINCT C.name, C.version, P.sense, UPPER(C.name) AS name_upper >+ FROM rhnPackageCapability C, rhnPackageBreaks P >+ WHERE P.package_id = ? >+ AND P.capability_id = C.id >+ORDER BY name_upper, C.version >+EOQ >+ >+ $sth = $dbh->prepare($query); >+ $sth->execute($self->id); >+ >+ my @columns; >+ while(@columns = $sth->fetchrow) { >+ push @ret, [ @columns ]; >+ } >+ >+ return @ret; >+} >+ >+sub predepends { >+ my $self = shift; >+ >+ my @ret; >+ my $dbh = RHN::DB->connect; >+ my $query; >+ my $sth; >+ >+ $query = <<EOQ; >+SELECT DISTINCT C.name, C.version, P.sense, UPPER(C.name) AS name_upper >+ FROM rhnPackageCapability C, rhnPackagePredepends P >+ WHERE P.package_id = ? >+ AND P.capability_id = C.id >+ORDER BY name_upper, C.version >+EOQ >+ >+ $sth = $dbh->prepare($query); >+ $sth->execute($self->id); >+ >+ my @columns; >+ while(@columns = $sth->fetchrow) { >+ push @ret, [ @columns ]; >+ } >+ >+ return @ret; >+} >+ > # given varying data, try to figure what freakin' package to load. > # NOTE: Might I say, this sucketh much donkey wong. Awaiting a better answer :( > sub guestimate_package_id {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 903068
:
685650
|
880583
|
881636
|
881637