Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
3ed0c310a3 | |||
b1213d5c2c | |||
26dffde972
|
|||
915eca6c2e | |||
a52e32d740
|
@@ -137,7 +137,6 @@ update_yaml_base() {
|
||||
local name
|
||||
local pkgnames
|
||||
local arches
|
||||
local pkgbase
|
||||
|
||||
pkgbase="${pkgbase:-${pkgname}}"
|
||||
version="$(get_full_version)"
|
||||
|
@@ -20,6 +20,7 @@ artixpkg_git_clone_usage() {
|
||||
-m, --maintainer=NAME Clone all packages of the named maintainer
|
||||
--protocol https Clone the repository over https
|
||||
-t, --topic=NAME Clone all packages of the named topic
|
||||
-a, --agent=NAME Set the CI agent (default: official)
|
||||
-j, --jobs N Run up to N jobs in parallel (default: $(nproc))
|
||||
--all Clone all existing packages, useful for cache warming
|
||||
-h, --help Show this help text
|
||||
@@ -90,6 +91,15 @@ artixpkg_git_clone() {
|
||||
TOPIC="${1#*=}"
|
||||
shift
|
||||
;;
|
||||
-a|--agent)
|
||||
(( $# <= 1 )) && die "missing argument for %s" "$1"
|
||||
CONFIGURE_OPTIONS+=("$1" "$2")
|
||||
shift 2
|
||||
;;
|
||||
--agent=*)
|
||||
CONFIGURE_OPTIONS+=("${1#*=}")
|
||||
shift
|
||||
;;
|
||||
--all)
|
||||
CLONE_ALL=1
|
||||
shift
|
||||
|
@@ -13,10 +13,14 @@ set -e
|
||||
|
||||
commit_ci(){
|
||||
[[ -d .artixlinux ]] || mkdir .artixlinux
|
||||
printf "@Library('artix-ci') import org.artixlinux.RepoPackage\n" > "${REPO_CI}"
|
||||
if [[ ${AGENT} == ${ARTIX_DB[11]} ]]; then
|
||||
printf "@Library('artix-ci@${AGENT}') import org.artixlinux.RepoPackage\n" > "${REPO_CI}"
|
||||
else
|
||||
printf "@Library('artix-ci') import org.artixlinux.RepoPackage\n" > "${REPO_CI}"
|
||||
fi
|
||||
{
|
||||
printf '\n'
|
||||
printf 'PackagePipeline(new RepoPackage(this))\n'
|
||||
printf '\n'
|
||||
printf 'PackagePipeline(new RepoPackage(this))\n'
|
||||
} >> "${REPO_CI}"
|
||||
|
||||
git add "${REPO_CI}"
|
||||
@@ -31,6 +35,7 @@ artixpkg_git_config_usage() {
|
||||
OPTIONS
|
||||
-m, --maintainer Set the maintainer topic via gitea api
|
||||
-u, --upstream Add upstream arch remote
|
||||
-a, --agent=NAME Set the CI agent (default: official)
|
||||
--protocol https Configure remote url to use https
|
||||
-j, --jobs N Run up to N jobs in parallel (default: $(nproc))
|
||||
-h, --help Show this help text
|
||||
@@ -102,6 +107,8 @@ artixpkg_git_config() {
|
||||
|
||||
local SET_TOPIC=0
|
||||
local UPSTREAM=0
|
||||
local AGENT=
|
||||
local CI_ADDED=0
|
||||
|
||||
# variables
|
||||
local -r command=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
||||
@@ -122,6 +129,15 @@ artixpkg_git_config() {
|
||||
UPSTREAM=1
|
||||
shift
|
||||
;;
|
||||
-a|--agent)
|
||||
(( $# <= 1 )) && die "missing argument for %s" "$1"
|
||||
AGENT="$2"
|
||||
shift 2
|
||||
;;
|
||||
--agent=*)
|
||||
AGENT="${1#*=}"
|
||||
shift
|
||||
;;
|
||||
--protocol=https)
|
||||
proto_force=1
|
||||
shift
|
||||
@@ -264,6 +280,12 @@ artixpkg_git_config() {
|
||||
if [[ ! -f ${REPO_CI} ]]; then
|
||||
msg "Adding ci support ..."
|
||||
commit_ci
|
||||
CI_ADDED=1
|
||||
fi
|
||||
|
||||
if [[ -n ${AGENT} ]] && (( ! CI_ADDED )); then
|
||||
msg "Switching ci support for [%s] ..." "${AGENT}"
|
||||
commit_ci
|
||||
fi
|
||||
|
||||
if [[ ! -f ${REPO_DB} ]]; then
|
||||
|
@@ -34,9 +34,15 @@ artixpkg_git_create() {
|
||||
local pkgbase
|
||||
local clone=0
|
||||
local config=0
|
||||
local TEAM='world'
|
||||
local TEAM="${ARTIX_DB[5]}"
|
||||
local OPTIONS=()
|
||||
|
||||
local TEAMS=(system world lib32)
|
||||
local TEAMS=(
|
||||
"${ARTIX_DB[2]}"
|
||||
"${ARTIX_DB[5]}"
|
||||
"${ARTIX_DB[8]}"
|
||||
"${ARTIX_DB[11]}"
|
||||
)
|
||||
# variables
|
||||
local path
|
||||
|
||||
@@ -101,10 +107,13 @@ artixpkg_git_create() {
|
||||
fi
|
||||
msg_success "Successfully created ${pkgbase}"
|
||||
fi
|
||||
if [[ ${TEAM} == ${ARTIX_DB[11]} ]]; then
|
||||
OPTIONS+=(--agent="${TEAM}")
|
||||
fi
|
||||
if (( clone )); then
|
||||
artixpkg_git_clone "${pkgbase}"
|
||||
artixpkg_git_clone "${OPTIONS[@]}" "${pkgbase}"
|
||||
elif (( config )); then
|
||||
artixpkg_git_config
|
||||
artixpkg_git_config "${OPTIONS[@]}"
|
||||
fi
|
||||
|
||||
done
|
||||
|
@@ -41,12 +41,14 @@ artixpkg_repo_import_usage() {
|
||||
Usage: ${COMMAND} [OPTIONS] [PKGBASE]...
|
||||
|
||||
OPTIONS
|
||||
--tag TAG Switch the current workspace to a specified version tag
|
||||
--tag TAG Switch the current workspace to a specified version tag
|
||||
--del Delete files before rsync import
|
||||
-h, --help Show this help text
|
||||
|
||||
EXAMPLES
|
||||
$ ${COMMAND} libfoo
|
||||
$ ${COMMAND} libfoo --tag TAG
|
||||
$ ${COMMAND} --tag TAG libfoo
|
||||
$ ${COMMAND} --tag TAG --del libfoo
|
||||
_EOF_
|
||||
}
|
||||
|
||||
@@ -76,20 +78,29 @@ artixpkg_repo_import() {
|
||||
|
||||
while (( $# )); do
|
||||
case $1 in
|
||||
--tag=*)
|
||||
TAG="${1#*=}"
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
artixpkg_repo_import_usage
|
||||
exit 0
|
||||
;;
|
||||
-*)
|
||||
die "invalid argument: %s" "$1"
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
--tag)
|
||||
(( $# <= 1 )) && die "missing argument for %s" "$1"
|
||||
TAG="$2"
|
||||
shift 2
|
||||
;;
|
||||
--tag=*)
|
||||
TAG="${1#*=}"
|
||||
shift
|
||||
;;
|
||||
--del)
|
||||
rsync_args+=(--delete-before)
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
artixpkg_repo_import_usage
|
||||
exit 0
|
||||
;;
|
||||
-*)
|
||||
die "invalid argument: %s" "$1"
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
@@ -97,6 +97,8 @@ STARTDIR=$(pwd)
|
||||
(( RMDIR )) && trap 'rm -rf $TEMPDIR' EXIT INT TERM QUIT
|
||||
TEMPDIR=$(mktemp -d --tmpdir checkpkg-script.XXXX)
|
||||
|
||||
changed=0
|
||||
|
||||
for _pkgname in "${pkgname[@]}"; do
|
||||
comparepkg=$_pkgname
|
||||
pkgurl=
|
||||
@@ -151,10 +153,16 @@ for _pkgname in "${pkgname[@]}"; do
|
||||
if ! diff_output="$(sdiff -s "$TEMPDIR/libraries-$_pkgname-old" "$TEMPDIR/libraries-$_pkgname")"; then
|
||||
message="Sonames differ in $_pkgname!"
|
||||
(( WARN )) && warning "$message" || msg "$message"
|
||||
printf "%s\n" "$diff_output"
|
||||
printf "%s\n" "$diff_output" 2>&1 | tee "${pkgfile##*/}-checkpkg.log"
|
||||
changed=1
|
||||
else
|
||||
msg "No soname differences for %s." "$_pkgname"
|
||||
fi
|
||||
done
|
||||
|
||||
(( RMDIR )) || msg "Files saved to %s" "$TEMPDIR"
|
||||
if ! (( RMDIR )); then
|
||||
msg "Files saved to %s" "$TEMPDIR"
|
||||
fi
|
||||
|
||||
exit "$changed"
|
||||
|
||||
|
@@ -79,14 +79,13 @@ IFS=: read -r _ _ _ _ _ HOME _ < <(getent passwd "${SUDO_USER:-$USER}")
|
||||
load_makepkg_config
|
||||
HOME=$ORIG_HOME
|
||||
|
||||
msg "Running checkpkg"
|
||||
[[ -d $PKGDEST ]] || PKGDEST=$PWD
|
||||
[[ -d $SRCDEST ]] || SRCDEST=$PWD
|
||||
[[ -d $SRCPKGDEST ]] || SRCPKGDEST=$PWD
|
||||
[[ -d $LOGDEST ]] || LOGDEST=$PWD
|
||||
|
||||
if chroot-run \
|
||||
-b "-B:${PWD}:/startdir -B:${SRCDEST}:/srcdest" \
|
||||
"$copydir" true
|
||||
then
|
||||
mapfile -t pkgnames < <(sudo -u "$makepkg_user" bash -c 'source PKGBUILD; printf "%s\n" "${pkgname[@]}"')
|
||||
fi
|
||||
msg "Running checkpkg"
|
||||
mapfile -t pkgnames < <(bash -c 'source PKGBUILD; printf "%s\n" "${pkgname[@]}"')
|
||||
|
||||
mapfile -t remotepkgs < <(pacman --config "$copydir"/etc/pacman.conf \
|
||||
--dbpath "$copydir"/var/lib/pacman \
|
||||
@@ -109,15 +108,4 @@ for remotepkg in "${remotepkgs[@]}"; do
|
||||
fi
|
||||
done
|
||||
|
||||
pkgfiles="${remotepkgs[@]/#file:\/\//}"
|
||||
|
||||
sudo -u "$makepkg_user" checkpkg --rmdir --warn --makepkg-config "$copydir/etc/makepkg.conf" "${pkgfiles[@]}"
|
||||
|
||||
msg "Running namcap"
|
||||
#msg2 "Checking %s\n" "PKGBUILD"
|
||||
sudo -u "$makepkg_user" namcap PKGBUILD 2>&1 | tee "PKGBUILD-namcap.log"
|
||||
|
||||
for pkgfile in "${pkgfiles[@]}"; do
|
||||
#msg2 "Checking %s\n" "${pkgfile##*/}"
|
||||
sudo -u "$makepkg_user" namcap "$pkgfile" 2>&1 | tee "${pkgfile##*/}-namcap.log"
|
||||
done
|
||||
sudo -u "$makepkg_user" checkpkg --rmdir --warn --makepkg-config "$copydir/etc/makepkg.conf" "${remotepkgs[@]/#file:\/\//}"
|
||||
|
@@ -36,5 +36,10 @@ for pkg in "${passfiles[@]}"; do
|
||||
msg2 "Found: %s" "${pkgfile}"
|
||||
[[ -e "${pkgfile}".sig ]] && rm "${pkgfile}".sig
|
||||
sign_pkg "${pkgfile}"
|
||||
ret=0
|
||||
else
|
||||
ret=1
|
||||
fi
|
||||
done
|
||||
|
||||
exit "$ret"
|
||||
|
Reference in New Issue
Block a user