@@ -125,34 +125,34 @@ def prepare_image
125
125
end
126
126
127
127
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?
155
151
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
156
156
end
157
157
158
158
def stop_and_remove_deb_tmp_image
0 commit comments