Skip to content

Commit a314147

Browse files
authored
Merge pull request #295 from os-autoinst/multiarch_repos
Add special handling of multiarch repos
2 parents 4be4d8d + 5368546 commit a314147

File tree

5 files changed

+107
-14
lines changed

5 files changed

+107
-14
lines changed

script/cfg.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
header = '''# GENERATED FILE - DO NOT EDIT
24
set -e
35
'''
@@ -110,16 +112,19 @@ def rsync_commands(checksum):
110112
def pre_rsync_repo(repos):
111113
return ''
112114

113-
rsync_repo1 = '''
114-
echo '# REPOOWNLIST'
115+
rsync_repo_buildid = '''
115116
[ ! -f __envsub/files_iso.lst ] || buildid=$(cat __envsub/files_iso.lst | grep -E 'FLAVORORS' | grep -o -E '(Build|Snapshot)[^-]*' | head -n 1)
116117
[ ! -f __envsub/files_iso.lst ] || test -n "$buildid" || buildid=$(cat __envsub/files_iso.lst | grep -o -E '(Build|Snapshot)[^-]*' | head -n 1)
117118
[ -z "__STAGING" ] || buildid=${buildid//Build/Build__STAGING.}
118119
[ ! -f __envsub/files_repo.lst ] || ! grep -q -- "-POOL-" __envsub/files_repo.lst || additional_repo_suffix=-POOL
119120
[ -n "$buildid" ] || buildid=$(grep -hEo 'Build[0-9]+(.[0-9]+)?' __envsub/Media1_*.lst 2>/dev/null | head -n 1)
120121
121122
buildid=${buildid/.iso}
123+
'''
122124

125+
rsync_repo1 = '''
126+
echo '# REPOOWNLIST'
127+
''' + rsync_repo_buildid + '''
123128
for repo in {REPOOWNLIST,}; do
124129
while read src; do
125130
[ ! -z "$src" ] || continue
@@ -172,6 +177,29 @@ def rsync_repodir2():
172177
done
173178
'''
174179

180+
181+
def rsync_repomultiarch(destpath, debug, source):
182+
destpath = destpath.rstrip("/")
183+
dest = os.path.basename(destpath)
184+
res = '''
185+
echo rsync --timeout=3600 -rtlp4 --delete --specials PRODUCTREPOPATH/'''+ destpath +'''/ /var/lib/openqa/factory/repo/''' + dest + '''-CURRENT
186+
echo rsync --timeout=3600 -rtlp4 --delete --specials --link-dest /var/lib/openqa/factory/repo/''' + dest + '''-CURRENT/ /var/lib/openqa/factory/repo/''' + dest + '''-CURRENT/ /var/lib/openqa/factory/repo/''' + dest + '''-$buildid/
187+
'''
188+
189+
if debug:
190+
debugfilter = "--include=" + debug + " --exclude={aarch64,armv7hl,i586,i686,noarch,nosrc,ppc64,ppc64le,s390x,src,x86_64}/*"
191+
res = res + '''
192+
echo rsync --timeout=3600 -rtlp4 --delete --specials ''' + debugfilter + ''' PRODUCTREPOPATH/'''+ destpath +'''-Debug/ /var/lib/openqa/factory/repo/''' + dest + '''-Debug-CURRENT/
193+
echo rsync --timeout=3600 -rtlp4 --delete --specials --link-dest /var/lib/openqa/factory/repo/''' + dest + '''-Debug-CURRENT/ /var/lib/openqa/factory/repo/''' + dest + '''-Debug-CURRENT/ /var/lib/openqa/factory/repo/''' + dest + '''-Debug-$buildid/'''
194+
195+
if source:
196+
sourcefilter = "--include=" + source + " --exclude={aarch64,armv7hl,i586,i686,noarch,nosrc,ppc64,ppc64le,s390x,src,x86_64}/*"
197+
res = res + '''
198+
echo rsync --timeout=3600 -rtlp4 --delete --specials ''' + sourcefilter + ''' PRODUCTREPOPATH/'''+ destpath +'''-Source/ /var/lib/openqa/factory/repo/''' + dest + '''-Source-CURRENT/
199+
echo rsync --timeout=3600 -rtlp4 --delete --specials --link-dest /var/lib/openqa/factory/repo/''' + dest + '''-Source-CURRENT/ /var/lib/openqa/factory/repo/''' + dest + '''-Source-CURRENT/ /var/lib/openqa/factory/repo/''' + dest + '''-Source-$buildid/'''
200+
201+
return res
202+
175203
rsync_repodir1_dest = lambda dest: '''
176204
archs=(ARCHITECTURREPO)
177205
buildid=$(cat __envsub/files_iso.lst | grep -E 'FLAVORORS' | grep -o -E '(Build|Snapshot)[^-]*' | head -n 1)

script/scriptgen.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ def __init__(self, name, actionGenerator):
175175
self.ln_iso_to_repo = {}
176176
self.mirror_repo = ""
177177
self.repos = []
178+
self.reposmultiarch = [] # these repos need not to be processed for each arch
178179
self.repolink = ""
179180
self.build_id_from_iso = 0
180181
self.repodirs = []
@@ -381,6 +382,10 @@ def doFlavor(self, node):
381382
self.archs_repo = t.attrib["archs"]
382383

383384
for t in node.findall(".//repos/*"):
385+
if t.get("multiarch", ""):
386+
self.reposmultiarch.append(t)
387+
continue
388+
384389
if "folder" in t.attrib:
385390
self.repodirs.append(t)
386391
else:
@@ -864,6 +869,19 @@ def gen_print_rsync_repo(self, f):
864869
print(cfg.header, file=f)
865870
if self.ag.version:
866871
print("version=" + self.ag.version, file=f)
872+
873+
if self.reposmultiarch:
874+
self.p(cfg.rsync_repo_buildid, f)
875+
for repo in self.reposmultiarch:
876+
destpath = repo.get("folder", repo.tag)
877+
dest = os.path.basename(destpath)
878+
self.p(
879+
cfg.rsync_repomultiarch(
880+
repo.get("folder", repo.tag), repo.get("debug", ""), repo.get("source", "")
881+
),
882+
f,
883+
)
884+
867885
if self.repos:
868886
self.p(cfg.pre_rsync_repo(self.repos), f)
869887
self.p(cfg.rsync_repo1, f)
@@ -1002,6 +1020,28 @@ def gen_print_openqa(self, f):
10021020
),
10031021
f,
10041022
)
1023+
1024+
imultiarch = 0
1025+
for repo in self.reposmultiarch:
1026+
destpath = repo.get("folder", repo.tag)
1027+
destpath = destpath.rstrip("/")
1028+
dest = os.path.basename(destpath)
1029+
self.p(' echo " REPO_{}={}-$buildex" \\\\'.format(imultiarch, dest), f)
1030+
self.p(' echo " REPO_{}={}-$buildex" \\\\'.format(repo.tag.upper(), dest), f)
1031+
imultiarch = imultiarch + 1
1032+
if repo.get("debug", ""):
1033+
self.p(' echo " REPO_{}={}-Debug-$buildex" \\\\'.format(imultiarch, dest), f)
1034+
self.p(' echo " REPO_{}_DEBUG={}-Debug-$buildex" \\\\'.format(repo.tag.upper(), dest), f)
1035+
self.p(" echo \" REPO_{}_DEBUG_PACKAGES='{}'\" \\\\".format(repo.tag.upper(), repo.get("debug", "")), f)
1036+
imultiarch = imultiarch + 1
1037+
if repo.get("source", ""):
1038+
self.p(' echo " REPO_{}={}-Source-$buildex" \\\\'.format(imultiarch, dest), f)
1039+
self.p(' echo " REPO_{}_SOURCE={}-Source-$buildex" \\\\'.format(repo.tag.upper(), dest), f)
1040+
self.p(
1041+
" echo \" REPO_{}_SOURCE_PACKAGES='{}'\" \\\\".format(repo.tag.upper(), repo.get("source", "")), f
1042+
)
1043+
imultiarch = imultiarch + 1
1044+
10051045
if len(self.iso1) > 0:
10061046
self.p(' iso1=""', f)
10071047
self.p(

t/obs/openSUSE:Leap:16.0:ToTest/print_openqa.before

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
FLAVOR=agama-installer-Leap \
88
ISO=agama-installer-Leap.aarch64-16.0.0-Leap-Build1.3.iso \
99
REPO_0=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
10-
REPO_SLE_LEAP_16_0_AARCH64_PPC64LE_S390X_X86_64=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
10+
REPO_1=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-Build1.3 \
11+
REPO_LEAP_OSS=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
12+
REPO_LEAP_OSS_DEBUG=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-Build1.3 \
13+
REPO_LEAP_OSS_DEBUG_PACKAGES='{java*,kernel-default-debug*,kernel-default-base-debug*,mraa-debug*,wicked-debug*}' \
1114
VERSION=16.0 \
1215
_OBSOLETE=1
1316

@@ -20,7 +23,10 @@
2023
FLAVOR=agama-installer-Leap \
2124
ISO=agama-installer-Leap.x86_64-16.0.0-Leap-Build1.3.iso \
2225
REPO_0=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
23-
REPO_SLE_LEAP_16_0_AARCH64_PPC64LE_S390X_X86_64=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
26+
REPO_1=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-Build1.3 \
27+
REPO_LEAP_OSS=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
28+
REPO_LEAP_OSS_DEBUG=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-Build1.3 \
29+
REPO_LEAP_OSS_DEBUG_PACKAGES='{java*,kernel-default-debug*,kernel-default-base-debug*,mraa-debug*,wicked-debug*}' \
2430
VERSION=16.0 \
2531
_OBSOLETE=1
2632

@@ -33,7 +39,10 @@
3339
FLAVOR=agama-installer-Leap \
3440
ISO=agama-installer-Leap.ppc64le-16.0.0-Leap-Build1.3.iso \
3541
REPO_0=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
36-
REPO_SLE_LEAP_16_0_AARCH64_PPC64LE_S390X_X86_64=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
42+
REPO_1=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-Build1.3 \
43+
REPO_LEAP_OSS=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
44+
REPO_LEAP_OSS_DEBUG=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-Build1.3 \
45+
REPO_LEAP_OSS_DEBUG_PACKAGES='{java*,kernel-default-debug*,kernel-default-base-debug*,mraa-debug*,wicked-debug*}' \
3746
VERSION=16.0 \
3847
_OBSOLETE=1
3948

@@ -46,7 +55,10 @@
4655
FLAVOR=agama-installer-Leap \
4756
ISO=agama-installer-Leap.s390x-16.0.0-Leap-Build1.3.iso \
4857
REPO_0=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
49-
REPO_SLE_LEAP_16_0_AARCH64_PPC64LE_S390X_X86_64=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
58+
REPO_1=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-Build1.3 \
59+
REPO_LEAP_OSS=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
60+
REPO_LEAP_OSS_DEBUG=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-Build1.3 \
61+
REPO_LEAP_OSS_DEBUG_PACKAGES='{java*,kernel-default-debug*,kernel-default-base-debug*,mraa-debug*,wicked-debug*}' \
5062
VERSION=16.0 \
5163
_OBSOLETE=1
5264

@@ -59,7 +71,10 @@
5971
FLAVOR=offline-installer \
6072
ISO=Leap-16.0-offline-installer-aarch64-Build1.3.install.iso \
6173
REPO_0=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
62-
REPO_SLE_LEAP_16_0_AARCH64_PPC64LE_S390X_X86_64=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
74+
REPO_1=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-Build1.3 \
75+
REPO_LEAP_OSS=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
76+
REPO_LEAP_OSS_DEBUG=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-Build1.3 \
77+
REPO_LEAP_OSS_DEBUG_PACKAGES='{java*,kernel-default-debug*,kernel-default-base-debug*,mraa-debug*,wicked-debug*}' \
6378
VERSION=16.0 \
6479
_OBSOLETE=1
6580

@@ -72,7 +87,10 @@
7287
FLAVOR=offline-installer \
7388
ISO=Leap-16.0-offline-installer-x86_64-Build1.3.install.iso \
7489
REPO_0=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
75-
REPO_SLE_LEAP_16_0_AARCH64_PPC64LE_S390X_X86_64=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
90+
REPO_1=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-Build1.3 \
91+
REPO_LEAP_OSS=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
92+
REPO_LEAP_OSS_DEBUG=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-Build1.3 \
93+
REPO_LEAP_OSS_DEBUG_PACKAGES='{java*,kernel-default-debug*,kernel-default-base-debug*,mraa-debug*,wicked-debug*}' \
7694
VERSION=16.0 \
7795
_OBSOLETE=1
7896

@@ -85,7 +103,10 @@
85103
FLAVOR=offline-installer \
86104
ISO=Leap-16.0-offline-installer-ppc64le-Build1.3.install.iso \
87105
REPO_0=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
88-
REPO_SLE_LEAP_16_0_AARCH64_PPC64LE_S390X_X86_64=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
106+
REPO_1=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-Build1.3 \
107+
REPO_LEAP_OSS=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
108+
REPO_LEAP_OSS_DEBUG=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-Build1.3 \
109+
REPO_LEAP_OSS_DEBUG_PACKAGES='{java*,kernel-default-debug*,kernel-default-base-debug*,mraa-debug*,wicked-debug*}' \
89110
VERSION=16.0 \
90111
_OBSOLETE=1
91112

@@ -98,7 +119,10 @@
98119
FLAVOR=offline-installer \
99120
ISO=Leap-16.0-offline-installer-s390x-Build1.3.install.iso \
100121
REPO_0=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
101-
REPO_SLE_LEAP_16_0_AARCH64_PPC64LE_S390X_X86_64=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
122+
REPO_1=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-Build1.3 \
123+
REPO_LEAP_OSS=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3 \
124+
REPO_LEAP_OSS_DEBUG=Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-Build1.3 \
125+
REPO_LEAP_OSS_DEBUG_PACKAGES='{java*,kernel-default-debug*,kernel-default-base-debug*,mraa-debug*,wicked-debug*}' \
102126
VERSION=16.0 \
103127
_OBSOLETE=1
104128

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
# Leap-16.0-aarch64-ppc64le-s390x-x86_64$
2-
rsync --timeout=3600 -rtlp4 --delete --specials obspublish::openqa/openSUSE:Leap:16.0:ToTest/product/local/000productcompose:leap_oss/Leap-16.0-aarch64-ppc64le-s390x-x86_64/ /var/lib/openqa/factory/repo/Leap-16.0-aarch64-ppc64le-s390x-x86_64-CURRENT
1+
rsync --timeout=3600 -rtlp4 --delete --specials obspublish::openqa/openSUSE:Leap:16.0:ToTest/product/local/*leap_oss/Leap-16.0-aarch64-ppc64le-s390x-x86_64/ /var/lib/openqa/factory/repo/Leap-16.0-aarch64-ppc64le-s390x-x86_64-CURRENT
32
rsync --timeout=3600 -rtlp4 --delete --specials --link-dest /var/lib/openqa/factory/repo/Leap-16.0-aarch64-ppc64le-s390x-x86_64-CURRENT/ /var/lib/openqa/factory/repo/Leap-16.0-aarch64-ppc64le-s390x-x86_64-CURRENT/ /var/lib/openqa/factory/repo/Leap-16.0-aarch64-ppc64le-s390x-x86_64-Build1.3/
3+
rsync --timeout=3600 -rtlp4 --delete --specials --include=java* --include=kernel-default-debug* --include=kernel-default-base-debug* --include=mraa-debug* --include=wicked-debug* --exclude=aarch64/* --exclude=armv7hl/* --exclude=i586/* --exclude=i686/* --exclude=noarch/* --exclude=nosrc/* --exclude=ppc64/* --exclude=ppc64le/* --exclude=s390x/* --exclude=src/* --exclude=x86_64/* obspublish::openqa/openSUSE:Leap:16.0:ToTest/product/local/*leap_oss/Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug/ /var/lib/openqa/factory/repo/Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-CURRENT/
4+
rsync --timeout=3600 -rtlp4 --delete --specials --link-dest /var/lib/openqa/factory/repo/Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-CURRENT/ /var/lib/openqa/factory/repo/Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-CURRENT/ /var/lib/openqa/factory/repo/Leap-16.0-aarch64-ppc64le-s390x-x86_64-Debug-Build1.3/

xml/obs/openSUSE:Leap:16.0.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<openQA
22
project_pattern="openSUSE:Leap:(?P&lt;version&gt;16.0):ToTest"
33
iso_path="images"
4-
repo_path="product/local/000productcompose:leap_oss"
4+
repo_path="product/local"
55
distri="opensuse"
66
archs="aarch64 x86_64 ppc64le s390x">
77
<flavor name="agama-installer-Leap" folder="*/*agama-installer-Leap*" iso="1" media1="0">
88
<repos>
9-
<oss name="Leap-16.0-aarch64-ppc64le-s390x-x86_64$" mirror="1"/>
9+
<leap_oss mirror="1" multiarch="1" folder="*leap_oss/Leap-16.0-aarch64-ppc64le-s390x-x86_64/" debug="{java*,kernel-default-debug*,kernel-default-base-debug*,mraa-debug*,wicked-debug*}"/>
1010
</repos>
1111
</flavor>
1212
<flavor name="offline-installer" folder="../product/local" media1="0">

0 commit comments

Comments
 (0)