Permalink
Browse files

Update README.

  • Loading branch information...
1 parent e0d5b3b commit 1e460aebded3f947e940c3457a65be45af0b23ab @ochameau committed Jul 12, 2012
Showing with 44 additions and 11 deletions.
  1. +33 −11 README.md
  2. +8 −0 sdks/clone_all_sdk_versions.sh
  3. +3 −0 sdks/get_sdk_released_versions.sh
View
@@ -1,16 +1,18 @@
```
$ python unpack.py -h
-usage: SDK addons repacker [-h] [--batch] [--target TARGET]
- {deps,checksum,unpack,repack} path
+usage: SDK addons repacker [-h] [--batch] [--target TARGET] [--force] [--diff]
+ [--diffstat] [--sdk SDK] [--sdks SDKS]
+ {deps,checksum,unpack,repackability,repack} path
Available actions:
- `deps`: display dependencies used by the addon
- `checksum`: verify that the addon is only using official SDK files
- `unpack`: create a source package out of an "compiled" addon
- - `repack`: rebuild an addon with another SDK version (need SDK `cfx` application)
+ - `repackability`: do various sanity check to see how safe the repack would be (requires `--sdks` argument)
+ - `repack`: rebuild an addon with another SDK version (requires `--sdk` argument)
positional arguments:
- {deps,checksum,unpack,repack}
+ {deps,checksum,unpack,repackability,repack}
Action to execute
path path to either a xpi file or an extension folder to
process
@@ -20,19 +22,30 @@ optional arguments:
--batch Process `path` argument as a folder containing
multiple addons
--target TARGET Folder where to put repacked xpi file(s)
+ --force Force unpack/repack even if checksums are wrong and
+ addon are using a patched SDK version.
+ --diff Print a diff patch between original XPI and repacked
+ one.
+ --diffstat Print a diff statistics between original XPI and
+ repacked one.
+ --sdk SDK Path to SDK folder to use for repacking.
+ --sdks SDKS Path to the directory with each released SDK version.
```
```
+# Print SDK version use for a given addon and which packages/modules is it using
$ python unpack.py deps addon.xpi
-345003/; 1.2.1; {"addon-kit": ["hotkeys", "tabs", "widget"], "auf-trollbook-posten": ["main"]}
+addon.xpi; 1.2.1; {"addon-kit": ["hotkeys", "tabs", "widget"], "auf-trollbook-posten": ["main"]}
```
```
+# Verify all SDK files shipped in the xpi and ensure that checksums are original ones
$ python unpack.py checksum addon.xpi
-345003/; 1.2.1; OK; [] <-- [] means no patched files. otherwise you get the list of non-official files
+addon.xpi; 1.2.1; OK; [] <-- [] means no patched files. otherwise you get the list of non-official files
```
```
+# Unpack an xpi to sources files
$ mkdir addon/
$ python unpack.py unpack addon.xpi --target addon/
$ ls -R addon
@@ -48,10 +61,19 @@ addon/locale:
```
```
-$ cd .../addon-sdk
-$ source bin/activate
-$ cd .../unpacker
-$ python unpack.py repack 345003/
-Successfully repacked 345003/ to 345003-repacked.xpi
+# Repack a given addon with a given SDK version
+$ cd .../repacker
+$ python unpack.py repack my-addon.xpi --sdk /path/to/a/sdk/folder
+Successfully repacked my-addon.xpi to my-addon-repacked.xpi
+```
+
+```
+# Sanity check for a given addon. Ensure that the repacker works fine and that the given xpi hasn't be manually modified.
+$ cd .../repacker
+$ cd sdks/
+$ ./clone_all_sdk_versions.sh
+$ cd ..
+$ python unpack.py repackability my-addon.xpi --sdks /absolute/path/to/sdks/folder
+Successfully repacked my-addon.xpi to my-addon-repacked.xpi
```
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+for i in `./get_sdk_released_versions.sh`; do
+ if [ ! -d $i ]; then
+ echo "clone " $i " ..."
+ git clone http://github.com/mozilla/addon-sdk -q --branch $i --depth 1 $i;
+ fi
+done
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+git ls-remote -t http://github.com/mozilla/addon-sdk "refs/tags/[1-9].*" | sed 's:.*/::'

0 comments on commit 1e460ae

Please sign in to comment.