Skip to content

Commit cfa3032

Browse files
author
qount25
committed
Fix: rubocop errors
1 parent e7f816c commit cfa3032

File tree

3 files changed

+28
-31
lines changed

3 files changed

+28
-31
lines changed

lib/pgpm/deb/builder.rb

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -125,34 +125,34 @@ def prepare_image
125125
end
126126

127127
def build_local_image
128-
puts " Building local #{image_name}..."
129-
container_opts = "-it --privileged --tmpfs /tmp --name pgpm-deb-tmp"
130-
system("podman create #{container_opts} #{base_image_name}")
131-
system("podman start pgpm-deb-tmp")
132-
133-
patch_pbuilder
134-
135-
# Generate pbuilder_install script.sh, copy it inside the image
136-
pbuild_install_script_path = "#{@pgpm_dir}/pbuilder_install_script.sh"
137-
puts " Generating #{pbuild_install_script_path}..."
138-
File.write "#{pbuild_install_script_path}", @spec.generate("pbuilder_install_script.sh")
139-
system("podman container cp #{pbuild_install_script_path} pgpm-deb-tmp:/root/")
140-
141-
# This command installs relevant postgresql packages into the chroot
142-
# base image inside the container (along with some other necessary
143-
# packages) and saves chroot base image with these changes.
144-
puts " Updating chroot image..."
145-
system("podman exec -w /root pgpm-deb-tmp /bin/bash -c 'fakeroot pbuilder execute --save-after-exec ./pbuilder_install_script.sh'")
146-
147-
# Exiting -- most likely error occurred because we cannot find the same
148-
# postgresql version in the Debian repository. The bash script
149-
# will do error reporting for us, so we just exit.
150-
if $CHILD_STATUS.to_i.positive?
151-
stop_and_remove_deb_tmp_image
152-
exit 1
153-
end
154-
system("podman commit pgpm-deb-tmp #{image_name}")
128+
puts " Building local #{image_name}..."
129+
container_opts = "-it --privileged --tmpfs /tmp --name pgpm-deb-tmp"
130+
system("podman create #{container_opts} #{base_image_name}")
131+
system("podman start pgpm-deb-tmp")
132+
133+
patch_pbuilder
134+
135+
# Generate pbuilder_install script.sh, copy it inside the image
136+
pbuild_install_script_path = "#{@pgpm_dir}/pbuilder_install_script.sh"
137+
puts " Generating #{pbuild_install_script_path}..."
138+
File.write pbuild_install_script_path.to_s, @spec.generate("pbuilder_install_script.sh")
139+
system("podman container cp #{pbuild_install_script_path} pgpm-deb-tmp:/root/")
140+
141+
# This command installs relevant postgresql packages into the chroot
142+
# base image inside the container (along with some other necessary
143+
# packages) and saves chroot base image with these changes.
144+
puts " Updating chroot image..."
145+
system("podman exec -w /root pgpm-deb-tmp /bin/bash -c 'fakeroot pbuilder execute --save-after-exec ./pbuilder_install_script.sh'")
146+
147+
# Exiting -- most likely error occurred because we cannot find the same
148+
# postgresql version in the Debian repository. The bash script
149+
# will do error reporting for us, so we just exit.
150+
if $CHILD_STATUS.to_i.positive?
155151
stop_and_remove_deb_tmp_image
152+
exit 1
153+
end
154+
system("podman commit pgpm-deb-tmp #{image_name}")
155+
stop_and_remove_deb_tmp_image
156156
end
157157

158158
def stop_and_remove_deb_tmp_image

lib/pgpm/deb/spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ def cmds_if_not_empty(cmds, else_echo)
6060
cmds.map! { |c| c.gsub("$", "$$") }
6161
cmds.join("\t")
6262
end
63-
6463
end
6564
end
6665
end

lib/pgpm/package/dependencies.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
module Pgpm
66
class Package
77
module Dependencies
8-
attr_accessor :postgres_version
9-
108
def build_dependencies
119
case Pgpm::OS.in_scope.class.name
1210
when "debian", "ubuntu"
@@ -44,7 +42,7 @@ def topologically_ordered_with_dependencies
4442
TopologicalPackageSorter.new([self, *all_requirements]).sorted_packages
4543
end
4644

47-
def postgres_version(version_type=:major_minor)
45+
def postgres_version(version_type = :major_minor)
4846
v = Pgpm::Postgres::Distribution.in_scope.version
4947
if version_type == :major
5048
v = v.split(".").first

0 commit comments

Comments
 (0)