Skip to content

Commit 1f89b95

Browse files
committed
Default vinca-snapshot package to ALL
1 parent 0c3783a commit 1f89b95

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

vinca/distro.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,6 @@ def check_ros1(self):
9696

9797
def get_python_version(self):
9898
return self._python_version
99+
100+
def get_package_names(self):
101+
return self._distro.release_packages.keys()

vinca/snapshot.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def main():
2121
"--package",
2222
type=str,
2323
dest="package",
24-
default="ros_base",
25-
help="ROS package to get dependencies for (default: ros_base)",
24+
default=None,
25+
help="ROS package to get dependencies for (default: ALL)",
2626
required=False,
2727
)
2828
parser.add_argument(
@@ -45,8 +45,12 @@ def main():
4545
args = parser.parse_args()
4646

4747
distro = Distro(args.distro)
48-
deps = distro.get_depends(args.package)
49-
deps.add(args.package)
48+
49+
if args.package is None:
50+
deps = distro.get_package_names()
51+
else:
52+
deps = distro.get_depends(args.package)
53+
deps.add(args.package)
5054

5155
if not args.quiet:
5256
max_len = max([len(dep) for dep in deps])
@@ -55,8 +59,13 @@ def main():
5559
output = {}
5660

5761
for dep in deps:
58-
url, tag = distro.get_released_repo(dep)
59-
version = distro.get_version(dep)
62+
try:
63+
url, tag = distro.get_released_repo(dep)
64+
version = distro.get_version(dep)
65+
except AttributeError:
66+
print("\033[93mPackage '{}' has no version set, skipping...\033[0m".format(dep))
67+
continue
68+
6069
output[dep] = {"url": url, "version": version, "tag": tag}
6170

6271
if not args.quiet:

0 commit comments

Comments
 (0)