This repository has been archived by the owner on May 22, 2020. It is now read-only.
forked from blablacar/dgr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aci: sort contents, and pull manifest to the front
If the manifest is the first file then tools do not need to download the whole image file in order to detect changes or updates. Sorted contents of ACIs allow for easier comparison, and usage of tools such as zsync, and deduplication on the server. The price, sorting by 'tar', is cheap. Parameter 'f' for 'tar' must be followed by the filename for recent versions of 'tar'. Mind the order! closes blablacar#210
- Loading branch information
1 parent
9fef085
commit 95d9429
Showing
3 changed files
with
8 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
package common | ||
|
||
func Tar(destination string, source ...string) error { // remove zip | ||
source = append(source, "") | ||
source = append(source, "") | ||
copy(source[2:], source[0:]) | ||
source[0] = "cpf" | ||
source[1] = destination | ||
|
||
return ExecCmd("tar", source...) | ||
params := []string{"--sort=name", "--numeric-owner", "-cpf", destination} | ||
params = append(params, source...) | ||
return ExecCmd("tar", params...) | ||
} |