Compare commits
	
		
			18 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 4718c88229 | |||
| d1ddaaf06a | |||
| 9484fff9f8 | |||
| 1e2e5f44e1 | |||
| 764d47ad8f | |||
| 9e67c31d61 | |||
| 41c90f8d49 | |||
| c97a0cdd59 | |||
| 1ba16c45f9 | |||
| 95afc31152 | |||
| af81317aad | |||
| 79e12f3d10 | |||
| 917cd188d9 | |||
| bfe462432d | |||
| 896e8e195f | |||
| 12d1b784ff | |||
| d8129cbb9a | |||
| 950e0604a4 | 
							
								
								
									
										2
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
									
									
									
									
								
							| @@ -1,6 +1,6 @@ | |||||||
| SHELL=/bin/bash | SHELL=/bin/bash | ||||||
|  |  | ||||||
| V=0.33 | V=0.37 | ||||||
| BUILDTOOLVER ?= $(V) | BUILDTOOLVER ?= $(V) | ||||||
|  |  | ||||||
| CHROOTVER=0.12 | CHROOTVER=0.12 | ||||||
|   | |||||||
| @@ -41,3 +41,6 @@ | |||||||
|  |  | ||||||
| # override the default git url for patches repo | # override the default git url for patches repo | ||||||
| # PATCH_URL=${GIT_SSH}:artix/artix-patches.git | # PATCH_URL=${GIT_SSH}:artix/artix-patches.git | ||||||
|  |  | ||||||
|  | # override the default debug pool | ||||||
|  | # PKGDEST_DBG=${WORKSPACE_DIR}/packages-debug | ||||||
|   | |||||||
| @@ -3,7 +3,6 @@ | |||||||
| LIBDIR=${LIBDIR:-'@libdir@'} | LIBDIR=${LIBDIR:-'@libdir@'} | ||||||
|  |  | ||||||
| _artixpkg_pkgbase() { | _artixpkg_pkgbase() { | ||||||
|     source "${LIBDIR}"/pkg/git/config.sh |  | ||||||
|     source "${LIBDIR}"/pkg/util.sh |     source "${LIBDIR}"/pkg/util.sh | ||||||
|     ls -1 "${TREE_DIR_ARTIX}" | tr '\n' ' ' |     ls -1 "${TREE_DIR_ARTIX}" | tr '\n' ' ' | ||||||
| } | } | ||||||
| @@ -17,7 +16,7 @@ _artixpkg_maintainers() { | |||||||
| } | } | ||||||
|  |  | ||||||
| _artixpkg_completion() { | _artixpkg_completion() { | ||||||
|     local cur prev comps comps_all repos autorepos teams agents cwords comp_cword_exflag |     local cur prev comps comps_all repos autorepos teams agents cwords comp_cword_exflag agent_flag_present | ||||||
|     source "${LIBDIR}"/pkg/db/db.sh 2>/dev/null |     source "${LIBDIR}"/pkg/db/db.sh 2>/dev/null | ||||||
|  |  | ||||||
|     cur="${COMP_WORDS[COMP_CWORD]}" |     cur="${COMP_WORDS[COMP_CWORD]}" | ||||||
| @@ -34,6 +33,7 @@ _artixpkg_completion() { | |||||||
|     comps_all="" |     comps_all="" | ||||||
|     comp_cword_exflag=0 |     comp_cword_exflag=0 | ||||||
|     comp_cword_all=0 |     comp_cword_all=0 | ||||||
|  |     agent_flag_present=false | ||||||
|     for ((i = 0; i < ${#COMP_WORDS[@]} - 1; i++)); do |     for ((i = 0; i < ${#COMP_WORDS[@]} - 1; i++)); do | ||||||
|         word="${COMP_WORDS[i]}" |         word="${COMP_WORDS[i]}" | ||||||
|         comps_all+=" $word" |         comps_all+=" $word" | ||||||
| @@ -42,6 +42,10 @@ _artixpkg_completion() { | |||||||
|             comps+=" $word" |             comps+=" $word" | ||||||
|             ((comp_cword_exflag++)) |             ((comp_cword_exflag++)) | ||||||
|         fi |         fi | ||||||
|  |         if [[ $word == -a || $word == --agent ]]; then | ||||||
|  |             # -a can also refer to --adopt | ||||||
|  |             agent_flag_present=true | ||||||
|  |         fi | ||||||
|     done |     done | ||||||
|     comps="${comps:1}" |     comps="${comps:1}" | ||||||
|     comps_all="${comps_all:1}" |     comps_all="${comps_all:1}" | ||||||
| @@ -67,6 +71,13 @@ _artixpkg_completion() { | |||||||
|         fi |         fi | ||||||
|     done |     done | ||||||
|     teams="${teams:1}" |     teams="${teams:1}" | ||||||
|  |     agents="" | ||||||
|  |     for word in "${AGENTS[@]}"; do | ||||||
|  |         if [[ $word != -* ]]; then | ||||||
|  |             agents+=" $word" | ||||||
|  |         fi | ||||||
|  |     done | ||||||
|  |     agents="${agents:1}" | ||||||
|  |  | ||||||
|     case "${comp_cword_exflag}" in |     case "${comp_cword_exflag}" in | ||||||
|         1) |         1) | ||||||
| @@ -79,7 +90,7 @@ _artixpkg_completion() { | |||||||
|                     COMPREPLY=($(compgen -W "maintainer query team topic transfer -h --help" -- ${cur})) |                     COMPREPLY=($(compgen -W "maintainer query team topic transfer -h --help" -- ${cur})) | ||||||
|                     ;; |                     ;; | ||||||
|                 git) |                 git) | ||||||
|                     COMPREPLY=($(compgen -W "ci clone config create pull push -h --help" -- ${cur})) |                     COMPREPLY=($(compgen -W "clone config create pull push -h --help" -- ${cur})) | ||||||
|                     ;; |                     ;; | ||||||
|                 repo) |                 repo) | ||||||
|                     COMPREPLY=($(compgen -W "add remove move import show -h --help" -- ${cur})) |                     COMPREPLY=($(compgen -W "add remove move import show -h --help" -- ${cur})) | ||||||
| @@ -91,37 +102,6 @@ _artixpkg_completion() { | |||||||
|             ;;   |             ;;   | ||||||
|         *) |         *) | ||||||
|             case "${comps}" in |             case "${comps}" in | ||||||
|                 "artixpkg repo add"*) |  | ||||||
|                     local repoAddCommon="-p --push -r --rebuild -n --nocheck -h --help" |  | ||||||
|                     case "${comp_cword_exflag}" in |  | ||||||
|                         3) |  | ||||||
|                             COMPREPLY=($(compgen -W "$repoAddCommon $autorepos $repos" -- ${cur})) |  | ||||||
|                             ;; |  | ||||||
|                         *) |  | ||||||
|                             COMPREPLY=($(compgen -W "$repoAddCommon $(_artixpkg_pkgbase)" -- ${cur})) |  | ||||||
|                             ;; |  | ||||||
|                     esac |  | ||||||
|                     ;; |  | ||||||
|                 "artixpkg repo remove"*) |  | ||||||
|                     case "${comp_cword_exflag}" in |  | ||||||
|                         3) |  | ||||||
|                             COMPREPLY=($(compgen -W "-p --push -h --help $autorepos $repos" -- ${cur})) |  | ||||||
|                             ;; |  | ||||||
|                         *) |  | ||||||
|                             COMPREPLY=($(compgen -W "-p --push -h --help $(_artixpkg_pkgbase)" -- ${cur})) |  | ||||||
|                             ;; |  | ||||||
|                     esac |  | ||||||
|                     ;; |  | ||||||
|                 "artixpkg repo move"*) |  | ||||||
|                     case "${comp_cword_exflag}" in |  | ||||||
|                         3|4) |  | ||||||
|                             COMPREPLY=($(compgen -W "-p --push -h --help $autorepos $repos" -- ${cur})) |  | ||||||
|                             ;; |  | ||||||
|                         *) |  | ||||||
|                             COMPREPLY=($(compgen -W "-p --push -h --help $(_artixpkg_pkgbase)" -- ${cur})) |  | ||||||
|                             ;; |  | ||||||
|                     esac |  | ||||||
|                     ;; |  | ||||||
|                 "artixpkg repo import"*) |                 "artixpkg repo import"*) | ||||||
|                     case "${prev}" in |                     case "${prev}" in | ||||||
|                         "--tag") |                         "--tag") | ||||||
| @@ -136,11 +116,53 @@ _artixpkg_completion() { | |||||||
|                 "artixpkg repo show") |                 "artixpkg repo show") | ||||||
|                     COMPREPLY=($(compgen -W "-b --base -p --pkgs -h --help" -- ${cur})) |                     COMPREPLY=($(compgen -W "-b --base -p --pkgs -h --help" -- ${cur})) | ||||||
|                     ;; |                     ;; | ||||||
|                 "artixpkg git clone"*) |                 "artixpkg repo"*) | ||||||
|  |                     if [ "$agent_flag_present" = true ] ; then | ||||||
|  |                         ((comp_cword_exflag--)) | ||||||
|  |                     fi | ||||||
|                     case "${prev}" in |                     case "${prev}" in | ||||||
|                         "-a"|"--agent") |                         "-a"|"--agent") | ||||||
|                             COMPREPLY=($(compgen -W "$agents" -- ${cur})) |                             COMPREPLY=($(compgen -W "$agents" -- ${cur})) | ||||||
|                             ;; |                             ;; | ||||||
|  |                         *) | ||||||
|  |                             case "${comps}" in | ||||||
|  |                                 "artixpkg repo add"*) | ||||||
|  |                                     local repoAddCommon="-p --push -r --rebuild -n --nocheck -a --agent -h --help" | ||||||
|  |                                     case "${comp_cword_exflag}" in | ||||||
|  |                                         3) | ||||||
|  |                                             COMPREPLY=($(compgen -W "$repoAddCommon $autorepos $repos" -- ${cur})) | ||||||
|  |                                             ;; | ||||||
|  |                                         *) | ||||||
|  |                                             COMPREPLY=($(compgen -W "$repoAddCommon $(_artixpkg_pkgbase)" -- ${cur})) | ||||||
|  |                                             ;; | ||||||
|  |                                     esac | ||||||
|  |                                     ;; | ||||||
|  |                                 "artixpkg repo remove"*) | ||||||
|  |                                     case "${comp_cword_exflag}" in | ||||||
|  |                                         3) | ||||||
|  |                                             COMPREPLY=($(compgen -W "-p --push -a --agent -h --help $autorepos $repos" -- ${cur})) | ||||||
|  |                                             ;; | ||||||
|  |                                         *) | ||||||
|  |                                             COMPREPLY=($(compgen -W "-p --push -a --agent -h --help $(_artixpkg_pkgbase)" -- ${cur})) | ||||||
|  |                                             ;; | ||||||
|  |                                     esac | ||||||
|  |                                     ;; | ||||||
|  |                                 "artixpkg repo move"*) | ||||||
|  |                                     case "${comp_cword_exflag}" in | ||||||
|  |                                         3|4) | ||||||
|  |                                             COMPREPLY=($(compgen -W "-p --push -a --agent -h --help $autorepos $repos" -- ${cur})) | ||||||
|  |                                             ;; | ||||||
|  |                                         *) | ||||||
|  |                                             COMPREPLY=($(compgen -W "-p --push -a --agent -h --help $(_artixpkg_pkgbase)" -- ${cur})) | ||||||
|  |                                             ;; | ||||||
|  |                                     esac | ||||||
|  |                                     ;; | ||||||
|  |                             esac | ||||||
|  |                             ;; | ||||||
|  |                     esac | ||||||
|  |                     ;; | ||||||
|  |                 "artixpkg git clone"*) | ||||||
|  |                     case "${prev}" in | ||||||
|                         "--protocol") |                         "--protocol") | ||||||
|                             COMPREPLY=($(compgen -W "https" -- ${cur})) |                             COMPREPLY=($(compgen -W "https" -- ${cur})) | ||||||
|                             ;; |                             ;; | ||||||
| @@ -155,7 +177,7 @@ _artixpkg_completion() { | |||||||
|                             COMPREPLY=() |                             COMPREPLY=() | ||||||
|                             ;; |                             ;; | ||||||
|                         *) |                         *) | ||||||
|                             COMPREPLY=($(compgen -W "-m --maintainer --protocol -s --search -t --team -a --agent -j --jobs --all -h --help $(_artixpkg_remotepkgbase ${cur})" -- ${cur})) |                             COMPREPLY=($(compgen -W "-m --maintainer --protocol -s --search -t --team -j --jobs --all -h --help $(_artixpkg_remotepkgbase ${cur})" -- ${cur})) | ||||||
|                             ;; |                             ;; | ||||||
|                     esac |                     esac | ||||||
|                     ;; |                     ;; | ||||||
| @@ -175,14 +197,11 @@ _artixpkg_completion() { | |||||||
|                     ;; |                     ;; | ||||||
|                 "artixpkg git create"*) |                 "artixpkg git create"*) | ||||||
|                     case "${prev}" in |                     case "${prev}" in | ||||||
|                         "-a"|"--agent") |  | ||||||
|                             COMPREPLY=($(compgen -W "$agents" -- ${cur})) |  | ||||||
|                             ;; |  | ||||||
|                         "-t"|"--team") |                         "-t"|"--team") | ||||||
|                             COMPREPLY=($(compgen -W "$teams" -- ${cur})) |                             COMPREPLY=($(compgen -W "$teams" -- ${cur})) | ||||||
|                             ;; |                             ;; | ||||||
|                         *) |                         *) | ||||||
|                             COMPREPLY=($(compgen -W "-c --clone -a --agent -t --team -h --help" -- ${cur})) |                             COMPREPLY=($(compgen -W "-c --clone -t --team -h --help" -- ${cur})) | ||||||
|                             ;; |                             ;; | ||||||
|                     esac |                     esac | ||||||
|                     ;; |                     ;; | ||||||
| @@ -212,29 +231,19 @@ _artixpkg_completion() { | |||||||
|                         "-m"|"--maintainer") |                         "-m"|"--maintainer") | ||||||
|                             COMPREPLY=($(compgen -W "$(_artixpkg_maintainers)" -- ${cur})) |                             COMPREPLY=($(compgen -W "$(_artixpkg_maintainers)" -- ${cur})) | ||||||
|                             ;; |                             ;; | ||||||
|                         "-t"|"--topic"|"-j"|"--jobs") |                         "-t"|"--topic") | ||||||
|                             # this flag expects a parameter |                             # this flag expects a parameter | ||||||
|                             COMPREPLY=() |                             COMPREPLY=() | ||||||
|                             ;; |                             ;; | ||||||
|                         *) |                         *) | ||||||
|                             COMPREPLY=($(compgen -W "-m --maintainer -t --topic -j --jobs -h --help $(_artixpkg_pkgbase)" -- ${cur})) |                             COMPREPLY=($(compgen -W "-m --maintainer -t --topic -h --help $(_artixpkg_pkgbase)" -- ${cur})) | ||||||
|                             ;; |  | ||||||
|                     esac |  | ||||||
|                     ;; |  | ||||||
|                 "artixpkg git ci"*) |  | ||||||
|                     case "${prev}" in |  | ||||||
|                         "-a"|"--agent") |  | ||||||
|                             COMPREPLY=($(compgen -W "$agents" -- ${cur})) |  | ||||||
|                             ;; |  | ||||||
|                         *) |  | ||||||
|                             COMPREPLY=($(compgen -W "-a --agent -h --help $(_artixpkg_pkgbase)" -- ${cur})) |  | ||||||
|                             ;; |                             ;; | ||||||
|                     esac |                     esac | ||||||
|                     ;; |                     ;; | ||||||
|                 "artixpkg admin maintainer"*) |                 "artixpkg admin maintainer"*) | ||||||
|                     case "${comp_cword_all}" in |                     case "${comp_cword_all}" in | ||||||
|                         3) |                         3) | ||||||
|                             COMPREPLY=($(compgen -W "-a --adopt --o --orphan -h --help" -- ${cur})) |                             COMPREPLY=($(compgen -W "-a --adopt -o --orphan -h --help" -- ${cur})) | ||||||
|                             ;; |                             ;; | ||||||
|                         *) |                         *) | ||||||
|                             COMPREPLY=($(compgen -W "-h --help $(_artixpkg_pkgbase)" -- ${cur})) |                             COMPREPLY=($(compgen -W "-h --help $(_artixpkg_pkgbase)" -- ${cur})) | ||||||
| @@ -272,7 +281,7 @@ _artixpkg_completion() { | |||||||
|                             COMPREPLY=() |                             COMPREPLY=() | ||||||
|                             ;; |                             ;; | ||||||
|                         *) |                         *) | ||||||
|                             COMPREPLY=($(compgen -W "-a --add -r --remove -d --del -j --jobs -h --help $(_artixpkg_pkgbase)" -- ${cur})) |                             COMPREPLY=($(compgen -W "-a --add -r --remove -d --delete -j --jobs -h --help $(_artixpkg_pkgbase)" -- ${cur})) | ||||||
|                             ;; |                             ;; | ||||||
|                     esac |                     esac | ||||||
|                     ;; |                     ;; | ||||||
|   | |||||||
| @@ -1,17 +0,0 @@ | |||||||
| ################ install ################ |  | ||||||
|  |  | ||||||
| # start services |  | ||||||
| # bluetoothd, cupsd, DM are added to the pkglist dynamicly |  | ||||||
| # metalog or syslog-ng is added to the pkglist dynamicly |  | ||||||
| # connmand or NetworkManager is added to the pkglist dynamicly |  | ||||||
| # only added if in array, these pkgs have no list entry |  | ||||||
|  |  | ||||||
| SERVICES=('acpid' 'bluetoothd' 'cronie' 'cupsd' 'metalog' 'connmand') |  | ||||||
|  |  | ||||||
| ################# live-session ################# |  | ||||||
|  |  | ||||||
| # default value |  | ||||||
| # PASSWORD="artix" |  | ||||||
|  |  | ||||||
| # Set to false to disable autologin in the live session |  | ||||||
| AUTOLOGIN="false" |  | ||||||
							
								
								
									
										30
									
								
								contrib/iso/profile.yaml.example
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								contrib/iso/profile.yaml.example
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | |||||||
|  | --- | ||||||
|  |  | ||||||
|  | # required | ||||||
|  | live-session: | ||||||
|  |     user: "artix" | ||||||
|  |     password: "artix" | ||||||
|  |     autologin: true | ||||||
|  |     use-xlibre: false | ||||||
|  |     services: [] | ||||||
|  |     user-services: [] | ||||||
|  |  | ||||||
|  | # required | ||||||
|  | rootfs: | ||||||
|  |     packages: [] | ||||||
|  |     packages-init: | ||||||
|  |         dinit: [] | ||||||
|  |         openrc: [] | ||||||
|  |         runit: [] | ||||||
|  |         s6: [] | ||||||
|  |  | ||||||
|  | # optional | ||||||
|  | livefs: | ||||||
|  |     packages: [] | ||||||
|  |     # optional | ||||||
|  |     packages-init: | ||||||
|  |         dinit: [] | ||||||
|  |         openrc: [] | ||||||
|  |         runit: [] | ||||||
|  |         s6: [] | ||||||
|  |  | ||||||
| @@ -88,7 +88,7 @@ make_rootfs() { | |||||||
|         msg "Prepare [Base installation] (rootfs)" |         msg "Prepare [Base installation] (rootfs)" | ||||||
|         local rootfs="${work_dir}/rootfs" |         local rootfs="${work_dir}/rootfs" | ||||||
|  |  | ||||||
|         load_pkgs "${root_list}" |         load_pkgs "rootfs" | ||||||
|  |  | ||||||
|         prepare_dir "${rootfs}" |         prepare_dir "${rootfs}" | ||||||
|  |  | ||||||
| @@ -100,7 +100,9 @@ make_rootfs() { | |||||||
|  |  | ||||||
|         copy_overlay "${root_overlay}" "${rootfs}" |         copy_overlay "${root_overlay}" "${rootfs}" | ||||||
|  |  | ||||||
|         [[ -z ${live_list} ]] && configure_chroot "${rootfs}" |         if ! "${HAS_LIVE}"; then | ||||||
|  |             configure_chroot "${rootfs}" | ||||||
|  |         fi | ||||||
|  |  | ||||||
|         clean_up_chroot "${rootfs}" |         clean_up_chroot "${rootfs}" | ||||||
|  |  | ||||||
| @@ -115,7 +117,7 @@ make_livefs() { | |||||||
|         msg "Prepare [Live installation] (livefs)" |         msg "Prepare [Live installation] (livefs)" | ||||||
|         local livefs="${work_dir}/livefs" |         local livefs="${work_dir}/livefs" | ||||||
|  |  | ||||||
|         load_pkgs "${live_list}" |         load_pkgs "livefs" | ||||||
|  |  | ||||||
|         prepare_dir "${livefs}" |         prepare_dir "${livefs}" | ||||||
|  |  | ||||||
| @@ -141,7 +143,7 @@ make_bootfs() { | |||||||
|     if [[ ! -e ${work_dir}/bootfs.lock ]]; then |     if [[ ! -e ${work_dir}/bootfs.lock ]]; then | ||||||
|         msg "Prepare [/iso/boot]" |         msg "Prepare [/iso/boot]" | ||||||
|  |  | ||||||
|         load_pkgs "${common_dir}/Packages-boot" |         load_pkgs "bootfs" | ||||||
|  |  | ||||||
|         prepare_dir "${iso_root}/boot" |         prepare_dir "${iso_root}/boot" | ||||||
|  |  | ||||||
| @@ -171,7 +173,9 @@ make_grub(){ | |||||||
|         msg "Prepare [/iso/boot/grub]" |         msg "Prepare [/iso/boot/grub]" | ||||||
|  |  | ||||||
|         local layer=${work_dir}/rootfs |         local layer=${work_dir}/rootfs | ||||||
|         [[ -n ${live_list} ]] && layer=${work_dir}/livefs |         if "${HAS_LIVE}"; then | ||||||
|  |             layer=${work_dir}/livefs | ||||||
|  |         fi | ||||||
|  |  | ||||||
|         prepare_grub "${work_dir}/rootfs" "$layer" |         prepare_grub "${work_dir}/rootfs" "$layer" | ||||||
|  |  | ||||||
| @@ -280,7 +284,7 @@ mk_boot(){ | |||||||
|  |  | ||||||
| mk_chroots(){ | mk_chroots(){ | ||||||
|     run_safe "make_rootfs" |     run_safe "make_rootfs" | ||||||
|     if [[ -n ${live_list} ]]; then |     if "${HAS_LIVE}"; then | ||||||
|         run_safe "make_livefs" |         run_safe "make_livefs" | ||||||
|     fi |     fi | ||||||
| } | } | ||||||
|   | |||||||
| @@ -21,13 +21,22 @@ configure_calamares(){ | |||||||
|             msg2 "Configuring: Calamares %s" "$config" |             msg2 "Configuring: Calamares %s" "$config" | ||||||
|  |  | ||||||
|             if [[ -f "$mods"/services-artix.conf ]]; then |             if [[ -f "$mods"/services-artix.conf ]]; then | ||||||
|                 local svc |                 local svc usvc | ||||||
|                 svc=$(yaml_array "${SERVICES[@]}") \ |                 svc=$(yaml_array "${SERVICES[@]}") \ | ||||||
|                     yq -P 'with(.; |                     yq -P 'with(.; | ||||||
|                             .command = "artix-service" | |                             .command = "artix-service" | | ||||||
|                             .services = env(svc) )' \ |                             .services = env(svc) )' \ | ||||||
|                         -i "$mods"/services-artix.conf |                         -i "$mods"/services-artix.conf | ||||||
|             fi |             fi | ||||||
|  |             if [[ -f "$mods"/postcfg.conf ]]; then | ||||||
|  |                 local  usvc initsys | ||||||
|  |                 initsys="${INITSYS}" \ | ||||||
|  |                 usvc=$(yaml_array "${USER_SERVICES[@]}") \ | ||||||
|  |                     yq -P 'with(.; | ||||||
|  |                             .initsys = env(initsys) | | ||||||
|  |                             .user-services = env(usvc) )' \ | ||||||
|  |                         -i "$mods"/postcfg.conf | ||||||
|  |             fi | ||||||
|         fi |         fi | ||||||
|     done |     done | ||||||
|     if [[ -d "$1"/etc/calamares-offline ]]; then |     if [[ -d "$1"/etc/calamares-offline ]]; then | ||||||
|   | |||||||
| @@ -4,9 +4,21 @@ | |||||||
|  |  | ||||||
| #{{{ session | #{{{ session | ||||||
|  |  | ||||||
|  | configure_user(){ | ||||||
|  |     local -r grps="users,lp,video,network,storage,wheel,audio,power,log,optical,network,scanner" | ||||||
|  |  | ||||||
|  |     chroot "$1" useradd -m -G "$grps" -s /bin/bash "${LIVEUSER}" | ||||||
|  |     echo "${LIVEUSER}:${PASSWORD}" | chroot "$1" chpasswd | ||||||
|  |     echo "root:${PASSWORD}" | chroot "$1" chpasswd | ||||||
|  | } | ||||||
|  |  | ||||||
| configure_services(){ | configure_services(){ | ||||||
|     local mnt="$1" |     local mnt="$1" | ||||||
|     add_svc_"${INITSYS}" "$mnt" "${SERVICES[*]}" |     add_svc_"${INITSYS}" "$mnt" | ||||||
|  |  | ||||||
|  |     if [[ "${INITSYS}" == "openrc" ]] || [[ "${INITSYS}" == "dinit" ]]; then | ||||||
|  |         add_user_svc_"${INITSYS}" "$mnt" | ||||||
|  |     fi | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -14,13 +26,14 @@ write_live_session_conf(){ | |||||||
|     local conf='' |     local conf='' | ||||||
|     conf+=$(printf '%s\n' '# live session configuration') |     conf+=$(printf '%s\n' '# live session configuration') | ||||||
|     conf+=$(printf "\nAUTOLOGIN=%s\n" "${AUTOLOGIN}") |     conf+=$(printf "\nAUTOLOGIN=%s\n" "${AUTOLOGIN}") | ||||||
|     conf+=$(printf "\nPASSWORD=%s\n" "${PASSWORD}") |     conf+=$(printf "\nLIVEUSER=%s\n" "${LIVEUSER}") | ||||||
|     printf '%s' "$conf" |     printf '%s' "$conf" | ||||||
| } | } | ||||||
|  |  | ||||||
| configure_chroot(){ | configure_chroot(){ | ||||||
|     local fs="$1" |     local fs="$1" | ||||||
|     msg "Configuring [%s]" "${fs##*/}" |     msg "Configuring [%s]" "${fs##*/}" | ||||||
|  |     configure_user "$fs" | ||||||
|     configure_services "$fs" |     configure_services "$fs" | ||||||
|     configure_calamares "$fs" |     configure_calamares "$fs" | ||||||
|     [[ ! -d "$fs/etc/artools" ]] && mkdir -p "$fs/etc/artools" |     [[ ! -d "$fs/etc/artools" ]] && mkdir -p "$fs/etc/artools" | ||||||
|   | |||||||
| @@ -7,6 +7,7 @@ | |||||||
| show_profile(){ | show_profile(){ | ||||||
|     msg2 "iso_file: %s" "${iso_file}" |     msg2 "iso_file: %s" "${iso_file}" | ||||||
|     msg2 "AUTOLOGIN: %s" "${AUTOLOGIN}" |     msg2 "AUTOLOGIN: %s" "${AUTOLOGIN}" | ||||||
|  |     msg2 "LIVEUSER: %s" "${LIVEUSER}" | ||||||
|     msg2 "PASSWORD: %s" "${PASSWORD}" |     msg2 "PASSWORD: %s" "${PASSWORD}" | ||||||
|     msg2 "SERVICES: %s" "${SERVICES[*]}" |     msg2 "SERVICES: %s" "${SERVICES[*]}" | ||||||
| } | } | ||||||
| @@ -15,79 +16,121 @@ load_profile(){ | |||||||
|     local profile_dir="${DATADIR}/iso-profiles" |     local profile_dir="${DATADIR}/iso-profiles" | ||||||
|     [[ -d "${WORKSPACE_DIR}"/iso-profiles ]] && profile_dir="${WORKSPACE_DIR}"/iso-profiles |     [[ -d "${WORKSPACE_DIR}"/iso-profiles ]] && profile_dir="${WORKSPACE_DIR}"/iso-profiles | ||||||
|  |  | ||||||
|     root_list="$profile_dir/${profile}/Packages-Root" |  | ||||||
|     root_overlay="$profile_dir/${profile}/root-overlay" |     root_overlay="$profile_dir/${profile}/root-overlay" | ||||||
|  |  | ||||||
|     [[ -f "$profile_dir/${profile}/Packages-Live" ]] && live_list="$profile_dir/${profile}/Packages-Live" |  | ||||||
|     [[ -d "$profile_dir/${profile}/live-overlay" ]] && live_overlay="$profile_dir/${profile}/live-overlay" |     [[ -d "$profile_dir/${profile}/live-overlay" ]] && live_overlay="$profile_dir/${profile}/live-overlay" | ||||||
|  |  | ||||||
|     common_dir="${DATADIR}/iso-profiles/common" |     common_dir="${DATADIR}/iso-profiles/common" | ||||||
|     [[ -d "$profile_dir"/common ]] && common_dir="${profile_dir}"/common |     [[ -d "$profile_dir"/common ]] && common_dir="${profile_dir}"/common | ||||||
|  |  | ||||||
|     [[ -f $profile_dir/${profile}/profile.conf ]] || return 1 |     profile_yaml=$profile_dir/${profile}/profile.yaml | ||||||
|  |  | ||||||
|     # shellcheck source=contrib/iso/profile.conf.example |     common_yaml="${common_dir}/common.yaml" | ||||||
|     [[ -r "$profile_dir/${profile}"/profile.conf ]] && . "$profile_dir/${profile}"/profile.conf |  | ||||||
|  |  | ||||||
|     AUTOLOGIN=${AUTOLOGIN:-true} |     [[ -f $profile_yaml ]] || return 1 | ||||||
|  |  | ||||||
|     PASSWORD=${PASSWORD:-'artix'} |     LIVEUSER=$(yq -P '.live-session.user' "$profile_yaml") | ||||||
|  |  | ||||||
|     if [[ -z "${SERVICES[*]}" ]];then |     PASSWORD=$(yq -P '.live-session.password' "$profile_yaml") | ||||||
|         SERVICES=('acpid' 'bluetoothd' 'cronie' 'cupsd' 'syslog-ng' 'connmand') |  | ||||||
|     fi |     AUTOLOGIN=$(yq -P '.live-session.autologin' "$profile_yaml") | ||||||
|  |  | ||||||
|  |     USE_XLIBRE=$(yq -P '.live-session.use-xlibre' "$profile_yaml") | ||||||
|  |  | ||||||
|  |     mapfile -t SERVICES < <(yq -P '.live-session.services[]' "$profile_yaml") | ||||||
|  |  | ||||||
|  |     mapfile -t USER_SERVICES < <(yq -P '.live-session.user-services[]' "$profile_yaml") | ||||||
|  |  | ||||||
|  |     HAS_LIVE=$(yq -P '. | has("livefs")' "$profile_yaml") | ||||||
|  |  | ||||||
|  |     HAS_LIVE_INIT=$(yq -P '.livefs | has("packages-init")' "$profile_yaml") | ||||||
|  |  | ||||||
|     return 0 |     return 0 | ||||||
| } | } | ||||||
|  |  | ||||||
| read_from_list() { |  | ||||||
|     local list="$1" |  | ||||||
|     local _space="s| ||g" |  | ||||||
|     #local _clean=':a;N;$!ba;s/\n/ /g' |  | ||||||
|     local _clean='/^$/d' |  | ||||||
|     local _com_rm="s|#.*||g" |  | ||||||
|     local _init="s|@initsys@|${INITSYS}|g" |  | ||||||
|  |  | ||||||
|     mapfile -t pkgs < <(sed "$_com_rm" "$list" \ |  | ||||||
|             | sed "$_space" \ |  | ||||||
|             | sed "$_init" \ |  | ||||||
|             | sed "$_clean" | sort -u) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| load_pkgs(){ | load_pkgs(){ | ||||||
|     local pkglist="$1" |     local list="$1" | ||||||
|  |  | ||||||
|  |     local common_base | ||||||
|  |     local common_apps | ||||||
|  |     local common_xorg | ||||||
|  |     local common_boot | ||||||
|  |     local common_init | ||||||
|  |     local packages_root | ||||||
|  |     local packages_live | ||||||
|  |     local packages_root_init | ||||||
|  |     local packages_live_init | ||||||
|  |  | ||||||
|  |     local common_key_init=".packages-init.${INITSYS}[]" | ||||||
|  |     local root_key_init=".rootfs.packages-init.${INITSYS}[]" | ||||||
|  |     local live_key_init=".livefs.packages-init.${INITSYS}[]" | ||||||
|  |  | ||||||
|     packages=() |     packages=() | ||||||
|  |  | ||||||
|     if [[ "${pkglist##*/}" == "Packages-Root" ]]; then |     case "$list" in | ||||||
|         for l in base apps "${INITSYS}"; do |         rootfs) | ||||||
|             msg2 "Loading Packages: [%s] ..." "Packages-${l}" |             msg2 "Loading Packages: [%s] ..." "common.packages-base" | ||||||
|             read_from_list "${common_dir}/Packages-${l}" |             mapfile -t common_base < <(yq -P '.packages-base[]' "$common_yaml") | ||||||
|             packages+=("${pkgs[@]}") |  | ||||||
|  |  | ||||||
|         done |             msg2 "Loading Packages: [%s] ..." "common.packages-init.${INITSYS}" | ||||||
|  |             mapfile -t common_init < <(common_key_init="$common_key_init" yq -P 'eval(strenv(common_key_init))' "$common_yaml") | ||||||
|  |  | ||||||
|         if [[ -n "${live_list}" ]]; then |             msg2 "Loading Packages: [%s] ..." "common.packages-apps" | ||||||
|             msg2 "Loading Packages: [Packages-xorg] ..." |             mapfile -t common_apps < <(yq -P '.packages-apps[]' "$common_yaml") | ||||||
|             read_from_list "${common_dir}/Packages-xorg" |  | ||||||
|             packages+=("${pkgs[@]}") |  | ||||||
|         fi |  | ||||||
|  |  | ||||||
|         for svc in "${SERVICES[@]}"; do |             if "${HAS_LIVE}"; then | ||||||
|             case "$svc" in |                 if ${USE_XLIBRE}; then | ||||||
|                 sddm|gdm|lightdm|mdm|greetd|lxdm|xdm) |                     msg2 "Loading Packages: [%s] ..." "common.packages-xlibre" | ||||||
|                     packages+=("$svc-${INITSYS}"); display_manager="$svc" ;; |                     mapfile -t common_xorg < <(yq -P '.packages-xlibre[]' "$common_yaml") | ||||||
|                 NetworkManager) packages+=("networkmanager-${INITSYS}") ;; |                 else | ||||||
|                 connmand) packages+=("connman-${INITSYS}") ;; |                     msg2 "Loading Packages: [%s] ..." "common.packages-xorg" | ||||||
|                 cupsd) packages+=("cups-${INITSYS}") ;; |                     mapfile -t common_xorg < <(yq -P '.packages-xorg[]' "$common_yaml") | ||||||
|                 bluetoothd) packages+=("bluez-${INITSYS}") ;; |                 fi | ||||||
|                 syslog-ng|metalog) packages+=("$svc-${INITSYS}") ;; |             fi | ||||||
|             esac |  | ||||||
|         done |  | ||||||
|  |  | ||||||
|     fi |             msg2 "Loading Packages: [%s] ..." "rootfs.packages" | ||||||
|     msg2 "Loading Packages: [%s] ..." "${pkglist##*/}" |             mapfile -t packages_root < <(yq -P '.rootfs.packages[]' "$profile_yaml") | ||||||
|     read_from_list "${pkglist}" |  | ||||||
|     packages+=("${pkgs[@]}") |             msg2 "Loading Packages: [%s] ..." "rootfs.packages-init.${INITSYS}" | ||||||
|  |             mapfile -t packages_root_init < <(root_key_init="$root_key_init" yq -P 'eval(strenv(root_key_init))' "$profile_yaml") | ||||||
|  |  | ||||||
|  |             packages+=( | ||||||
|  |                 "${common_base[@]}" | ||||||
|  |                 "${common_init[@]}" | ||||||
|  |                 "${common_apps[@]}" | ||||||
|  |                 "${packages_root[@]}" | ||||||
|  |                 "${packages_root_init[@]}" | ||||||
|  |             ) | ||||||
|  |  | ||||||
|  |             if "${HAS_LIVE}"; then | ||||||
|  |                 packages+=( | ||||||
|  |                     "${common_xorg}" | ||||||
|  |                 ) | ||||||
|  |             fi | ||||||
|  |         ;; | ||||||
|  |         livefs) | ||||||
|  |             msg2 "Loading Packages: [%s] ..." "livefs.packages" | ||||||
|  |             mapfile -t packages_live < <(yq -P '.livefs.packages[]' "$profile_yaml") | ||||||
|  |  | ||||||
|  |             if "${HAS_LIVE_INIT}"; then | ||||||
|  |                 msg2 "Loading Packages: [%s] ..." "livefs.packages-init.${INITSYS}" | ||||||
|  |                 mapfile -t packages_live_init < <(live_key_init="$live_key_init" yq -P 'eval(strenv(live_key_init))' "$profile_yaml") | ||||||
|  |             fi | ||||||
|  |  | ||||||
|  |             packages+=( | ||||||
|  |                 "${packages_live[@]}" | ||||||
|  |                 "${packages_live_init[@]}" | ||||||
|  |             ) | ||||||
|  |         ;; | ||||||
|  |         bootfs) | ||||||
|  |             msg2 "Loading Packages: [%s] ..." "common.packages-boot" | ||||||
|  |             mapfile -t common_boot < <(yq -P '.packages-boot[]' "$common_yaml") | ||||||
|  |  | ||||||
|  |             packages+=( | ||||||
|  |                 "${common_boot[@]}" | ||||||
|  |             ) | ||||||
|  |         ;; | ||||||
|  |     esac | ||||||
| } | } | ||||||
|  |  | ||||||
| #}}} | #}}} | ||||||
|   | |||||||
| @@ -5,35 +5,68 @@ | |||||||
| #{{{ services | #{{{ services | ||||||
|  |  | ||||||
| add_svc_openrc(){ | add_svc_openrc(){ | ||||||
|     local mnt="$1" names="$2" rlvl="${3:-default}" |     local mnt="$1" rlvl="${2:-default}" | ||||||
|     for svc in $names; do |     for svc in "${SERVICES[@]}"; do | ||||||
|         if [[ -f $mnt/etc/init.d/$svc ]];then |         if [[ -f $mnt/etc/init.d/$svc ]];then | ||||||
|             msg2 "Setting %s: [%s]" "${INITSYS}" "$svc" |             msg2 "Setting %s: [%s]" "${INITSYS}" "$svc" | ||||||
|             chroot "$mnt" rc-update add "$svc" "$rlvl" &>/dev/null |             chroot "$mnt" rc-update add "$svc" "$rlvl" &>/dev/null | ||||||
|  |         else | ||||||
|  |             warning "Service %s not found. Skipping." "$svc" | ||||||
|  |         fi | ||||||
|  |     done | ||||||
|  | } | ||||||
|  |  | ||||||
|  | add_user_svc_openrc(){ | ||||||
|  |     local mnt="$1" rlvl="${2:-default}" | ||||||
|  |     for svc in "${USER_SERVICES[@]}"; do | ||||||
|  |         if [[ -f "$mnt"/etc/user/init.d/"$svc" ]];then | ||||||
|  |             msg2 "Setting user %s: [%s]" "${INITSYS}" "$svc" | ||||||
|  |             local rc=".config/rc/runlevels/default" | ||||||
|  |             chroot "$mnt" mkdir -p /home/"${LIVEUSER}/$rc" | ||||||
|  |             chroot "$mnt" ln -s /etc/user/init.d/"$svc" /home/"${LIVEUSER}/$rc/$svc" | ||||||
|  |             chroot "$mnt" chown -R "${LIVEUSER}:${LIVEUSER}" /home/"${LIVEUSER}"/.config/rc | ||||||
|  |         else | ||||||
|  |             warning "Service %s not found. Skipping." "$svc" | ||||||
|         fi |         fi | ||||||
|     done |     done | ||||||
| } | } | ||||||
|  |  | ||||||
| add_svc_runit(){ | add_svc_runit(){ | ||||||
|     local mnt="$1" names="$2" rlvl="${3:-default}" |     local mnt="$1" rlvl="${2:-default}" | ||||||
|     for svc in $names; do |     for svc in "${SERVICES[@]}"; do | ||||||
|         if [[ -d $mnt/etc/runit/sv/$svc ]]; then |         if [[ -d $mnt/etc/runit/sv/$svc ]]; then | ||||||
|             msg2 "Setting %s: [%s]" "${INITSYS}" "$svc" |             msg2 "Setting %s: [%s]" "${INITSYS}" "$svc" | ||||||
|             chroot "$mnt" ln -s /etc/runit/sv/"$svc" /etc/runit/runsvdir/"$rlvl" &>/dev/null |             chroot "$mnt" ln -s /etc/runit/sv/"$svc" /etc/runit/runsvdir/"$rlvl" &>/dev/null | ||||||
|  |         else | ||||||
|  |             warning "Service %s not found. Skipping." "$svc" | ||||||
|         fi |         fi | ||||||
|     done |     done | ||||||
| } | } | ||||||
|  |  | ||||||
| add_svc_s6(){ | add_svc_s6(){ | ||||||
|     local mnt="$1" names="$2" rlvl="${3:-default}" dep |     local mnt="$1" rlvl="${2:-default}" dep | ||||||
|  |     local display_manager | ||||||
|  |     local supported_dms=(sddm gdm lightdm mdm greetd lxdm xdm) | ||||||
|  |  | ||||||
|  |     for dm in "${supported_dms[@]}"; do | ||||||
|  |         if in_array "$dm" "${SERVICES[@]}"; then | ||||||
|  |             display_manager="$dm" | ||||||
|  |         fi | ||||||
|  |     done | ||||||
|  |  | ||||||
|     dep="$mnt"/etc/s6/sv/"$display_manager"-srv/dependencies.d |     dep="$mnt"/etc/s6/sv/"$display_manager"-srv/dependencies.d | ||||||
|     for svc in $names; do |  | ||||||
|  |     for svc in "${SERVICES[@]}"; do | ||||||
|         msg2 "Setting %s: [%s]" "${INITSYS}" "$svc" |         msg2 "Setting %s: [%s]" "${INITSYS}" "$svc" | ||||||
|         chroot "$mnt" s6-service add "$rlvl" "$svc" |         if [[ -d "$mnt"/etc/s6/sv/"$svc" ]] || [[ -d "$mnt"/etc/s6/sv/"$svc"-srv ]]; then | ||||||
|         if [[ "$svc" == "$display_manager" ]]; then |             chroot "$mnt" s6-service add "$rlvl" "$svc" | ||||||
|             if [[ -d "$dep" ]]; then |             if [[ "$svc" == "$display_manager" ]]; then | ||||||
|                 touch "$dep"/artix-live |                 if [[ -d "$dep" ]]; then | ||||||
|  |                     touch "$dep"/artix-live | ||||||
|  |                 fi | ||||||
|             fi |             fi | ||||||
|  |         else | ||||||
|  |             warning "Service %s not found. Skipping." "$svc" | ||||||
|         fi |         fi | ||||||
|     done |     done | ||||||
|  |  | ||||||
| @@ -47,22 +80,29 @@ add_svc_s6(){ | |||||||
|     chroot "$mnt" cp -a "$src"/bin /usr |     chroot "$mnt" cp -a "$src"/bin /usr | ||||||
| } | } | ||||||
|  |  | ||||||
| add_svc_suite66(){ | add_svc_dinit(){ | ||||||
|     local mnt="$1" names="$2" |     local mnt="$1" | ||||||
|     for svc in $names; do |     for svc in "${SERVICES[@]}"; do | ||||||
|         if [[ -f "$mnt"/etc/66/service/"$svc" ]]; then |         if [[ -f "$mnt"/etc/dinit.d/"$svc" ]]; then | ||||||
|             msg2 "Setting %s: [%s]" "${INITSYS}" "$svc" |             msg2 "Setting %s: [%s]" "${INITSYS}" "$svc" | ||||||
|             chroot "$mnt" 66-enable -t default "$svc" &>/dev/null |             chroot "$mnt" dinitctl enable -o "$svc" &>/dev/null | ||||||
|  |         else | ||||||
|  |             warning "Service %s not found. Skipping." "$svc" | ||||||
|         fi |         fi | ||||||
|     done |     done | ||||||
| } | } | ||||||
|  |  | ||||||
| add_svc_dinit(){ | add_user_svc_dinit(){ | ||||||
|     local mnt="$1" names="$2" |     local mnt="$1" | ||||||
|     for svc in $names; do |     for svc in "${USER_SERVICES[@]}"; do | ||||||
|         if [[ -d $mnt/etc/dinit.d/boot.d ]]; then |         if [[ -f "$mnt"/etc/dinit.d/user/"$svc" ]]; then | ||||||
|             msg2 "Setting %s: [%s]" "${INITSYS}" "$svc" |             msg2 "Setting user %s: [%s]" "${INITSYS}" "$svc" | ||||||
|             chroot "$mnt" ln -s ../"$svc" /etc/dinit.d/boot.d/"$svc" &>/dev/null |             local usr_sv="/home/${LIVEUSER}/.config/dinit.d" | ||||||
|  |             chroot "$mnt" mkdir -p "$usr_sv"/boot.d | ||||||
|  |             chroot "$mnt" ln -s /etc/dinit.d/user/"$svc" "$usr_sv"/boot.d/"$svc" | ||||||
|  |             chroot "$mnt" chown -R "${LIVEUSER}:${LIVEUSER}" "$usr_sv" | ||||||
|  |         else | ||||||
|  |             warning "Service %s not found. Skipping." "$svc" | ||||||
|         fi |         fi | ||||||
|     done |     done | ||||||
| } | } | ||||||
|   | |||||||
| @@ -7,6 +7,9 @@ ARTOOLS_INCLUDE_GIT_PULL_SH=1 | |||||||
|  |  | ||||||
| set -e | set -e | ||||||
|  |  | ||||||
|  | # shellcheck source=src/lib/pkg/db/db.sh | ||||||
|  | source "${LIBDIR}"/pkg/db/db.sh | ||||||
|  |  | ||||||
|  |  | ||||||
| artixpkg_git_pull_usage() { | artixpkg_git_pull_usage() { | ||||||
|     local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}} |     local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}} | ||||||
| @@ -123,6 +126,11 @@ artixpkg_git_pull() { | |||||||
|                     die 'failed to pull %s' "${pkgbase}" |                     die 'failed to pull %s' "${pkgbase}" | ||||||
|                 fi |                 fi | ||||||
|  |  | ||||||
|  |                 msg "Querying ${pkgbase} ..." | ||||||
|  |                 if ! show_db; then | ||||||
|  |                     warning "Could not query ${REPO_DB}" | ||||||
|  |                 fi | ||||||
|  |  | ||||||
|             ) |             ) | ||||||
|         else |         else | ||||||
|             warning "Skip pulling ${pkgbase}: Directory does not exist" |             warning "Skip pulling ${pkgbase}: Directory does not exist" | ||||||
|   | |||||||
| @@ -61,8 +61,6 @@ patch_pkgbase(){ | |||||||
|             fi |             fi | ||||||
|         done |         done | ||||||
|     fi |     fi | ||||||
|  |  | ||||||
|     git --no-pager diff PKGBUILD |  | ||||||
| } | } | ||||||
|  |  | ||||||
| artixpkg_repo_import_usage() { | artixpkg_repo_import_usage() { | ||||||
| @@ -142,7 +140,9 @@ artixpkg_repo_import() { | |||||||
|         esac |         esac | ||||||
|     done |     done | ||||||
|  |  | ||||||
|     update_patches |     if ! (( NP )); then | ||||||
|  |         update_patches | ||||||
|  |     fi | ||||||
|  |  | ||||||
|     pkgbases+=("$@") |     pkgbases+=("$@") | ||||||
|  |  | ||||||
| @@ -159,16 +159,18 @@ artixpkg_repo_import() { | |||||||
|                 upstream="${arch_map["$pkgbase"]:-$pkgbase}" |                 upstream="${arch_map["$pkgbase"]:-$pkgbase}" | ||||||
|  |  | ||||||
|                 stat_busy "Checking for upstream url" |                 stat_busy "Checking for upstream url" | ||||||
|                 if ! git config --local --get remote.upstream.url &>/dev/null; then |                 if ! git config get remote.upstream.url &>/dev/null; then | ||||||
|                     git remote add upstream "${GIT_UPSTREAM_URL}/${upstream}".git |                     git remote add upstream "${GIT_UPSTREAM_URL}/${upstream}".git | ||||||
|                 fi |                 fi | ||||||
|                 stat_done |                 stat_done | ||||||
|  |  | ||||||
|                 msg2 "Fetching upstream tags" |                 stat_busy "Fetching upstream tags" | ||||||
|                 git fetch --tags upstream main |                 git fetch -fq --prune --tags upstream main | ||||||
|  |                 stat_done | ||||||
|  |  | ||||||
|                 local latest version |                 local latest version | ||||||
|                 latest=$(git describe --tags FETCH_HEAD) |                 latest=$(git describe --tags FETCH_HEAD) | ||||||
|  |  | ||||||
|                 version="${latest}" |                 version="${latest}" | ||||||
|                 if [[ -n "${TAG}" ]]; then |                 if [[ -n "${TAG}" ]]; then | ||||||
|                     version="${TAG}" |                     version="${TAG}" | ||||||
| @@ -180,21 +182,22 @@ artixpkg_repo_import() { | |||||||
|                         warning "Could not query ${REPO_DB}" |                         warning "Could not query ${REPO_DB}" | ||||||
|                     fi |                     fi | ||||||
|  |  | ||||||
|                     git checkout "${version}" -b "${version}" &>/dev/null |                     git checkout -q "${version}" -b "${version}" | ||||||
|                     local temp |                     local temp | ||||||
|                     temp=$(mktemp -d --tmpdir "${pkgbase}.XXXXXXXXXX") |                     temp=$(mktemp -d --tmpdir "${pkgbase}.XXXXXXXXXX") | ||||||
|  |  | ||||||
|                     rsync "${rsync_args[@]}" "$(pwd)"/ "${temp}"/ &>/dev/null |                     rsync "${rsync_args[@]}" -q "$(pwd)"/ "${temp}"/ | ||||||
|                     git checkout master &>/dev/null |                     git checkout -q master | ||||||
|                     git branch -D "${version}" &>/dev/null |                     git branch -q -D "${version}" | ||||||
|  |  | ||||||
|                     msg "Importing upstream changeset for ${version}" |                     msg "Importing upstream changeset for ${version}" | ||||||
|                     rsync "${rsync_args[@]}" "${temp}"/ "$(pwd)"/ #&>/dev/null |                     rsync "${rsync_args[@]}" "${temp}"/ "$(pwd)"/ | ||||||
|  |  | ||||||
|                     if ! (( NP )); then |                     if ! (( NP )); then | ||||||
|                         msg2 "Patching ${pkgbase} ..." |                         msg2 "Patching ${pkgbase} ..." | ||||||
|                         patch_pkgbase "${pkgbase}" |                         patch_pkgbase "${pkgbase}" | ||||||
|                     fi |                     fi | ||||||
|  |                     git --no-pager diff PKGBUILD | ||||||
|                 fi |                 fi | ||||||
|             ) |             ) | ||||||
|         fi |         fi | ||||||
|   | |||||||
| @@ -138,6 +138,9 @@ artixpkg_repo_move() { | |||||||
|                         update_yaml_move "${SRC}" "${DEST}" |                         update_yaml_move "${SRC}" "${DEST}" | ||||||
|  |  | ||||||
|                         team=$(detect_team) |                         team=$(detect_team) | ||||||
|  |                         if [[ -z "$team" ]]; then | ||||||
|  |                             team=$(team_from_yaml) | ||||||
|  |                         fi | ||||||
|                         update_yaml_team "${team}" |                         update_yaml_team "${team}" | ||||||
|  |  | ||||||
|                         if [[ -z ${AGENT} ]]; then |                         if [[ -z ${AGENT} ]]; then | ||||||
| @@ -156,6 +159,9 @@ artixpkg_repo_move() { | |||||||
|                                 if [[ "$f" == "${REPO_DB}" ]]; then |                                 if [[ "$f" == "${REPO_DB}" ]]; then | ||||||
|                                     git add "$f" |                                     git add "$f" | ||||||
|                                 fi |                                 fi | ||||||
|  |                                 if [[ "$f" == "${REPO_CI}" ]]; then | ||||||
|  |                                     git add "$f" | ||||||
|  |                                 fi | ||||||
|                             done |                             done | ||||||
|                             for f in $(git ls-files --others); do |                             for f in $(git ls-files --others); do | ||||||
|                                 if [[ "$f" == "${SRCINFO}" ]]; then |                                 if [[ "$f" == "${SRCINFO}" ]]; then | ||||||
|   | |||||||
| @@ -112,7 +112,9 @@ artixpkg_repo_remove() { | |||||||
|                     local commit_msg |                     local commit_msg | ||||||
|                     commit_msg=$(get_commit_msg 'remove' "${DEST}") |                     commit_msg=$(get_commit_msg 'remove' "${DEST}") | ||||||
|  |  | ||||||
|                     # pkg2yaml -o "${SRCINFO}" |                     if ! [[ -f "${SRCINFO}" ]]; then | ||||||
|  |                         pkg2yaml -o "${SRCINFO}" | ||||||
|  |                     fi | ||||||
|  |  | ||||||
|                     upgrade_db |                     upgrade_db | ||||||
|  |  | ||||||
| @@ -130,6 +132,14 @@ artixpkg_repo_remove() { | |||||||
|                             if [[ "$f" == "${REPO_DB}" ]]; then |                             if [[ "$f" == "${REPO_DB}" ]]; then | ||||||
|                                 git add "$f" |                                 git add "$f" | ||||||
|                             fi |                             fi | ||||||
|  |                             if [[ "$f" == "${REPO_CI}" ]]; then | ||||||
|  |                                 git add "$f" | ||||||
|  |                             fi | ||||||
|  |                         done | ||||||
|  |                         for f in $(git ls-files --others); do | ||||||
|  |                             if [[ "$f" == "${SRCINFO}" ]]; then | ||||||
|  |                                 git add "$f" | ||||||
|  |                             fi | ||||||
|                         done |                         done | ||||||
|                         stat_done |                         stat_done | ||||||
|  |  | ||||||
|   | |||||||
| @@ -64,6 +64,8 @@ load_pkg_config(){ | |||||||
|  |  | ||||||
|     PATCH_URL=${PATCH_URL:-"${GIT_SSH}:artix/artix-patches.git"} |     PATCH_URL=${PATCH_URL:-"${GIT_SSH}:artix/artix-patches.git"} | ||||||
|  |  | ||||||
|  |     PKGDEST_DBG=${PKGDEST_DBG:-"${WORKSPACE_DIR}/packages-debug"} | ||||||
|  |  | ||||||
|     return 0 |     return 0 | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -31,6 +31,18 @@ remove(){ | |||||||
|     # pkg removal will be done by a patched repo-remove honoring -R |     # pkg removal will be done by a patched repo-remove honoring -R | ||||||
| } | } | ||||||
|  |  | ||||||
|  | update_dbg() { | ||||||
|  |     local rmp | ||||||
|  |     rmp=${pkgname%"${PKGEXT}"} | ||||||
|  |     rmp=${rmp%-*} | ||||||
|  |     rmp=${rmp%-*} | ||||||
|  |     rm -fv "${PKGDEST_DBG}/${rmp}"* | ||||||
|  |     if pkgfile=$(find_cached_pkgfile "${pkgname}"); then | ||||||
|  |         msg "Found: %s" "${pkgfile}" | ||||||
|  |         ln -sfv "${pkgfile}" "${PKGDEST_DBG}"/ | ||||||
|  |     fi | ||||||
|  | } | ||||||
|  |  | ||||||
| repo_action() { | repo_action() { | ||||||
|     local repo_path |     local repo_path | ||||||
|     # shellcheck disable=SC2153 |     # shellcheck disable=SC2153 | ||||||
| @@ -40,11 +52,13 @@ repo_action() { | |||||||
|     for pkgname in "${passfiles[@]}"; do |     for pkgname in "${passfiles[@]}"; do | ||||||
|         "$func" |         "$func" | ||||||
|     done |     done | ||||||
|     ( cd "${repo_path}" || return |     if ! "${dbg_pkg}"; then | ||||||
|         if [[ -n "${action}" ]]; then |         ( cd "${repo_path}" || return | ||||||
|             repo-"${action}" "${action_args[@]}" "${dest_repo}.${db_ext}" "${packages[@]}" |             if [[ -n "${action}" ]]; then | ||||||
|         fi |                 repo-"${action}" "${action_args[@]}" "${dest_repo}.${db_ext}" "${packages[@]}" | ||||||
|     ) |             fi | ||||||
|  |         ) | ||||||
|  |     fi | ||||||
| } | } | ||||||
|  |  | ||||||
| #}}} | #}}} | ||||||
| @@ -55,9 +69,10 @@ db_ext="db.tar.${DBEXT}" | |||||||
|  |  | ||||||
| add_pkg=false | add_pkg=false | ||||||
| rm_pkg=false | rm_pkg=false | ||||||
|  | dbg_pkg=false | ||||||
|  |  | ||||||
| cmd=${0##*/} | cmd=${0##*/} | ||||||
| dest_repo=${cmd#*-} | dest_repo=world #${cmd#*-} | ||||||
| action_args=(-R) | action_args=(-R) | ||||||
|  |  | ||||||
| usage() { | usage() { | ||||||
| @@ -65,19 +80,21 @@ usage() { | |||||||
|     printf '    -d <dest>          Destination repository\n' |     printf '    -d <dest>          Destination repository\n' | ||||||
|     printf '    -a                 Add package(s) to repository\n' |     printf '    -a                 Add package(s) to repository\n' | ||||||
|     printf '    -r                 Remove package(s) from repository\n' |     printf '    -r                 Remove package(s) from repository\n' | ||||||
|  |     printf '    -u                 Update debug repository\n' | ||||||
|     printf '    -h                 This help\n' |     printf '    -h                 This help\n' | ||||||
|     printf '\n' |     printf '\n' | ||||||
|     printf '\n' |     printf '\n' | ||||||
|     exit "$1" |     exit "$1" | ||||||
| } | } | ||||||
|  |  | ||||||
| opts='arLRhd:' | opts='uarhd:' | ||||||
|  |  | ||||||
| while getopts "${opts}" arg; do | while getopts "${opts}" arg; do | ||||||
|     case "${arg}" in |     case "${arg}" in | ||||||
|         d) dest_repo="$OPTARG" ;; |         d) dest_repo="$OPTARG" ;; | ||||||
|         a) add_pkg=true; rm_pkg=false ;; |         a) add_pkg=true; rm_pkg=false ;; | ||||||
|         r) rm_pkg=true; add_pkg=false ;; |         r) rm_pkg=true; add_pkg=false ;; | ||||||
|  |         u) dbg_pkg=true ;; | ||||||
|         h|?) usage 0 ;; |         h|?) usage 0 ;; | ||||||
|     esac |     esac | ||||||
| done | done | ||||||
| @@ -87,10 +104,14 @@ shift $(( OPTIND - 1 )) | |||||||
| passfiles=("$@") | passfiles=("$@") | ||||||
|  |  | ||||||
| if [[ -n "${passfiles[*]}" ]]; then | if [[ -n "${passfiles[*]}" ]]; then | ||||||
|     if ${add_pkg}; then |     if ! "${dbg_pkg}"; then | ||||||
|         repo_action add |         if ${add_pkg}; then | ||||||
|     fi |             repo_action add | ||||||
|     if ${rm_pkg}; then |         fi | ||||||
|         repo_action remove |         if ${rm_pkg}; then | ||||||
|  |             repo_action remove | ||||||
|  |         fi | ||||||
|  |     else | ||||||
|  |         repo_action update_dbg | ||||||
|     fi |     fi | ||||||
| fi | fi | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user