icecat: add release icecat-140.6.0-1gnu1 for aramo
This commit is contained in:
parent
92fef42cd6
commit
17ba0259bf
3382 changed files with 457689 additions and 569094 deletions
|
|
@ -13,3 +13,82 @@ I needed to make changes to some of the test MARs in this directory and it was a
|
|||
- I had a bit of trouble figuring out the signing. Eventually I discovered the following things: (a) The test MAR signatures successfully verify against `toolkit/mozapps/update/updater/xpcshellCertificate.der` and (b) according to [this comment](https://searchfox.org/mozilla-central/rev/fc00627e34639ef1014e87d9fa24091905e9dc5d/toolkit/mozapps/update/updater/moz.build#41-43), that certificate was generated from `mycert` in `modules/libmar/tests/unit/data`. Thus, I signed the MAR like this: `../<obj>/dist/bin/signmar -d ../modules/libmar/tests/unit/data -n mycert -s partial_mac_unsigned.mar partial_mac.mar`.
|
||||
- I wanted to do some verification to make sure that the new MAR looked right. First I verified the signature: `../<obj>/dist/bin/signmar -D ../toolkit/mozapps/update/updater/xpcshellCertificate.der -v partial_mac.mar`. This appears to output nothing on success, but it's probably good to check to make sure `echo $?` is `0`. I also compared the output of `mar -T partial_mac.mar` to that of the original. I saw a few unexpected size changes which I believe are likely due to slight differences in the compression used (maybe the algorithm changed slightly since this was last generated?). To make sure that these did not correspond to effective changes, I extracted the new MAR with `mkdir cmp && cd cmp && mar -J -x ../partial_mac.mar && cd ..` and compared the resulting files to make sure they had the expected contents.
|
||||
- Overwrite the original MAR with the new one and remove the `temp` directory: `cd .. && mv -f temp/partial_mac.mar toolkit/mozapps/update/tests/data/partial_mac.mar && rm -rf temp`
|
||||
|
||||
In bug 1950055, we wanted to support Zucchini as an alternative to bspatch. Below are the steps we went through to generate partial_zucchini.mar from partial.mar, with inspiration from the text above.
|
||||
|
||||
- Realize that in partial.mar, all exe patches are the same patch (turning `complete.exe` into `partial.exe`), and all png patches are the same patch (turning `complete.png` into `partial.png`):
|
||||
|
||||
```
|
||||
$ mar -J -x ../partial.mar
|
||||
|
||||
$ grep -r MBDIFF10 .
|
||||
Binary file ./0/00/00png0.png.patch matches
|
||||
Binary file ./0/0exe0.exe.patch matches
|
||||
Binary file ./distribution/extensions/extensions0/extensions0png0.png.patch matches
|
||||
Binary file ./distribution/extensions/extensions0/extensions0png1.png.patch matches
|
||||
Binary file ./distribution/extensions/extensions1/extensions1png0.png.patch matches
|
||||
Binary file ./distribution/extensions/extensions1/extensions1png1.png.patch matches
|
||||
Binary file ./exe0.exe.patch matches
|
||||
Binary file ./searchplugins/searchpluginspng0.png.patch matches
|
||||
Binary file ./searchplugins/searchpluginspng1.png.patch matches
|
||||
|
||||
$ md5sum ./0/00/00png0.png.patch ./distribution/extensions/extensions0/extensions0png0.png.patch ./distribution/extensions/extensions0/extensions0png1.png.patch ./distribution/extensions/extensions1/extensions1png0.png.patch ./distribution/extensions/extensions1/extensions1png1.png.patch ./searchplugins/searchpluginspng0.png.patch ./searchplugins/searchpluginspng1.png.patch
|
||||
69ab8dc8614e6bb154c029b12ca8e3e9 *./0/00/00png0.png.patch
|
||||
69ab8dc8614e6bb154c029b12ca8e3e9 *./distribution/extensions/extensions0/extensions0png0.png.patch
|
||||
69ab8dc8614e6bb154c029b12ca8e3e9 *./distribution/extensions/extensions0/extensions0png1.png.patch
|
||||
69ab8dc8614e6bb154c029b12ca8e3e9 *./distribution/extensions/extensions1/extensions1png0.png.patch
|
||||
69ab8dc8614e6bb154c029b12ca8e3e9 *./distribution/extensions/extensions1/extensions1png1.png.patch
|
||||
69ab8dc8614e6bb154c029b12ca8e3e9 *./searchplugins/searchpluginspng0.png.patch
|
||||
69ab8dc8614e6bb154c029b12ca8e3e9 *./searchplugins/searchpluginspng1.png.patch
|
||||
|
||||
$ md5sum ./0/0exe0.exe.patch ./exe0.exe.patch
|
||||
bd6e413d3248cfbeff65e104b6c4cd39 *./0/0exe0.exe.patch
|
||||
bd6e413d3248cfbeff65e104b6c4cd39 *./exe0.exe.patch
|
||||
```
|
||||
|
||||
- Generate the equivalent zucchini patches:
|
||||
|
||||
```
|
||||
$ ./obj-x86_64-pc-windows-msvc/dist/bin/zucchini.exe -gen toolkit/mozapps/update/tests/data/complete.exe toolkit/mozapps/update/tests/data/partial.exe exe0.exe.patch -keep
|
||||
$ ./obj-x86_64-pc-windows-msvc/dist/bin/zucchini.exe -gen toolkit/mozapps/update/tests/data/complete.png toolkit/mozapps/update/tests/data/partial.png 00png0.png.patch -keep
|
||||
```
|
||||
|
||||
- Replace all patch files on disk by their Zucchini equivalent, then double check by rerunning the `md5sum` commands:
|
||||
|
||||
```
|
||||
$ grep -r Zucc .
|
||||
Binary file ./0/00/00png0.png.patch matches
|
||||
Binary file ./0/0exe0.exe.patch matches
|
||||
Binary file ./distribution/extensions/extensions0/extensions0png0.png.patch matches
|
||||
Binary file ./distribution/extensions/extensions0/extensions0png1.png.patch matches
|
||||
Binary file ./distribution/extensions/extensions1/extensions1png0.png.patch matches
|
||||
Binary file ./distribution/extensions/extensions1/extensions1png1.png.patch matches
|
||||
Binary file ./exe0.exe.patch matches
|
||||
Binary file ./searchplugins/searchpluginspng0.png.patch matches
|
||||
Binary file ./searchplugins/searchpluginspng1.png.patch matches
|
||||
|
||||
$ md5sum ./0/00/00png0.png.patch ./distribution/extensions/extensions0/extensions0png0.png.patch ./distribution/extensions/extensions0/extensions0png1.png.patch ./distribution/extensions/extensions1/extensions1png0.png.patch ./distribution/extensions/extensions1/extensions1png1.png.patch ./searchplugins/searchpluginspng0.png.patch ./searchplugins/searchpluginspng1.png.patch
|
||||
958bae1b40904145959ba45f988a7156 *./0/00/00png0.png.patch
|
||||
958bae1b40904145959ba45f988a7156 *./distribution/extensions/extensions0/extensions0png0.png.patch
|
||||
958bae1b40904145959ba45f988a7156 *./distribution/extensions/extensions0/extensions0png1.png.patch
|
||||
958bae1b40904145959ba45f988a7156 *./distribution/extensions/extensions1/extensions1png0.png.patch
|
||||
958bae1b40904145959ba45f988a7156 *./distribution/extensions/extensions1/extensions1png1.png.patch
|
||||
958bae1b40904145959ba45f988a7156 *./searchplugins/searchpluginspng0.png.patch
|
||||
958bae1b40904145959ba45f988a7156 *./searchplugins/searchpluginspng1.png.patch
|
||||
|
||||
$ md5sum ./0/0exe0.exe.patch ./exe0.exe.patch
|
||||
7750e88e0c1d006710abbd625710748b *./0/0exe0.exe.patch
|
||||
7750e88e0c1d006710abbd625710748b *./exe0.exe.patch
|
||||
```
|
||||
|
||||
- Generate an unsigned mar file. Unfortunately on Windows this doesn't preserve the permissions from the original mar. The simplest solution is to do this part on a UNIX (file)system.
|
||||
|
||||
```
|
||||
$ mar -J -c ../partial_zucchini_unsigned.mar -H xpcshell-test -V '*' 2/20/20png0.png 0/0exe0.exe.patch 0/00/00text2 distribution/extensions/extensions0/extensions0text0 distribution/extensions/extensions0/extensions0png1.png.patch 0/00/00text0 distribution/extensions/extensions0/extensions0png0.png.patch searchplugins/searchpluginspng1.png.patch distribution/extensions/extensions1/extensions1png0.png.patch distribution/extensions/extensions1/extensions1text0 searchplugins/searchpluginstext0 distribution/extensions/extensions1/extensions1png1.png.patch defaults/pref/channel-prefs.js update-settings.ini updatev2.manifest searchplugins/searchpluginspng0.png.patch precomplete 0/00/00png0.png.patch updatev3.manifest exe0.exe.patch 2/20/20text0
|
||||
```
|
||||
|
||||
- Generate a signed mar from the unsigned mar:
|
||||
|
||||
```
|
||||
$ /d/mozilla-source/icecat/obj-x86_64-pc-windows-msvc/dist/bin/signmar.exe -d /d/mozilla-source/icecat/modules/libmar/tests/unit/data/ -n mycert -s ../partial_zucchini_unsigned.mar ../partial_zucchini.mar
|
||||
```
|
||||
|
|
|
|||
BIN
icecat/toolkit/mozapps/update/tests/data/partial_zucchini.mar
Normal file
BIN
icecat/toolkit/mozapps/update/tests/data/partial_zucchini.mar
Normal file
Binary file not shown.
Binary file not shown.
|
|
@ -58,6 +58,8 @@ const DIR_RESOURCES =
|
|||
const TEST_FILE_SUFFIX = AppConstants.platform == "macosx" ? "_mac" : "";
|
||||
const FILE_COMPLETE_MAR = "complete" + TEST_FILE_SUFFIX + ".mar";
|
||||
const FILE_PARTIAL_MAR = "partial" + TEST_FILE_SUFFIX + ".mar";
|
||||
const FILE_PARTIAL_ZUCCHINI_MAR =
|
||||
"partial_zucchini" + TEST_FILE_SUFFIX + ".mar";
|
||||
const FILE_COMPLETE_PRECOMPLETE = "complete_precomplete" + TEST_FILE_SUFFIX;
|
||||
const FILE_PARTIAL_PRECOMPLETE = "partial_precomplete" + TEST_FILE_SUFFIX;
|
||||
const FILE_COMPLETE_REMOVEDFILES = "complete_removed-files" + TEST_FILE_SUFFIX;
|
||||
|
|
@ -152,6 +154,7 @@ const APP_UPDATE_SJS_HOST = "http://127.0.0.1";
|
|||
const APP_UPDATE_SJS_PATH = "/" + REL_PATH_DATA + "app_update.sjs";
|
||||
|
||||
var gIncrementalDownloadErrorType;
|
||||
var gIncrementalDownloadCancelOk = false;
|
||||
|
||||
var gResponseBody;
|
||||
|
||||
|
|
@ -5171,7 +5174,13 @@ IncrementalDownload.prototype = {
|
|||
|
||||
/* nsIRequest */
|
||||
cancel(_aStatus) {
|
||||
throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
|
||||
// We aren't actually going to do anything to cancel this. The tests should
|
||||
// clean up the completed download either way, so it should never really
|
||||
// matter if we actually finish it after calling this. But we want to throw
|
||||
// an error if a test calls this unexpectedly.
|
||||
if (!gIncrementalDownloadCancelOk) {
|
||||
throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
|
||||
}
|
||||
},
|
||||
suspend() {
|
||||
throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
|
||||
|
|
@ -5694,6 +5703,12 @@ const EXIT_CODE = ${JSON.stringify(TestUpdateMutexCrossProcess.EXIT_CODE)};
|
|||
* expectedDownloadResult
|
||||
* This function asserts that the download should finish with this
|
||||
* result. Defaults to `NS_OK`.
|
||||
* expectedDownloadStartResult
|
||||
* This function asserts that `AUS.downloadUpdate` return the
|
||||
* expected value. Defaults to
|
||||
* `Ci.nsIApplicationUpdateService.DOWNLOAD_SUCCESS`. If a different
|
||||
* value is specified, later checks that the download completed
|
||||
* properly will be skipped.
|
||||
* incrementalDownloadErrorType
|
||||
* This can be used to specify an alternate value of
|
||||
* `gIncrementalDownloadErrorType`. The default value is `3`, which
|
||||
|
|
@ -5716,6 +5731,7 @@ async function downloadUpdate({
|
|||
expectDownloadRestriction,
|
||||
expectedCheckResult,
|
||||
expectedDownloadResult = Cr.NS_OK,
|
||||
expectedDownloadStartResult = Ci.nsIApplicationUpdateService.DOWNLOAD_SUCCESS,
|
||||
incrementalDownloadErrorType = 3,
|
||||
onDownloadStartCallback,
|
||||
slowDownload,
|
||||
|
|
@ -5733,7 +5749,10 @@ async function downloadUpdate({
|
|||
"update-download-restriction-hit"
|
||||
);
|
||||
});
|
||||
} else {
|
||||
} else if (
|
||||
expectedDownloadStartResult ==
|
||||
Ci.nsIApplicationUpdateService.DOWNLOAD_SUCCESS
|
||||
) {
|
||||
downloadFinishedPromise = new Promise(resolve =>
|
||||
gAUS.addDownloadListener({
|
||||
onStartRequest: _aRequest => {},
|
||||
|
|
@ -5797,6 +5816,9 @@ async function downloadUpdate({
|
|||
|
||||
initMockIncrementalDownload();
|
||||
gIncrementalDownloadErrorType = incrementalDownloadErrorType;
|
||||
gIncrementalDownloadCancelOk =
|
||||
expectedDownloadStartResult !=
|
||||
Ci.nsIApplicationUpdateService.DOWNLOAD_SUCCESS;
|
||||
|
||||
update = await gAUS.selectUpdate(updates);
|
||||
}
|
||||
|
|
@ -5821,9 +5843,12 @@ async function downloadUpdate({
|
|||
const result = await gAUS.downloadUpdate(update);
|
||||
Assert.equal(
|
||||
result,
|
||||
Ci.nsIApplicationUpdateService.DOWNLOAD_SUCCESS,
|
||||
"nsIApplicationUpdateService:downloadUpdate should succeed"
|
||||
expectedDownloadStartResult,
|
||||
"nsIApplicationUpdateService:downloadUpdate status should be correct"
|
||||
);
|
||||
if (result != Ci.nsIApplicationUpdateService.DOWNLOAD_SUCCESS) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (waitToStartPromise) {
|
||||
|
|
@ -5853,3 +5878,60 @@ async function downloadUpdate({
|
|||
await TestUtils.waitForTick();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds a file open until it ought to be closed.
|
||||
*
|
||||
* @param file
|
||||
* The `nsIFile` for the file to be held open
|
||||
* @param shareMode
|
||||
* Optional. The share mode (`dwShareMode`) to pass to `CreateFileW`
|
||||
* when opening the file. If provided, should be a string containing
|
||||
* a combination of 'r', 'w', and 'd' to indicate sharing for the
|
||||
* read, write, and delete permissions, respectively. The default is to
|
||||
* share nothing.
|
||||
* @return An asynchronous function taking no arguments. When it is called and
|
||||
* the returned promise resolves, the file is no longer being held open.
|
||||
*/
|
||||
async function holdFileOpen(file, shareMode) {
|
||||
const testHelper = getTestDirFile("test_file_hold_open.exe", false);
|
||||
|
||||
const args = [file.path];
|
||||
if (shareMode) {
|
||||
args.push(shareMode);
|
||||
}
|
||||
|
||||
const proc = await Subprocess.call({
|
||||
command: testHelper.path,
|
||||
arguments: args,
|
||||
});
|
||||
const isLocked = await proc.stdout.readString();
|
||||
|
||||
if (isLocked.trim() != "Locked") {
|
||||
throw new Error("Expected status to be Locked, found " + isLocked);
|
||||
}
|
||||
|
||||
return async () => {
|
||||
await proc.stdin.write("q");
|
||||
const rc = await proc.wait(1000);
|
||||
Assert.equal(rc.exitCode, 0, "Expected process to have successful exit");
|
||||
};
|
||||
}
|
||||
|
||||
async function setFileModifiedAge(outfile, ageInSeconds) {
|
||||
const outfilePath = outfile.path;
|
||||
const testHelper = getTestDirFile("test_file_change_mtime.exe");
|
||||
|
||||
let proc = await Subprocess.call({
|
||||
command: testHelper.path,
|
||||
arguments: [outfilePath, ageInSeconds],
|
||||
});
|
||||
|
||||
let stdout;
|
||||
while ((stdout = await proc.stdout.readString())) {
|
||||
logTestInfo(stdout);
|
||||
}
|
||||
|
||||
const rc = await proc.wait(1000); // Wait for it to exit.
|
||||
Assert.equal(rc.exitCode, 0, "Expected process to have successful exit");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue