scripts: cros_generate_sysroot: Only install DEPENDs into sysroot

> The point of cros_generate_sysroot is to generate a sysroot that can
> be built against (i.e. headers & libraries). Including BDEPEND in
> there doesn't make sense as we'd never execute programs out of it.
>
> Mike

I also changed from using an ENV variable to pass the root to using
a command line argument. This way the root shows up in the logs.

BUG=b:291914996
TEST=CQ

Change-Id: I7dc9a56e99566bcb9b2d964ae0cb3dd59b6452e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4730216
Commit-Queue: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Raul Rangel <rrangel@chromium.org>
diff --git a/scripts/cros_generate_sysroot.py b/scripts/cros_generate_sysroot.py
index 7095e7d..91ed813 100644
--- a/scripts/cros_generate_sysroot.py
+++ b/scripts/cros_generate_sysroot.py
@@ -125,10 +125,17 @@
             packages = self.options.package.split()
         else:
             for pkg in self.options.package.split():
-                cmd = ["qdepends", "-q", "-C", pkg]
+                cmd = [
+                    "qdepends",
+                    "-q",
+                    "-C",
+                    "--depend",
+                    "--root",
+                    raw_sysroot,
+                    pkg,
+                ]
                 output = cros_build_lib.run(
                     cmd,
-                    extra_env={"ROOT": raw_sysroot},
                     capture_output=True,
                     encoding="utf-8",
                 ).stdout