tag 458993 patch
thanks

The attached (very rough) patch allows rubber to support chapterbib
properly by adding '% rubber: bibtex.chapterbib 1' to the initial
document.

[Someone who has more experience in coding python than myself should
probably check it out before blindly applying it.]


Don Armstrong

-- 
If it jams, force it. If it breaks, it needed replacing anyway.
 -- Lowery's Law

http://www.donarmstrong.com              http://rzlab.ucr.edu
diff -u rubber-1.1/debian/changelog rubber-1.1/debian/changelog
--- rubber-1.1/debian/changelog
+++ rubber-1.1/debian/changelog
@@ -1,3 +1,9 @@
+rubber (1.1-2.2) unstable; urgency=low
+
+  * Properly handle chapterbib
+
+ -- Don Armstrong <[EMAIL PROTECTED]>  Thu, 20 Mar 2008 18:17:29 -0700
+
 rubber (1.1-2.1) unstable; urgency=low
 
   * Non-maintainer upload.
only in patch2:
unchanged:
--- rubber-1.1.orig/src/rules/latex/bibtex.py
+++ rubber-1.1/src/rules/latex/bibtex.py
@@ -39,7 +39,7 @@
 	funcionality required when compiling documents as well as material to
 	parse blg files for diagnostics.
 	"""
-	def __init__ (self, doc, dict, base=None):
+	def __init__ (self, doc, dict, base=None,chapterbib=None):
 		"""
 		Initialize the state of the module and register appropriate functions
 		in the main process. The extra arugment 'base' can be used to specify
@@ -48,10 +48,15 @@
 		self.doc = doc
 		self.env = doc.env
 
-		if base is None:
-			self.base = doc.src_base
+                if base is None:
+                        self.base = doc.src_base
+                else:
+                        self.base = base
+
+		if chapterbib is None:
+			self.chapterbib = 0
 		else:
-			self.base = base
+			self.chapterbib = 1
 
 		cwd = self.env.vars["cwd"]
 		self.bib_path = [cwd]
@@ -240,7 +245,6 @@
 		This method actually runs BibTeX with the appropriate environment
 		variables set.
 		"""
-		msg.progress(_("running BibTeX on %s") % self.base)
 		doc = {}
 		if len(self.bib_path) != 1:
 			doc["BIBINPUTS"] = string.join(self.bib_path +
@@ -248,9 +252,17 @@
 		if len(self.bst_path) != 1:
 			doc["BSTINPUTS"] = string.join(self.bst_path +
 				[os.getenv("BSTINPUTS", "")], ":")
-		if self.env.execute(["bibtex", self.base], doc):
-			msg.info(_("There were errors making the bibliography."))
-			return 1
+		if self.chapterbib:
+			for auxname in self.doc.aux_md5.keys():
+				msg.progress(_("running BibTeX on %s") % auxname)
+				if self.env.execute(["bibtex", auxname], doc):
+					msg.info(_("There were errors making the bibliography."))
+					return 1
+		else:
+			msg.progress(_("running BibTeX on %s") % self.base)
+			if self.env.execute(["bibtex", self.base], doc):
+				msg.info(_("There were errors making the bibliography."))
+				return 1
 		self.run_needed = 0
 		self.doc.must_compile = 1
 		return 0

Reply via email to