Skip to content

Commit 4c61ead

Browse files
committed
Support testing leap16 without new iso
1 parent 01d15fa commit 4c61ead

File tree

10 files changed

+149
-192
lines changed

10 files changed

+149
-192
lines changed

script/cfg.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,29 @@ def rsync_repodir2():
178178
done
179179
'''
180180

181+
rsync_remodir_multiarch = '''
182+
buildid=$(grep -hEo 'Build[0-9]+(.[0-9]+)?' __envsub/Media1_*.lst 2>/dev/null | head -n 1)
183+
184+
while read src; do
185+
[ ! -z "$src" ] || continue
186+
dest=$src
187+
dest=${dest%-Build*}
188+
189+
echo rsync --timeout=3600 -rtlp4 --delete --specials PRODUCTREPOPATH/$dest/ /var/lib/openqa/factory/repo/fixed/$dest-CURRENT/
190+
echo rsync --timeout=3600 -rtlp4 --delete --specials --link-dest /var/lib/openqa/factory/repo/fixed/$dest-CURRENT/ /var/lib/openqa/factory/repo/fixed/$dest-CURRENT/ /var/lib/openqa/factory/repo/$dest-$buildid
191+
done < <(cat __envsub/files_repo.lst | grep -v Debug | grep -v Source | grep -v .license )
192+
'''
193+
194+
rsync_remodir_multiarch_debug = '''
195+
while read src; do
196+
[ ! -z "$src" ] || continue
197+
dest=$src
198+
dest=${dest%-Build*}
199+
200+
echo rsync --timeout=3600 -rtlp4 --delete --specials RSYNCFILTER PRODUCTREPOPATH/$dest/ /var/lib/openqa/factory/repo/fixed/$dest-CURRENT/
201+
echo rsync --timeout=3600 -rtlp4 --delete --specials --link-dest /var/lib/openqa/factory/repo/fixed/$dest-CURRENT/ /var/lib/openqa/factory/repo/fixed/$dest-CURRENT-Debug/ /var/lib/openqa/factory/repo/$dest-$buildid
202+
done < <(cat __envsub/files_repo.lst | grep Debug )
203+
'''
181204

182205
def rsync_repomultiarch(destpath, debug, source):
183206
destpath = destpath.rstrip("/")
@@ -325,6 +348,7 @@ def pre_openqa_call_start(repos):
325348
[ -n "$iso" ] || [ "$flavor" != "''' + assets_flavor + r'''" ] || build=$(grep -o -E '(Build|Snapshot)[^-]*' __envsub/files_asset.lst | grep -o -E '[0-9]\.?[0-9]+(\.[0-9]+)*' | head -n 1)
326349
[ -n "$iso" ] || [ "$flavor" != "''' + assets_flavor + r'''" ] || buildex=$(grep -o -E '(Build|Snapshot)[^-]*' __envsub/files_asset.lst | head -n 1)
327350
[ -n "$iso$build" ] || build=$(grep -h -o -E '(Build|Snapshot)[^-]*' __envsub/Media1*.lst 2>/dev/null | head -n 1 | grep -o -E '[0-9]\.?[0-9]+(\.[0-9]+)*')|| :
351+
[ -n "$build" ] || [ "FIXEDISO" != 1 ] || build=$(grep -h -o -E '(Build|Snapshot)[^-]*' __envsub/Media1*.lst 2>/dev/null | head -n 1 | grep -o -E '[0-9]\.?[0-9]+(\.[0-9]+)*')|| :
328352
[ -n "$build" ] || continue
329353
buildex=${buildex/.install.iso/}
330354
buildex=${buildex/.iso/}

script/scriptgen.py

Lines changed: 64 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ def __init__(self, name, actionGenerator):
167167
self.asset_rsync = {}
168168
self.norsync = {}
169169
self.isos = []
170+
self.isos_fixed = []
170171
self.iso_folder = {}
171172
self.iso_5 = ""
172173
self.fixed_iso = ""
@@ -309,6 +310,10 @@ def p(
309310
if self.ag.domain:
310311
s = s.replace("opensuse.org", self.ag.domain)
311312
s = s.replace("REPOLINK", self.repolink)
313+
fixediso = "0"
314+
if self.isos_fixed:
315+
fixediso = "1"
316+
s = s.replace("FIXEDISO", fixediso)
312317
print(s, file=f)
313318

314319
def doFlavor(self, node):
@@ -340,13 +345,14 @@ def doFlavor(self, node):
340345
self.fixed_iso = node.attrib["fixed_iso"]
341346
if node.attrib.get("rsync", "1") == "0":
342347
self.norsync[f] = 1
343-
344-
if node.attrib.get("iso", "") and node.attrib.get("name", ""):
348+
iso_attrib = node.attrib.get("iso", "")
349+
if iso_attrib.endswith(".iso"):
350+
self.isos_fixed.append(iso_attrib)
351+
elif iso_attrib and node.attrib.get("name", ""):
345352
for iso in node.attrib["name"].split("|"):
346353
if node.attrib.get("folder", ""):
347354
# self.iso_path = node.attrib["folder"]
348355
self.iso_folder[iso] = node.attrib["folder"]
349-
iso_attrib = node.attrib["iso"]
350356
if iso_attrib == "extract_as_repo":
351357
self.iso_extract_as_repo[iso] = 1
352358
elif iso_attrib != "1":
@@ -382,7 +388,7 @@ def doFlavor(self, node):
382388
self.archs_repo = t.attrib["archs"]
383389

384390
for t in node.findall(".//repos/*"):
385-
if t.get("multiarch", ""):
391+
if t.get("multiarch", "") and not self.isos_fixed:
386392
self.reposmultiarch.append(t)
387393
continue
388394

@@ -590,6 +596,12 @@ def gen_read_files(self, f):
590596
".iso$",
591597
)
592598

599+
if self.isos_fixed:
600+
self.p("for arch in ARCHITECTURS; do", f)
601+
for iso in self.isos_fixed:
602+
self.p(" echo {} >> __envsub/files_iso.lst".format(iso), f)
603+
self.p("done", f)
604+
593605
if self.repolink:
594606
self.p(cfg.read_files_repo_link, f)
595607
if self.repolink and self.build_id_from_iso:
@@ -659,13 +671,14 @@ def gen_read_files(self, f):
659671
suffix = ""
660672
if repodir.attrib.get("suffix"):
661673
suffix = repodir.attrib["suffix"]
662-
repopath = ""
674+
675+
selffolder = ""
676+
if self.folder:
677+
selffolder = "/" + self.folder
663678
if "/" in self.folder or "/" in repodir.attrib["folder"]:
664-
repopath = self.ag.productpath + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix
679+
repopath = self.ag.productpath + selffolder + "/*" + repodir.attrib["folder"] + "*" + suffix
665680
else:
666-
repopath = (
667-
self.ag.productrepopath() + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix
668-
)
681+
repopath = self.ag.productrepopath() + selffolder + "/*" + repodir.attrib["folder"] + "*" + suffix
669682

670683
args = (
671684
cfg.read_files_repo,
@@ -680,7 +693,7 @@ def gen_read_files(self, f):
680693
archs.replace(" ", "|").replace("armv7hl", "armv7hl|armv7l"),
681694
)
682695
if self.media1 == "0":
683-
args += ("| grep -P 'Media[1-3](.license)?$'", "")
696+
args += ("| grep -P 'Media[1-3](.license)?$'", "| grep -v .license")
684697
self.p(*args)
685698

686699
# let's sync media.1/media to be able verify build_id
@@ -693,21 +706,36 @@ def gen_read_files(self, f):
693706
if archs:
694707
wild = "*" + archs + "*"
695708
if "Leap" in self.ag.envdir or "Jump" in self.ag.envdir or self.version_from_media:
696-
if " " in archs and self.repodirs:
709+
if " " in archs and self.repodirs and "1" != repodir.attrib.get("multiarch", ""):
697710
self.p("for arch in {}; do".format(archs), f)
698711
wild = "*$arch*"
699712
done = "done"
700713

701714
for repodir in self.repodirs:
715+
selffolder = ""
716+
if self.folder:
717+
selffolder = "/" + self.folder
718+
if "/" in self.folder or "/" in repodir.attrib["folder"]:
719+
repopath = self.ag.productpath + selffolder + "/*" + repodir.attrib["folder"] + "*" + suffix
720+
else:
721+
repopath = (
722+
self.ag.productrepopath() + selffolder + "/*" + repodir.attrib["folder"] + "*" + suffix
723+
)
724+
725+
Media1Replace = "*Media1"
726+
if self.media1 == "0":
727+
Media1Replace = "*"
702728
self.p(
703729
cfg.read_files_repo_media,
704730
f,
705731
"PRODUCTREPOPATH",
706-
self.ag.productpath + "/" + self.folder + "/*" + repodir.attrib["folder"] + wild,
732+
repopath,
707733
"Media1.lst",
708734
"Media1_{}.lst".format(
709735
os.path.basename(repodir.attrib["folder"]).lstrip("*") + repodir.get("archs", "")
710736
),
737+
"*Media1",
738+
Media1Replace,
711739
)
712740

713741
if done:
@@ -898,6 +926,30 @@ def gen_print_rsync_repo(self, f):
898926
for r in self.repodirs:
899927
if r.attrib.get("gen", ""):
900928
continue
929+
if self.media1 == "0" and "1" == r.attrib.get("multiarch", ""):
930+
self.p(
931+
cfg.rsync_remodir_multiarch,
932+
f,
933+
"files_repo.lst",
934+
"files_repo_{}.lst".format(os.path.basename(r.attrib["folder"]).lstrip("*")),
935+
"PRODUCTREPOPATH",
936+
self.productrepopath() + xtrapath + r.attrib["folder"],
937+
)
938+
if r.attrib.get("debug", ""):
939+
self.p(
940+
cfg.rsync_remodir_multiarch_debug,
941+
f,
942+
"files_repo.lst",
943+
"files_repo_{}.lst".format(os.path.basename(r.attrib["folder"]).lstrip("*")),
944+
"PRODUCTREPOPATH",
945+
self.productrepopath() + xtrapath + r.attrib["folder"],
946+
"RSYNCFILTER",
947+
" --include=PACKAGES --exclude={aarch64,armv7hl,i586,i686,noarch,nosrc,ppc64,ppc64le,riscv64,s390x,src,x86_64}/*".replace(
948+
"PACKAGES", r.attrib["debug"]
949+
),
950+
)
951+
continue
952+
901953
if not r.attrib.get("dest", ""):
902954
self.p(cfg.rsync_repodir1, f, "mid=''", "mid='{}'".format(r.attrib.get("mid", "")))
903955
elif self.media1 == "0":
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
openSUSE - Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build172.9
2+
Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build172.9
Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
agama-installer-Leap.aarch64-16.0.0-Leap-Build1.3.iso
2-
agama-installer-Leap.aarch64-16.0.0-Leap-PXE-Build1.3.install.iso
3-
agama-installer-Leap.ppc64le-16.0.0-Leap-Build1.3.iso
4-
agama-installer-Leap.s390x-16.0.0-Leap-Build1.3.iso
5-
agama-installer-Leap.x86_64-16.0.0-Leap-Build1.3.iso
6-
agama-installer-Leap.x86_64-16.0.0-Leap-PXE-Build1.3.install.iso
7-
Leap-16.0-offline-installer-aarch64-Build1.3.install.iso
8-
Leap-16.0-offline-installer-ppc64le-Build1.3.install.iso
9-
Leap-16.0-offline-installer-s390x-Build1.3.install.iso
10-
Leap-16.0-offline-installer-x86_64-Build1.3.install.iso
11-
Leap-16.0-online-installer-aarch64-Build1.3.install.iso
12-
Leap-16.0-online-installer-ppc64le-Build1.3.install.iso
13-
Leap-16.0-online-installer-s390x-Build1.3.install.iso
14-
Leap-16.0-online-installer-x86_64-Build1.3.install.iso
1+
Leap-16.0-offline-installer-aarch64.install.iso
2+
Leap-16.0-offline-installer-x86_64.install.iso
3+
Leap-16.0-offline-installer-ppc64le.install.iso
4+
Leap-16.0-offline-installer-s390x.install.iso

t/obs/openSUSE:Leap:16.0:ToTest/files_repo.lst

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug
2+
Leap-16.0-aarch64-ppc64le-s390x-x86_64-Source
3+
Leap-16.0-aarch64-ppc64le-s390x-x86_64

0 commit comments

Comments
 (0)