Compare commits
	
		
			30 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 8cc8b66e7f | |||
| 0ae8c16801 | |||
| bb674109ed | |||
| ede2ac11e2 | |||
| e8913b07c3 | |||
| f5f9a2acb8 | |||
| c6f7df51d2 | |||
| b105207138 | |||
| 55e98abdc1 | |||
| 896c031ea9 | |||
| 8f16db45e8 | |||
| 47ee03e1a4 | |||
| 17f49857e2 | |||
| 68e23f7e47 | |||
| c5228a8b43 | |||
| 84151f360f | |||
| a6ca83be7e | |||
| 0a07a1f1dd | |||
| 9dedb2e4cb | |||
| dcf6ec1d7b | |||
| 62022faad7 | |||
| dea81dd9f9 | |||
| e49d2d77bd | |||
| 4a06d4d2eb | |||
| 231d054ee9 | |||
| 2945493eb7 | |||
| 0f037f1106 | |||
| 6c4197e76d | |||
| 8ebdad278e | |||
| 2bacf6d19e | 
| @@ -112,10 +112,10 @@ chroot_extra_mount() { | ||||
|     chroot_add_resolv_conf "$1" | ||||
|     chroot_mount "/etc/hosts" "$1/etc/hosts" -B | ||||
|     chroot_mount "${cache_dirs[0]}" "$1${cache_dirs[0]}" -B | ||||
|     if [[ -e /etc/localtime ]];then | ||||
|         [[ -e $1/etc/localtime ]] || touch $1/etc/localtime | ||||
|         chroot_mount "/etc/localtime" "$1/etc/localtime" -B | ||||
|     fi | ||||
| #     if [[ -e /etc/localtime ]];then | ||||
| #         [[ -e $1/etc/localtime ]] || touch $1/etc/localtime | ||||
| #         chroot_mount "/etc/localtime" "$1/etc/localtime" -B | ||||
| #     fi | ||||
|  | ||||
|     for cache_dir in ${cache_dirs[@]:1}; do | ||||
|         chroot_mount "$cache_dir" "$1${cache_dir}" -Br | ||||
|   | ||||
| @@ -33,7 +33,7 @@ gen_iso_fn(){ | ||||
| prepare_build(){ | ||||
|     timer_start=$(get_timer) | ||||
|  | ||||
|     load_profile "${PROFILE}" | ||||
|     load_profile | ||||
|  | ||||
|     local pacman_conf pac_file="pacman-default.conf" | ||||
|  | ||||
|   | ||||
| @@ -21,6 +21,8 @@ load_config "${USERCONFDIR}/artools/artools.conf" || load_config "${SYSCONFDIR}/ | ||||
|  | ||||
| create_first=false | ||||
| rebuild=false | ||||
| no_check=false | ||||
| is_checkpkg=false | ||||
|  | ||||
| mkchrootpkg_args=(-c -n) | ||||
|  | ||||
| @@ -33,6 +35,8 @@ usage() { | ||||
|     echo "    -r <dir>           Create chroots in this directory" | ||||
|     echo '    -c                 Recreate the chroot before building' | ||||
|     echo '    -m                 Major rebuild' | ||||
|     echo '    -N                 Disable check() function' | ||||
|     echo '    -C                 Run checkpkg after built' | ||||
|     echo '    -h                 This help' | ||||
|     echo '' | ||||
|     echo "Default mkchrootpkg_args args: ${mkchrootpkg_args[*]}" | ||||
| @@ -42,13 +46,15 @@ usage() { | ||||
|  | ||||
| orig_argv=("$0" "$@") | ||||
|  | ||||
| opts='hcmr:' | ||||
| opts='hcCNmr:' | ||||
|  | ||||
| while getopts "${opts}" arg; do | ||||
|     case "${arg}" in | ||||
|         r) CHROOTS_PKG="$OPTARG" ;; | ||||
|         c) create_first=true ;; | ||||
|         m) rebuild=true ;; | ||||
|         C) is_checkpkg=true; mkchrootpkg_args+=(-C) ;; | ||||
|         N) no_check=true; mkchrootpkg_args+=(-N) ;; | ||||
|         h|?) usage 0 ;; | ||||
|         *) echo "invalid argument '%s'" "${arg}"; usage 1 ;; | ||||
|     esac | ||||
|   | ||||
| @@ -58,7 +58,7 @@ show_deps(){ | ||||
|  | ||||
|     [[ $arch == 'any' ]] && CARCH=any | ||||
|  | ||||
|     local archver=$(get_full_version $pkg) | ||||
|     local archver=$(get_full_version) | ||||
|  | ||||
|     msg2 "repo: %s" "$repo" | ||||
|     [[ -n ${pkgbase} ]] && msg2 "pkgbase: %s" "${pkgbase}" | ||||
| @@ -73,20 +73,42 @@ show_deps(){ | ||||
|     [[ -n ${optdepends[@]} ]] && msg2 "optdepends: %s" "${optdepends[@]}" | ||||
| } | ||||
|  | ||||
| from_arch(){ | ||||
|     local pkg="$1" src= dest= | ||||
|     local git_tree_arch=$(find_tree "${TREE_DIR_ARCH}" "$pkg") | ||||
|     [[ -z $git_tree_arch ]] && die "Package '%s' does not exist!" "$pkg" | ||||
| subrepo_new(){ | ||||
|     local group="${1:-$GROUP}" team="${2:-$TEAM}" | ||||
|     local dest=${TREE_DIR_ARTIX}/$group/${PACKAGE}/trunk | ||||
|  | ||||
|     local package=${TREE_DIR_ARCH}/$git_tree_arch/$pkg | ||||
|     cd ${TREE_DIR_ARTIX}/$group | ||||
|  | ||||
|     local org=$(get_pkg_org "${PACKAGE}") | ||||
|  | ||||
|     create_repo "${PACKAGE}" "$org" | ||||
|  | ||||
|     add_repo_to_team "${PACKAGE}" "$org" "$team" | ||||
|  | ||||
|     subrepo_clone "${PACKAGE}" "$org" | ||||
|  | ||||
|     prepare_dir "$dest" | ||||
|  | ||||
|     commit_jenkins_files "${PACKAGE}" | ||||
| } | ||||
|  | ||||
| from_arch(){ | ||||
|     local src= dest= | ||||
|  | ||||
|     cd ${TREE_DIR_ARTIX} | ||||
|  | ||||
|     local git_tree_arch=$(find_tree "${TREE_DIR_ARCH}" "${PACKAGE}") | ||||
|     [[ -z $git_tree_arch ]] && die "Package '%s' does not exist!" "${PACKAGE}" | ||||
|  | ||||
|     local package=${TREE_DIR_ARCH}/$git_tree_arch/${PACKAGE} | ||||
|     local repo=$(find_repo "$package" "${staging}" "${unstable}") | ||||
|  | ||||
|     src=$package/repos/$repo | ||||
|  | ||||
|     local git_tree_artix=$(find_tree "${TREE_DIR_ARTIX}" "$pkg") | ||||
|     local tree_dir=$(get_artix_tree "$pkg" "$git_tree_artix" "$git_tree_arch") | ||||
|     local git_tree_artix=$(find_tree "${TREE_DIR_ARTIX}" "${PACKAGE}") | ||||
|     local tree_dir=$(get_artix_tree "${PACKAGE}" "$git_tree_artix" "$git_tree_arch") | ||||
|  | ||||
|     dest=${TREE_DIR_ARTIX}/$tree_dir/$pkg/trunk | ||||
|     dest=${TREE_DIR_ARTIX}/$tree_dir/${PACKAGE}/trunk | ||||
|  | ||||
|     msg "tree: %s" "$tree_dir" | ||||
|     show_deps "$src" "$repo" | ||||
| @@ -96,25 +118,25 @@ from_arch(){ | ||||
|         cd ${TREE_DIR_ARTIX}/$git_tree_artix | ||||
|  | ||||
|         . $dest/PKGBUILD 2>/dev/null | ||||
|         local artixver=$(get_full_version $pkg) | ||||
|         local artixver=$(get_full_version) | ||||
|  | ||||
|         msg2 "Artix Version: %s" "$artixver" | ||||
|     else | ||||
|         subrepo_new "$pkg" "$tree_dir" "$git_tree_arch" | ||||
|         subrepo_new "$tree_dir" "$git_tree_arch" | ||||
|     fi | ||||
|  | ||||
|     msg "Sync (%s) from [%s] to [%s]" "$pkg" "$git_tree_arch" "$tree_dir" | ||||
|     msg "Sync (%s) from [%s] to [%s]" "${PACKAGE}" "$git_tree_arch" "$tree_dir" | ||||
|  | ||||
|     sync_pkg "$src" "$dest" | ||||
|     patch_pkg "$pkg" | ||||
|     patch_pkg "${PACKAGE}" | ||||
| } | ||||
|  | ||||
| view_build(){ | ||||
|     local pkg="$1" src= | ||||
|     local git_tree_arch=$(find_tree "${TREE_DIR_ARCH}" "$pkg") | ||||
|     [[ -z $git_tree_arch ]] && die "Package '%s' does not exist!" "$pkg" | ||||
|     local src= | ||||
|     local git_tree_arch=$(find_tree "${TREE_DIR_ARCH}" "${PACKAGE}") | ||||
|     [[ -z $git_tree_arch ]] && die "Package '%s' does not exist!" "${PACKAGE}" | ||||
|  | ||||
|     local pkg_path=${TREE_DIR_ARCH}/$git_tree_arch/$pkg | ||||
|     local pkg_path=${TREE_DIR_ARCH}/$git_tree_arch/${PACKAGE} | ||||
|     local repo=$(find_repo "$pkg_path" "${staging}" "${unstable}") | ||||
|  | ||||
|     src=$pkg_path/repos/$repo | ||||
| @@ -122,6 +144,16 @@ view_build(){ | ||||
|     show_deps "$src" "$repo" | ||||
| } | ||||
|  | ||||
| check_tree(){ | ||||
|     local git_tree_arch=$(find_tree "${TREE_DIR_ARCH}" "${PACKAGE}") | ||||
|     [[ -z $git_tree_arch ]] && die "Package '%s' does not exist!" "${PACKAGE}" | ||||
|     local git_tree_artix=$(find_tree "${TREE_DIR_ARTIX}" "${PACKAGE}") | ||||
|     local tree_dir=$(get_artix_tree "${PACKAGE}" "$git_tree_artix" "$git_tree_arch") | ||||
|     msg "tree_dir: %s" "$tree_dir" | ||||
|     [[ -z $git_tree_artix ]] && msg2 "exists: %s" "no" | ||||
|     [[ -n $git_tree_artix ]] && msg2 "exists: %s" "yes" | ||||
| } | ||||
|  | ||||
| sync_repos(){ | ||||
|     ${sync_arch} && pull_tree_arch | ||||
|     if ${sync_artix};then | ||||
| @@ -149,6 +181,7 @@ conf=false | ||||
| unstable=false | ||||
| staging=true | ||||
| sync_group=false | ||||
| check=false | ||||
|  | ||||
| PACKAGE='' | ||||
|  | ||||
| @@ -169,7 +202,8 @@ usage() { | ||||
|     echo '    -n            Make new remote subrepo and clone it' | ||||
|     echo '    -u            Include kde & gnome unstable (only with -i)' | ||||
|     echo '    -w            Exclude staging (only with -i)' | ||||
|     echo '    -v            View package depends' | ||||
|     echo '    -v            Check if a package is in the artix tree(s)' | ||||
|     echo '    -c            View package depends' | ||||
|     echo '    -h            This help' | ||||
|     echo '' | ||||
|     echo '' | ||||
| @@ -178,7 +212,7 @@ usage() { | ||||
|  | ||||
| orig_argv=("$0" "$@") | ||||
|  | ||||
| opts='p:t:g:uwsinzyvh' | ||||
| opts='p:t:g:uwsinzycvh' | ||||
|  | ||||
| while getopts "${opts}" arg; do | ||||
|     case "${arg}" in | ||||
| @@ -192,6 +226,7 @@ while getopts "${opts}" arg; do | ||||
|         n) createnew=true ;; | ||||
|         w) staging=false ;; | ||||
|         u) unstable=true ;; | ||||
|         c) check=true ;; | ||||
|         v) view=true ;; | ||||
|         h|?) usage 0 ;; | ||||
|         *) echo "invalid argument '${arg}'"; usage 1 ;; | ||||
| @@ -205,8 +240,10 @@ prepare_dir "${TREE_DIR_ARCH}" | ||||
|  | ||||
| ${sync} && sync_repos | ||||
|  | ||||
| ${view} && view_build "${PACKAGE}" | ||||
| ${view} && view_build | ||||
|  | ||||
| ${import} && from_arch "${PACKAGE}" | ||||
| ${check} && check_tree | ||||
|  | ||||
| ${createnew} && subrepo_new "${PACKAGE}" "${GROUP}" "${TEAM}" | ||||
| ${import} && from_arch | ||||
|  | ||||
| ${createnew} && subrepo_new | ||||
|   | ||||
| @@ -17,27 +17,82 @@ | ||||
|  | ||||
| shopt -s extglob | ||||
|  | ||||
| # Source makepkg.conf; fail if it is not found | ||||
| if [[ -r '/etc/makepkg.conf' ]]; then | ||||
| 	source '/etc/makepkg.conf' | ||||
|     # shellcheck source=makepkg-x86_64.conf | ||||
|     source '/etc/makepkg.conf' | ||||
| else | ||||
| 	die '/etc/makepkg.conf not found!' | ||||
|     die '/etc/makepkg.conf not found!' | ||||
| fi | ||||
|  | ||||
| load_user_info | ||||
| # Source user-specific makepkg.conf overrides | ||||
| if [[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/pacman/makepkg.conf" ]]; then | ||||
|     # shellcheck source=/dev/null | ||||
|     source "${XDG_CONFIG_HOME:-$HOME/.config}/pacman/makepkg.conf" | ||||
| elif [[ -r "$HOME/.makepkg.conf" ]]; then | ||||
|     # shellcheck source=/dev/null | ||||
|     source "$HOME/.makepkg.conf" | ||||
| fi | ||||
|  | ||||
| load_vars "${USERCONFDIR}/pacman/makepkg.conf" || load_vars "$USER_HOME/.makepkg.conf" | ||||
| load_vars /etc/makepkg.conf | ||||
| usage() { | ||||
|     cat <<- _EOF_ | ||||
|         Usage: ${BASH_SOURCE[0]##*/} [OPTIONS] | ||||
|  | ||||
|         Searches for a locally built package corresponding to the PKGBUILD, and | ||||
|         downloads the last version of that package from the Pacman repositories. | ||||
|         It then compares the list of .so files provided by each version of the | ||||
|         package and outputs if there are soname differences for the new package. | ||||
|         A directory is also created using mktemp with files containing a file | ||||
|         list for both packages and a library list for both packages. | ||||
|  | ||||
|         OPTIONS | ||||
|             -r, --rmdir     Remove the temporary directory | ||||
|             -w, --warn      Print a warning in case of differences | ||||
|             -h, --help      Show this help text | ||||
| _EOF_ | ||||
| } | ||||
|  | ||||
| RMDIR=0 | ||||
| WARN=0 | ||||
|  | ||||
| OPT_SHORT='rwh' | ||||
| OPT_LONG=('rmdir' 'warn' 'help') | ||||
| if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then | ||||
|     exit 1 | ||||
| fi | ||||
| set  -- "${OPTRET[@]}" | ||||
|  | ||||
| while :; do | ||||
|     case $1 in | ||||
|         -r|--rmdir) | ||||
|             RMDIR=1 | ||||
|             ;; | ||||
|         -w|--warn) | ||||
|             WARN=1 | ||||
|             ;; | ||||
|         -h|--help) | ||||
|             usage | ||||
|             exit 0 | ||||
|             ;; | ||||
|         --) | ||||
|             shift; break | ||||
|             ;; | ||||
|     esac | ||||
|     shift | ||||
| done | ||||
|  | ||||
| if [[ ! -f PKGBUILD ]]; then | ||||
|     die 'This must be run in the directory of a built package.' | ||||
| fi | ||||
|  | ||||
| # shellcheck source=PKGBUILD.proto | ||||
| . ./PKGBUILD | ||||
| if [[ $arch == 'any' ]]; then | ||||
| if [[ ${arch[0]} == 'any' ]]; then | ||||
|     CARCH='any' | ||||
| fi | ||||
|  | ||||
| STARTDIR=$(pwd) | ||||
| (( RMDIR )) && trap 'rm -rf $TEMPDIR' EXIT INT TERM QUIT | ||||
| TEMPDIR=$(mktemp -d --tmpdir checkpkg-script.XXXX) | ||||
|  | ||||
| for _pkgname in "${pkgname[@]}"; do | ||||
| @@ -90,9 +145,12 @@ for _pkgname in "${pkgname[@]}"; do | ||||
|     find-libprovides "$TEMPDIR/$oldpkg" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname-old" | ||||
|     find-libprovides "$pkgfile" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname" | ||||
|     if ! diff_output="$(sdiff -s "$TEMPDIR/libraries-$_pkgname-old" "$TEMPDIR/libraries-$_pkgname")"; then | ||||
|         msg "Sonames differ in %s!" "$_pkgname" | ||||
|         message="Sonames differ in $_pkgname!" | ||||
|         (( WARN )) && warning "$message" || msg "$message" | ||||
|         echo "$diff_output" | ||||
|     else | ||||
|         msg "No soname differences for %s" "$_pkgname." | ||||
|         msg "No soname differences for %s." "$_pkgname" | ||||
|     fi | ||||
| done | ||||
|  | ||||
| (( RMDIR )) || msg "Files saved to %s" "$TEMPDIR" | ||||
|   | ||||
| @@ -74,7 +74,7 @@ commit_pkg(){ | ||||
|  | ||||
|         ${push} && pull_tree "${git_tree}" "$head" | ||||
|  | ||||
|         subrepo_pull "${PACKAGE}" | ||||
| #         subrepo_pull "${PACKAGE}" | ||||
|         subrepo_push "${PACKAGE}" | ||||
|         subrepo_clean "${PACKAGE}" | ||||
|  | ||||
| @@ -130,7 +130,7 @@ symlink_commit_pkg(){ | ||||
|  | ||||
|         ${push} && pull_tree "${git_tree}" "$head" | ||||
|  | ||||
|         subrepo_pull "${PACKAGE}" | ||||
| #         subrepo_pull "${PACKAGE}" | ||||
|         subrepo_push "${PACKAGE}" | ||||
|         subrepo_clean "${PACKAGE}" | ||||
|  | ||||
|   | ||||
| @@ -18,14 +18,14 @@ | ||||
| compare(){ | ||||
|     local pkgpath="$1" group="$2" | ||||
|     local pkg=${pkgpath##*/} | ||||
|     local artixrepo=$(find_repo "$package" "${staging}" "${unstable}") | ||||
|     local artixrepo=$(find_repo "$pkgpath" "${staging}" "${unstable}") | ||||
|     local artixshow=${artixrepo%-*} | ||||
|     local pkgbuild=$pkgpath/repos/$artixrepo/PKGBUILD | ||||
|  | ||||
|     if [[ -f $pkgbuild ]];then | ||||
|  | ||||
|         . $pkgbuild 2>/dev/null | ||||
|         local artixver=$(get_full_version $pkg) | ||||
|         local artixver=$(get_full_version) | ||||
|  | ||||
|         local archpath=$(get_import_path $pkg) | ||||
|  | ||||
| @@ -36,7 +36,7 @@ compare(){ | ||||
|  | ||||
|         if [[ -f $pkgbuild ]];then | ||||
|             . $pkgbuild 2>/dev/null | ||||
|             local archver=$(get_full_version $pkg) | ||||
|             local archver=$(get_full_version) | ||||
|         fi | ||||
|  | ||||
|         local result=$(vercmp "$artixver" "$archver") | ||||
| @@ -101,7 +101,7 @@ check_db(){ | ||||
|             if [[ -f $pkgbuild ]];then | ||||
|  | ||||
|                 . $pkgbuild 2>/dev/null | ||||
|                 local artixver=$(get_full_version $pkg) | ||||
|                 local artixver=$(get_full_version) | ||||
|                 local is_entry=false | ||||
|  | ||||
|                 for name in ${pkgname[@]};do | ||||
|   | ||||
| @@ -38,6 +38,23 @@ find_cached_pkgfile() { | ||||
|     esac | ||||
| } | ||||
|  | ||||
| get_pkgbasename(){ | ||||
|     local pkg="$1" | ||||
|     local pkgbasename name ver rel arch | ||||
|  | ||||
|     pkgbasename=${pkg%.pkg.tar.?z} | ||||
|     arch=${pkgbasename##*-} | ||||
|     pkgbasename=${pkgbasename%-"$arch"} | ||||
|  | ||||
|     rel=${pkgbasename##*-} | ||||
|     pkgbasename=${pkgbasename%-"$rel"} | ||||
|  | ||||
|     ver=${pkgbasename##*-} | ||||
|  | ||||
|     name=${pkgbasename%-"$ver"} | ||||
|     echo $name | ||||
| } | ||||
|  | ||||
| update_repo2(){ | ||||
|     local repo="$1" | ||||
|     local repo_path=${REPOS_ROOT}/$repo/os/${ARCH} packages=() | ||||
| @@ -48,7 +65,6 @@ update_repo2(){ | ||||
|             if ${add_pkg};then | ||||
|                 local action='add' | ||||
|                 packages+=("$name") | ||||
| #                 checkpkg "${pkgfile}" || return 2 | ||||
|                 if ${sign_pkg};then | ||||
|                     [[ -e ${pkgfile}.sig ]] && rm ${pkgfile}.sig | ||||
|                     signfile ${pkgfile} | ||||
| @@ -56,7 +72,7 @@ update_repo2(){ | ||||
|                 ln -sf ${pkgfile}{,.sig} $repo_path/ | ||||
|             elif ${del_pkg};then | ||||
|                 local action='remove' | ||||
|                 packages+=("$name") | ||||
|                 packages+=("$(get_pkgbasename "$name")") | ||||
|                 [[ -e $repo_path/$name ]] && rm $repo_path/$name | ||||
|                 [[ -e $repo_path/$name.sig ]] && rm $repo_path/$name.sig | ||||
|             fi | ||||
| @@ -85,14 +101,13 @@ update_repo(){ | ||||
|  | ||||
|     for name in ${pkgsearch[@]}; do | ||||
|         pkgarch=$(get_pkg_arch "$name") | ||||
|         ver=$(get_full_version "$name") | ||||
|         ver=$(get_full_version) | ||||
|         if pkgfile=$(find_cached_package "$name" "$ver" "$pkgarch");then | ||||
|             local pkg=${pkgfile##*/} | ||||
|             info "Found: %s" "$pkg" | ||||
|             if ${add_pkg};then | ||||
|                 local action='add' | ||||
|                 packages+=("$pkg") | ||||
| #                 checkpkg "${pkgfile}" || return 2 | ||||
|                 if ${sign_pkg};then | ||||
|                     [[ -e ${pkgfile}.sig ]] && rm ${pkgfile}.sig | ||||
|                     signfile ${pkgfile} | ||||
|   | ||||
| @@ -33,17 +33,18 @@ find . -type d -print0 2>/dev/null| while read -r -d '' d; do | ||||
|         for dep in "${depends[@]}"; do | ||||
|             # lose the version comparator, if any | ||||
|             depname=${dep%%[<>=]*} | ||||
|             [[ $depname = "$match" ]] && echo "$d (depends)" | ||||
|             [[ $depname = "$match" ]] && msg "$d (depends)" | ||||
|         done | ||||
|         for dep in "${makedepends[@]}"; do | ||||
|             # lose the version comparator, if any | ||||
|             depname=${dep%%[<>=]*} | ||||
|             [[ $depname = "$match" ]] && echo "$d (makedepends)" | ||||
|             [[ $depname = "$match" ]] && msg "$d (makedepends)" | ||||
|         done | ||||
|         for dep in "${optdepends[@]/:*}"; do | ||||
|             # lose the version comaparator, if any | ||||
|             depname=${dep%%[<>=]*} | ||||
|             [[ $depname = "$match" ]] && echo "$d (optdepends)" | ||||
|             [[ $depname = "$match" ]] && msg "$d (optdepends)" | ||||
|         done | ||||
|     fi | ||||
| done | ||||
|  | ||||
|   | ||||
| @@ -33,6 +33,7 @@ REPO_DB_PREFIX= | ||||
| REPO_DB_SUFFIX= | ||||
| LOCKFILE= | ||||
| CLEAN_LOCK=0 | ||||
| PREVENT_DOWNGRADE=0 | ||||
|  | ||||
| . @libdir@/artools/util-base.sh | ||||
|  | ||||
| @@ -52,6 +53,7 @@ Multiple packages to add can be specified on the command line.\n" | ||||
|         printf -- "\n" | ||||
|         printf -- "Options:\n" | ||||
|         printf -- "  -n, --new         only add packages that are not already in the database\n" | ||||
|         printf -- "$(gettext "  -p, --prevent-downgrade  do not add package to database if a newer version is already present\n")" | ||||
|     elif [[ $cmd == "links-remove" ]] ; then | ||||
|         printf -- "Usage: links-remove [options] <path-to-db> <packagename> ...\n" | ||||
|         printf -- "\n" | ||||
| @@ -199,6 +201,18 @@ db_write_entry() { | ||||
|         if (( ONLYADDNEW )); then | ||||
|             return 0 | ||||
|         fi | ||||
|     else | ||||
|         pkgentry=$(find_pkgentry "$pkgname") | ||||
|         if [[ -n $pkgentry ]]; then | ||||
|  | ||||
|             local version=$(sed -n '/^%VERSION%$/ {n;p;q}' "$pkgentry/desc") | ||||
|             if (( $(vercmp "$version" "$pkgver") > 0 )); then | ||||
|                 warning "$(gettext "A newer version for '%s' is already present in database")" "$pkgname" | ||||
|                 if (( PREVENT_DOWNGRADE )); then | ||||
|                     return 0 | ||||
|                 fi | ||||
|             fi | ||||
|         fi | ||||
|     fi | ||||
|  | ||||
|     # remove an existing entry if it exists, ignore failures | ||||
| @@ -459,6 +473,7 @@ while (( $# )); do | ||||
|         -s|--sign) SIGN=1 ;; | ||||
|         -k|--key) KEY=1 ; shift; GPGKEY=$1 ;; | ||||
|         -v|--verify) VERIFY=1 ;; | ||||
|         -p|--prevent-downgrade) PREVENT_DOWNGRADE=1 ;; | ||||
|         *) args+=("$1") ;; | ||||
|     esac | ||||
|     shift | ||||
|   | ||||
| @@ -29,7 +29,9 @@ keepbuilddir=0 | ||||
| update_first=0 | ||||
| clean_first=0 | ||||
| run_namcap=0 | ||||
| run_checkpkg=0 | ||||
| temp_chroot=0 | ||||
| run_nocheck=0 | ||||
|  | ||||
| bindmounts_ro=() | ||||
| bindmounts_rw=() | ||||
| @@ -73,6 +75,8 @@ usage() { | ||||
|     echo '           Useful for maintaining multiple copies' | ||||
|     echo "           Default: $copy" | ||||
|     echo '-n         Run namcap on the package' | ||||
|     echo '-C         Run checkpkg on the package' | ||||
|     echo '-N         Disable check() function' | ||||
|     echo '-T         Build in a temporary directory' | ||||
|     echo '-U         Run makepkg as a specified user' | ||||
|     exit 1 | ||||
| @@ -80,37 +84,31 @@ usage() { | ||||
|  | ||||
| # {{{ functions | ||||
|  | ||||
| # Usage: sync_chroot $rootdir $copydir [$copy] | ||||
| # Usage: sync_chroot $chrootdir $copydir [$copy] | ||||
| sync_chroot() { | ||||
|     local rootdir=$1 | ||||
|     local chrootdir=$1 | ||||
|     local copydir=$2 | ||||
|     local copy=${3:-$2} | ||||
|  | ||||
|     if [[ "$rootdir" -ef "$copydir" ]]; then | ||||
|     if [[ "$chrootdir/root" -ef "$copydir" ]]; then | ||||
|         error 'Cannot sync copy with itself: %s' "$copydir" | ||||
|         return 1 | ||||
|     fi | ||||
|  | ||||
|     # Get a read lock on the root chroot to make | ||||
|     # sure we don't clone a half-updated chroot | ||||
|     slock 8 "$rootdir.lock" \ | ||||
|         "Locking clean chroot [%s]" "$rootdir" | ||||
|     slock 8 "$chrootdir/root.lock" \ | ||||
|         "Locking clean chroot [%s]" "$chrootdir/root" | ||||
|  | ||||
|     stat_busy "Synchronizing chroot copy [%s] -> [%s]" "$rootdir" "$copy" | ||||
|     if is_subvolume "$rootdir" && is_same_fs "$rootdir" "$(dirname -- "$copydir")" && ! mountpoint -q "$copydir"; then | ||||
|         if is_subvolume "$copydir"; then | ||||
|             subvolume_delete_recursive "$copydir" || | ||||
|                 die "Unable to delete subvolume %s" "$copydir" | ||||
|         else | ||||
|             # avoid change of filesystem in case of an umount failure | ||||
|             rm --recursive --force --one-file-system "$copydir" || | ||||
|                 die "Unable to delete %s" "$copydir" | ||||
|         fi | ||||
|         btrfs subvolume snapshot "$rootdir" "$copydir" >/dev/null || | ||||
|     stat_busy "Synchronizing chroot copy [%s] -> [%s]" "$chrootdir/root" "$copy" | ||||
|     if is_btrfs "$chrootdir" && ! mountpoint -q "$copydir"; then | ||||
|         subvolume_delete_recursive "$copydir" || | ||||
|             die "Unable to delete subvolume %s" "$copydir" | ||||
|         btrfs subvolume snapshot "$chrootdir/root" "$copydir" >/dev/null || | ||||
|             die "Unable to create subvolume %s" "$copydir" | ||||
|     else | ||||
|         mkdir -p "$copydir" | ||||
|         rsync -a --delete -q -W -x "$rootdir/" "$copydir" | ||||
|         rsync -a --delete -q -W -x "$chrootdir/root/" "$copydir" | ||||
|     fi | ||||
|     stat_done | ||||
|  | ||||
| @@ -225,14 +223,8 @@ _chrootbuild() { | ||||
|     sudo --preserve-env=SOURCE_DATE_EPOCH -iu builduser bash -c 'cd /startdir; makepkg "$@"' -bash "$@" | ||||
|     ret=$? | ||||
|     case $ret in | ||||
|         0) | ||||
|         0|14) | ||||
|             return 0;; | ||||
|         14) | ||||
|             # whitelist "The package failed to install." but only if there are multiple split packages | ||||
|             # in which case they might be conflicting | ||||
|             local pkgfiles=(/pkgdest/*.pkg.tar.xz) | ||||
|             (( ${#pkgfiles[@]} > 1)) | ||||
|             return $?;; | ||||
|         *) | ||||
|             return $ret;; | ||||
|     esac | ||||
| @@ -255,9 +247,6 @@ download_sources() { | ||||
|         env SRCDEST="$SRCDEST" BUILDDIR="$WORKDIR" \ | ||||
|         makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o "${verifysource_args[@]}" || | ||||
|         die "Could not download sources." | ||||
|  | ||||
|     # Clean up garbage from verifysource | ||||
| #     rm -rf "$builddir" | ||||
| } | ||||
|  | ||||
| move_products() { | ||||
| @@ -293,7 +282,7 @@ move_products() { | ||||
|  | ||||
| orig_argv=("$0" "$@") | ||||
|  | ||||
| opts='hcur:I:l:nTD:d:U:' | ||||
| opts='hcur:I:l:nNCTD:d:U:' | ||||
|  | ||||
| while getopts "${opts}" arg; do | ||||
|     case "$arg" in | ||||
| @@ -305,6 +294,8 @@ while getopts "${opts}" arg; do | ||||
|         I) install_pkgs+=("$OPTARG") ;; | ||||
|         l) copy="$OPTARG" ;; | ||||
|         n) run_namcap=1; makepkg_args+=(--install) ;; | ||||
|         N) run_nocheck=1; makepkg_args+=(--nocheck) ;; | ||||
|         C) run_checkpkg=1 ;; | ||||
|         T) temp_chroot=1; copy+="-$$" ;; | ||||
|         U) makepkg_user="$OPTARG" ;; | ||||
|         h|*) usage ;; | ||||
| @@ -358,7 +349,7 @@ load_vars /etc/makepkg.conf | ||||
| lock 9 "$copydir.lock" "Locking chroot copy [%s]" "$copy" | ||||
|  | ||||
| if [[ ! -d $copydir ]] || (( clean_first )); then | ||||
|     sync_chroot "$chrootdir/root" "$copydir" "$copy" | ||||
|     sync_chroot "$chrootdir" "$copydir" "$copy" | ||||
| fi | ||||
|  | ||||
| bindmounts_rw+=("${PWD}:/startdir" "${SRCDEST}:/srcdest") | ||||
| @@ -391,6 +382,11 @@ if chroot-run \ | ||||
|     "$copydir" \ | ||||
|     /chrootbuild "${makepkg_args[@]}" | ||||
| then | ||||
|     pkgnames=() | ||||
|     for pkgfile in "$copydir"/pkgdest/*; do | ||||
|         pkgfile=${pkgfile##*/}; | ||||
|         pkgnames+=("${pkgfile%-*-*-*}"); | ||||
|     done | ||||
|     move_products | ||||
| else | ||||
|     (( ret += 1 )) | ||||
| @@ -405,6 +401,15 @@ if (( ret != 0 )); then | ||||
|         die "Build failed, check %s/build" "$copydir" | ||||
|     fi | ||||
| else | ||||
|     if (( run_checkpkg )); then | ||||
|         msg "Running checkpkg" | ||||
|         msg2 "Downloading current versions" | ||||
|         if pacman --noconfirm -Swdd --logfile /dev/null "${pkgnames[@]}"; then | ||||
|             msg2 "Checking packages" | ||||
|             sudo -u "$makepkg_user" checkpkg --rmdir --warn | ||||
|         else | ||||
|             warning "Skipped checkpkg due to missing packages" | ||||
|         fi | ||||
|     fi | ||||
|     true | ||||
| fi | ||||
|  | ||||
|   | ||||
| @@ -19,16 +19,19 @@ | ||||
|  | ||||
| # TREE_DIR_ARTIX=${WORKSPACE_DIR}/artixlinux | ||||
|  | ||||
| # customize buildtree, packages and community should be enabled | ||||
| # TREE_NAMES_ARTIX=( | ||||
| #         packages | ||||
| #         community | ||||
| #         packages-kernel | ||||
| #         packages-openrc | ||||
| #         packages-runit | ||||
| #         packages-s6 | ||||
| #         packages-media | ||||
| #         packages-xorg | ||||
| #         packages-python | ||||
| #         packages-perl | ||||
| #         packages-java | ||||
| #         packages-qt5 | ||||
| #         packages-devel | ||||
| #         packages-ruby | ||||
| @@ -38,6 +41,7 @@ | ||||
| #         packages-lxqt | ||||
| #         packages-mate | ||||
| #         packages-kde | ||||
| #         packages-xfce | ||||
| # ) | ||||
|  | ||||
| # HOST_TREE_ARCH=git://git.archlinux.org/svntogit | ||||
| @@ -60,7 +64,7 @@ | ||||
| # the dist release; default: auto | ||||
| # ISO_VERSION=$(date +%Y%m%d) | ||||
|  | ||||
| # possible values: openrc, runit (s6 not yet supported) | ||||
| # possible values: openrc, runit, s6 | ||||
| # INITSYS="openrc" | ||||
|  | ||||
| # gpg key; leave empty or commented to skip sfs signing | ||||
|   | ||||
| @@ -84,6 +84,7 @@ init_artools_pkg(){ | ||||
|             packages-xorg | ||||
|             packages-python | ||||
|             packages-perl | ||||
|             packages-java | ||||
|             packages-qt5 | ||||
|             packages-devel | ||||
|             packages-ruby | ||||
| @@ -93,6 +94,8 @@ init_artools_pkg(){ | ||||
|             packages-lxqt | ||||
|             packages-mate | ||||
|             packages-kde | ||||
|             packages-xfce | ||||
| #             packages-haskell | ||||
|     ) | ||||
|  | ||||
|     HOST_TREE_ARTIX=${HOST_TREE_ARTIX:-"gitea@${GIT_DOMAIN}:artixlinux"} | ||||
|   | ||||
| @@ -28,6 +28,15 @@ add_svc_runit(){ | ||||
|     fi | ||||
| } | ||||
|  | ||||
| add_svc_s6(){ | ||||
|     local mnt="$1" name="$2" | ||||
|     if [[ -d $mnt/etc/s6/sv/$name ]]; then | ||||
|         msg2 "Setting %s ..." "$name" | ||||
| #         chroot $mnt s6-rc-bundle $name default &>/dev/null | ||||
| #         chroot $mnt s6-rc -u change default &>/dev/null | ||||
|     fi | ||||
| } | ||||
|  | ||||
| set_xdm(){ | ||||
|     if [[ -f $1/etc/conf.d/xdm ]];then | ||||
|         local conf='DISPLAYMANAGER="'${DISPLAYMANAGER}'"' | ||||
| @@ -70,6 +79,14 @@ configure_services(){ | ||||
|                 add_svc_runit "$mnt" "$svc" | ||||
|             done | ||||
|         ;; | ||||
|         's6') | ||||
|             for svc in ${SERVICES[@]}; do | ||||
|                 add_svc_s6 "$mnt" "$svc" | ||||
|             done | ||||
|             for svc in ${SERVICES_LIVE[@]}; do | ||||
|                 add_svc_s6 "$mnt" "$svc" | ||||
|             done | ||||
|         ;; | ||||
|     esac | ||||
|     info "Done configuring [%s]" "${INITSYS}" | ||||
| } | ||||
| @@ -77,7 +94,7 @@ configure_services(){ | ||||
| configure_system(){ | ||||
|     local mnt="$1" | ||||
|     case ${INITSYS} in | ||||
|         'openrc' | 'runit') | ||||
|         'openrc' | 'runit'|'s6') | ||||
|             configure_logind "$mnt" "elogind" | ||||
|         ;; | ||||
|     esac | ||||
| @@ -131,6 +148,15 @@ write_servicescfg_conf(){ | ||||
|                 yaml+=$(write_yaml_map 4 'runlevel' 'default') | ||||
|             done | ||||
|         ;; | ||||
|         's6') | ||||
|             yaml+=$(write_yaml_map 0 'svDir' '/etc/s6/sv') | ||||
|             yaml+=$(write_yaml_map 0 'rcDir' '/etc/s6-rc') | ||||
|             yaml+=$(write_yaml_map 0 'services') | ||||
|             for svc in ${SERVICES[@]};do | ||||
|                 yaml+=$(write_yaml_seq_map 2 'name' "$svc") | ||||
|                 yaml+=$(write_yaml_map 4 'bundle' 'default') | ||||
|             done | ||||
|         ;; | ||||
|     esac | ||||
|     yaml+=$(write_empty_line) | ||||
|     printf '%s' "${yaml}" | ||||
| @@ -142,7 +168,7 @@ write_unpackfs_conf(){ | ||||
|     yaml+=$(write_yaml_map 0 'unpack') | ||||
|     yaml+=$(write_yaml_seq_map 2 'source' "/run/artix/bootmnt/artix/x86_64/rootfs.sfs") | ||||
|     yaml+=$(write_yaml_map 4 'sourcefs' 'squashfs') | ||||
|     yaml+=$(write_yaml_map 4 'destination' '') | ||||
|     yaml+=$(write_yaml_map 4 'destination' '""') | ||||
|     yaml+=$(write_empty_line) | ||||
|     printf '%s' "${yaml}" | ||||
| } | ||||
| @@ -159,14 +185,15 @@ configure_calamares(){ | ||||
|     fi | ||||
| } | ||||
|  | ||||
| configure_live_image(){ | ||||
| configure_image(){ | ||||
|     local fs="$1" | ||||
|     msg "Configuring [livefs]" | ||||
|     msg "Configuring [%s]" "${fs##*/}" | ||||
|     configure_hosts "$fs" | ||||
|     configure_system "$fs" | ||||
|     configure_services "$fs" | ||||
|     configure_calamares "$fs" | ||||
|     [[ ! -d "$fs/etc/artools" ]] && mkdir -p "$fs/etc/artools" | ||||
|     msg2 "Writing live.conf" | ||||
|     write_live_session_conf > "$fs/etc/artools/live.conf" | ||||
|     msg "Done configuring [livefs]" | ||||
|     msg "Done configuring [%s]" "${fs##*/}" | ||||
| } | ||||
|   | ||||
| @@ -32,7 +32,7 @@ prepare_initramfs(){ | ||||
|         su ${OWNER} -c "gpg --export ${GPG_KEY} >/tmp/GPG_KEY" | ||||
|         exec 17<>/tmp/GPG_KEY | ||||
|     fi | ||||
|     local _kernel=$(cat $mnt/usr/lib/modules/*/version) | ||||
|     local _kernel=$(<$mnt/usr/src/linux/version) | ||||
|     ARTIX_GNUPG_FD=${GPG_KEY:+17} artools-chroot $mnt \ | ||||
|         /usr/bin/mkinitcpio -k ${_kernel} \ | ||||
|         -c /etc/mkinitcpio-artix.conf \ | ||||
| @@ -59,14 +59,13 @@ prepare_boot_extras(){ | ||||
| } | ||||
|  | ||||
| configure_grub(){ | ||||
|     local conf="$1/boot/grub/kernels.cfg" | ||||
|     sed -e "s|@iso_label@|${iso_label}|" -i $conf | ||||
|     sed -e "s|@iso_label@|${iso_label}|" -i ${iso_root}/boot/grub/kernels.cfg | ||||
| } | ||||
|  | ||||
| prepare_grub(){ | ||||
|     local platform=i386-pc img='core.img' prefix=/boot/grub | ||||
|     local lib=$1/usr/lib/grub theme=$2/usr/share/grub | ||||
|     local grub=$3/boot/grub efi=$3/efi/boot | ||||
|     local grub=${iso_root}/boot/grub efi=${iso_root}/efi/boot | ||||
|  | ||||
|     prepare_dir ${grub}/${platform} | ||||
|  | ||||
| @@ -104,7 +103,7 @@ prepare_grub(){ | ||||
|         grub-mkfont -o ${grub}/unicode.pf2 /usr/share/fonts/misc/unifont.bdf | ||||
|     fi | ||||
|  | ||||
|     local size=4M mnt="${mnt_dir}/efiboot" efi_img="$3/efi.img" | ||||
|     local size=4M mnt="${mnt_dir}/efiboot" efi_img="${iso_root}/efi.img" | ||||
|     msg2 "Creating fat image of %s ..." "${size}" | ||||
|     truncate -s ${size} "${efi_img}" | ||||
|     mkfs.fat -n ARTIX_EFI "${efi_img}" &>/dev/null | ||||
|   | ||||
| @@ -44,7 +44,10 @@ mount_overlay(){ | ||||
|     mkdir -p "$upper" | ||||
|     case $upper in | ||||
|         */livefs) lower="$work/rootfs" ;; | ||||
|         */bootfs) lower="$work/livefs":"$work/rootfs" ;; | ||||
|         */bootfs) | ||||
|             lower="$work/rootfs" | ||||
|             [[ -d "$work/livefs" ]] && lower="$work/livefs":"$work/rootfs" | ||||
|         ;; | ||||
|     esac | ||||
|     track_fs -t overlay overlay -olowerdir="$lower",upperdir="$upper",workdir="${mnt_dir}/work" "$upper" | ||||
| } | ||||
|   | ||||
| @@ -12,21 +12,6 @@ | ||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
| # GNU General Public License for more details. | ||||
|  | ||||
| init_profile(){ | ||||
|     local profdir="$1" prof="$2" | ||||
|  | ||||
|     ROOT_LIST="$profdir/base/Packages-Root" | ||||
|     ROOT_OVERLAY="$profdir/base/root-overlay" | ||||
|     LIVE_LIST="$profdir/base/Packages-Live" | ||||
|     LIVE_OVERLAY="$profdir/base/live-overlay" | ||||
|  | ||||
|     [[ -f "$profdir/$prof/Packages-Root" ]] && ROOT_LIST="$profdir/$prof/Packages-Root" | ||||
|     [[ -d "$profdir/$prof/root-overlay" ]] && ROOT_OVERLAY="$profdir/$prof/root-overlay" | ||||
|  | ||||
|     [[ -f "$profdir/$prof/Packages-Live" ]] && LIVE_LIST="$profdir/$prof/Packages-Live" | ||||
|     [[ -d "$profdir/$prof/live-overlay" ]] && LIVE_OVERLAY="$profdir/$prof/live-overlay" | ||||
| } | ||||
|  | ||||
| show_profile(){ | ||||
|     msg2 "iso_file: %s" "${iso_file}" | ||||
|     msg2 "AUTOLOGIN: %s" "${AUTOLOGIN}" | ||||
| @@ -39,15 +24,18 @@ show_profile(){ | ||||
| } | ||||
|  | ||||
| load_profile(){ | ||||
|     local prof="$1" | ||||
|     local profdir="${DATADIR}/iso-profiles" | ||||
|     [[ -d ${WORKSPACE_DIR}/iso-profiles ]] && profdir=${WORKSPACE_DIR}/iso-profiles | ||||
|     local profile_dir="${DATADIR}/iso-profiles" | ||||
|     [[ -d ${WORKSPACE_DIR}/iso-profiles ]] && profile_dir=${WORKSPACE_DIR}/iso-profiles | ||||
|  | ||||
|     init_profile "$profdir" "$prof" | ||||
|     ROOT_LIST="$profile_dir/${PROFILE}/Packages-Root" | ||||
|     ROOT_OVERLAY="$profile_dir/${PROFILE}/root-overlay" | ||||
|  | ||||
|     [[ -f $profdir/$prof/profile.conf ]] || return 1 | ||||
|     [[ -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" | ||||
|  | ||||
|     [[ -r $profdir/$prof/profile.conf ]] && . $profdir/$prof/profile.conf | ||||
|     [[ -f $profile_dir/${PROFILE}/profile.conf ]] || return 1 | ||||
|  | ||||
|     [[ -r $profile_dir/${PROFILE}/profile.conf ]] && . $profile_dir/${PROFILE}/profile.conf | ||||
|  | ||||
|     DISPLAYMANAGER=${DISPLAYMANAGER:-'none'} | ||||
|  | ||||
| @@ -63,13 +51,13 @@ load_profile(){ | ||||
|     ADDGROUPS=${ADDGROUPS:-"video,power,optical,network,lp,scanner,wheel,users,log"} | ||||
|  | ||||
|     if [[ -z ${SERVICES[@]} ]];then | ||||
|         SERVICES=('acpid' 'bluetooth' 'cronie' 'cupsd' 'syslog-ng' 'NetworkManager') | ||||
|         SERVICES=('acpid' 'bluetooth' 'cronie' 'cupsd' 'syslog-ng' 'connman') | ||||
|     fi | ||||
|  | ||||
|     if [[ ${DISPLAYMANAGER} != "none" ]];then | ||||
|         case "${INITSYS}" in | ||||
|             'openrc') SERVICES+=('xdm') ;; | ||||
|             'runit') SERVICES+=("${DISPLAYMANAGER}") ;; | ||||
|             'runit'|'s6') SERVICES+=("${DISPLAYMANAGER}") ;; | ||||
|         esac | ||||
|     fi | ||||
|  | ||||
| @@ -81,7 +69,6 @@ load_profile(){ | ||||
| } | ||||
|  | ||||
| write_live_session_conf(){ | ||||
|     msg2 "Writing live.conf" | ||||
|     local conf='' | ||||
|     conf+=$(printf '%s\n' '# live session configuration') | ||||
|     conf+=$(printf "\nAUTOLOGIN=%s\n" "${AUTOLOGIN}") | ||||
| @@ -97,7 +84,7 @@ load_pkgs(){ | ||||
|  | ||||
|     local _init="s|@$init||g" | ||||
|     case "$init" in | ||||
|         'openrc') _init_rm1="s|@runit.*||g"; _init_rm2="s|@s6*||g" ;; | ||||
|         'openrc') _init_rm1="s|@runit.*||g"; _init_rm2="s|@s6.*||g" ;; | ||||
|         's6') _init_rm1="s|@runit.*||g"; _init_rm2="s|@openrc.*||g" ;; | ||||
|         'runit') _init_rm1="s|@s6.*||g"; _init_rm2="s|@openrc.*||g" ;; | ||||
|     esac | ||||
|   | ||||
| @@ -13,9 +13,6 @@ | ||||
| # GNU General Public License for more details. | ||||
|  | ||||
| error_function() { | ||||
|     if [[ -p $logpipe ]]; then | ||||
|         rm "$logpipe" | ||||
|     fi | ||||
|     local func="$1" | ||||
|     # first exit all subshells, then print the error | ||||
|     if (( ! BASH_SUBSHELL )); then | ||||
| @@ -134,6 +131,8 @@ make_rootfs() { | ||||
|  | ||||
|         copy_overlay "${ROOT_OVERLAY}" "${rootfs}" | ||||
|  | ||||
|         [[ -z ${LIVE_LIST} ]] && configure_image "${rootfs}" | ||||
|  | ||||
|         clean_up_image "${rootfs}" | ||||
|  | ||||
|         : > ${work_dir}/rootfs.lock | ||||
| @@ -155,7 +154,7 @@ make_livefs() { | ||||
|  | ||||
|         copy_overlay "${LIVE_OVERLAY}" "${livefs}" | ||||
|  | ||||
|         configure_live_image "${livefs}" | ||||
|         configure_image "${livefs}" | ||||
|  | ||||
|         umount_overlay | ||||
|  | ||||
| @@ -198,9 +197,12 @@ make_grub(){ | ||||
|     if [[ ! -e ${work_dir}/grub.lock ]]; then | ||||
|         msg "Prepare [/iso/boot/grub]" | ||||
|  | ||||
|         prepare_grub "${work_dir}/rootfs" "${work_dir}/livefs" "${iso_root}" | ||||
|         local layer=${work_dir}/rootfs | ||||
|         [[ -n ${LIVE_LIST} ]] && layer=${work_dir}/livefs | ||||
|  | ||||
|         configure_grub "${iso_root}" | ||||
|         prepare_grub "${work_dir}/rootfs" "$layer" | ||||
|  | ||||
|         configure_grub | ||||
|  | ||||
|         : > ${work_dir}/grub.lock | ||||
|         msg "Done [/iso/boot/grub]" | ||||
| @@ -218,7 +220,7 @@ prepare_images(){ | ||||
|     local timer=$(get_timer) | ||||
|     load_pkgs "${ROOT_LIST}" "${INITSYS}" | ||||
|     run_safe "make_rootfs" | ||||
|     if [[ -f ${LIVE_LIST} ]]; then | ||||
|     if [[ -n ${LIVE_LIST} ]]; then | ||||
|         load_pkgs "${LIVE_LIST}" "${INITSYS}" | ||||
|         run_safe "make_livefs" | ||||
|     fi | ||||
|   | ||||
| @@ -54,9 +54,10 @@ load_team_id(){ | ||||
| add_repo_to_team(){ | ||||
|     local pkg="$1" org="$2" team="$3" | ||||
|     local id=$(load_team_id "$org" "$team") | ||||
|     local gitname=$(get_compliant_name "$pkg") | ||||
|  | ||||
|     msg2 "Adding package repo [%s] to team (%s)" "$pkg" "$team" | ||||
|     msg2 "Adding package repo [%s] to team (%s)" "$gitname" "$team" | ||||
|  | ||||
|     curl -s -X PUT "${GIT_URL}/api/v1/teams/$id/repos/$org/$pkg?access_token=${GIT_TOKEN}" \ | ||||
|     curl -s -X PUT "${GIT_URL}/api/v1/teams/$id/repos/$org/$gitname?access_token=${GIT_TOKEN}" \ | ||||
|         -H  "accept: application/json" | ||||
| } | ||||
|   | ||||
| @@ -81,7 +81,7 @@ pull_tree(){ | ||||
|     local remote_head=$(get_remote_head) | ||||
|  | ||||
|     msg "Checking %s (%s)" "${tree}" "$os" | ||||
|     if $(has_changes "${local_head}" "${remote_head}");then | ||||
|     if has_changes "${local_head}" "${remote_head}";then | ||||
|         git pull origin master | ||||
|     fi | ||||
| } | ||||
| @@ -139,22 +139,3 @@ config_tree(){ | ||||
|         fi | ||||
|     cd .. | ||||
| } | ||||
|  | ||||
| subrepo_new(){ | ||||
|     local pkg="$1" tree="$2" team="${3:-$2}" | ||||
|     local dest=${TREE_DIR_ARTIX}/$tree/$pkg/trunk | ||||
|  | ||||
|     cd ${TREE_DIR_ARTIX}/$tree | ||||
|  | ||||
|     local org=$(get_pkg_org "$pkg") | ||||
|  | ||||
|     create_repo "$pkg" "$org" | ||||
|  | ||||
|     add_repo_to_team "$pkg" "$org" "$team" | ||||
|  | ||||
|     subrepo_clone "$pkg" "$org" | ||||
|  | ||||
|     prepare_dir "$dest" | ||||
|  | ||||
|     commit_jenkins_files "$pkg" | ||||
| } | ||||
|   | ||||
| @@ -109,7 +109,7 @@ find_repo(){ | ||||
|     local pkg="$1" stag="$2" unst="$3" repo= | ||||
|  | ||||
|     for r in $(arch_repos "$stag" "$unst");do | ||||
|         [[ -f $pkg/repos/$r-x86_64/PKGBUILD ]] && repo=$r-x86_64 | ||||
|         [[ -f $pkg/repos/$r-${ARCH}/PKGBUILD ]] && repo=$r-${ARCH} | ||||
|         [[ -f $pkg/repos/$r-any/PKGBUILD ]] && repo=$r-any | ||||
|     done | ||||
|     echo $repo | ||||
| @@ -149,16 +149,20 @@ get_artix_tree(){ | ||||
|         $(get_cases ruby)) tree=packages-ruby ;; | ||||
|         $(get_cases openrc)) tree=packages-openrc ;; | ||||
|         $(get_cases runit)) tree=packages-runit ;; | ||||
|         $(get_cases s6)) tree=packages-s6 ;; | ||||
|         $(get_cases media)) tree=packages-media ;; | ||||
|         $(get_cases xorg)) tree=packages-xorg ;; | ||||
|         $(get_cases qt5)) tree=packages-qt5 ;; | ||||
|         $(get_cases gtk)) tree=packages-gtk ;; | ||||
|         $(get_cases java)) tree=packages-java ;; | ||||
|         $(get_cases haskell)) tree=packages-haskell ;; | ||||
|         $(get_cases devel)) tree=packages-devel ;; | ||||
|         $(get_cases lxqt)) tree=packages-lxqt ;; | ||||
|         $(get_cases cinnamon)) tree=packages-cinnamon ;; | ||||
|         $(get_cases kde)) tree=packages-kde ;; | ||||
|         $(get_cases gnome)) tree=packages-gnome ;; | ||||
|         $(get_cases mate)) tree=packages-mate ;; | ||||
|         $(get_cases xfce)) tree=packages-xfce ;; | ||||
|         *) tree=$artix_tree | ||||
|     esac" | ||||
|     echo $tree | ||||
|   | ||||
		Reference in New Issue
	
	Block a user