Merge branch 'master-MC1.8' of github.com:MightyPirates/OpenComputers into OC1.5-MC1.8

This commit is contained in:
Florian Nücke 2015-05-01 12:18:19 +02:00
commit 2419f78ee2
3 changed files with 15 additions and 1 deletions

View File

@ -299,6 +299,7 @@ javadoc {
task deobfJar(type: Jar) {
from sourceSets.main.output
exclude "cofh/**"
exclude "mods/**"
configurations.embedded.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'

View File

@ -10,6 +10,7 @@ if #args < 2 then
io.write(" -u: copy only when the SOURCE file differs from the destination\n")
io.write(" file or when the destination file is missing.\n")
io.write(" -v: verbose output.")
io.write(" -x: stay on original source file system.")
return
end
@ -58,6 +59,15 @@ local function areEqual(path1, path2)
return result
end
local function isMount(path)
path = fs.canonical(path)
for _, mountPath in fs.mounts() do
if path == fs.canonical(mountPath) then
return true
end
end
end
local function recurse(fromPath, toPath)
status(fromPath, toPath)
if fs.isDirectory(fromPath) then
@ -72,6 +82,9 @@ local function recurse(fromPath, toPath)
-- my real cp always does this, even with -f, -n or -i.
return nil, "cannot overwrite non-directory `" .. toPath .. "' with directory `" .. fromPath .. "'"
end
if options.x and isMount(fromPath) then
return true
end
fs.makeDirectory(toPath)
for file in fs.list(fromPath) do
local result, reason = recurse(fs.concat(fromPath, file), fs.concat(toPath, file))

View File

@ -59,7 +59,7 @@ local name = options.name or "OpenOS"
io.write("Installing " .. name .." to device " .. (choice.getLabel() or choice.address) .. "\n")
os.sleep(0.25)
local cpPath = filesystem.concat(findMount(filesystem.get(os.getenv("_")).address), "bin/cp")
local cpOptions = "-vr" .. (options.u and "ui " or "")
local cpOptions = "-vrx" .. (options.u and "ui " or "")
local cpSource = filesystem.concat(findMount(fromAddress), options.fromDir or "/", "*")
local cpDest = findMount(choice.address) .. "/"
local result, reason = os.execute(cpPath .. " " .. cpOptions .. " " .. cpSource .. " " .. cpDest)