Other branches may be made as a part of operations, but will always have the
`xsa/` prefix (e.g., `xsa/tmp`).
+## Command-line conventions
+
+Some commands accept a `<versionlist>`. This can be:
+ - A single version; e.g., `4.7` or `master`
+ - `all`, which will include all versions listed in the XSA
+ - A range with two versions; e.g., `4.11..4.9`. This range **MUST**
+ be high to low. The first version can be `master`.
+ - A range with only one version. `4.10..` for instance will be all
+ versions for this XSA older than 4.10 (inclusive). `..4.8` will be
+ all versions for this XSA newer than 4.8 (inclusive).
+
## Generating patches from a branch
To create a set of patches for a particular xen version for a
The developer repeats `xsatool 213 backport` until all backports have
been made.
-`xsatool 213 sync-patches`
+`xsatool 213 sync-patches [<versionlist>]`
For each version for which `xsa/213/${v}` exists, this will:
- Update the recipe for that version in `xsa213.meta`
+If `<versionlist>` is supplied, it will be limited to the range
+specified.
+
`xsatool 213 dedup-patches`
Sync-patches will always generate a separate set of patches for each
## Checking patches before sending them out
-`xsatool 213 test-apply`
+`xsatool 213 test-apply [<versionlist>]`
-For each version for which patches exist in `xsa213.meta`, it creates
-`test/213/$v-stable`, `test/213/$v-baseline`, and `test/213/$v`
+For each version in `<versionlist>` , it creates `test/213/$v-stable`,
+`test/213/$v-baseline`, and `test/213/$v`. (If no `<versionlist>` is
+supplied, it defaults to `all`.)
Individual versions can be specified as well: `xsatool 213 test-apply 4.6 4.5`
-`xsatool 213 test-build`
+`xsatool 213 test-build [<versionlist>]`
-For each version for which patches exist in `xsa213.meta`, it will
-attempt to check out a tree based on `test/213/$v` and do a build. If
-the branch does not exist it will throw an error.
+For each version in `<versionlist>`, it will attempt to check out a
+tree based on `test/213/$v` and do a build. If the branch does not
+exist it will throw an error. (If no `<versionlist>` is supplied, it
+defaults to `all`.)
-As with `test-apply`, you can also specify individual versions:
-`xsatool 213 test-build 4.5`
-
-`xsatool 213 test`
+`xsatool 213 test [<versionlist>]`
Do both `test-apply` and `test-build` (i.e., a full test) for each
version.
Assuming the developer has checked her changes into `xsa.git`, update
your copy of `xsa.git`, and then
-`xsatool 213 sync-branch`
+`xsatool 213 sync-branch [<versionlist>]`
For each version specified, it will reset all branches (`-stable`,
`-baseline`, and patch branch) according to the updated recipe in
-`xsa213.meta`.
-
-As with `sync-patches`, you can either specify a specific version, or
-you can leave the version blank and it will make branches for versions
-*for which recipes exist*.
+`xsa213.meta`. If no `<versionlist>` is supplied, it
+defaults to `all`.
This could also be useful, for example, if prerequisites are manually
added or removed.
## Updating the 'base' of an outstanding XSA when the stable branches have changed
-`xsatool NNN reset-base [versions]`
+`xsatool NNN reset-base <[versionlist]>`
For each version, this will update StableRef to point to the current
value of the 'stable' branch (either `master` or `stable-VV`). It
will then re-apply the patch and any prerequisites as-is (i.e., *not*
-doing a rebase), failing out in case of an error.
+doing a rebase), failing out in case of an error. If no
+`<versionlist>` is supplied, it defaults to `all`.
## Marking XSAs as published
longer supported.
(Eventually this will be implemented by the `xsatool global
-end-support [version]` command.)
+end-support <version>` command.)
## 'Canonicalizing' metadata files
return ForEachCodeTree(f2)
}
-// Convert argument list into a set of versions:
-// - If no versions exist, use SupportedVersions from metadata
-// - If hasPatches is true, include only versions which have patches; otherwise
-// include all of them.
-// - Otherwise add the list of versions in order
-func VersionsFromArgs(xsa *XSAMeta, args []string, hasPatches bool) (vers []XenVersion) {
- if len(args) == 0 || (len(args) == 1 && args[0] == "all") {
- for _, v := range xsa.SupportedVersions {
- // Check to see if the branch exists
- if hasPatches && !xsa.HasRecipe(v) {
- // FIXME: Should this be "break" instead?
- continue
- }
- vers = append(vers, v)
- }
- } else {
- // FIXME: Verify xenversion format
- for _, v := range args {
- vers = append(vers, XenVersion(v))
- }
- }
- return
-}
-
type MainFunc func(*XSAMeta, []string) int
// GLOBAL
)
func sync(xsa *XSAMeta, args []string, sync bool) (ret int) {
- vers := VersionsFromArgs(xsa, args, true)
+ vers := xsa.SupportedVersions
+ if len(args) > 0 {
+ var err error
+ vers, err = VersionsFromString(args[0], xsa.SupportedVersions, xsa.HasRecipe)
+ if err != nil {
+ fmt.Printf("Error parsing versions: %v", err)
+ return
+ }
+ }
if !sync && len(vers) > 1 {
fmt.Printf("Error: Doesn't make sense to make more than one version\n")
}
func MainSyncBranch(xsa *XSAMeta, args []string) (ret int) {
- vers := VersionsFromArgs(xsa, args, false)
+ vers := xsa.SupportedVersions
+ if len(args) > 0 {
+ var err error
+ vers, err = VersionsFromString(args[0], xsa.SupportedVersions, nil)
+ if err != nil {
+ fmt.Printf("Error parsing versions: %v", err)
+ return
+ }
+ }
+ //vers := VersionsFromArgs(xsa, args, false)
for _, v := range vers {
prefix := "xsa"
// -- Re-set stableref to upstream
// -- Re-apply recipe
- vers := VersionsFromArgs(xsa, args, false)
+ vers := xsa.SupportedVersions
+ if len(args) > 0 {
+ var err error
+ vers, err = VersionsFromString(args[0], xsa.SupportedVersions, nil)
+ if err != nil {
+ fmt.Printf("Error parsing versions: %v", err)
+ return
+ }
+ }
+ //vers := VersionsFromArgs(xsa, args, false)
for _, v := range vers {
r := xsa.GetRecipe(v)