Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add support for wildcards; added mappings file; add script to fetch a…

… single release
  • Loading branch information...
commit a4229f7ec46b94cf7e936c44d9bd4aa0a549f9ad 1 parent 557ff18
@wbamberg wbamberg authored
Showing with 134 additions and 1 deletion.
  1. +18 −0 get_release.sh
  2. +104 −0 mappings.txt
  3. +12 −1 obsolete.py
View
18 get_release.sh
@@ -0,0 +1,18 @@
+
+mkdir sdk/$1
+
+mkdir working
+cd working
+
+mkdir $1
+cd $1
+
+curl -O https://ftp.mozilla.org/pub/mozilla.org/labs/jetpack/addon-sdk-$1.tar.gz
+tar -xf addon-sdk-$1.tar.gz
+cd addon-sdk-$1
+source bin/activate
+cfx sdocs
+tar -xf addon-sdk-docs.tgz
+mv addon-sdk-docs/* ../../../sdk/$1
+mv doc/* ../../../sdk/$1
+cd ../../
View
104 mappings.txt
@@ -0,0 +1,104 @@
+sdk/*/dev-guide/addon-development/commonjs.html sdk/1.11/dev-guide/guides/commonjs.html
+sdk/*/dev-guide/addon-development/console.html sdk/1.11/dev-guide/console.html
+sdk/*/dev-guide/addon-development/events.html sdk/1.11/dev-guide/guides/events.html
+sdk/*/dev-guide/addon-development/getting-started.html sdk/1.11/dev-guide/tutorials/index.html
+sdk/*/dev-guide/addon-development/guides.html sdk/1.11/dev-guide/guides/index.html
+sdk/*/dev-guide/addon-development/implementing-reusable-module.html sdk/1.11/dev-guide/tutorials/reusable-modules.html
+sdk/*/dev-guide/addon-development/implementing-simple-addon.html sdk/1.11/dev-guide/tutorials/getting-started-with-cfx.html
+sdk/*/dev-guide/addon-development/installation.html sdk/1.11/dev-guide/tutorials/installation.html
+sdk/*/dev-guide/addon-development/l10n.html sdk/1.11/dev-guide/tutorials/l10n.html
+sdk/*/dev-guide/addon-development/library-detector.html sdk/1.11/dev-guide/guides/library-detector.html
+sdk/*/dev-guide/addon-development/mobile.html sdk/1.11/dev-guide/tutorials/mobile.html
+sdk/*/dev-guide/addon-development/module-search.html sdk/1.11/dev-guide/guides/module-search.html
+sdk/*/dev-guide/addon-development/package-spec.html sdk/1.11/dev-guide/package-spec.html
+sdk/*/dev-guide/addon-development/program-id.html sdk/1.11/dev-guide/guides/program-id.html
+sdk/*/dev-guide/addon-development/sdk-vs-xul.html sdk/1.11/dev-guide/guides/sdk-vs-xul.html
+sdk/*/dev-guide/addon-development/third-party-packages.html sdk/1.11/dev-guide/third-party-apis.html
+sdk/*/dev-guide/addon-development/troubleshooting.html sdk/1.11/dev-guide/tutorials/troubleshooting.html
+sdk/*/dev-guide/addon-development/tutorials.html sdk/1.11/dev-guide/tutorials/index.html
+sdk/*/dev-guide/addon-development/two-types-of-scripts.html sdk/1.11/dev-guide/guides/two-types-of-scripts.html
+sdk/*/dev-guide/addon-development/web-content.html sdk/1.11/dev-guide/guides/content-scripts/index.html
+sdk/*/dev-guide/addon-development/xul-migration.html sdk/1.11/dev-guide/guides/xul-migration.html
+sdk/*/dev-guide/addon-development/annotator/annotator.html sdk/1.11/dev-guide/tutorials/annotator/index.html
+sdk/*/dev-guide/addon-development/annotator/creating.html sdk/1.11/dev-guide/tutorials/annotator/creating.html
+sdk/*/dev-guide/addon-development/annotator/displaying.html sdk/1.11/dev-guide/tutorials/annotator/displaying.html
+sdk/*/dev-guide/addon-development/annotator/overview.html sdk/1.11/dev-guide/tutorials/annotator/overview.html
+sdk/*/dev-guide/addon-development/annotator/storing.html sdk/1.11/dev-guide/tutorials/annotator/storing.html
+sdk/*/dev-guide/addon-development/annotator/widget.html sdk/1.11/dev-guide/tutorials/annotator/widget.html
+sdk/*/dev-guide/addon-development/content-scripts/access.html sdk/1.11/dev-guide/guides/content-scripts/accessing-the-dom.html
+sdk/*/dev-guide/addon-development/content-scripts/loading.html sdk/1.11/dev-guide/guides/content-scripts/loading.html
+sdk/*/dev-guide/addon-development/content-scripts/reddit-example.html sdk/1.11/dev-guide/guides/content-scripts/reddit-example.html
+sdk/*/dev-guide/addon-development/content-scripts/using-port.html sdk/1.11/dev-guide/guides/content-scripts/using-port.html
+sdk/*/dev-guide/addon-development/content-scripts/using-postmessage.html sdk/1.11/dev-guide/guides/content-scripts/using-postmessage.html
+sdk/*/dev-guide/appendices/credits.html sdk/1.11/dev-guide/credits.html
+sdk/*/dev-guide/appendices/glossary.html sdk/1.11/dev-guide/glossary.html
+sdk/*/dev-guide/module-development/chrome.html sdk/1.11/dev-guide/tutorials/chrome.html
+sdk/*/dev-guide/module-development/globals.html sdk/1.11/packages/api-utils/globals.html
+sdk/*/dev-guide/module-development/guides.html sdk/1.11/dev-guide/guides/index.html
+sdk/*/dev-guide/module-development/tutorials.html sdk/1.11/dev-guide/tutorials/index.html
+sdk/*/packages/addon-kit/addon-kit.html sdk/1.11/packages/addon-kit/index.html
+sdk/*/packages/addon-kit/docs/clipboard.html sdk/1.11/packages/addon-kit/clipboard.html
+sdk/*/packages/addon-kit/docs/context-menu.html sdk/1.11/packages/addon-kit/context-menu.html
+sdk/*/packages/addon-kit/docs/hotkeys.html sdk/1.11/packages/addon-kit/hotkeys.html
+sdk/*/packages/addon-kit/docs/notifications.html sdk/1.11/packages/addon-kit/notifications.html
+sdk/*/packages/addon-kit/docs/page-mod.html sdk/1.11/packages/addon-kit/page-mod.html
+sdk/*/packages/addon-kit/docs/page-worker.html sdk/1.11/packages/addon-kit/page-worker.html
+sdk/*/packages/addon-kit/docs/panel.html sdk/1.11/packages/addon-kit/panel.html
+sdk/*/packages/addon-kit/docs/passwords.html sdk/1.11/packages/addon-kit/passwords.html
+sdk/*/packages/addon-kit/docs/private-browsing.html sdk/1.11/packages/addon-kit/private-browsing.html
+sdk/*/packages/addon-kit/docs/request.html sdk/1.11/packages/addon-kit/request.html
+sdk/*/packages/addon-kit/docs/selection.html sdk/1.11/packages/addon-kit/selection.html
+sdk/*/packages/addon-kit/docs/self.html sdk/1.11/packages/addon-kit/self.html
+sdk/*/packages/addon-kit/docs/simple-prefs.html sdk/1.11/packages/addon-kit/simple-prefs.html
+sdk/*/packages/addon-kit/docs/simple-storage.html sdk/1.11/packages/addon-kit/simple-storage.html
+sdk/*/packages/addon-kit/docs/tabs.html sdk/1.11/packages/addon-kit/tabs.html
+sdk/*/packages/addon-kit/docs/timers.html sdk/1.11/packages/addon-kit/timers.html
+sdk/*/packages/addon-kit/docs/widget.html sdk/1.11/packages/addon-kit/widget.html
+sdk/*/packages/addon-kit/docs/windows.html sdk/1.11/packages/addon-kit/windows.html
+sdk/*/packages/api-utils/api-utils.html sdk/1.11/packages/api-utils/index.html
+sdk/*/packages/api-utils/docs/api-utils.html sdk/1.11/packages/api-utils/api-utils.html
+sdk/*/packages/api-utils/docs/app-strings.html sdk/1.11/packages/api-utils/app-strings.html
+sdk/*/packages/api-utils/docs/base.html sdk/1.11/packages/api-utils/base.html
+sdk/*/packages/api-utils/docs/byte-streams.html sdk/1.11/packages/api-utils/byte-streams.html
+sdk/*/packages/api-utils/docs/collection.html sdk/1.11/packages/api-utils/collection.html
+sdk/*/packages/api-utils/docs/content.html sdk/1.11/packages/api-utils/content.html
+sdk/*/packages/api-utils/docs/cortex.html sdk/1.11/packages/api-utils/cortex.html
+sdk/*/packages/api-utils/docs/cuddlefish.html sdk/1.11/packages/api-utils/cuddlefish.html
+sdk/*/packages/api-utils/docs/environment.html sdk/1.11/packages/api-utils/environment.html
+sdk/*/packages/api-utils/docs/errors.html sdk/1.11/packages/api-utils/errors.html
+sdk/*/packages/api-utils/docs/events.html sdk/1.11/packages/api-utils/events.html
+sdk/*/packages/api-utils/docs/file.html sdk/1.11/packages/api-utils/file.html
+sdk/*/packages/api-utils/docs/hidden-frame.html sdk/1.11/packages/api-utils/hidden-frame.html
+sdk/*/packages/api-utils/docs/httpd.html sdk/1.11/packages/api-utils/httpd.html
+sdk/*/packages/api-utils/docs/light-traits.html sdk/1.11/packages/api-utils/light-traits.html
+sdk/*/packages/api-utils/docs/list.html sdk/1.11/packages/api-utils/list.html
+sdk/*/packages/api-utils/docs/match-pattern.html sdk/1.11/packages/api-utils/match-pattern.html
+sdk/*/packages/api-utils/docs/memory.html sdk/1.11/packages/api-utils/memory.html
+sdk/*/packages/api-utils/docs/message-manager.html sdk/1.11/packages/api-utils/message-manager.html
+sdk/*/packages/api-utils/docs/namespace.html sdk/1.11/packages/api-utils/namespace.html
+sdk/*/packages/api-utils/docs/observer-service.html sdk/1.11/packages/api-utils/observer-service.html
+sdk/*/packages/api-utils/docs/plain-text-console.html sdk/1.11/packages/api-utils/plain-text-console.html
+sdk/*/packages/api-utils/docs/preferences-service.html sdk/1.11/packages/api-utils/preferences-service.html
+sdk/*/packages/api-utils/docs/runtime.html sdk/1.11/packages/api-utils/runtime.html
+sdk/*/packages/api-utils/docs/sandbox.html sdk/1.11/packages/api-utils/sandbox.html
+sdk/*/packages/api-utils/docs/tab-browser.html sdk/1.11/packages/api-utils/tab-browser.html
+sdk/*/packages/api-utils/docs/text-streams.html sdk/1.11/packages/api-utils/text-streams.html
+sdk/*/packages/api-utils/docs/traceback.html sdk/1.11/packages/api-utils/traceback.html
+sdk/*/packages/api-utils/docs/traits.html sdk/1.11/packages/api-utils/traits.html
+sdk/*/packages/api-utils/docs/unit-test.html sdk/1.11/packages/api-utils/unit-test.html
+sdk/*/packages/api-utils/docs/unload.html sdk/1.11/packages/api-utils/unload.html
+sdk/*/packages/api-utils/docs/url.html sdk/1.11/packages/api-utils/url.html
+sdk/*/packages/api-utils/docs/window-utils.html sdk/1.11/packages/api-utils/window-utils.html
+sdk/*/packages/api-utils/docs/xhr.html sdk/1.11/packages/api-utils/xhr.html
+sdk/*/packages/api-utils/docs/xpcom.html sdk/1.11/packages/api-utils/xpcom.html
+sdk/*/packages/api-utils/docs/xul-app.html sdk/1.11/packages/api-utils/xul-app.html
+sdk/*/packages/api-utils/docs/content/loader.html sdk/1.11/packages/api-utils/content/loader.html
+sdk/*/packages/api-utils/docs/content/proxy.html sdk/1.11/packages/api-utils/content/proxy.html
+sdk/*/packages/api-utils/docs/content/symbiont.html sdk/1.11/packages/api-utils/content/symbiont.html
+sdk/*/packages/api-utils/docs/content/worker.html sdk/1.11/packages/api-utils/content/worker.html
+sdk/*/packages/test-harness/test-harness.html sdk/1.11/packages/test-harness/index.html
+sdk/*/packages/test-harness/docs/harness.html sdk/1.11/packages/test-harness/harness.html
+sdk/*/packages/test-harness/docs/run-tests.html sdk/1.11/packages/test-harness/run-tests.html
+sdk/1.6/dev-guide/guides/content-scripts/access.html sdk/1.11/dev-guide/guides/content-scripts/accessing-the-dom.html
+sdk/1.7/dev-guide/guides/content-scripts/access.html sdk/1.11/dev-guide/guides/content-scripts/accessing-the-dom.html
+sdk/1.8/dev-guide/guides/content-scripts/access.html sdk/1.11/dev-guide/guides/content-scripts/accessing-the-dom.html
View
13 obsolete.py
@@ -41,6 +41,12 @@ def create_link_from_replacement_path(path_and_filename, replacement_path_and_fi
prefix = "../" * depth
return prefix + replacement_path_and_filename
+def get_wildcarded(path):
+ # only the version may be wildcarded, and we assume it's at pos number 2
+ pieces = path.split(os.sep)
+ pieces[1] = "*"
+ return os.sep.join(pieces)
+
def obsolete(obsoleted, latest, mappings):
missing_files = []
for (dirpath, dirnames, filenames) in os.walk(os.sep.join(["sdk", obsoleted])):
@@ -48,11 +54,16 @@ def obsolete(obsoleted, latest, mappings):
if not filename.endswith(".html"):
continue
path_and_filename = os.sep.join([dirpath, filename])
- # first, look for a replacement in mappings
+ # first, look for an exact replacement in mappings
replacement_path_and_filename = mappings.get(path_and_filename, "")
if replacement_path_and_filename:
insert_notice(path_and_filename, replacement_path_and_filename, OBSOLETE_NOTICE_POSTAMBLE)
continue
+ # next, look for a wildcard replacement in mappings
+ replacement_path_and_filename = mappings.get(get_wildcarded(path_and_filename), "")
+ if replacement_path_and_filename:
+ insert_notice(path_and_filename, replacement_path_and_filename, OBSOLETE_NOTICE_POSTAMBLE)
+ continue
# next, see if the same file exists in "latest"
dirpieces = path_and_filename.split(os.sep)
dirpieces[1] = latest
Please sign in to comment.
Something went wrong with that request. Please try again.