File: parse-deps.pl

package info (click to toggle)
autopkgtest 5.55
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,600 kB
  • sloc: python: 15,479; sh: 2,317; makefile: 116; perl: 19
file content (25 lines) | stat: -rwxr-xr-x 609 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/perl
# Copyright 2006-2016 Canonical Ltd.
# Copyright 2023 Simon McVittie
# SPDX-License-Identifier: GPL-2.0-or-later

# Usage: parse-deps.pl DEPS ARCH
# Parse DEPS as a d/control Depends string, and print dependencies suitable for
# DEBIAN/control Depends to stdout.
# Example:
# ./parse-deps.pl "a (>= 1), b [i386], c [amd64], d <!nocheck>, e:arm64" i386
# ->
# a (>= 1), b, d, e:arm64

use strict;
use warnings;

use Dpkg::Deps;

my $origdeps = shift;
my $arch = shift;

my $dep = deps_parse($origdeps, reduce_restrictions => 1, host_arch => $arch);
my $out = $dep->output();

print $out, "\n";