diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2021-03-19 17:13:34 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2021-03-22 10:33:10 -0300 |
| commit | fbd857e1a0b2aae5beb3875427612e41bf67b35e (patch) | |
| tree | 977d5af9712330345cf1633660a95b9adc3caf0d /src | |
| parent | 058643a9342c68ce38b5dd55a02564a001f807e2 (diff) | |
| download | luarocks-fbd857e1a0b2aae5beb3875427612e41bf67b35e.tar.gz luarocks-fbd857e1a0b2aae5beb3875427612e41bf67b35e.tar.bz2 luarocks-fbd857e1a0b2aae5beb3875427612e41bf67b35e.zip | |
pack: check that directory inside archive actually exists
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/pack.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/luarocks/pack.lua b/src/luarocks/pack.lua index 34268475..5d70a854 100644 --- a/src/luarocks/pack.lua +++ b/src/luarocks/pack.lua | |||
| @@ -35,7 +35,13 @@ function pack.pack_source_rock(rockspec_file) | |||
| 35 | local name_version = rockspec.name .. "-" .. rockspec.version | 35 | local name_version = rockspec.name .. "-" .. rockspec.version |
| 36 | local rock_file = fs.absolute_name(name_version .. ".src.rock") | 36 | local rock_file = fs.absolute_name(name_version .. ".src.rock") |
| 37 | 37 | ||
| 38 | local source_file, source_dir = fetch.fetch_sources(rockspec, false) | 38 | local temp_dir, err = fs.make_temp_dir("pack-"..name_version) |
| 39 | if not temp_dir then | ||
| 40 | return nil, "Failed creating temporary directory: "..err | ||
| 41 | end | ||
| 42 | util.schedule_function(fs.delete, temp_dir) | ||
| 43 | |||
| 44 | local source_file, source_dir = fetch.fetch_sources(rockspec, true, temp_dir) | ||
| 39 | if not source_file then | 45 | if not source_file then |
| 40 | return nil, source_dir | 46 | return nil, source_dir |
| 41 | end | 47 | end |
