Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
reposync
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
linuxsupport
cronjobs
reposync
Commits
529d7bc3
Commit
529d7bc3
authored
2 years ago
by
Alex Iribarren
Committed by
Marta Vila Fernandes
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Upgrade to newer reposync, which fixes a bunch of issues
parent
e34d87ea
No related branches found
No related tags found
1 merge request
!229
Upgrade to newer reposync, which fixes a bunch of issues
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
reposync/Dockerfile
+2
-7
2 additions, 7 deletions
reposync/Dockerfile
reposync/reposync.patch
+0
-11
0 additions, 11 deletions
reposync/reposync.patch
reposync/runreposync.sh
+11
-64
11 additions, 64 deletions
reposync/runreposync.sh
with
13 additions
and
82 deletions
reposync/Dockerfile
+
2
−
7
View file @
529d7bc3
FROM
gitlab-registry.cern.ch/linuxsupport/
cc7
-base:latest
FROM
gitlab-registry.cern.ch/linuxsupport/
alma9
-base:latest
RUN
yum
install
-y
jq createrepo patch
python3-requests
\
RUN
yum
install
-y
yum-utils bc diffutils
python3-requests
\
&&
yum clean all
RUN
rm
-rf
/etc/yum.repos.d/
*
...
...
@@ -10,11 +10,6 @@ COPY *.sh /root/
COPY
*.py /root/
COPY
prod.repos.d/ /root/prod.repos.d/
# Temporary hack, hopefully. Waiting on
# https://github.com/rpm-software-management/yum-utils/pull/49
COPY
reposync.patch /root/
RUN
patch /usr/bin/reposync /root/reposync.patch
VOLUME
/repo
WORKDIR
/root
...
...
This diff is collapsed.
Click to expand it.
reposync/reposync.patch
deleted
100644 → 0
+
0
−
11
View file @
e34d87ea
--- reposync 2018-10-10 14:02:54.070891179 +0200
+++ reposync.new 2018-10-10 14:03:24.692535073 +0200
@@ -363,7 +363,7 @@
else:
my.logger.warning('Removing %s due to failed signature check: %s' % rpmfn)
os.unlink(pkg.localpath)
- exit_code = 1
+ exit_code = 2
continue
my.closeRpmDB()
This diff is collapsed.
Click to expand it.
reposync/runreposync.sh
+
11
−
64
View file @
529d7bc3
...
...
@@ -42,7 +42,6 @@ printf "\nasync=0\n" >> /etc/yum.repos.d/sync.repo
# Create REPOPATH even if the repo is empty
if
[
!
-d
$REPOPATH
]
;
then
/bin/mkdir
-p
${
REPOPATH
}
# Repo doesn't exist yet, but we still want createrepo to run even if it's empty
PRECOUNT
=
-1
fi
...
...
@@ -68,20 +67,15 @@ trap 'rm -f "$LOCKFILE"; exit $?' INT TERM EXIT
if
[[
$RUN_REPOSYNC
-eq
1
]]
;
then
grep
'baseurl='
/etc/yum.repos.d/sync.repo |
grep
-q
'aarch64'
if
[
$?
-eq
0
]
;
then
AARCH64
=
"--arch=aarch64"
fi
# Run reposync
/usr/bin/reposync
\
--delete
\
--remote-time
\
--downloadcomps
\
--download-metadata
\
--norepopath
\
--source
\
--gpgcheck
\
--download_path
${
REPOPATH
}
\
${
AARCH64
}
\
--download-path
${
REPOPATH
}
\
--repoid
${
REPOID
}
2> /local/stderr
RET
=
$?
...
...
@@ -115,8 +109,7 @@ fi
POSTCOUNT
=
$(
wc
-l
/tmp/postlist |
cut
-d
' '
-f1
)
# cdn.redhat.com delivers us some rpms with junk attached at the end ... ?
# these are 'useable' but since the size changes, metadata must be regenerated to
# take it into account.
# this may not be an issue anymore, but let's track it just in case
POSTSIZE
=
$(
awk
'{print $2}'
/tmp/postlist |
paste
-sd
+ | bc
)
if
[[
(
$PRECOUNT
-eq
$POSTCOUNT
)
&&
(
$PRESIZE
-ne
$POSTSIZE
)
]]
;
then
...
...
@@ -128,60 +121,14 @@ fi
if
[[
(
$PRECOUNT
-ne
$POSTCOUNT
)
||
(
$PRESIZE
-ne
$POSTSIZE
)
]]
;
then
CHANGELIST
=
$(
/usr/bin/diff
--changed-group-format
=
'%>'
--unchanged-group-format
=
''
<
(
awk
'{print $1}'
/tmp/prelist
)
<
(
awk
'{print $1}'
/tmp/postlist
)
)
# Run createrepo
if
[[
$RUN_CREATEREPO
-eq
1
]]
;
then
COMPXMLFILE
=
$(
/bin/ls
-1tr
${
REPOPATH
}
/
*
-comps
*
xml.gz 2>&1 | /usr/bin/tail
-1
)
if
[
-f
"
$COMPXMLFILE
"
]
;
then
/bin/cp
-f
$COMPXMLFILE
$REPOPATH
/comps.xml.gz
/bin/gunzip
-f
$REPOPATH
/comps.xml.gz
/bin/rm
-f
$REPOPATH
/
*
-comps
*
xml.gz
GROUPFILE
=
"-g
${
REPOPATH
}
/comps.xml"
fi
# Run createrepo
/usr/bin/createrepo
\
--workers
5
\
--checksum
${
CHECKSUM
}
\
${
GROUPFILE
}
\
--outputdir
${
REPOPATH
}
\
${
REPOPATH
}
2> /local/stderr
RET
=
$?
if
[[
$RET
-ne
0
]]
;
then
cat
<<
EOF
| error | tee
$OUTPUT
"exit_code":
$RET
,
"error": "createrepo failed",
"output": "
$(
sed
's/"/\\"/g'
/local/stderr
)
"
EOF
exit
$RET
fi
/bin/rm
-f
$REPOPATH
/comps.xml
# Keep the current xml.gz file and remove the older one
UPDXMLFILE
=
$(
/bin/ls
-1tr
$REPOPATH
/
*
-updateinfo
.xml.gz 2>&1 | /usr/bin/tail
-1
)
if
[
-f
"
$UPDXMLFILE
"
]
;
then
/usr/bin/modifyrepo
$UPDXMLFILE
$REPOPATH
/repodata
NEWUPDXMLFILE
=
$(
sed
'/updateinfo.xml.gz/!d; s/.*repodata\/\(.*\)".*/\1/'
${
REPOPATH
}
/repodata/repomd.xml
)
/usr/bin/find
${
REPOPATH
}
-name
'*updateinfo.xml*'
-not
-name
$NEWUPDXMLFILE
-printf
"removed '%f'
\n
"
-delete
fi
# Keep the current yaml.gz file and remove the older one
MODULEFILE
=
$(
/bin/ls
-1tr
${
REPOPATH
}
/
*
-module
*
yaml.gz 2>&1 | /usr/bin/tail
-1
)
if
[
-f
"
$MODULEFILE
"
]
;
then
/usr/bin/modifyrepo
--mdtype
=
modules
$MODULEFILE
$REPOPATH
/repodata
NEWMODULEFILE
=
$(
sed
'/yaml.gz/!d; s/.*repodata\/\(.*\)".*/\1/'
${
REPOPATH
}
/repodata/repomd.xml
)
/usr/bin/find
${
REPOPATH
}
-name
'*module*.yaml*'
-not
-path
${
REPOPATH
}
/repodata/
$NEWMODULEFILE
-printf
"removed '%f'
\n
"
-delete
fi
fi
# end of if [[ $RUN_CREATEREPO -eq 1 ]]
else
# else of if [[ $PRECOUNT -ne $POSTCOUNT ]]
# No new packages
/bin/rm
-f
$REPOPATH
/
*
-updateinfo
.xml.gz
$REPOPATH
/
*
-comps
*
xml.gz
$REPOPATH
/
*
-updateinfo
.xml
fi
# Keep the current xml.gz file and remove the older one
NEWUPDXMLFILE
=
$(
sed
'/updateinfo.xml/!d; s/.*repodata\/\(.*\)".*/\1/'
${
REPOPATH
}
/repodata/repomd.xml
)
[
-n
"
$NEWUPDXMLFILE
"
]
&&
/usr/bin/find
${
REPOPATH
}
-name
'*updateinfo.xml*'
-not
-name
$NEWUPDXMLFILE
-printf
"removed '%f'
\n
"
-delete
# Keep the current yaml.gz file and remove the older one
NEWMODULEFILE
=
$(
sed
'/yaml.gz/!d; s/.*repodata\/\(.*\)".*/\1/'
${
REPOPATH
}
/repodata/repomd.xml
)
[
-n
"
$NEWMODULEFILE
"
]
&&
/usr/bin/find
${
REPOPATH
}
-name
'*module*.yaml*'
-not
-path
${
REPOPATH
}
/repodata/
$NEWMODULEFILE
-printf
"removed '%f'
\n
"
-delete
fi
for
rpm
in
${
CHANGELIST
}
;
do
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment