forked from artix/artools
		
	Compare commits
	
		
			19 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| d8195e2288 | |||
| bfe9130cfb | |||
| 8873a71824 | |||
| bb86a05f2f | |||
| bd611c1af2 | |||
| f4e8f703ea | |||
| aa83bc79bb | |||
| 1bb9687ece | |||
| 48ced03735 | |||
| 0437e66091 | |||
| 9af6d02dea | |||
| 685992cca3 | |||
| 816e13895f | |||
| 6a3f48f181 | |||
| b4d9195c03 | |||
| 0123e6d044 | |||
| e2b2a21ed1 | |||
| 0e2e2875db | |||
| a4d006adef | 
							
								
								
									
										15
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								Makefile
									
									
									
									
									
								
							| @@ -1,4 +1,4 @@ | ||||
| VERSION=0.13 | ||||
| VERSION=0.14 | ||||
|  | ||||
| CHROOT_VERSION=0.9 | ||||
|  | ||||
| @@ -34,15 +34,11 @@ PKG_BIN = \ | ||||
| 	bin/pkg/deploypkg \ | ||||
| 	bin/pkg/commitpkg \ | ||||
| 	bin/pkg/comparepkg \ | ||||
| 	bin/pkg/checkpkg \ | ||||
| 	bin/pkg/mkchrootpkg \ | ||||
| 	bin/pkg/pkg2yaml \ | ||||
| 	bin/pkg/buildtree \ | ||||
| 	bin/pkg/lddd \ | ||||
| 	bin/pkg/finddeps \ | ||||
| 	bin/pkg/find-libdeps \ | ||||
| 	bin/pkg/links-add \ | ||||
| 	bin/pkg/sogrep | ||||
| 	bin/pkg/links-add | ||||
|  | ||||
| LN_COMMITPKG = \ | ||||
| 	extrapkg \ | ||||
| @@ -89,9 +85,6 @@ LN_DEPLOYPKG = \ | ||||
| PKG_LIBS = \ | ||||
| 	$(wildcard lib/pkg/*) | ||||
|  | ||||
| PKG_LISTS = \ | ||||
| 	$(wildcard data/pkglists/*.list) | ||||
|  | ||||
| PKG_UTIL = lib/util-pkg.sh | ||||
|  | ||||
| PKG_DATA = \ | ||||
| @@ -171,8 +164,6 @@ install_pkg: | ||||
| 	install $(DIRMODE) $(DESTDIR)$(BINDIR) | ||||
| 	install $(MODE) $(PKG_BIN) $(DESTDIR)$(BINDIR) | ||||
|  | ||||
| 	$(LN) find-libdeps $(DESTDIR)$(BINDIR)/find-libprovides | ||||
|  | ||||
| 	$(LN) links-add $(DESTDIR)$(BINDIR)/links-remove | ||||
|  | ||||
| 	for l in $(LN_COMMITPKG); do $(LN) commitpkg $(DESTDIR)$(BINDIR)/$$l; done | ||||
| @@ -189,8 +180,6 @@ install_pkg: | ||||
| 	install $(DIRMODE) $(DESTDIR)$(DATADIR)/$(TOOLS)/patches | ||||
| 	install $(FILEMODE) $(PATCHES) $(DESTDIR)$(DATADIR)/$(TOOLS)/patches | ||||
|  | ||||
| 	install $(DIRMODE) $(DESTDIR)$(DATADIR)/$(TOOLS)/pkglists | ||||
| 	install $(FILEMODE) $(PKG_LISTS) $(DESTDIR)$(DATADIR)/$(TOOLS)/pkglists | ||||
| install_cpio: | ||||
| 	+make CPIODIR=$(CPIODIR) DESTDIR=$(DESTDIR) -C initcpio install | ||||
|  | ||||
|   | ||||
| @@ -78,7 +78,7 @@ from_arch(){ | ||||
|     [[ -z $git_tree_arch ]] && die "Package '%s' does not exist!" "$pkg" | ||||
|  | ||||
|     local package=${TREE_DIR_ARCH}/$git_tree_arch/$pkg | ||||
|     local repo=$(find_repo "$package") | ||||
|     local repo=$(find_repo "$package" "${staging}" "${unstable}") | ||||
|  | ||||
|     src=$package/repos/$repo | ||||
|  | ||||
| @@ -114,7 +114,7 @@ view_build(){ | ||||
|     [[ -z $git_tree_arch ]] && die "Package '%s' does not exist!" "$pkg" | ||||
|  | ||||
|     local pkg_path=${TREE_DIR_ARCH}/$git_tree_arch/$pkg | ||||
|     local repo=$(find_repo "$pkg_path") | ||||
|     local repo=$(find_repo "$pkg_path" "${staging}" "${unstable}") | ||||
|  | ||||
|     src=$pkg_path/repos/$repo | ||||
|  | ||||
| @@ -139,6 +139,8 @@ import=false | ||||
| view=false | ||||
| createnew=false | ||||
| conf=false | ||||
| unstable=false | ||||
| staging=true | ||||
|  | ||||
| PACKAGE='' | ||||
|  | ||||
| @@ -157,6 +159,8 @@ usage() { | ||||
|     echo "    -y            Don't clone or pull artix repos" | ||||
|     echo '    -i            Import a package from arch repos' | ||||
|     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 '    -h            This help' | ||||
|     echo '' | ||||
| @@ -166,7 +170,7 @@ usage() { | ||||
|  | ||||
| orig_argv=("$0" "$@") | ||||
|  | ||||
| opts='p:t:g:sinzyvh' | ||||
| opts='p:t:g:uwsinzyvh' | ||||
|  | ||||
| while getopts "${opts}" arg; do | ||||
|     case "${arg}" in | ||||
| @@ -178,6 +182,8 @@ while getopts "${opts}" arg; do | ||||
|         y) sync_artix=false ;; | ||||
|         i) import=true ;; | ||||
|         n) createnew=true ;; | ||||
|         w) staging=false ;; | ||||
|         u) unstable=true ;; | ||||
|         v) view=true ;; | ||||
|         h|?) usage 0 ;; | ||||
|         *) echo "invalid argument '${arg}'"; usage 1 ;; | ||||
|   | ||||
| @@ -1,80 +0,0 @@ | ||||
| #!/bin/bash | ||||
| # | ||||
| # Copyright (C) 2018-19 artoo@artixlinux.org | ||||
| # Copyright (C) 2018 Artix Linux Developers | ||||
| # | ||||
| # This program is free software; you can redistribute it and/or modify | ||||
| # it under the terms of the GNU General Public License as published by | ||||
| # the Free Software Foundation; version 2 of the License. | ||||
| # | ||||
| # This program is distributed in the hope that it will be useful, | ||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
| # GNU General Public License for more details. | ||||
|  | ||||
| . @libdir@/artools/util-base.sh | ||||
| . @libdir@/artools/util-pkg.sh | ||||
|  | ||||
| shopt -s extglob | ||||
|  | ||||
| load_user_info | ||||
|  | ||||
| load_vars "${USERCONFDIR}/pacman/makepkg.conf" || load_vars "$USER_HOME/.makepkg.conf" | ||||
| load_vars /etc/makepkg.conf | ||||
|  | ||||
| if [[ ! -f PKGBUILD ]]; then | ||||
|     die 'This must be run in the directory of a built package.' | ||||
| fi | ||||
|  | ||||
| . ./PKGBUILD | ||||
| if [[ $arch == 'any' ]]; then | ||||
|     CARCH='any' | ||||
| fi | ||||
|  | ||||
| STARTDIR=$(pwd) | ||||
| TEMPDIR=$(mktemp -d --tmpdir checkpkg-script.XXXX) | ||||
|  | ||||
| for _pkgname in "${pkgname[@]}"; do | ||||
|     target_pkgver=$(get_full_version "$_pkgname") | ||||
|     if ! pkgfile=$(find_cached_package "$_pkgname" "$target_pkgver" "$CARCH"); then | ||||
|         die 'tarball not found for package: %s' "${_pkgname}-$target_pkgver" | ||||
|     fi | ||||
|  | ||||
|     ln -s "$pkgfile" "$TEMPDIR" | ||||
|  | ||||
|     pkgurl=$(pacman -Spdd --print-format '%l' --noconfirm "$_pkgname") | ||||
|  | ||||
|     if [[ $? -ne 0 ]]; then | ||||
|         die "Couldn't download previous package for %s." "$_pkgname" | ||||
|     fi | ||||
|  | ||||
|     oldpkg=${pkgurl##*://*/} | ||||
|  | ||||
|     if [[ ${oldpkg##*/} = ${pkgfile##*/} ]]; then | ||||
|         die "The built package (%s) is the one in the repo right now!" "$_pkgname" | ||||
|     fi | ||||
|  | ||||
|     if [[ $pkgurl = file://* ]]; then | ||||
|         ln -s "${pkgurl#file://}" "$TEMPDIR/$oldpkg" | ||||
|     elif [[ -f "$PKGDEST/$oldpkg" ]]; then | ||||
|         ln -s "$PKGDEST/$oldpkg" "$TEMPDIR/$oldpkg" | ||||
|     elif [[ -f "$STARTDIR/$oldpkg" ]]; then | ||||
|         ln -s "$STARTDIR/$oldpkg" "$TEMPDIR/$oldpkg" | ||||
|     else | ||||
|         curl -fsLC - --retry 3 --retry-delay 3 -o "$TEMPDIR/$oldpkg" "$pkgurl" | ||||
|     fi | ||||
|  | ||||
|     bsdtar tf "$TEMPDIR/$oldpkg" | sort > "$TEMPDIR/filelist-$_pkgname-old" | ||||
|     bsdtar tf "$pkgfile" | sort > "$TEMPDIR/filelist-$_pkgname" | ||||
|  | ||||
|     sdiff -s "$TEMPDIR/filelist-$_pkgname-old" "$TEMPDIR/filelist-$_pkgname" | ||||
|  | ||||
|     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" | ||||
|         echo "$diff_output" | ||||
|     else | ||||
|         msg "No soname differences for %s" "$_pkgname." | ||||
|     fi | ||||
| done | ||||
| @@ -15,6 +15,22 @@ | ||||
| . @libdir@/artools/util-base.sh | ||||
| . @libdir@/artools/util-pkg.sh | ||||
|  | ||||
| get_path(){ | ||||
|     local repo="$1" pkg=trunk/PKGBUILD | ||||
|     if [[ $repo != trunk ]]; then | ||||
|         [[ -f repos/$repo-${ARCH}/PKGBUILD ]] && pkg=repos/$repo-${ARCH}/PKGBUILD | ||||
|         [[ -f repos/$repo-any/PKGBUILD ]] && pkg=repos/$repo-any/PKGBUILD | ||||
|     fi | ||||
|     echo $pkg | ||||
| } | ||||
|  | ||||
| prepare_commit(){ | ||||
|     local dest="$1" | ||||
|     [[ -d repos/$dest ]] && git rm -r repos/$dest | ||||
|     [[ ! -d repos ]] && mkdir repos | ||||
|     [[ ! -d repos/$dest ]] && mkdir repos/$dest | ||||
| } | ||||
|  | ||||
| commit_pkg(){ | ||||
|     local git_tree=$(find_tree "${TREE_DIR_ARTIX}" "${PACKAGE}") | ||||
|     if [[ -n ${git_tree} ]];then | ||||
| @@ -25,9 +41,13 @@ commit_pkg(){ | ||||
|  | ||||
|         cd ${TREE_DIR_ARTIX}/${git_tree}/${PACKAGE} | ||||
|  | ||||
|         . trunk/PKGBUILD | ||||
|         local pkgbuild=$(get_path "${REPO_SRC}") | ||||
|  | ||||
|         . $pkgbuild | ||||
|         [[ $arch == 'any' ]] && CARCH=any | ||||
|         local ver=$(get_full_version "${PACKAGE}") | ||||
|  | ||||
|         local version=$(get_full_version) | ||||
|  | ||||
|         local commit_msg="" | ||||
|  | ||||
|         if ${remove};then | ||||
| @@ -36,14 +56,14 @@ commit_pkg(){ | ||||
|                 local pkg=${PACKAGE} | ||||
|                 git rm -r trunk | ||||
|             else | ||||
|                 local pkg="${PACKAGE}-$ver" | ||||
|                 local pkg="${PACKAGE}-$version" | ||||
|                 git rm -r repos/"${REPO_SRC}-$CARCH" | ||||
|             fi | ||||
|             commit_msg="[${REPO_SRC}] '$pkg' ${action}" | ||||
|             msg "Action: %s" "$commit_msg" | ||||
|         else | ||||
|             local action='modify' | ||||
|             commit_msg="[${REPO_SRC}] '${PACKAGE}-$ver' ${action}" | ||||
|             commit_msg="[${REPO_SRC}] '${PACKAGE}-$version' ${action}" | ||||
|             msg "Action: %s" "$commit_msg" | ||||
|             git add . | ||||
|  | ||||
| @@ -76,17 +96,18 @@ symlink_commit_pkg(){ | ||||
|  | ||||
|         cd ${TREE_DIR_ARTIX}/${git_tree}/${PACKAGE} | ||||
|  | ||||
|         . trunk/PKGBUILD | ||||
|         local pkgbuild=$(get_path "${REPO_SRC}") | ||||
|  | ||||
|         . $pkgbuild | ||||
|         [[ $arch == 'any' ]] && CARCH=any | ||||
|         local ver=$(get_full_version "${PACKAGE}") | ||||
|  | ||||
|         local version=$(get_full_version) | ||||
|  | ||||
|         if [[ ${REPO_SRC} == 'trunk' ]];then | ||||
|             local action='add' | ||||
|             local dest="${REPO_DEST}-$CARCH" | ||||
|  | ||||
|             [[ -d repos/$dest ]] && git rm -r repos/$dest | ||||
|             [[ ! -d repos ]] && mkdir repos | ||||
|             [[ ! -d repos/$dest ]] && mkdir repos/$dest | ||||
|             prepare_commit "$dest" | ||||
|  | ||||
|             cp trunk/* repos/$dest/ | ||||
|         else | ||||
| @@ -94,14 +115,12 @@ symlink_commit_pkg(){ | ||||
|             local src="${REPO_SRC}-$CARCH" dest="${REPO_DEST}-$CARCH" | ||||
|  | ||||
|             [[ ! -f repos/$src/PKGBUILD ]] && die "%s does not exist!" "repos/$src/PKGBUILD" | ||||
|             [[ -d repos/$dest ]] && git rm -r repos/$dest | ||||
|             [[ ! -d repos ]] && mkdir repos | ||||
|             [[ ! -d repos/$dest ]] && mkdir repos/$dest | ||||
|             prepare_commit "$dest" | ||||
|  | ||||
|             cp repos/$src/* repos/$dest/ | ||||
|             git rm -r repos/$src | ||||
|         fi | ||||
|         local commit_msg="[${REPO_SRC}] -> [${REPO_DEST}] '${PACKAGE}-$ver' ${action}" | ||||
|         local commit_msg="[${REPO_SRC}] -> [${REPO_DEST}] '${PACKAGE}-$version' ${action}" | ||||
|         msg "Action: %s" "$commit_msg" | ||||
|  | ||||
|         git add . | ||||
|   | ||||
| @@ -15,19 +15,12 @@ | ||||
| . @libdir@/artools/util-base.sh | ||||
| . @libdir@/artools/util-pkg.sh | ||||
|  | ||||
| show_version_table(){ | ||||
|     msg_table_header "%-20s %-20s %-25s %-30s %-30s" "Arch Repo" "Artix Repo" "Package" "Arch version" "Artix version" | ||||
|  | ||||
|     for tree in ${TREE_NAMES_ARTIX[@]};do | ||||
|  | ||||
|         local git=$(find ${TREE_DIR_ARTIX}/$tree/ -mindepth 1 -maxdepth 1 -type d) | ||||
|  | ||||
|         for package in ${git[@]}; do | ||||
|  | ||||
|             local pkg=${package##*/} | ||||
| compare(){ | ||||
|     local pkgpath="$1" group="$2" | ||||
|     local pkg=${pkgpath##*/} | ||||
|     local artixrepo=$(find_repo "$package" "${staging}" "${unstable}") | ||||
|     local artixshow=${artixrepo%-*} | ||||
|             local pkgbuild=$package/repos/$artixrepo/PKGBUILD | ||||
|     local pkgbuild=$pkgpath/repos/$artixrepo/PKGBUILD | ||||
|  | ||||
|     if [[ -f $pkgbuild ]];then | ||||
|  | ||||
| @@ -57,9 +50,9 @@ show_version_table(){ | ||||
|                 case $artixrepo in | ||||
|                     *testing*|*staging*) | ||||
|                         if $repomatch;then | ||||
|                                     msg_row "%-20s %-20s %-25s %-30s %-30s" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver" | ||||
|                             msg_row "${table}" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver" "$group" | ||||
|                         else | ||||
|                                     msg_row_notify "%-20s %-20s %-25s %-30s %-30s" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver" | ||||
|                             msg_row_notify "${table}" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver" "$group" | ||||
|                         fi | ||||
|                     ;; | ||||
|                 esac | ||||
| @@ -68,14 +61,14 @@ show_version_table(){ | ||||
|         elif ${upgrades};then | ||||
|  | ||||
|             if [ $result -eq -1 ];then | ||||
|                         msg_row_upgrade "%-20s %-20s %-25s %-30s %-30s" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver" | ||||
|                 msg_row_upgrade "${table}" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver" "$group" | ||||
|             fi | ||||
|  | ||||
|         elif ${downgrades};then | ||||
|  | ||||
|             if [ $result -eq 1 ];then | ||||
|                 if [[ -n $archver ]] && [[ -n $archrepo ]];then | ||||
|                             msg_row_downgrade "%-20s %-20s %-25s %-30s %-30s" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver" | ||||
|                     msg_row_downgrade "${table}" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver" "$group" | ||||
|                 fi | ||||
|             fi | ||||
|  | ||||
| @@ -83,6 +76,102 @@ show_version_table(){ | ||||
|         unset pkgver epoch pkgrel artixver archver pkgbuild archpath | ||||
|  | ||||
|     fi | ||||
| } | ||||
|  | ||||
| is_db_entry() { | ||||
|     local pkgname="$1" repo="$(arch2artix $2)" | ||||
|     if [[ -d ${USERCACHEDIR}/${LINKSDBEXT}/${ARCH}/$repo/$pkgname ]];then | ||||
|         return 0 | ||||
|     fi | ||||
|     return 1 | ||||
| } | ||||
|  | ||||
| check_db(){ | ||||
|     local pkgpath="$1" | ||||
|     local pkg=${pkgpath##*/} | ||||
|     local sarch=(any ${ARCH}) | ||||
|     local arch_repos=$(arch_repos "${staging}" "${unstable}") | ||||
|  | ||||
|     for repo in ${arch_repos[@]};do | ||||
|  | ||||
|         for a in ${sarch[@]};do | ||||
|  | ||||
|             local pkgbuild=$pkgpath/repos/$repo-$a/PKGBUILD | ||||
|  | ||||
|             if [[ -f $pkgbuild ]];then | ||||
|  | ||||
|                 . $pkgbuild 2>/dev/null | ||||
|                 local artixver=$(get_full_version $pkg) | ||||
|                 local is_entry=false | ||||
|  | ||||
|                 for name in ${pkgname[@]};do | ||||
|  | ||||
|                     if is_db_entry "$name-$artixver" "$repo";then | ||||
|                         is_entry=true | ||||
|                     fi | ||||
|                     if ! $is_entry; then | ||||
|                         msg_row "${table2}" "$repo" "$name" "$artixver" "$is_entry" | ||||
|                     fi | ||||
|                 done | ||||
|                 unset artixver is_entry pkgbuild pkgver epoch pkgname pkgbase | ||||
|             fi | ||||
|         done | ||||
|     done | ||||
| } | ||||
|  | ||||
| update_db_cache(){ | ||||
|     msg "Updating database cache" | ||||
|     for repo in "${searchrepos[@]}"; do | ||||
|         local cachedir=${USERCACHEDIR}/${LINKSDBEXT}/${ARCH}/${repo} | ||||
|         rm -rf "$cachedir" | ||||
|         mkdir -p "$cachedir" | ||||
|         msg2 "%s" "$repo" | ||||
|         curl -s "${REPOS_MIRROR}/${repo}/os/${ARCH}/${repo}.${LINKSDBEXT}" \ | ||||
|             | bsdtar -xf - -C "$cachedir" | ||||
|     done | ||||
|     msg "Done" | ||||
| } | ||||
|  | ||||
| query_db() { | ||||
|     msg_table_header "${table3}" "Repo" "Package" "Library" | ||||
|     for repo in "${searchrepos[@]}"; do | ||||
|         local prefix= | ||||
|         local db=${USERCACHEDIR}/${LINKSDBEXT}/${ARCH}/${repo}/ | ||||
|         if [[ -d ${db} ]]; then | ||||
|             while read -rd '' pkg; do | ||||
|                 read -r match | ||||
|                 pkg=${pkg#${db}} | ||||
|                 pkg="${pkg%/*}" | ||||
|  | ||||
|                 msg_row "${table3}" "${repo}" "${pkg}" "${match}" | ||||
|             done < <(grep -rZ "${library}" "${db}") | sort -u | ||||
|         fi | ||||
|     done | ||||
|     exit 0 | ||||
| } | ||||
|  | ||||
| show_version_table(){ | ||||
|  | ||||
|     if ${check};then | ||||
|         ${sync} && update_db_cache | ||||
|         msg_table_header "${table2}" "Repo" "Package" "Version" "Database" | ||||
|     elif ${query};then | ||||
|         ${sync} && update_db_cache | ||||
|         query_db | ||||
|     else | ||||
|         msg_table_header "${table}" "Arch Repo" "Artix Repo" "Package" "Arch version" "Artix version" "Group" | ||||
|     fi | ||||
|  | ||||
|     for tree in ${TREE_NAMES_ARTIX[@]};do | ||||
|  | ||||
|         local git=$(find ${TREE_DIR_ARTIX}/$tree/ -mindepth 1 -maxdepth 1 -type d) | ||||
|  | ||||
|         for package in ${git[@]}; do | ||||
|             if ${check};then | ||||
|                 check_db "$package" | ||||
|             else | ||||
|                 compare "$package" "$tree" | ||||
|             fi | ||||
|         done | ||||
|     done | ||||
| } | ||||
| @@ -98,14 +187,35 @@ staging=true | ||||
| upgrades=false | ||||
| downgrades=false | ||||
| move=false | ||||
| check=false | ||||
| sync=false | ||||
| query=false | ||||
|  | ||||
| artix_repos=( | ||||
|     'goblins' 'gremlins' 'system' 'world' | ||||
|     'galaxy-goblins' 'galaxy-gremlins' 'galaxy' | ||||
|     'lib32-goblins' 'lib32-gremlins' 'lib32' | ||||
|     'gnome-wobble' 'kde-wobble' | ||||
| ) | ||||
|  | ||||
| readonly table="%-20s %-20s %-25s %-25s %-25s %-20s" | ||||
| readonly table2="%-20s %-35s %-20s %-10s" | ||||
| readonly table3="%-20s %-45s %s" | ||||
|  | ||||
| searchrepos=(${artix_repos[@]}) | ||||
|  | ||||
| usage() { | ||||
|     echo "Usage: ${0##*/} [options]" | ||||
|     echo "Usage: ${0##*/} [options] (with -q [libname])" | ||||
|     echo '    -u            Show upgrade packages' | ||||
|     echo '    -d            Show downgrade packages' | ||||
|     echo '    -m            Show packages to move' | ||||
|     echo "    -x            Don't inlcude staging packages" | ||||
|     echo '    -y            Include unstable kde and gnome' | ||||
|     echo '    -c            Check repos' | ||||
|     echo "    -s            Sync repo databases" | ||||
|     echo "    -q            Query repo databases for so libs" | ||||
|     echo '    -r <repo>     Repo name to query' | ||||
|     echo '                  [default: all]' | ||||
|     echo '    -h            This help' | ||||
|     echo '' | ||||
|     echo '' | ||||
| @@ -114,7 +224,7 @@ usage() { | ||||
|  | ||||
| orig_argv=("$0" "$@") | ||||
|  | ||||
| opts='udmxyh' | ||||
| opts='r:qcsudmxyh' | ||||
|  | ||||
| while getopts "${opts}" arg; do | ||||
|     case "${arg}" in | ||||
| @@ -123,6 +233,10 @@ while getopts "${opts}" arg; do | ||||
|         m) move=true ;; | ||||
|         x) staging=false ;; | ||||
|         y) unstable=true ;; | ||||
|         c) check=true ;; | ||||
|         s) sync=true ;; | ||||
|         q) query=true ;; | ||||
|         r) searchrepos=("$OPTARG") ;; | ||||
|         h|?) usage 0 ;; | ||||
|         *) echo "invalid argument '${arg}'"; usage 1 ;; | ||||
|     esac | ||||
| @@ -130,4 +244,6 @@ done | ||||
|  | ||||
| shift $(($OPTIND - 1)) | ||||
|  | ||||
| library="$1"; shift | ||||
|  | ||||
| show_version_table | ||||
|   | ||||
| @@ -1,102 +0,0 @@ | ||||
| #!/bin/bash | ||||
| # | ||||
| # Copyright (C) 2018-19 artoo@artixlinux.org | ||||
| # Copyright (C) 2018 Artix Linux Developers | ||||
| # | ||||
| # This program is free software; you can redistribute it and/or modify | ||||
| # it under the terms of the GNU General Public License as published by | ||||
| # the Free Software Foundation; version 2 of the License. | ||||
| # | ||||
| # This program is distributed in the hope that it will be useful, | ||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
| # GNU General Public License for more details. | ||||
|  | ||||
| . @libdir@/artools/util-base.sh | ||||
| . @libdir@/artools/util-pkg.sh | ||||
|  | ||||
| # $1: sofile | ||||
| # $2: soarch | ||||
| process_sofile() { | ||||
|     # extract the library name: libfoo.so | ||||
|     local soname="${1%.so?(+(.+([0-9])))}".so | ||||
|     # extract the major version: 1 | ||||
|     soversion="${1##*\.so\.}" | ||||
|     if [[ "$soversion" = "$1" ]] && (($IGNORE_INTERNAL)); then | ||||
|         return | ||||
|     fi | ||||
|     if ! in_array "${soname}=${soversion}-$2" ${soobjects[@]}; then | ||||
|     # libfoo.so=1-64 | ||||
|         msg "${soname}=${soversion}-$2" | ||||
|         soobjects+=("${soname}=${soversion}-$2") | ||||
|     fi | ||||
| } | ||||
|  | ||||
| set -e | ||||
| shopt -s extglob | ||||
|  | ||||
| IGNORE_INTERNAL=0 | ||||
|  | ||||
| if [[ $1 = "--ignore-internal" ]]; then | ||||
|     IGNORE_INTERNAL=1 | ||||
|     shift | ||||
| fi | ||||
|  | ||||
| script_mode=${0##*/find-lib} | ||||
|  | ||||
| case $script_mode in | ||||
|     deps|provides) true;; | ||||
|     *) die "Unknown mode %s" "$script_mode" ;; | ||||
| esac | ||||
|  | ||||
| if [[ -z $1 ]]; then | ||||
|     echo "${0##*/} [options] <package file|extracted package dir>" | ||||
|     echo "Options:" | ||||
|     echo "    --ignore-internal      ignore internal libraries" | ||||
|     exit 1 | ||||
| fi | ||||
|  | ||||
| if [[ -d $1 ]]; then | ||||
|     pushd $1 >/dev/null | ||||
| else | ||||
|     WORKDIR=$(mktemp -d --tmpdir "${0##*/}.XXXXXXXXXX") | ||||
|  | ||||
|     case ${script_mode} in | ||||
|         deps) bsdtar -C "$WORKDIR" -xf "$1";; | ||||
|         provides) bsdtar -C "$WORKDIR" -xf "$1" --include="*.so*";; | ||||
|     esac | ||||
|  | ||||
|     pushd "$WORKDIR" >/dev/null | ||||
| fi | ||||
|  | ||||
| case $script_mode in | ||||
|     deps) find_args=(-perm -u+x);; | ||||
|     provides) find_args=(-name *.so*);; | ||||
| esac | ||||
|  | ||||
| find $PWD -type f "${find_args[@]}" | while read filename; do | ||||
|     if [[ $script_mode = "provides" ]]; then | ||||
|         # ignore if we don't have a shared object | ||||
|         if ! LC_ALL=C readelf -h "$filename" 2>/dev/null | grep -q '.*Type:.*DYN (Shared object file).*'; then | ||||
|             continue | ||||
|         fi | ||||
|     fi | ||||
|  | ||||
|     # get architecture of the file; if soarch is empty it's not an ELF binary | ||||
|     soarch=$(LC_ALL=C readelf -h "$filename" 2>/dev/null | sed -n 's/.*Class.*ELF\(32\|64\)/\1/p') | ||||
|     [[ -n $soarch ]] || continue | ||||
|  | ||||
|     if [[ $script_mode = "provides" ]]; then | ||||
|         # get the string binaries link to: libfoo.so.1.2 -> libfoo.so.1 | ||||
|         sofile=$(LC_ALL=C readelf -d "$filename" 2>/dev/null | sed -n 's/.*Library soname: \[\(.*\)\].*/\1/p') | ||||
|         [[ -z $sofile ]] && sofile="${filename##*/}" | ||||
|         process_sofile "${sofile}" "${soarch}" | ||||
|     elif [[ $script_mode = "deps" ]]; then | ||||
|         # process all libraries needed by the binary | ||||
|         for sofile in $(LC_ALL=C readelf -d "$filename" 2>/dev/null | sed -nr 's/.*Shared library: \[(.*)\].*/\1/p'); do | ||||
|             process_sofile "${sofile}" "${soarch}" | ||||
|         done | ||||
|     fi | ||||
| done | ||||
|  | ||||
| popd >/dev/null | ||||
| @@ -1,48 +0,0 @@ | ||||
| #!/bin/bash | ||||
| # | ||||
| # Copyright (C) 2018-19 artoo@artixlinux.org | ||||
| # Copyright (C) 2018 Artix Linux Developers | ||||
| # | ||||
| # This program is free software; you can redistribute it and/or modify | ||||
| # it under the terms of the GNU General Public License as published by | ||||
| # the Free Software Foundation; version 2 of the License. | ||||
| # | ||||
| # This program is distributed in the hope that it will be useful, | ||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
| # GNU General Public License for more details. | ||||
|  | ||||
| . @libdir@/artools/util-base.sh | ||||
|  | ||||
| match=$1 | ||||
|  | ||||
| if [[ -z $match ]]; then | ||||
|     echo 'Usage: finddeps <depname>' | ||||
|     echo '' | ||||
|     echo 'Find packages that depend on a given depname.' | ||||
|     echo 'Run this script from the top-level directory of your ABS tree.' | ||||
|     echo '' | ||||
|     exit 1 | ||||
| fi | ||||
|  | ||||
| find $PWD -type d | while read d; do | ||||
|     if [[ -f "$d/PKGBUILD" ]]; then | ||||
|         unset pkgname depends makedepends optdepends | ||||
|         . "$d/PKGBUILD" | ||||
|         for dep in "${depends[@]}"; do | ||||
|             # lose the version comparator, if any | ||||
|             depname=${dep%%[<>=]*} | ||||
|             [[ $depname = $match ]] && msg "$d (depends)" | ||||
|         done | ||||
|         for dep in "${makedepends[@]}"; do | ||||
|             # lose the version comparator, if any | ||||
|             depname=${dep%%[<>=]*} | ||||
|             [[ $depname = $match ]] && msg "$d (makedepends)" | ||||
|         done | ||||
|         for dep in "${optdepends[@]/:*}"; do | ||||
|             # lose the version comaparator, if any | ||||
|             depname=${dep%%[<>=]*} | ||||
|             [[ $depname = $match ]] && msg "$d (optdepends)" | ||||
|         done | ||||
|     fi | ||||
| done | ||||
| @@ -1,140 +0,0 @@ | ||||
| #!/bin/bash | ||||
| # | ||||
| #   sogrep - find shared library links in an Arch Linux repository. | ||||
| # | ||||
| #   Copyright (c) 2019 by Eli Schwartz <eschwartz@archlinux.org> | ||||
| #   Copyright (c) 2019 artoo@artixlinux.org | ||||
| # | ||||
| #   This program is free software; you can redistribute it and/or modify | ||||
| #   it under the terms of the GNU General Public License as published by | ||||
| #   the Free Software Foundation; either version 2 of the License, or | ||||
| #   (at your option) any later version. | ||||
| # | ||||
| #   This program is distributed in the hope that it will be useful, | ||||
| #   but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
| #   GNU General Public License for more details. | ||||
| # | ||||
| #   You should have received a copy of the GNU General Public License | ||||
| #   along with this program.  If not, see <https://www.gnu.org/licenses/>. | ||||
| # | ||||
|  | ||||
| . @libdir@/artools/util-base.sh | ||||
|  | ||||
| load_user_info | ||||
|  | ||||
| load_config "${USERCONFDIR}/artools/artools.conf" || load_config "${SYSCONFDIR}/artools.conf" | ||||
|  | ||||
| # options | ||||
| REFRESH=0 | ||||
| VERBOSE=0 | ||||
|  | ||||
| recache() { | ||||
|     local repo verbosity=-s | ||||
|  | ||||
|     (( VERBOSE )) && verbosity=--progress-bar | ||||
|  | ||||
|     for repo in "${ARTIX_REPOS[@]}"; do | ||||
|             rm -rf "${SOCACHE_DIR}/${ARCH}/${repo}" | ||||
|             mkdir -p "${SOCACHE_DIR}/${ARCH}/${repo}" | ||||
|             curl "$verbosity" "${SOLINKS_MIRROR}/${repo}/os/${ARCH}/${repo}.${LINKSDBEXT}" | bsdtar -xf - -C "${SOCACHE_DIR}/${ARCH}/${repo}" | ||||
|     done | ||||
| } | ||||
|  | ||||
| search() { | ||||
|     local repo=$1 lib=$2 srepos=("${ARTIX_REPOS[@]}") | ||||
|  | ||||
|     if [[ $repo != all ]]; then | ||||
|         if ! in_array "${repo}" "${ARTIX_REPOS[@]}"; then | ||||
|             echo "${BASH_SOURCE[0]##*/}: unrecognized repo '$repo'" | ||||
|             echo "Try '${BASH_SOURCE[0]##*/} --help' for more information." | ||||
|             exit 1 | ||||
|         fi | ||||
|         srepos=("${repo}") | ||||
|     fi | ||||
|  | ||||
|     for repo in "${srepos[@]}"; do | ||||
|         local prefix= | ||||
|         (( VERBOSE && ${#srepos[@]} > 1 )) && prefix=${repo}/ | ||||
|         db=${SOCACHE_DIR}/${ARCH}/${repo}/ | ||||
|         if [[ -d ${db} ]]; then | ||||
|             while read -rd '' pkg; do | ||||
|                 read -r match | ||||
|                 pkg=${pkg#${db}} | ||||
|                 pkg="${prefix}${pkg%-*-*/links}" | ||||
|  | ||||
|                 if (( VERBOSE )); then | ||||
|                     printf '%-45s %s\n' "${pkg}" "${match}" | ||||
|                 else | ||||
|                     printf '%s\n' "${pkg}" | ||||
|                 fi | ||||
|             done < <(grep -rZ "${lib}" "${db}") | sort -u | ||||
|         fi | ||||
|     done | ||||
| } | ||||
|  | ||||
| usage() { | ||||
|     cat <<- _EOF_ | ||||
|         Usage: ${BASH_SOURCE[0]##*/} [OPTIONS] REPO LIBNAME | ||||
|  | ||||
|         Check the soname links database for Artix Linux repositories containing | ||||
|         packages linked to a given shared library. If the repository specified | ||||
|         is "all", then all repositories will be searched, otherwise only the | ||||
|         named repository will be searched. | ||||
|  | ||||
|         If the links database does not exist, it will be downloaded first. | ||||
|  | ||||
|         OPTIONS | ||||
|             -v, --verbose   Show matched links in addition to pkgname | ||||
|             -r, --refresh   Refresh the links databases | ||||
|             -h, --help      Show this help text | ||||
| _EOF_ | ||||
| } | ||||
|  | ||||
| # utility function to resort with multiple repos + no-verbose | ||||
| resort() { sort -u; } | ||||
|  | ||||
| if (( $# == 0 )); then | ||||
|     echo "error: No arguments passed." | ||||
|     echo "Try '${BASH_SOURCE[0]##*/} --help' for more information." | ||||
|     exit 1 | ||||
| fi | ||||
| OPT_SHORT='vrh' | ||||
| OPT_LONG=('verbose' 'refresh' 'help') | ||||
| if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then | ||||
|     exit 1 | ||||
| fi | ||||
| set  -- "${OPTRET[@]}" | ||||
|  | ||||
| while :; do | ||||
|     case $1 in | ||||
|         -v|--verbose) | ||||
|             resort() { cat; } | ||||
|             VERBOSE=1 | ||||
|             ;; | ||||
|         -r|--refresh) | ||||
|             REFRESH=1 | ||||
|             ;; | ||||
|         -h|--help) | ||||
|             usage | ||||
|             exit 0 | ||||
|             ;; | ||||
|         --) | ||||
|             shift; break | ||||
|             ;; | ||||
|     esac | ||||
|     shift | ||||
| done | ||||
|  | ||||
| if ! (( ( REFRESH && $# == 0 ) || $# == 2 )); then | ||||
|     echo "error: Incorrect number of arguments passed." | ||||
|     echo "Try '${BASH_SOURCE[0]##*/} --help' for more information." | ||||
|     exit 1 | ||||
| fi | ||||
|  | ||||
| if (( REFRESH )) || [[ ! -d ${SOCACHE_DIR} ]]; then | ||||
|     recache | ||||
|     (( $# == 2 )) || exit 0 | ||||
| fi | ||||
|  | ||||
| search "$@" | ||||
| @@ -25,11 +25,19 @@ | ||||
| #         packages-kernel | ||||
| #         packages-openrc | ||||
| #         packages-runit | ||||
| #         packages-media | ||||
| #         packages-xorg | ||||
| #         packages-python | ||||
| #         packages-perl | ||||
| #         packages-qt5 | ||||
| #         packages-devel | ||||
| #         packages-ruby | ||||
| #         packages-gtk | ||||
| #         packages-gnome | ||||
| #         packages-cinnamon | ||||
| #         packages-lxqt | ||||
| #         packages-mate | ||||
| #         packages-kde | ||||
| # ) | ||||
|  | ||||
| # HOST_TREE_ARCH=git://git.archlinux.org/svntogit | ||||
| @@ -42,7 +50,7 @@ | ||||
| # REPOS_ROOT=${WORKSPACE_DIR}/repos | ||||
|  | ||||
| # default mirror for sogrep | ||||
| # SOLINKS_MIRROR="http://mirror1.artixlinux.org/repos" | ||||
| # REPOS_MIRROR="http://mirror1.artixlinux.org/repos" | ||||
|  | ||||
| ############################################# | ||||
| ################ artools-iso ################ | ||||
|   | ||||
| @@ -1,63 +0,0 @@ | ||||
| accountsservice | ||||
| cairo | ||||
| colord | ||||
| cppunit | ||||
| dbus | ||||
| dbus-glib | ||||
| dbus-python | ||||
| desktop-file-utils | ||||
| fontconfig | ||||
| geoclue2 | ||||
| glu | ||||
| gst-plugins-bad | ||||
| gst-plugins-base | ||||
| gst-plugins-good | ||||
| gst-plugins-ugly | ||||
| gstreamer | ||||
| harfbuzz | ||||
| hicolor-icon-theme | ||||
| libatasmart | ||||
| libbsd | ||||
| libdrm | ||||
| libevdev | ||||
| libinput | ||||
| libmbim | ||||
| libnice | ||||
| libqmi | ||||
| libvdpau | ||||
| libxcb | ||||
| libxft | ||||
| libxi | ||||
| media-player-info | ||||
| mesa | ||||
| modemmanager | ||||
| networkmanager | ||||
| orc | ||||
| p11-kit | ||||
| polkit | ||||
| poppler | ||||
| poppler-data | ||||
| pulseaudio | ||||
| pyxdg | ||||
| r | ||||
| sdl | ||||
| shared-mime-info | ||||
| sound-theme-freedesktop | ||||
| startup-notification | ||||
| systemdcompat | ||||
| telepathy-glib | ||||
| ttf-dejavu | ||||
| udisks2 | ||||
| upower | ||||
| wayland | ||||
| wayland-protocols | ||||
| webrtc-audio-processing | ||||
| xcb-proto | ||||
| xcb-util | ||||
| xcb-util-cursor | ||||
| xcb-util-image | ||||
| xcb-util-keysyms | ||||
| xcb-util-renderutil | ||||
| xcb-util-wm | ||||
| xdg-user-dirs | ||||
| xdg-utils | ||||
| @@ -1,63 +0,0 @@ | ||||
| adwaita-icon-theme | ||||
| atk | ||||
| at-spi2-atk | ||||
| at-spi2-core | ||||
| babl | ||||
| cantarell-fonts | ||||
| cogl | ||||
| dconf | ||||
| flatpak | ||||
| gamin | ||||
| gcab | ||||
| gconf | ||||
| gcr | ||||
| gdk-pixbuf2 | ||||
| gegl02 | ||||
| git | ||||
| glade | ||||
| glib2 | ||||
| glib-networking | ||||
| gnome-common | ||||
| gnome-keyring | ||||
| gobject-introspection | ||||
| gsettings-desktop-schemas | ||||
| gssdp | ||||
| gtk2 | ||||
| gtk3 | ||||
| gtk-doc | ||||
| gtksourceview3 | ||||
| gupnp | ||||
| gupnp-igd | ||||
| gvfs | ||||
| json-glib | ||||
| libcloudproviders | ||||
| libcroco | ||||
| libgee | ||||
| libglade | ||||
| libgnome-keyring | ||||
| libgudev | ||||
| libnotify | ||||
| librsvg | ||||
| libsecret | ||||
| libsoup | ||||
| libxml2 | ||||
| libxslt | ||||
| meld | ||||
| mobile-broadband-provider-info | ||||
| modemmanager | ||||
| networkmanager | ||||
| network-manager-applet | ||||
| orca | ||||
| ostree | ||||
| pango | ||||
| pyatspi | ||||
| pygobject | ||||
| pygobject2 | ||||
| pygtk | ||||
| rest | ||||
| ttf-bitstream-vera | ||||
| vala | ||||
| vte | ||||
| vte3 | ||||
| yelp-tools | ||||
| yelp-xsl | ||||
| @@ -1,4 +0,0 @@ | ||||
| phonon-gstreamer | ||||
| polkit-qt | ||||
| extra-cmake-modules | ||||
| phonon | ||||
| @@ -1,17 +0,0 @@ | ||||
| linux | ||||
| nvidia | ||||
| nvidia-utils | ||||
| acpi_call | ||||
| bbswitch | ||||
| broadcom-wl | ||||
| tp_smapi | ||||
| r8168 | ||||
| virtualbox-modules-artix | ||||
| linux-lts | ||||
| nvidia-lts | ||||
| acpi_call-lts | ||||
| bbswitch-lts | ||||
| broadcom-wl-lts | ||||
| tp_smapi-lts | ||||
| r8168-lts | ||||
| linux-firmware | ||||
| @@ -1,31 +0,0 @@ | ||||
| lxqt-about | ||||
| lxqt-admin | ||||
| lxqt-config | ||||
| lxqt-globalkeys | ||||
| lxqt-notificationd | ||||
| lxqt-openssh-askpass | ||||
| lxqt-panel | ||||
| lxqt-policykit | ||||
| lxqt-powermanagement | ||||
| lxqt-qtplugin | ||||
| lxqt-runner | ||||
| lxqt-session | ||||
| lxqt-sudo | ||||
| lxqt-themes | ||||
| lxqt-build-tools | ||||
|  | ||||
| compton-conf | ||||
| lximage-qt | ||||
| obconf-qt | ||||
| openbox | ||||
| pcmanfm-qt | ||||
| qterminal | ||||
| liblxqt | ||||
| libqtxdg | ||||
| lxmenu-data | ||||
| libfm-qt | ||||
| libfm | ||||
| qtermwidget | ||||
| libsysstat | ||||
| libstatgrab | ||||
| qps | ||||
| @@ -1,37 +0,0 @@ | ||||
| libdmx | ||||
| libfontenc | ||||
| libice | ||||
| libpciaccess | ||||
| libsm | ||||
| libx11 | ||||
| libxau | ||||
| libxaw | ||||
| libxcomposite | ||||
| libxcursor | ||||
| libxdamage | ||||
| libxdmcp | ||||
| libxext | ||||
| libxfixes | ||||
| libxfont2 | ||||
| libxi|libxft | ||||
| libxinerama | ||||
| libxkbfile | ||||
| libxkbui | ||||
| libxmu | ||||
| libxpm | ||||
| libxrandr | ||||
| libxrender | ||||
| libxres | ||||
| libxshmfence | ||||
| libxss | ||||
| libxt | ||||
| libxtst | ||||
| libxv | ||||
| libxvmc | ||||
| libxxf86vm | ||||
| pixman | ||||
| xbitmaps | ||||
| xkeyboard-config | ||||
| xorgproto | ||||
| xterm | ||||
| xtrans | ||||
| @@ -85,10 +85,14 @@ init_artools_pkg(){ | ||||
|             packages-python | ||||
|             packages-perl | ||||
|             packages-qt5 | ||||
|             packages-devel | ||||
|             packages-ruby | ||||
| #         packages-desktop | ||||
| #         packages-kde | ||||
| #         packages-gnome | ||||
|             packages-gtk | ||||
|             packages-gnome | ||||
|             packages-cinnamon | ||||
|             packages-lxqt | ||||
|             packages-mate | ||||
|             packages-kde | ||||
|     ) | ||||
|  | ||||
|     HOST_TREE_ARTIX=${HOST_TREE_ARTIX:-"gitea@${GIT_DOMAIN}:artixlinux"} | ||||
| @@ -103,23 +107,13 @@ init_artools_pkg(){ | ||||
|  | ||||
|     REPOS_ROOT=${REPOS_ROOT:-"${WORKSPACE_DIR}/repos"} | ||||
|  | ||||
|     SOLINKS_MIRROR=${SOLINKS_MIRROR:-'http://mirror1.artixlinux.org/repos'} | ||||
|  | ||||
|     SOCACHE_DIR="${XDG_CACHE_HOME:-$USER_HOME/.cache}/sogrep" | ||||
|     REPOS_MIRROR=${REPOS_MIRROR:-'http://mirror1.artixlinux.org/repos'} | ||||
|  | ||||
|     DBEXT=${DBEXT:-'xz'} | ||||
|  | ||||
|     LINKSDBEXT=${LINKSDBEXT:-"links.tar.${DBEXT}"} | ||||
|  | ||||
|     PKGDBEXT=${PKGDBEXT:-"db.tar.${DBEXT}"} | ||||
|  | ||||
|     [[ -z ${ARTIX_REPOS[@]} ]] && \ | ||||
|     ARTIX_REPOS=( | ||||
|         'goblins' 'gremlins' 'system' 'world' | ||||
|         'galaxy-goblins' 'galaxy-gremlins' 'galaxy' | ||||
|         'lib32-goblins' 'lib32-gremlns' 'lib32' | ||||
|         'gnome-wobble' 'kde-wobble' | ||||
|     ) | ||||
| } | ||||
|  | ||||
| init_artools_iso(){ | ||||
| @@ -185,6 +179,8 @@ load_user_info(){ | ||||
|  | ||||
|     USERCONFDIR="${XDG_CONFIG_HOME:-$USER_HOME/.config}" | ||||
|     prepare_dir "${USERCONFDIR}" | ||||
|  | ||||
|     USERCACHEDIR="${XDG_CACHE_HOME:-$USER_HOME/.cache}/artools" | ||||
| } | ||||
|  | ||||
| # orig_argv=("$0" "$@") | ||||
|   | ||||
| @@ -136,12 +136,24 @@ write_servicescfg_conf(){ | ||||
|     printf '%s' "${yaml}" | ||||
| } | ||||
|  | ||||
| write_unpackfs_conf(){ | ||||
|     local yaml=$(write_yaml_header) | ||||
|     yaml+=$(write_empty_line) | ||||
|     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_empty_line) | ||||
|     printf '%s' "${yaml}" | ||||
| } | ||||
|  | ||||
| configure_calamares(){ | ||||
|     local mods="$1/etc/calamares/modules" | ||||
|     if [[ -d "$mods" ]];then | ||||
|         msg2 "Configuring Calamares" | ||||
|         write_users_conf > "$mods"/users.conf | ||||
|         write_servicescfg_conf > "$mods"/services-"${INITSYS}".conf | ||||
|         [[ -z ${DESKTOP_LIST} ]] && write_unpackfs_conf > "$mods"/unpackfs.conf | ||||
|         sed -e "s|openrc|${INITSYS}|" -i "$mods"/postcfg.conf | ||||
|         sed -e "s|services-openrc|services-${INITSYS}|" -i "$1"/etc/calamares/settings.conf | ||||
|     fi | ||||
|   | ||||
| @@ -23,14 +23,12 @@ get_remote_head(){ | ||||
| get_pkg_org(){ | ||||
|     local pkg="$1" org= sub= | ||||
|     case ${pkg} in | ||||
|         ruby-*) org=${pkg:0:6}; sub="${org:5}"; echo "packagesRuby" ;; | ||||
|         perl-*) org=${pkg:0:6}; sub="${org:5}"; echo "packagesPerl" ;; | ||||
|         python-*) org=${pkg:0:8}; sub="${org:7}"; echo "packagesPython" ;; | ||||
|         python2-*) org=${pkg:0:9}; sub="${org:8}"; echo "packagesPython" ;; | ||||
|         lib32*) org=${pkg:0:7}; sub="${org:6}"; echo "packagesL" ;; #"packages${sub^^}" ;; | ||||
| #         lib*) org=${pkg:0:4}; sub="${org:3}"; echo "packagesLib${sub^^}" ;; | ||||
|         *) org=${pkg:0:1}; echo "packages${org^^}" ;; | ||||
|         ruby-*) org="packagesRuby" ;; | ||||
|         perl-*) org="packagesPerl" ;; | ||||
|         python-*|python2-*) org="packagesPython" ;; | ||||
|         *) sub=${pkg:0:1}; org="packages${sub^^}" ;; | ||||
|     esac | ||||
|     echo $org | ||||
| } | ||||
|  | ||||
| subrepo_push(){ | ||||
|   | ||||
| @@ -69,6 +69,25 @@ patch_pkg(){ | ||||
|     esac | ||||
| } | ||||
|  | ||||
| arch2artix(){ | ||||
|     local repo="$1" artix=none | ||||
|     case "$repo" in | ||||
|         core) artix=system ;; | ||||
|         extra) artix=world ;; | ||||
|         community) artix=galaxy ;; | ||||
|         multilib) artix=lib32 ;; | ||||
|         staging) artix=goblins ;; | ||||
|         testing) artix=gremlins ;; | ||||
|         community-staging) artix=galaxy-goblins ;; | ||||
|         community-testing) artix=galaxy-gremlins ;; | ||||
|         multilib-staging) artix=lib32-goblins ;; | ||||
|         multilib-testing) artix=lib32-gremlins ;; | ||||
|         kde-unstable) artix=kde-wobble ;; | ||||
|         gnome-unstable) artix=gnome-wobble ;; | ||||
|     esac | ||||
|     echo $artix | ||||
| } | ||||
|  | ||||
| find_tree(){ | ||||
|     local tree="$1" pkg="$2" | ||||
|     local result=$(find $tree -mindepth 2 -maxdepth 2 -type d -name "$pkg") | ||||
| @@ -76,22 +95,40 @@ find_tree(){ | ||||
|     echo ${result##*/} | ||||
| } | ||||
|  | ||||
| find_repo(){ | ||||
|     local pkg="$1" stag="$2" unst="$3" repo= | ||||
| arch_repos(){ | ||||
|     local stag="$1" unst="$2" | ||||
|     local repos=(core extra testing community community-testing multilib multilib-testing) | ||||
|  | ||||
|     $stag && repos+=(staging community-staging multilib-staging) | ||||
|     $unst && repos+=(gnome-unstable kde-unstable) | ||||
|  | ||||
|     for r in ${repos[@]};do | ||||
|     echo ${repos[@]} | ||||
| } | ||||
|  | ||||
| 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-any/PKGBUILD ]] && repo=$r-any | ||||
|     done | ||||
|     echo $repo | ||||
| } | ||||
|  | ||||
| is_valid_repo(){ | ||||
|     local src="$1" cases= | ||||
|     for r in $(arch_repos true true);do | ||||
|         cases=${cases:-}${cases:+|}${r} | ||||
|     done | ||||
|     eval "case $src in | ||||
|         ${cases}|trunk) return 0 ;; | ||||
|         *) return 1 ;; | ||||
|     esac" | ||||
| } | ||||
|  | ||||
| get_cases(){ | ||||
|     local pkglist="${DATADIR}/pkglists/$1.list" | ||||
|     local pkglist="${SYSCONFDIR}/pkglist.d/$1.list" | ||||
|  | ||||
|     local _space="s| ||g" _clean=':a;N;$!ba;s/\n/ /g' _com_rm="s|#.*||g" | ||||
|  | ||||
|     local pkgs=($(sed "$_com_rm" "$pkglist" | sed "$_space" | sed "$_clean")) | ||||
| @@ -107,22 +144,24 @@ get_artix_tree(){ | ||||
|     local pkg="$1" artix_tree="${2:-$3}" tree | ||||
|     eval "case $pkg in | ||||
|         $(get_cases kernel)) tree=packages-kernel ;; | ||||
|         python-*|python2-*) tree=packages-python ;; | ||||
|         perl-*) tree=packages-perl ;; | ||||
|         ruby-*) tree=packages-ruby ;; | ||||
|         xorg*|xf86*|$(get_cases xorg)) tree=packages-xorg ;; | ||||
|         *-openrc) tree=packages-openrc ;; | ||||
|         *-runit) tree=packages-runit ;; | ||||
|         qt5-*) tree=packages-qt5 ;; | ||||
|         lxqt*|$(get_cases lxqt)) tree=packages-lxqt ;; | ||||
|         $(get_cases python)) tree=packages-python ;; | ||||
|         $(get_cases perl)) tree=packages-perl ;; | ||||
|         $(get_cases ruby)) tree=packages-ruby ;; | ||||
|         $(get_cases openrc)) tree=packages-openrc ;; | ||||
|         $(get_cases runit)) tree=packages-runit ;; | ||||
|         $(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 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 ;; | ||||
|         *) tree=$artix_tree | ||||
|     esac" | ||||
|     echo $tree | ||||
|  | ||||
| #         $(get_cases freedesktop)) tree=packages-desktop ;; | ||||
| #         $(get_cases kde)) tree=packages-kde ;; | ||||
| #         $(get_cases gnome)) tree=packages-gnome ;; | ||||
|  | ||||
| } | ||||
|  | ||||
| get_import_path(){ | ||||
| @@ -143,14 +182,6 @@ pkgver_equal() { | ||||
|     fi | ||||
| } | ||||
|  | ||||
| is_valid_repo(){ | ||||
|     local src="$1" | ||||
|     case $src in | ||||
|         core|extra|community|multilib|testing|staging|community-testing|community-staging|multilib-testing|multilib-staging|trunk) return 0 ;; | ||||
|         *) return 1 ;; | ||||
|     esac | ||||
| } | ||||
|  | ||||
| find_cached_package() { | ||||
|     local searchdirs=("$PKGDEST" "$PWD") results=() | ||||
|     local targetname=$1 targetver=$2 targetarch=$3 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user