Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pablo Correa Gomez
GNOME aports utils
Commits
ac925d47
Commit
ac925d47
authored
Aug 16, 2022
by
Pablo Correa Gomez
Browse files
update-core: initial script to automate stable version updates
parent
119b34a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
update-core.sh
0 → 100755
View file @
ac925d47
#!/bin/bash
#
# Copyright (C) 2022 Pablo Correa Gomez
#
set
-e
source
./packages
die
()
{
echo
$1
return
1
}
test
-n
"
$1
"
||
die
"A first argument with the major version to update is required"
MAJ_VER
=
"
$1
"
PACKAGES
=
"
$GNOME_CORE_APPS
$GNOME_SYSTEM
"
APORTSDIR
=
${
APORTSDIR
:-
"
$HOME
/aports"
}
test
-d
$APORTSDIR
||
die
"A directory is needed,
$APORTSDIR
does not exist "
BRANCH
=
${
2
:-
"master"
}
GIT
=
"git --git-dir=
${
APORTSDIR
}
/.git --work-tree=
${
APORTSDIR
}
"
ORIGINAL_BRANCH
=
"
$(
$GIT
rev-parse
--abbrev-ref
HEAD
)
"
$GIT
checkout
--quiet
$BRANCH
$GIT
checkout
--quiet
-B
gnome-
$MAJ_VER
GNOME_API_NAMESPACE
=
"https://gitlab.gnome.org/api/v4/projects/GNOME%2F"
TAGS_API_ENDPOINT
=
"/repository/tags"
for
package
in
$PACKAGES
;
do
if
[
"
$package
"
=
"gnome-software"
]
;
then
echo
"skipping gnome-software, needs plugin sync"
continue
fi
upstream_name
=
"
$package
"
# These packages might be renamed
if
[
"
$package
"
=
"gnome-console"
]
;
then
upstream_name
=
"console"
fi
VER
=
"
$(
curl
--silent
\
"
${
GNOME_API_NAMESPACE
}${
upstream_name
}${
TAGS_API_ENDPOINT
}
?search=^
${
MAJ_VER
}
"
|
jq
-r
'.[0].name'
)
"
cd
$APORTSDIR
/community/
$package
.
APKBUILD
# We should sanitize the version.
# For example, orca has tags of the form ORCA_42_3
if
[
-z
"
$VER
"
]
||
[
x
"
$VER
"
=
x
"null"
]
||
[
"
$VER
"
=
"
$pkgver
"
]
;
then
echo
"skipped
$package
, latest version:
$VER
, packaged version:
$pkgver
"
continue
fi
# Copied from abump. Abump tries to build every package,
# which might not be desired
sed
-i
-e
"s/^pkgver=.*/pkgver=
$VER
/"
\
-e
"s/^pkgrel=.*/pkgrel=0/"
\
APKBUILD
abuild checksum
git add APKBUILD
git commit
-m
"community/
$package
: upgrade to
$VER
"
cd
-
done
$GIT
checkout
--quiet
$ORIGINAL_BRANCH
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment