-
Notifications
You must be signed in to change notification settings - Fork 5
/
dh_epicsdep
executable file
·71 lines (45 loc) · 1.36 KB
/
dh_epicsdep
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/perl
=head1 NAME
dh_epicsdep - Generate EPICS dependency information
=cut
use strict;
use Debian::Debhelper::Dh_Lib;
use Parse::DebControl;
=head1 SYNOPSIS
B<dh_epicsdep> [S<I<debhelper options>>]
=head1 DESCRIPTION
This utility provides the substituion variable epics:Depends.
It add a versioned dependency to epics-dev to all *-dev
packages which should match the libepics* dependency.
=cut
init();
my $ver = `dpkg-query --show --showformat='\${Version}' epics-dev`;
# The following requires perl >= 5.10
if( ${^CHILD_ERROR_NATIVE} != 0 ) {
die "Package name epics-dev not installed";
}
# remove deb revision
$ver =~ s/-[^-]+$//;
verbose_print("epics $ver\n");
# if epics base version is a patch release
if( $ver =~ m/\d+\.\d+\.\d+\.\d+$/m ) {
# remove patch number
$ver =~ s/\.\d+$//;
}
verbose_print("Adding dependency to epics $ver\n");
foreach my $pkg(getpackages()) {
verbose_print("Package: $pkg\n");
# Skip packages not named '*-dev'
if( $pkg !~ /-dev$/) {
next;
}
# this range should encompass all patch releases of the series
addsubstvar($pkg, "epics:Depends", "epics-dev", ">= ${ver}~");
addsubstvar($pkg, "epics:Depends", "epics-dev", "<= ${ver}.+");
}
=head1 SEE ALSO
L<debhelper(7)>, L<epics-debhelper(7)>
This program is a not part of the official debhelper package.
=head1 AUTHOR
Michael Davidsaver <mdavidsaver@gmail.com>
=cut