1Dpkg::Source::Package(3perl) libdpkg-perl Dpkg::Source::Package(3perl)
2
3
4
6 Dpkg::Source::Package - manipulate Debian source packages
7
9 This module provides a class that can manipulate Debian source
10 packages. While it supports both the extraction and the creation of
11 source packages, the only API that is officially supported is the one
12 that supports the extraction of the source package.
13
15 $string = get_default_diff_ignore_regex()
16 Returns the default diff ignore regex.
17
18 set_default_diff_ignore_regex($string)
19 Set a regex as the new default diff ignore regex.
20
21 @array = get_default_tar_ignore_pattern()
22 Returns the default tar ignore pattern, as an array.
23
25 $p = Dpkg::Source::Package->new(%opts, options => {})
26 Creates a new object corresponding to a source package. When the
27 key filename is set to a .dsc file, it will be used to initialize
28 the source package with its description. Otherwise if the format
29 key is set to a valid value, the object will be initialized for
30 that format (since dpkg 1.19.3).
31
32 The options key is a hash ref which supports the following options:
33
34 skip_debianization
35 If set to 1, do not apply Debian changes on the extracted
36 source package.
37
38 skip_patches
39 If set to 1, do not apply Debian-specific patches. This
40 options is specific for source packages using format "2.0"
41 and "3.0 (quilt)".
42
43 require_valid_signature
44 If set to 1, the check_signature() method will be stricter
45 and will error out if the signature can't be verified.
46
47 require_strong_checksums
48 If set to 1, the check_checksums() method will be stricter
49 and will error out if there is no strong checksum.
50
51 copy_orig_tarballs
52 If set to 1, the extraction will copy the upstream tarballs
53 next the target directory. This is useful if you want to be
54 able to rebuild the source package after its extraction.
55
56 $p->get_filename()
57 Returns the filename of the DSC file.
58
59 $p->get_files()
60 Returns the list of files referenced by the source package. The
61 filenames usually do not have any path information.
62
63 $p->check_checksums()
64 Verify the checksums embedded in the DSC file. It requires the
65 presence of the other files constituting the source package. If any
66 inconsistency is discovered, it immediately errors out. It will
67 make sure at least one strong checksum is present.
68
69 If the object has been created with the "require_strong_checksums"
70 option, then any problem will result in a fatal error.
71
72 $p->get_upstream_signing_key($dir)
73 Get the filename for the upstream key.
74
75 $p->armor_original_tarball_signature($bin, $asc)
76 Convert a signature from binary to ASCII armored form. If the
77 signature file does not exist, it is a no-op. If the signature file
78 is already ASCII armored then simply copy it, otherwise convert it
79 from binary to ASCII armored form.
80
81 $p->check_original_tarball_signature($dir, @asc)
82 Verify the original upstream tarball signatures @asc using the
83 upstream public keys. It requires the origin upstream tarballs,
84 their signatures and the upstream signing key, as found in an
85 unpacked source tree $dir. If any inconsistency is discovered, it
86 immediately errors out.
87
88 $bool = $p->is_signed()
89 Returns 1 if the DSC files contains an embedded OpenPGP signature.
90 Otherwise returns 0.
91
92 $p->check_signature()
93 Implement the same OpenPGP signature check that dpkg-source does.
94 In case of problems, it prints a warning or errors out.
95
96 If the object has been created with the "require_valid_signature"
97 option, then any problem will result in a fatal error.
98
99 $p->extract($targetdir)
100 Extracts the source package in the target directory $targetdir.
101 Beware that if $targetdir already exists, it will be erased (as
102 long as the no_overwrite_dir option is set).
103
105 Version 2.02 (dpkg 1.21.10)
106 New method: armor_original_tarball_signature().
107
108 Version 2.01 (dpkg 1.20.1)
109 New method: get_upstream_signing_key().
110
111 Version 2.00 (dpkg 1.20.0)
112 New method: check_original_tarball_signature().
113
114 Remove variable: $diff_ignore_default_regexp.
115
116 Hide variable: @tar_ignore_default_pattern.
117
118 Version 1.03 (dpkg 1.19.3)
119 New option: format in new().
120
121 Version 1.02 (dpkg 1.18.7)
122 New option: require_strong_checksums in check_checksums().
123
124 Version 1.01 (dpkg 1.17.2)
125 New functions: get_default_diff_ignore_regex(),
126 set_default_diff_ignore_regex(), get_default_tar_ignore_pattern()
127
128 Deprecated variables: $diff_ignore_default_regexp,
129 @tar_ignore_default_pattern
130
131 Version 1.00 (dpkg 1.16.1)
132 Mark the module as public.
133
134
135
1361.21.21 2023-07-19 Dpkg::Source::Package(3perl)