Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 869977 Details for
Bug 1038092
%config(norepalce) files in jdk do not persist during update correctly
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
propsoed scripplet in lua
scriplet1.lua (text/x-lua), 3.59 KB, created by
jiri vanek
on 2014-03-03 15:21:55 UTC
(
hide
)
Description:
propsoed scripplet in lua
Filename:
MIME Type:
Creator:
jiri vanek
Created:
2014-03-03 15:21:55 UTC
Size:
3.59 KB
patch
obsolete
>-- see https://bugzilla.redhat.com/show_bug.cgi?id=1038092 for whole issue > >local posix = require "posix" > >--local currentjvm = "blaaah" >local currentjvm = "%{uniquesuffix}" >--local jvmdir = "/usr/lib/jvm" >local jvmdir = "%{_jvmdir}" >--local jvmDestdir = "/home/jvanek/Desktop" >local jvmDestdir = jvmdir >--local origname = "java-1.7.0-openjdk" >local origname = "%{name}" >--local origjavaver = "1.7.0" >local origjavaver = "%{javaver}" >--trasnform substitute names to lua patterns >local name = string.gsub(string.gsub(origname, "%-", "%%-"), "%.", "%%.") >local javaver = string.gsub(origjavaver, "%.", "%%.") >--local arch = "x86_64" >local arch ="%{_arch}" > >local jvms = { } > >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/tz.properties", > "jre/lib/deployment.properties", > "jre/lib/deployment.config", > "jre/lib/security/US_export_policy.jar", > "jre/lib/security/java.policy", > "jre/lib/security/java.security", > "jre/lib/security/local_policy.jar", > "jre/lib/security/nss.cfg,", > "jre/lib/ext"} > >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 > >foundJvms = posix.dir(jvmdir); >if (foundJvms == nil) then > return >end >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 > table.insert(jvms, p) >-- testing only > --s = string.gsub(p, arch, "i386"); > --table.insert(jvms, s); > --table.insert(jvms, "java-1.7.0-openjdk-1.7.0.61-2.4.5.1.fc20.x86_64") > --table.insert(jvms, "java-1.7.0-openjdk-1.7.0.59-2.4.5.1.fc20.i686") > --table.insert(jvms, "java-1.7.0-openjdk-1.7.0.59-2.4.5.01.fc20.x86_64") > --table.insert(jvms, "java-1.7.0-openjdk-1.7.0.61-2.4.5.2.fc20.i686") >-- end testing > end >end > >if (#jvms <=0) then >--no jdk installed, bye > return >end; > >--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) > >-- for i,file in pairs(jvms) do >-- print(file) >-- end > >latestjvm = jvms[#jvms] > > >for i,file in pairs(caredFiles) do > local SOURCE=jvmdir.."/"..latestjvm.."/"..file > local DEST=jvmDestdir.."/"..currentjvm.."/"..file > local stat1 = posix.stat(SOURCE, "type"); > if (stat1 ~= nil) then >--if SOURCE exists, create DEST prent directories > local s = "" > local dirs = splitToTable(DEST, "[^/]+") > 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 > posix.mkdir(s) > end > end >-- Copy with -a to keep everything intact > os.execute("cp".." -ar "..SOURCE.." "..DEST) > end >end >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1038092
:
832597
|
833677
|
833746
|
833751
|
838485
| 869977 |
873571