diff --git a/build.gradle b/build.gradle index e33079526..a63e09d76 100644 --- a/build.gradle +++ b/build.gradle @@ -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/**' diff --git a/src/main/resources/assets/opencomputers/loot/OpenOS/bin/cp.lua b/src/main/resources/assets/opencomputers/loot/OpenOS/bin/cp.lua index 5a15b1cf9..85920d0aa 100644 --- a/src/main/resources/assets/opencomputers/loot/OpenOS/bin/cp.lua +++ b/src/main/resources/assets/opencomputers/loot/OpenOS/bin/cp.lua @@ -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)) diff --git a/src/main/resources/assets/opencomputers/loot/OpenOS/bin/install.lua b/src/main/resources/assets/opencomputers/loot/OpenOS/bin/install.lua index 0ded2c5b1..25367c286 100644 --- a/src/main/resources/assets/opencomputers/loot/OpenOS/bin/install.lua +++ b/src/main/resources/assets/opencomputers/loot/OpenOS/bin/install.lua @@ -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)