Compare commits

...

2 Commits

Author SHA1 Message Date
6787d5fafb merge branch 'artixpkg' 2023-05-25 20:57:42 +02:00
2a0c08e34b artixpkg git: fix config help examples 2023-05-25 17:02:57 +02:00
3 changed files with 60 additions and 10 deletions

View File

@@ -22,9 +22,9 @@ artixpkg_git_config_usage() {
-h, --help Show this help text
EXAMPLES
$ ${COMMAND} config -t libfoo
$ ${COMMAND} config -u libfoo
$ ${COMMAND} config *
$ ${COMMAND} -t libfoo
$ ${COMMAND} -u libfoo
$ ${COMMAND} *
_EOF_
}

View File

@@ -7,7 +7,7 @@ ARTOOLS_INCLUDE_GIT_CREATE_SH=1
source "${LIBDIR}"/pkg/git/clone.sh
source "${LIBDIR}"/pkg/git/config.sh
source "${LIBDIR}"/pkg/git/ci/jenkins.sh
source "${LIBDIR}"/pkg/ci/jenkins.sh
set -e

View File

@@ -7,16 +7,48 @@ ARTOOLS_INCLUDE_REPO_IMPORT_SH=1
set -e
patch_pkgbase(){
local name="$1"
local pkgbuild
pkgbuild=trunk/PKGBUILD
sed -e 's|arch-meson|artix-meson|' -i "${pkgbuild}"
case "${name}" in
glibc)
msg "Patching %s" "${name}"
sed -e 's|{locale,systemd/system,tmpfiles.d}|{locale,tmpfiles.d}|' \
-e '/nscd.service/d' \
-i "${pkgbuild}"
;;
linux|linux-lts)
msg "Patching %s" "${name}"
sed -e 's|KBUILD_BUILD_HOST=.*|KBUILD_BUILD_HOST=artixlinux|' -i "${pkgbuild}"
sed -e 's|CONFIG_DEFAULT_HOSTNAME=.*|CONFIG_DEFAULT_HOSTNAME="artixlinux"|' \
-i "$pkgpath"/config
;;
gstreamer|gst-plugins-*|licenses)
msg "Patching %s" "${name}"
sed -e 's|https://www.archlinux.org/|https://www.artixlinux.org/|' \
-e 's|(Arch Linux)|(Artix Linux)|' \
-i "${pkgbuild}"
;;
esac
}
artixpkg_repo_import_usage() {
local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
cat <<- _EOF_
Usage: ${COMMAND} [OPTIONS] [PKGBASE]...
OPTIONS
--switch TAG Switch the current trunk to a specified version tag
-h, --help Show this help text
EXAMPLES
$ ${COMMAND} libfoo
$ ${COMMAND} libfoo --switch TAG
_EOF_
}
@@ -29,9 +61,18 @@ artixpkg_repo_import() {
# options
local pkgbases=()
local pkgbase
local upstream_url
upstream_url="https://gitlab.archlinux.org/archlinux/packaging/packages"
local TAG
local rsync_args=()
rsync_args+=(-aWxvci --progress --delete-before --no-R --no-implied-dirs --exclude '.git')
while (( $# )); do
case $1 in
--switch=*)
TAG="${1#*=}"
shift
;;
-h|--help)
artixpkg_repo_import_usage
exit 0
@@ -58,7 +99,7 @@ artixpkg_repo_import() {
( cd "${pkgbase}" || return
stat_busy "Checking for upstream url"
if ! git config --local --get remote.upstream.url &>/dev/null; then
git remote add upstream https://gitlab.archlinux.org/archlinux/packaging/packages/${pkgbase}.git
git remote add upstream "${upstream_url}"/${pkgbase}.git
fi
stat_done
@@ -66,17 +107,26 @@ artixpkg_repo_import() {
git fetch upstream --tags
stat_done
local latest
local latest version
latest=$(git describe --tags FETCH_HEAD)
version="${latest}"
if [[ -n "${TAG}" ]]; then
version="${TAG}"
fi
stat_busy "Importing upstream changeset for ${latest}"
git checkout "${latest}" -b "${latest}" &>/dev/null
stat_busy "Importing upstream changeset for ${version}"
git checkout "${version}" -b "${version}" &>/dev/null
local temp
temp=$(mktemp -d --tmpdir "${pkgbase}.XXXXXXXXXX")
local rsync_args=(-aWxvci --progress --delete-before --no-R --no-implied-dirs --exclude '.git')
rsync "${rsync_args[@]}" "$(pwd)"/ "${temp}"/ &>/dev/null
git checkout master &>/dev/null
git branch -D "${latest}" &>/dev/null
git branch -D "${version}" &>/dev/null
rsync "${rsync_args[@]}" "${temp}"/ "$(pwd)"/trunk/ &>/dev/null
patch_pkgbase "${pkgbase}"
stat_done
)
fi