diff --git a/README.md b/README.md index 68c3fb2..b405b3b 100644 --- a/README.md +++ b/README.md @@ -100,12 +100,11 @@ git clone https://github.com/xcp-ng-rpms/xapi.git # ... Here add your patches ... # Build. -xcp-ng-dev container build -b 8.2 --rm xapi/ +xcp-ng-dev container build --rm xapi/ 8.2 ``` **Important switches** -* `-b` / `--branch` allows to select which version of XCP-ng to work on (defaults to the latest known version if not specified). * `--no-exit` drops you to a shell after the build, instead of closing the container. Useful if the build fails and you need to debug. * `--rm` destroys the container on exit. Helps preventing containers from using too much space on disk. You can still reclaim space afterwards by running `docker container prune` and `docker image prune` * `-v` / `--volume` (see *Mounting repos from outside the container* below) @@ -120,7 +119,7 @@ fully automated. `%autopatch` in the `%prep` block; add `BuildRequires: quilt` 2. let quilt apply them in a 8.3 buildenv (`quilt` in 8.3 is only in EPEL) and get you a shell: ```sh -xcp-ng-dev container build --rm -b 8.3 --rpmbuild-stage=p -n --enablerepo=epel . +xcp-ng-dev container build --rm --rpmbuild-stage=p -n --enablerepo=epel 8.3 ``` 3. ask `quilt` to refresh all your patches (alternatively just the one you want) ```sh @@ -170,5 +169,5 @@ example, if I clone some repos into a directory on my host, say `/work/code/`, then I can mount it inside the container as follows: ```sh -xcp-ng-dev container shell -b 8.2 -v /work/code:/mnt/repos +xcp-ng-dev container shell -v /work/code:/mnt/repos 8.2 ``` diff --git a/src/xcp_ng_dev/cli.py b/src/xcp_ng_dev/cli.py index 6b37b07..2b60dc4 100755 --- a/src/xcp_ng_dev/cli.py +++ b/src/xcp_ng_dev/cli.py @@ -100,7 +100,7 @@ def buildparser(): "Built RPMs and SRPMs will be in RPMS/ and SRPMS/ subdirectories. " "Any preexisting BUILD, BUILDROOT, RPMS or SRPMS directories will be removed first.") parser_build.add_argument( - 'build_local', nargs='?', default='.', + 'source_dir', nargs='?', default='.', help="Root path where SPECS/ and SOURCES are available. " "The default is the working directory") parser_build.add_argument( @@ -160,7 +160,7 @@ def container(args): if hasattr(args, 'command') and args.command != []: docker_args += ["-e", "COMMAND=%s" % ' '.join(args.command)] if build: - build_dir = os.path.abspath(args.build_local) + build_dir = os.path.abspath(args.source_dir) docker_args += ["-v", f"{build_dir}:/home/builder/rpmbuild"] docker_args += ["-e", "BUILD_LOCAL=1"] print(f"Building directory {build_dir}")