summaryrefslogtreecommitdiff
path: root/scripts/Dpkg/Compression
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2016-07-29 21:32:34 +0200
committerGuillem Jover <guillem@debian.org>2016-07-31 12:45:32 +0200
commitcd64cd76c924070a2c1f57bac817216e705b6b52 (patch)
tree13d08279fe53562eecde8b3aa55b1140691d58ae /scripts/Dpkg/Compression
parent048f56f78cd7886c1835343ff97b68679a6f7aa6 (diff)
downloaddpkg-cd64cd76c924070a2c1f57bac817216e705b6b52.tar.gz
Dpkg: Rename various private methods and functions
Rename private functions names, so that they have an underscore and more uniform names. This way it is made explicit that those functions are not expected to be used by external modules, and provide no guarantees on their API stability.
Diffstat (limited to 'scripts/Dpkg/Compression')
-rw-r--r--scripts/Dpkg/Compression/FileHandle.pm16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/Dpkg/Compression/FileHandle.pm b/scripts/Dpkg/Compression/FileHandle.pm
index 9d91b7756..9ce717c10 100644
--- a/scripts/Dpkg/Compression/FileHandle.pm
+++ b/scripts/Dpkg/Compression/FileHandle.pm
@@ -171,9 +171,9 @@ sub ensure_open {
delete $opts{to_file};
if ($mode eq 'w') {
- $self->open_for_write(%opts);
+ $self->_open_for_write(%opts);
} elsif ($mode eq 'r') {
- $self->open_for_read(%opts);
+ $self->_open_for_read(%opts);
} else {
croak "invalid mode in ensure_open: $mode";
}
@@ -213,9 +213,9 @@ sub OPEN {
my ($mode, $filename) = @_;
$self->set_filename($filename);
if ($mode eq '>') {
- $self->open_for_write();
+ $self->_open_for_write();
} elsif ($mode eq '<') {
- $self->open_for_read();
+ $self->_open_for_read();
} else {
croak 'Dpkg::Compression::FileHandle does not support ' .
"open() mode $mode";
@@ -235,7 +235,7 @@ sub CLOSE {
} else {
$ret = 0;
}
- $self->cleanup();
+ $self->_cleanup();
return $ret;
}
@@ -390,7 +390,7 @@ sub get_filehandle {
## INTERNAL METHODS
-sub open_for_write {
+sub _open_for_write {
my ($self, %opts) = @_;
my $filehandle;
@@ -408,7 +408,7 @@ sub open_for_write {
*$self->{file} = $filehandle;
}
-sub open_for_read {
+sub _open_for_read {
my ($self, %opts) = @_;
my $filehandle;
@@ -427,7 +427,7 @@ sub open_for_read {
*$self->{file} = $filehandle;
}
-sub cleanup {
+sub _cleanup {
my $self = shift;
my $cmdline = *$self->{compressor}{cmdline} // '';
*$self->{compressor}->wait_end_process(nocheck => *$self->{allow_sigpipe});