summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'rox-base/zeroinstall-injector/files/zeroinstall-injector-0.27-local_feed.patch')
-rw-r--r--rox-base/zeroinstall-injector/files/zeroinstall-injector-0.27-local_feed.patch121
1 files changed, 121 insertions, 0 deletions
diff --git a/rox-base/zeroinstall-injector/files/zeroinstall-injector-0.27-local_feed.patch b/rox-base/zeroinstall-injector/files/zeroinstall-injector-0.27-local_feed.patch
new file mode 100644
index 0000000..a7fa7dc
--- /dev/null
+++ b/rox-base/zeroinstall-injector/files/zeroinstall-injector-0.27-local_feed.patch
@@ -0,0 +1,121 @@
+diff -ur zeroinstall-orig/0launch-gui/properties.py zeroinstall/0launch-gui/properties.py
+--- zeroinstall-orig/0launch-gui/properties.py 2007-04-08 04:50:32.000000000 -0600
++++ zeroinstall/0launch-gui/properties.py 2007-05-07 09:48:41.000000000 -0600
+@@ -263,7 +263,13 @@
+ model, miter = sel.get_selected()
+ if not miter: return # build in progress
+ iface = model[miter][Feeds.URI]
+- self.remove_feed_button.set_sensitive(iface != self.interface.uri)
++ # Only enable removing user_override feeds
++ enable_remove = False
++ for x in self.interface.feeds:
++ if x.uri == iface:
++ if x.user_override:
++ enable_remove = True
++ self.remove_feed_button.set_sensitive( enable_remove )
+ self.description.set_details(iface_cache.get_interface(iface))
+
+ def updated(self):
+diff -ur zeroinstall-orig/injector/model.py zeroinstall/injector/model.py
+--- zeroinstall-orig/injector/model.py 2007-04-06 13:22:30.000000000 -0600
++++ zeroinstall/injector/model.py 2007-05-07 09:48:41.000000000 -0600
+@@ -70,6 +70,7 @@
+ developer = Stability(10, 'developer', 'Work-in-progress - bugs likely')
+ testing = Stability(20, 'testing', 'Stability unknown - please test!')
+ stable = Stability(30, 'stable', 'Tested - no serious problems found')
++packaged = Stability(35, 'packaged', 'Supplied by the local package manager')
+ preferred = Stability(40, 'preferred', 'Best of all - must be set manually')
+
+ class Restriction(object):
+diff -ur zeroinstall-orig/injector/reader.py zeroinstall/injector/reader.py
+--- zeroinstall-orig/injector/reader.py 2007-04-07 02:47:20.000000000 -0600
++++ zeroinstall/injector/reader.py 2007-05-07 12:33:27.000000000 -0600
+@@ -41,7 +41,7 @@
+ before = parse_version(e.getAttribute('before'))))
+
+ def update_from_cache(interface):
+- """Read a cached interface and any user overrides.
++ """Read a cached interface and any local feeds or user overrides.
+ @param interface: the interface object to update
+ @type interface: L{model.Interface}
+ @return: True if cached version and user overrides loaded OK.
+@@ -61,7 +61,11 @@
+ debug("Loading cached information for %s from %s", interface, cached)
+ update(interface, cached)
+
+- update_user_overrides(interface)
++ if update_local_feeds(interface):
++ cached = True
++
++ if update_user_overrides(interface):
++ cached = True
+
+ # Special case: add our fall-back local copy of the injector as a feed
+ if interface.uri == injector_gui_uri:
+@@ -70,6 +74,49 @@
+
+ return bool(cached)
+
++def update_local_feeds(interface):
++ """Update an interface with system-supplied local feeds.
++ @param interface: the interface object to update
++ @type interface: L{model.Interface}
++ @return: True if a local feed was loaded.
++ @rtype: bool"""
++ debug( "update_local_feeds for %s" % escape(interface.uri) )
++ path = basedir.load_first_config(config_site, 'local_feeds',
++ escape(interface.uri))
++
++ if not path:
++ return False
++
++ debug( "Adding system-supplied local_feed from '%s'" % path )
++
++ # Ensure the local feed matches the specified interface
++ root = qdom.parse(file(path))
++ if root.getAttribute('uri') != interface.uri:
++ match = False
++ for item in root.childNodes:
++ if item.uri != XMLNS_IFACE: continue
++ if item.name == 'feed-for':
++ if interface.uri == item.getAttribute('interface'):
++ match = True
++ break
++ if not match:
++ raise InvalidInterface('Local feed does not match specified interface')
++
++ realpath = path
++ linkcount = 0
++ while os.path.islink(realpath):
++ # Add the "real" location, not the link
++ oldpath = realpath
++ realpath = os.readlink(oldpath)
++ if not realpath.startswith('/'):
++ realpath = os.path.join(os.path.dirname(oldpath), realpath)
++ linkcount += 1
++ if linkcount > 100:
++ raise InvalidInterface('Local feed symlink more than 100 levels deep, skipping')
++ interface.feeds.append(Feed(realpath, None, False))
++
++ return True
++
+ def update_user_overrides(interface):
+ """Update an interface with user-supplied information.
+ @param interface: the interface object to update
+@@ -77,7 +124,7 @@
+ user = basedir.load_first_config(config_site, config_prog,
+ 'user_overrides', escape(interface.uri))
+ if not user:
+- return
++ return False
+
+ root = qdom.parse(file(user))
+
+@@ -113,6 +160,7 @@
+ if not feed_src:
+ raise InvalidInterface('Missing "src" attribute in <feed>')
+ interface.feeds.append(Feed(feed_src, item.getAttribute('arch'), True))
++ return True
+
+ def check_readable(interface_uri, source):
+ """Test whether an interface file is valid.