Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check for unescaped cpio file #157

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
environment:
matrix:
- julia_version: 0.7
- julia_version: 1.0
- julia_version: nightly

platform:
- x86 # 32-bit
- x64 # 64-bit

# # Uncomment the following lines to allow failures on nightly julia
# # (tests will run but not make your overall status red)
# matrix:
# allow_failures:
# - julia_version: nightly

branches:
only:
- master
- /release-.*/

notifications:
- provider: Email
on_build_success: false
on_build_failure: false
on_build_status_changed: false

install:
- ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1"))

build_script:
- echo "%JL_BUILD_SCRIPT%"
- C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%"

test_script:
- echo "%JL_TEST_SCRIPT%"
- C:\julia\bin\julia -e "%JL_TEST_SCRIPT%"

# # Uncomment to support code coverage upload. Should only be enabled for packages
# # which would have coverage gaps without running on Windows
# on_success:
# - echo "%JL_CODECOV_SCRIPT%"
# - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%"
4 changes: 2 additions & 2 deletions src/WinRPM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ function do_install(package::Package)
end
info("Extracting: ", name)

cpio = splitext(joinpath(cache, escape(basename(path))))[1] * ".cpio"
cpio = splitext(joinpath(cache, basename(path)))[1] * ".cpio"

local err = nothing
for cmd = [`$exe7z x -y $path2 -o$cache`, `$exe7z x -y $cpio -o$installdir`]
Expand Down Expand Up @@ -516,7 +516,7 @@ end

include("winrpm_bindeps.jl")

# deprecations
# deprecations
@deprecate help() "Please see the README.md file at https://github.com/JuliaPackaging/WinRPM.jl"

end
11 changes: 11 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Test
using WinRPM
using Libz, LibExpat

#check that a file with a special char is downloaded correctly
@testset "escaping" begin
pkgs = [WinRPM.select(WinRPM.lookup("libstdc++6", WinRPM.OS_ARCH), "libstdc++6")]
WinRPM.do_install(WinRPM.Packages(pkgs))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #95 (comment) and https://github.com/JuliaPackaging/WinRPM.jl/pull/147/files/929e616ce9eac79c710d80640dba6946362064ca#diff-fce720c43af3c52c862fd7451c7374b8 - running tests should avoid making permanent observable modifications to a user's environment, such as installing a bunch of packages they may not need or want for anything other than verifying tests work. Better would be to do this in a temporary location that gets cleaned up afterwards.

todo, toup = WinRPM.prepare_install(pkgs[1])
@test isempty(todo) && isempty(toup)
end