copy-jdk-configs-4.0-3.el9> M Mv ĉJ4!!%joLne)Ip-Bm5 ']b@areleng@rockylinux.org p-Bm5 ']Y+7F[ yxb :xFXB=^jjiK3[ a"ۯbB@} &O˯;!hOۉ':ke1 <24V-Gj}M~>N=F-vIV6/_= 5ބ`ybЩ|@80hΕV{K!Y!H})Dk'k7"YxW30&e}ކe.1p[᧢y*8V)w\K{Rzy+͒5>N6E"C ,9E*ٶ<mO3FKHu b|=| MY>io;|xHpw9` <_zq/\-"?<5H@,' %d95505eb750099b6518ca4c31a662077d0952234a62a23a033e67a3fbbe314c3027a01160e01d784c7a0b9216a2b7f7989e7a9acd[]W )\-5CUP<>D@?@qd  =7; v     , X  (?8H9d:GHIXY\]^Sbd e f %l (t @u Pv `w x y  ?"????????@,@0Ccopy-jdk-configs4.03.el9JDKs configuration files copierUtility script to transfer JDKs configuration files between updates or for archiving. With script to fix incorrectly created rpmnew filesb@Apb-2dcb695b-83ee-4782-a86d-61a4296d6ca3-b-noarchM^Rocky Linux 9Rocky Enterprise Software FoundationBSDRocky Linux Build System (Peridot) Unspecifiedhttps://pagure.io/copy_jdk_configslinuxnoarch1ӁA큤b>Ib>Ib@Bb>I8a81cc8d2d07d525c97b56f4bf5d1457ce716b3c1de1e103e6acb4c9a1ffd5a49391f6ad7e9e98f9eeb056395d2fc2e4cd062cc374c7b614612d47095a44e2c3386eaf71633bf096e6c17471f50e867dabdf14d38a157ca27a0425dc583eb9ferootrootrootrootrootrootrootrootcopy-jdk-configs-4.0-3.el9.src.rpmcopy-jdk-configs @@     /bin/sh/usr/bin/bash/usr/bin/luafindutilslualua-posixrpmlib(BuiltinLuaScripts)rpmlib(CompressedFileNames)rpmlib(FileDigests)rpmlib(PayloadFilesHavePrefix)rpmlib(PayloadIsZstd)4.2.2-13.0.4-14.6.0-14.0-15.4.18-14.16.1.3a`[``@_^)@^0"@Mohan Boddu - 4.0-3Fedora Release Engineering - 4.0-1Fedora Release Engineering - 4.0-0Fedora Release Engineering - 3.7-8Fedora Release Engineering - 3.7-7Andrew Hughes - 3.7-6Fedora Release Engineering - 3.7-5- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags Related: rhbz#1991688- added requires and orderWithRequires of findutils to provide find and xargs (rh1965305)- bumped to 4.0 to resolve remvoed rpm 4.17 removing arg from global table- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild- Rebuilt for lua 5.4.0.- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild4.0-3.el9copy_jdk_configs.luacopy_jdk_configs_fixFiles.shcopy-jdk-configsLICENSE/usr/libexec//usr/share/licenses//usr/share/licenses/copy-jdk-configs/-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protectioncpiozstd19noarch-redhat-linux-gnuLua script, ASCII text executableBourne-Again shell script, ASCII text executabledirectoryASCII textRRfunction createPretransScript() -- the sript must be available during pretrans, so multiply it to tmp os.execute("mkdir -p /var/lib/rpm-state") temp_path="/var/lib/rpm-state/copy_jdk_configs.lua" -- print("generating " .. temp_path) file = io.open(temp_path, "w") file:write([[#!/usr/bin/lua -- rpm call -- debug=true lua -- copy_jdk_configs.lua --currentjvm "%{uniquesuffix %{nil}}" --jvmdir "%{_jvmdir %{nil}}" --origname "%{name}" --origjavaver "%{javaver}" --arch "%{_arch}" --test call -- debug=true lua -- copy_jdk_configs.lua --currentjvm "java-1.8.0-openjdk-1.8.0.65-3.b17.fc22.x86_64" --jvmdir "/usr/lib/jvm" --origname "java-1.8.0-openjdk" --origjavaver "1.8.0" --arch "x86_64" --jvmDestdir /home/jvanek/Desktop local M = {} if (os.getenv("debug") == "true") then debug = true; else debug = false; end local function debugOneLinePrint(string) if (debug) then print(string) end ; end function getPath(str, sep) sep = sep or '/' return str:match("(.*" .. sep .. ")") end function splitToTable(source, pattern) local i1 = string.gmatch(source, pattern) local l1 = {} for i in i1 do table.insert(l1, i) end return l1 end local function slurp(path) local f = io.open(path) local s = f:read("*a") f:close() return s end function trim(s) return (s:gsub("^%s*(.-)%s*$", "%1")) end local function dirWithParents(path) local s = "" local dirs = splitToTable(path, "[^/]+") for i, d in pairs(dirs) do if (i == #dirs) then break end s = s .. "/" .. d local stat2 = posix.stat(s, "type"); if (stat2 == nil) then debugOneLinePrint(s .. " does not exists, creating") if (not dry) then posix.mkdir(s) end else debugOneLinePrint(s .. " exists,not creating") end end end -- main function, -- formelry main body -- move to function resolved -- https://bugzilla.redhat.com/show_bug.cgi?id=1892224 -- for readability not indented, todo, indent once tuned function M.mainProgram(arg) debugOneLinePrint("cjc: lua debug on") local caredFiles = { "jre/lib/calendars.properties", "jre/lib/content-types.properties", "jre/lib/flavormap.properties", "jre/lib/logging.properties", "jre/lib/net.properties", "jre/lib/psfontj2d.properties", "jre/lib/sound.properties", "jre/lib/deployment.properties", "jre/lib/deployment.config", "jre/lib/security/US_export_policy.jar", "jre/lib/security/unlimited/US_export_policy.jar", "jre/lib/security/limited/US_export_policy.jar", "jre/lib/security/policy/unlimited/US_export_policy.jar", "jre/lib/security/policy/limited/US_export_policy.jar", "jre/lib/security/java.policy", "jre/lib/security/java.security", "jre/lib/security/local_policy.jar", "jre/lib/security/unlimited/local_policy.jar", "jre/lib/security/limited/local_policy.jar", "jre/lib/security/policy/unlimited/local_policy.jar", "jre/lib/security/policy/limited/local_policy.jar", "jre/lib/security/nss.cfg", "jre/lib/security/cacerts", "jre/lib/security/blacklisted.certs", "jre/lib/security/jssecacerts", "jre/lib/security/trusted.certs", "jre/lib/security/trusted.jssecerts", "jre/lib/security/trusted.clientcerts", "jre/lib/ext", "jre/lib/security/blacklist", "jre/lib/security/javaws.policy", "jre/lib/security/nss.fips.cfg", "lib/security", "conf", "lib/ext" } -- before import to allow run from spec if (arg[1] == "--list") then for i, file in pairs(caredFiles) do print(file) end return 0; end -- yum install lua-posix local posix = require "posix" -- the one we are installing local currentjvm = nil local jvmdir = nil local jvmDestdir = nil local origname = nil local origjavaver = nil local arch = nil local temp = nil; local dry = false; for i = 1, #arg, 2 do if (arg[i] == "--help" or arg[i] == "-h") then print("all but jvmDestdir and debug are mandatory") print(" --currentjvm") print(" NVRA of currently installed java") print(" --jvmdir") print(" Directory where to find this kind of virtual machine. Generally /usr/lib/jvm") print(" --origname") print(" convinient switch to determine jdk. Generally java-1.X.0-vendor") print(" --origjavaver") print(" convinient switch to determine jdk's version. Generally 1.X.0") print(" --arch") print(" convinient switch to determine jdk's arch") print(" --jvmDestdir") print(" Migration/testing switch. Target Mostly same as jvmdir, but you may wont to copy ouside it.") print(" --debug or $debug") print(" Enables printing out whats going on. true/false. False by default") print(" --temp") print(" optional file to save intermediate result - directory configs were copied from") print(" --dry") print(" true/fase if true, then no changes will be written to disk except one tmp file. False by default") print(" **** specil parasm ****") print(" --list") print(" if present on cmdline, list all cared files and exists") os.exit(0) end if (arg[i] == "--currentjvm") then currentjvm = arg[i + 1] end if (arg[i] == "--jvmdir") then jvmdir = arg[i + 1] end if (arg[i] == "--origname") then origname = arg[i + 1] end if (arg[i] == "--origjavaver") then origjavaver = arg[i + 1] end if (arg[i] == "--arch") then arch = arg[i + 1] end if (arg[i] == "--jvmDestdir") then jvmDestdir = arg[i + 1] end if (arg[i] == "--debug") then --no string, boolean, workaround if (arg[i + 1] == "true") then debug = true end end if (arg[i] == "--dry") then --no string, boolean, workaround if (arg[i + 1] == "true") then dry = true end end if (arg[i] == "--temp") then temp = arg[i + 1] end end if (jvmDestdir == nil) then jvmDestdir = jvmdir end if (debug) then print("--currentjvm:"); print(currentjvm); print("--jvmdir:"); print(jvmdir); print("--jvmDestdir:"); print(jvmDestdir); print("--origname:"); print(origname); print("--origjavaver:"); print(origjavaver); print("--arch:"); print(arch); print("--debug:"); print(debug); end --trasnform substitute names to lua patterns local name = string.gsub(string.gsub(origname, "%-", "%%-"), "%.", "%%.") local javaver = string.gsub(origjavaver, "%.", "%%.") local jvms = { } debugOneLinePrint("started") foundJvms = posix.dir(jvmdir); if (foundJvms == nil) then debugOneLinePrint("no, or nothing in " .. jvmdir .. " exit") return end debugOneLinePrint("found " .. #foundJvms .. " jvms") for i, p in pairs(foundJvms) do -- regex similar to %{_jvmdir}/%{name}-%{javaver}*%{_arch} bash command if (string.find(p, name .. "%-" .. javaver .. ".*" .. arch) ~= nil) then debugOneLinePrint("matched: " .. p) if (currentjvm == p) then debugOneLinePrint("this jdk is already installed. exiting lua script") return end ; if (string.match(p, ".*-debug$")) then print(p .. " matched but seems to be debug variant. Skipping") else table.insert(jvms, p) end else debugOneLinePrint("NOT matched: " .. p) end end if (#jvms <= 0) then debugOneLinePrint("no matching jdk in " .. jvmdir .. " exit") return end ; debugOneLinePrint("matched " .. #jvms .. " jdk in " .. jvmdir) --full names are like java-1.7.0-openjdk-1.7.0.60-2.4.5.1.fc20.x86_64 table.sort(jvms, function(a, b) -- version-sort -- split on non word: . - local l1 = splitToTable(a, "[^%.-]+") local l2 = splitToTable(b, "[^%.-]+") for x = 1, math.min(#l1, #l2) do local l1x = tonumber(l1[x]) local l2x = tonumber(l2[x]) if (l1x ~= nil and l2x ~= nil) then --if hunks are numbers, go with them if (l1x < l2x) then return true; end if (l1x > l2x) then return false; end else if (l1[x] < l2[x]) then return true; end if (l1[x] > l2[x]) then return false; end end -- if hunks are equals then move to another pair of hunks end return a < b end) if (debug) then print("sorted lsit of jvms") for i, file in pairs(jvms) do print(file) end end latestjvm = jvms[#jvms] if (temp ~= nil) then src = jvmdir .. "/" .. latestjvm debugOneLinePrint("temp declared as " .. temp .. " saving used dir of " .. src) file = io.open(temp, "w") file:write(src) file:close() end local readlinkOutput = os.tmpname() for i, file in pairs(caredFiles) do local SOURCE = jvmdir .. "/" .. latestjvm .. "/" .. file local DEST = jvmDestdir .. "/" .. currentjvm .. "/" .. file debugOneLinePrint("going to copy " .. SOURCE) debugOneLinePrint("to " .. DEST) local stat1 = posix.stat(SOURCE, "type"); if (stat1 ~= nil) then debugOneLinePrint(SOURCE .. " exists") dirWithParents(DEST) -- Copy with -a to keep everything intact local exe = "cp" .. " -ar " .. SOURCE .. " " .. DEST local linkExe = "readlink" .. " -f " .. SOURCE .. " > " .. readlinkOutput debugOneLinePrint("executing " .. linkExe) os.remove(readlinkOutput) os.execute(linkExe) local link = trim(slurp(readlinkOutput)) debugOneLinePrint(" ...link is " .. link) if (not ((link) == (SOURCE))) then debugOneLinePrint("WARNING link " .. link .. " where file " .. SOURCE .. " expected!") debugOneLinePrint("Will try to copy link target rather then link itself!") --replacing any NVRA by future NVRA (still execting to have NVRA for any multiple-installable targets -- lua stubbornly consider dash as inteval. Replacing by dot to match X-Y more correct as X.Y rather then not at all local linkDest = string.gsub(link, latestjvm:gsub("-", "."), currentjvm) debugOneLinePrint("attempting to copy " .. link .. " to " .. linkDest) if (link == linkDest) then debugOneLinePrint("Those are identical files! Nothing to do!") else local exe2 = "cp" .. " -ar " .. link .. " " .. linkDest dirWithParents(linkDest) debugOneLinePrint("executing " .. exe2) if (not dry) then os.execute(exe2) end end else debugOneLinePrint("executing " .. exe) if (not dry) then os.execute(exe) end end else debugOneLinePrint(SOURCE .. " does not exists") end end end --unindented main function if (arg == nil) then debugOneLinePrint("arg variable is nil, you have to call mainProgram manually") -- this can actually not be invoked, as the debug is set via arg else M.mainProgram(arg) end return M]]) file:close() end -- in netinst, the above call may fail. pcall should save instalation (as there is nothing to copy anyway) -- https://bugzilla.redhat.com/show_bug.cgi?id=1295701 -- todo, decide whether to check for {rpm_state_dir} and skip on not-existing, or keep creating if pcall(createPretransScript) then -- ok else -- print("Error running copy-jdk-configs pretrans.") end# remove file created in pretrans # echo "removing /var/lib/rpm-state/copy_j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