File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ def build
14
14
puts "build()"
15
15
prepare
16
16
generate_deb_src_files
17
- # create_container
17
+ create_container
18
18
#run_pbuilder
19
19
#copy_build_from_container
20
- # cleanup
20
+ cleanup
21
21
end
22
22
23
23
private
@@ -73,6 +73,24 @@ def run_container_command(cmd)
73
73
end
74
74
75
75
def cleanup
76
+ puts "Cleaning up..."
77
+
78
+ # Stop and destroy podman container
79
+ puts " Stopping podman container: #{ @container_name } "
80
+ system ( "podman stop #{ @container_name } " )
81
+ puts " Destroying podman container: #{ @container_name } "
82
+ system ( "podman container rm #{ @container_name } " )
83
+
84
+ # Remove temporary files
85
+ #
86
+ # Make sure @pgpm_dir starts with "/tmp/" or we may accidentally
87
+ # delete something everything! You can never be sure!
88
+ if @pgpm_dir . start_with? ( "/tmp/" )
89
+ puts " Removing temporary files in #{ @pgpm_dir } "
90
+ FileUtils . rm_rf ( @pgpm_dir )
91
+ else
92
+ puts "WARNING: will not remove temporary files, strange path: \" #{ @pgpm_dir } \" "
93
+ end
76
94
end
77
95
78
96
# Needed because SELinux requires :z suffix for mounted directories to
You can’t perform that action at this time.
0 commit comments