-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #35270 - Enable boot image download for iso images
* Implement fetch and extract boot image * Implement class for file extraction with isoinfo * Add capability for archive extraction * Separate logging and file writing tasks Co-Authored-By: Ewoud Kohl van Wijngaarden <[email protected]>
- Loading branch information
1 parent
a48da73
commit 4f38afe
Showing
7 changed files
with
116 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module Proxy | ||
class ArchiveExtract < Proxy::Util::CommandTask | ||
include Util | ||
|
||
SHELL_COMMAND = 'isoinfo' | ||
|
||
def initialize(image_path, file_in_image, dst_path) | ||
args = [ | ||
which(SHELL_COMMAND), | ||
# Print information from Rock Ridge extensions | ||
'-R', | ||
# Filename to read ISO-9660 image from | ||
'-i', image_path.to_s, | ||
# Extract specified file to stdout | ||
'-x', file_in_image.to_s | ||
] | ||
|
||
super(args, nil, dst_path) | ||
end | ||
|
||
def start | ||
lock = Proxy::FileLock.try_locking(File.join(File.dirname(@output), ".#{File.basename(@output)}.lock")) | ||
if lock.nil? | ||
false | ||
else | ||
super do | ||
Proxy::FileLock.unlock(lock) | ||
File.unlink(lock) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters