← Back to team overview

ubuntu-packaging-guide-team team mailing list archive

[Merge] lp:~andrewsomething/ubuntu-packaging-guide/fix-single-html into lp:ubuntu-packaging-guide

 

Andrew Starr-Bochicchio has proposed merging lp:~andrewsomething/ubuntu-packaging-guide/fix-single-html into lp:ubuntu-packaging-guide.

Requested reviews:
  Ubuntu Packaging Guide Team (ubuntu-packaging-guide-team)
Related bugs:
  Bug #1014639 in Ubuntu Packaging Guide: "http://developer.ubuntu.com/packaging/singlehtml does not work anymore"
  https://bugs.launchpad.net/ubuntu-packaging-guide/+bug/1014639

For more details, see:
https://code.launchpad.net/~andrewsomething/ubuntu-packaging-guide/fix-single-html/+merge/120667

This branch fixes the installation of the singlehtml version. This
is done by adding a .install file. This also adjusts the add-languages
script to write the new file. Additionally, this fixes the linking
code in debian/rules to actually link identical files again as well as
link for non-english packages.

If we can land this soon. We might still get to upload before Feature
Freeze.
-- 
https://code.launchpad.net/~andrewsomething/ubuntu-packaging-guide/fix-single-html/+merge/120667
Your team Ubuntu Packaging Guide Team is requested to review the proposed merge of lp:~andrewsomething/ubuntu-packaging-guide/fix-single-html into lp:ubuntu-packaging-guide.
=== modified file 'debian/changelog'
--- debian/changelog	2012-08-09 08:56:42 +0000
+++ debian/changelog	2012-08-21 21:29:20 +0000
@@ -20,6 +20,7 @@
   * debian/rules: Add a get-orig-source target.
   * Drop udd-newpackage page. It's contents are sufficiently covered in
     the packaging-new-software page (LP: #942754).
+  * Fix installation of singlehtml (LP: #1014639).
 
   [ Andrew Starr-Bochicchio + Daniel Holbach ]
   * provide a means to ship per-language per-flavour packages, if a certain

=== modified file 'debian/rules'
--- debian/rules	2012-06-23 00:42:27 +0000
+++ debian/rules	2012-08-21 21:29:20 +0000
@@ -15,14 +15,10 @@
 	dh_compress -X usr/share/doc/ubuntu-packaging-guide-html/_sources
 
 override_dh_link:
-	# symlink identical resources.
-	for version in html epub pdf; do \
-		if [ "$$version" = "html" ]; then subversion="html singlehtml"; \
-		else subversion=$$version; \
-		fi; \
-		for sv in $$subversion; do \
-			cd debian/ubuntu-packaging-guide-$$version && LC_ALL=C fdupes -r1nq \
-				usr/share/doc/ubuntu-packaging-guide-$$version/$$sv | while read s; do \
+	# symlink identical resources. Only needed for the html packages.
+	for lang in `find debian/ -maxdepth 1 -iname *html* -type d | cut -c 30-`; do \
+		cd debian/ubuntu-packaging-guide$$lang && LC_ALL=C fdupes -r1nq \
+		usr/share/doc/ubuntu-packaging-guide$$lang | while read s; do \
 				set -- $$(echo $$s | tr ' ' '\n' | sort); \
 				f=$$1; shift; \
 				for d; do \
@@ -30,9 +26,8 @@
 					rm $$f; ln -s /$$d $$f; \
 				done; \
 			done; \
-			cd -; \
-		done; \
-	done;
+		cd -; \
+	done
 	# use system copies of jquery and underscore instead.
 	for filename in `find $$DEBIANDIR -wholename '*/_static/jquery.js'`; do \
 		rm $$filename; \

=== modified file 'debian/scripts/add-languages'
--- debian/scripts/add-languages	2012-06-15 15:08:29 +0000
+++ debian/scripts/add-languages	2012-08-21 21:29:20 +0000
@@ -123,6 +123,27 @@
         template_file = os.path.join(self.base_path, "debian/" + template_name + ".docs")
         new_file = os.path.join(self.base_path, "debian/" + new_package_name + ".docs")
         doc_type = template_name.split("-")[-1]
+        if template_name.endswith("html"):
+            self.write_docs_file(template_file, new_file, doc_type, language)
+            install_file = os.path.join(self.base_path, 
+                                        "debian/" + template_name + ".install")
+            new_install_file = os.path.join(self.base_path,
+                                            "debian/" + new_package_name + ".install")
+            with open(install_file, "r") as install_file:
+                lines = install_file.readlines()
+            with open(new_install_file, "w") as new_install_file:
+                for line in lines:
+                    source = re.sub("%s/" % doc_type,
+                                          "%s/%s/" % (doc_type, language),
+                                          line.split('\t')[0])
+                    dest = re.sub("-%s/" % doc_type,
+                                          "-%s-%s/" % (doc_type, language),
+                                          line.split('\t')[-1])
+                    new_install_file.write(source + '\t' + dest)
+        else:
+            self.write_docs_file(template_file, new_file, doc_type, language)
+
+    def write_docs_file(self, template_file, new_file, doc_type, language):
         with open(template_file, "r") as template_file:
             lines = template_file.readlines()
         with open(new_file, "w") as new_file:

=== modified file 'debian/ubuntu-packaging-guide-html.docs'
--- debian/ubuntu-packaging-guide-html.docs	2012-06-13 16:16:04 +0000
+++ debian/ubuntu-packaging-guide-html.docs	2012-08-21 21:29:20 +0000
@@ -1,7 +1,3 @@
-_build/singlehtml/_images
-_build/singlehtml/index.html
-_build/singlehtml/objects.inv
-_build/singlehtml/_static
 _build/html/*.html
 _build/html/_images
 _build/html/_static

=== added file 'debian/ubuntu-packaging-guide-html.install'
--- debian/ubuntu-packaging-guide-html.install	1970-01-01 00:00:00 +0000
+++ debian/ubuntu-packaging-guide-html.install	2012-08-21 21:29:20 +0000
@@ -0,0 +1,3 @@
+_build/singlehtml/_images	usr/share/doc/ubuntu-packaging-guide-html/singlehtml/
+_build/singlehtml/index.html	usr/share/doc/ubuntu-packaging-guide-html/singlehtml/
+_build/singlehtml/_static	usr/share/doc/ubuntu-packaging-guide-html/singlehtml/


Follow ups