You are not logged in.

#1 2017-12-06 09:21:50

Cody Learner
Member
Registered: 2017-12-06
Posts: 7

aurt, yet another, but very minamilistic AUR assistant

UPDATE ABOUT AURT: Dec 14, 2017


What exactly is aurt?
It’s a simple, thin, wrapper shell script around makepkg, pacman, git, and cower, for the purpose of convenience. It uses existing, well proven, powerful tools, a handful of important commands, along with “convenience adding fluff” commands. It combines what I would use and do if building and installing AUR packages manually, into a single script, with enough feedback to know whats going on while running. For my use case, aurt has replaced pacaur without the penalty of any added inconvenience.

Why another AUR helper?
    I saw writing this script as a perfect opportunity to learn more about Arch and shell scripting. After getting a functioning concept, I thought others may find it useful.

Who would want to use this?
    Likely no one, after all it’s written by an unknown, who is inexperienced at scripting.
    Those wanting and able to deal with their own custom AUR management solution.
    Those experienced enough to read the script as safe, using it as a starting point for customization.
    The above, opting for the simple, minimalist convenience aurt offers, using it as is.
    Those preferring cli pacman directly for official repo packages, while preferring a separate solution for AUR package management.

Who would NOT want use this?
    Those having not mastered at all aspects of manual AUR management.
    Those wanting a well proven with track record, stable, hands off, turnkey AUR solution.
    Those having more than a dozen or so AUR packages.
    Those wanting automation of AUR stuff on the level that pacman provides for official repo packages.
    Those wanting a single solution for all package management.
    Those not wanting to handle AUR packages individually, one at a time.

What differentiates aurt?  Why a 175 line script for a small handful of 'important' commands?
    It's different in it’s presentation and offering as a script / template, and nothing more.
    '175 line script'? Because it makes things more convenient for me and I enjoy writing and using it.

Goals and future?
    It has already met my goals so I'll likely not expand on it.  EDIT: I may occasionally post updates.
    Keep the script as simply as possible so myself and others can modify to suite.
    Don't implement any code I don't have my head around and understand what it is doing.
    Post it on the Arch forums as a first real contribution after many years (AIF days) as a user.
    Hear of anyone who may find it useful.
    No plan on maintenance outside my personal use or offering it as an AUR package.



Dec 13, 2017 Update: Implemented some of the suggestions made below. Did some minor testing, ran through shellcheck. Comes in at about * 175 lines with about 120 lines code, the rest is a header, help page, and run messages. Added a few simple features. The most worthy of mention is a stop with message encouraging the user to use the $EDITOR feature for PKGBUILD check before continuing with building / installing." See below:

Feature list

------------------------------------------------------------------
             Usage: aurt [operation] [package name]
 ------------------------------------------------------------------

             Operation: -S  = Install AUR package

             Operation: -R  = Remove AUR package

             Operation: -C  = Check for AUR updates

             Operation: -s  = Search for AUR package

             Operation: -D  = Download AUR package & AUR deps

             Operation: -h  = Aurt help page

             Operation: -ch  = Cower help page

             Operation: -p  = Show pacman.log

 ------------------------------------------------------------------
  -D operation downloads dependencies that are AUR packages.
  In this case, the dependencies are placed within the package
  build directory. These AUR packages will need manual build
  and installation, in the correct order.
 ------------------------------------------------------------------
    -S checks 4 udates, builds if avail, installs in this order
      -R option = pacman -Rns + rm package build dir & log

Latest aurt script

#!/bin/bash
# aurt, a tiny AUR helper script. [Dependencies: sudo, base-devel, git, cower]
# Version: December 13, 2017
# Attribute: Dave Reisner aka falconindy @ Arch Linux for cower https://github.com/falconindy/cower
# Using cower for searching and handling of uninstalled AUR dependency features.
# Attribute: @Arch Linux community: Trilby, "Pacman Development Team", Alad, Eschwartz
#
header () {
cat << Read-Header

 --------------------------------------------------------------------------------
    Aurt, a tiny AUR helper script.       USAGE: \$ aurt [operation] [package]
 --------------------------------------------------------------------------------
  -S Install    -R Remove    -C Check Updates    -s Search    -D Download deps
         -p pacman log               -ch Cower Help               -h Help
 --------------------------------------------------------------------------------
    thunar-base dir:  tbd      leafpad-aurt:  lart      Orphans: R \$(p -Qtdq)
 --------------------------------------------------------------------------------
                           Edit these notes to suite.                        
 --------------------------------------------------------------------------------

Read-Header
}

basedir="${HOME}"/z-AUR-Auto/aurt-built
builddir="${HOME}"/z-AUR-Auto/aurt-built/"${2}"

install() {

	exec &> >(tee -i "${basedir}"/$"{2}".log)
if	[[ -d ${builddir}/.git ]] &&
	[[ $(git -C "${builddir}" rev-parse HEAD) = $(git -C "${builddir}" rev-parse @\{upstream\}) ]]
	then
		echo ; echo "    Git reports ${2} is up to date. NOTHING TO DO, EXITING." ; echo ; exit
fi
if	[[ -d ${builddir}/.git ]] ; then
	cd "${builddir}" || exit
	git reset --hard HEAD
	git merge
else
	cd "${basedir}" || exit
	git clone https://aur.archlinux.org/"${2}".git
fi
	cd "${builddir}" || exit
	echo
	echo "   It's recommend to inspect the PKGBUILD prior to building the package"
	echo "   After inspection, close your editor to continue." ; echo
while true; do
	read -r -p "  Proceed to PKGBUILD? [Y/n] " yn
case $yn in
	y) $EDITOR PKGBUILD ; break 
	;;
	n) break 
	;;
	* ) echo " y or n " 
	;;
esac
done	
	makepkg -si --needed
}

remove() {

	exec &> >(tee -i "${basedir}"/"${2}".log)
	ls -la "${basedir}" ; echo
		echo "   Do you want to delete ${builddir} & ${2}.log now?"
		echo "   NEXT: Running sudo pacman -Rns ${2}, rm -fr ${builddir}" ; echo
while true; do
	read -r -p "  Proceed? [Y/n] " yn
case $yn in
	y) break 
	;;
	n) exit 
	;;
	* ) echo " y or n " 
	;;
esac
done
        rm -fr "${builddir}"
	rm "${basedir}"/"${2}".log
	sudo pacman -Rns "${2}"
}

search() {

	echo "Searching .............." ; echo
	cower -qs --by=name "${2}"
	number=$(cower -qs --by=name "${2}" | wc -l)
	echo ; echo " Found: ${number} packages above with ${2} in name." ; echo
	echo " If there is an exact match, details shown below." ; echo
	cower -i "${2}" ; echo
}

download-dep () {

	mkdir "${basedir}"/"${2}" 2> /dev/null
	cower -fdd "${2}" -t "${basedir}"/"${2}"
	dpkgs=$(ls "${basedir}"/"${2}") ; echo
	echo "Downloaded:          Note: Function runs 'cower -fdd', -f opt forces overwrite. " ; echo
	echo "$dpkgs"
						## cd "${builddir}"/"${2}"    ## makepkg -si --needed ; echo makepkg "$?" ; echo
	echo "   Downloaded packages base dir: ${basedir}/${2}" ; echo
	echo "   cd to 'base dir'/pkg.name and use makepkg to build "
	echo "   Note: The dep's must be installed in correct order, or all same time" ; echo
}

help () {

cat << Read-Help 
 ------------------------------------------------------------------
             Usage: aurt [operation] [package name]
 ------------------------------------------------------------------

             Operation: -S  = Install AUR package

             Operation: -R  = Remove AUR package

             Operation: -C  = Check for AUR updates

             Operation: -s  = Search for AUR package

             Operation: -D  = Download AUR package & AUR deps

             Operation: -h  = Aurt help page

             Operation: -ch  = Cower help page

             Operation: -p  = Show pacman.log

 ------------------------------------------------------------------
  -D operation downloads dependencies that are AUR packages.
  In this case, the dependencies are placed within the package
  build directory. These AUR packages will need manual build
  and installation, in the correct order.
 ------------------------------------------------------------------
    -S checks 4 updates, builds if avail, installs in this order
      -R option = pacman -Rns + rm package build dir & log
 ------------------------------------------------------------------
               EXAMPLE:    $ aurt -S cower
 ------------------------------------------------------------------

Read-Help
}

#    |Operation|Function-Command|Parameter passed|

case "${1}" in
	    -S)
		install		"${@}"
		;;
	    -R)
		remove		"${@}"
		;;
	    -C)
		cower -uv
		;;
	    -s)
		search		"${@}"
		;;
	    -D)
		download-dep	"${@}"
		;;
	    -h)
		help
		;;
 	   -ch)
		cower -h
		;;
	    -p)
		cat /var/log/pacman.log
		;;
	     *)
		header
esac
shift











Yet another one, I know but I was bored. This is small ~110 lines actual code, 1/2 of which are echo's, and simple enough to easily read whats going on. My first time using variable parameters. Ran a few tests so far. Seems to work ok. I'm a self taught absolute newb with scripting so proceed with caution. Would be very interested to hear any constructive criticism from some of the many smart people here. I stole an elephant to use, hope you don't mind. I'll follow up with a name to attribute the pacman elephant and interested to hear anything about it.

Combined everything into a single script @ around 140 * lines. Hope someone finds it useful. It would be cool to see some user engagement and collaboration to fix some of the rough edges. I'm done with it as it works for me, but I'll likely lurk in the background to see if anything ever becomes of it.
Enjoy!

Last edited by Cody Learner (Today 20:17:14)

Online

#2 2017-12-06 09:49:17

slithery
Member
Registered: 2013-12-01
Posts: 2,080

Re: aurt, yet another, but very minamilistic AUR assistant

Some of your variables need quoting, run it through shellcheck.net to see what I mean.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan

aur - dotfiles

Offline

#3 2017-12-06 09:52:31

Alad
Wiki Admin/IRC Op/TU
From: The Land of The Bloat
Registered: 2014-05-04
Posts: 1,678
Website

Re: aurt, yet another, but very minamilistic AUR assistant

I'm having some trouble reading what's going on here - Try to avoid things like putting blocks on a single line to test if the output matches some string.

Otherwise it seems you've written 110 lines to basically run three commands - git clone, git pull and makepkg -si. Not sure why you're running git clone after running git pull either.


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby
Honest Alad's Package Emporium—Now with added bugs! (Closed until further notice)

Offline

#4 2017-12-06 10:44:08

Seventh
Member
Registered: 2016-08-05
Posts: 19

Re: aurt, yet another, but very minamilistic AUR assistant

Whats the difference in what Trillby posted here? https://bbs.archlinux.org/viewtopic.php … 2#p1752342

Offline

#5 2017-12-06 21:03:49

Cody Learner
Member
Registered: 2017-12-06
Posts: 7

Re: aurt, yet another, but very minamilistic AUR assistant

slithery wrote:

Some of your variables need quoting, run it through shellcheck.net to see what I mean.

Thanks slithery, ran it through shellcheck and fixed everything i think.

Alad wrote:

I'm having some trouble reading what's going on here - Try to avoid things like putting blocks on a single line to test if the output matches some string.

Otherwise it seems you've written 110 lines to basically run three commands - git clone, git pull and makepkg -si. Not sure why you're running git clone after running git pull either.

Thanks Alad. I guess readability would be pretty subjective depending on skills, etc. It seems easy to me - or could likely be said of whoever wrote a script... I'd like to try learn whats more "standard" so everyone including myself sees it as easy to read. I get lost reading most scripts unless I really dissect and work on one, but I'm very inexperienced. Shorter seems easier though. Do people tend to all have distinctive styles of writing shell, or is it pretty standardized?

You mean like the one below? Would you put the "Already up to date." into another variable or? I'm sure there are cleaner ways to check for updates, but this one just popped into thought while working on it. Are there any others that stand out as needing attention? Oh and in case it's not obvious and if I screwed up on my methods, I try avoid git for the most part. It hurts my brain for some reason.

if [[ $(cd "${builddir}" ; git pull 2> /dev/null) = "Already up to date." ]] ; then

This script started out a copy and paste of Trilby's 3 lines. I just kept testing, adding, wanting more, etc. I like feedback in the shell on whats going on during running someones script. I tend to focus on that too much, and end up with something that is 3 - 4 times longer than necessary just to satisfy my ocd with it. I do find it entertaining to try write shell for some odd reason though. Prolly cause it's not remotely related to what I do for work, which petty much discourages using your brain to think.

Running git pull to check for updates, then delete the directory to start clean with clone.

@ Seventh, did you see the attribute to Tribly in the script? Trilby got my thought process going with his example so I ran with it and considered his input worthy of mention. I could have stopped at probably 10 lines, but like I said, I enjoy it and just got carried away.

I've used pacaur for some time. I have looked at the script and was honestly completely lost. For the limited features of pacaur I use (pacaur -S) I think the 20 or so lines of code actually doing something in my script could replace that functionality to suite my preferred requirements. The rest just make it more enjoyable to use for me...lol. Pacman and makepkg and now git are pretty much 99% of my solution. I just glued it together with the remaining 1% to my liking.

Enjoying the feedback. I'll post the updates below. I added a yes no during removal regarding deletion of files. I'm also getting some minor unwanted issues I'm unsure of on how to solve. For the help and show log options, the positional variables are unset. This leads to a .log file being produced on the base directory. The log is of whatever is on my screen. I could I do a if else to disable logging for those options, but hopefully learn of something simpler.


#!/bin/bash
# By Cody Learner
# aurt's a tiny AUR script to complement pacman + pkgbrowser use.
# aurt's designed to handle AUR packages one at a time. 
#
# Attribute Trilby @ arch forums for the meat* of this script. 
# https://bbs.archlinux.org/viewtopic.php?pid=1752342#p1752342
# *Providing the idea & sample commands, inspiring me.
#------------------------------------------------------------------
#		bash  "positional parameters"
#------------------------------------------------------------------
#		$0 would contain "a_program_name"
#		$1 would contain "word1"
#		$2 would contain "word2"
#		$3 would contain "word3"
#------------------------------------------------------------------
#  Define:     [COMMAND]   -[OPTIONS]     [PACKAGE]     [Not Used]
#------------------------------------------------------------------
#  Example:  |    aurt    |     -I     |  pkgbrowser  |     NR    |
#------------------------------------------------------------------
#  Position: |    $0	  |     $1     |     $2       |	    $3    |
#------------------------------------------------------------------
# echo "$@" ($@ in bouble quotes) expands all parameters
# Function commands follwed by "$@" passes positional parameters to functions.

#============================= START SCRIPT ================================

echo -----------------------------------------------------------------------
echo " aurt, a tiny AUR assistant.   UEAGE: aurt [option] [package]        "
echo " [-I] install [-R] remove [-h] help [-l] pacman log [no combinations] "
echo -----------------------------------------------------------------------
echo

#----------------------------
#   SET VARIABLES & LOGGING
#----------------------------
# parameter $1 = -[OPTIONS] Entered when calling aurt 
# parameter $2 =  [PACKAGE] Entered when calling aurt

basedir=${HOME}/z-AUR-Auto/aurt-built
builddir=${HOME}/z-AUR-Auto/aurt-built/${2}

touch "${basedir}"/"${2}".log 
exec &> >(tee -i "${basedir}/${2}.log")

#------------------------
# Some messages to echo 
#-----------------------

      if   [[ ${1} = -I ]] ; then
	echo "    Installing $2"

      elif [[ ${1} = -R ]] ; then
	echo "    Removing $2 with pacman -Rns and rm -r ${builddir} and ${2}.log"
      fi
echo

#------------------------
# Begin INSTALL function
#------------------------
install() {

	echo "    '${builddir}' variable set to: ${builddir}"
echo
     if [ -e  "${builddir}" ] ; then
	echo "    Build directory is already present, check if update available via git pull." ; echo
	else
	mkdir "${builddir}"
      fi

      if [[ $(cd "${builddir}" ; git pull 2> /dev/null) = "Already up to date." ]] ; then
	echo "    Git pull indicates ${2} is up to date. Nothing to do. Exiting aurt" - exit code $? ; echo ; exit
echo
	else
	cd "${basedir}" || exit
	echo "    Git pull indicates update available for ${2}, cd to ${basedir}, preparing for git clone."
echo
	rm -fr "${builddir}" 
	git clone https://aur.archlinux.org/"${2}".git
      fi
echo
	cd "${builddir}" || exit
	echo "    cd back into ${builddir} to run makepkg -si "
echo
	makepkg -si --needed
echo
}

#-----------------------
# Begin REMOVE function
#-----------------------
remove() {
echo ----------------------------------------------------
	echo " PACMAN:"
echo
	sudo pacman -Rns "${2}"
echo ----------------------------------------------------
echo
echo ----------------------------------------------------
echo " ls -al ${basedir}"
echo
	ls -al "${basedir}"
echo ----------------------------------------------------
echo
echo "  Deleting files mentioned above." 
	yes-no
echo
	sudo rm -r "${builddir}"
	sudo rm "${basedir}/${2}".log
echo
echo ----------------------------------------------------
echo " ls -al ${basedir}"
echo
	ls -al "${basedir}"
echo ----------------------------------------------------
echo
	echo "   Remove function completed. - exit code $? "
echo
}

#-----------------------
# Begin YES-NO function
#-----------------------
yes-no () {
while true; do 
 read -r -p "  Proceed? " yn
    case $yn in
        [Yy]* ) break;;
        [Nn]* ) exit;;
        * ) echo "yes or no.";;
    esac
done
}

#--------------------
#   RUN FUNCTIONS
#--------------------

      if [[ "$1" == "-I" ]]; then
    	install "$@"                    #  RUN INSTALL #

	elif [[ "$1" == "-R" ]]; then
	remove "$@"                     #  RUN REMOVE  #

	elif [[ "$1" == "-h" ]]; then
	aurt-help                       #   RUN HELP   #

	elif [[ "$1" == "-l" ]]; then
	cat /var/log/pacman.log; echo	#  PACMAN LOG  #
      fi

echo "  aurt's done exit code $? 'zero is good!'"

Here's what I mean by feedback from the script.

$ aurt -I cower
-----------------------------------------------------------------------
 aurt, a tiny AUR assistant.   UEAGE: aurt [option] [package]        
 [-I] install [-R] remove [-h] help [-l] pacman log [no combinations] 
-----------------------------------------------------------------------

    Installing cower

    '/home/cody/z-AUR-Auto/aurt-built/cower' variable set to: /home/cody/z-AUR-Auto/aurt-built/cower

    Git pull indicates update available for cower, cd to /home/cody/z-AUR-Auto/aurt-built, preparing for git clone.

Cloning into 'cower'...

    cd back into /home/cody/z-AUR-Auto/aurt-built/cower to run makepkg -si 

==> Making package: cower 17-2 (Wed Dec  6 11:50:02 PST 2017)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading cower-17.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 25661  100 25661    0     0  25661      0  0:00:01  0:00:01 --:--:-- 17233
  -> Downloading cower-17.tar.gz.sig...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   310  100   310    0     0    310      0  0:00:01  0:00:01 --:--:--   298
==> Validating source files with md5sums...
    cower-17.tar.gz ... Passed
    cower-17.tar.gz.sig ... Skipped
==> Verifying source file signatures with gpg...
    cower-17.tar.gz ... Passed
==> Extracting sources...
  -> Extracting cower-17.tar.gz with bsdtar
==> Starting build()...
cc -Wclobbered -Wempty-body -Wfloat-equal -Wignored-qualifiers -Wmissing-declarations -Wmissing-parameter-type -Wsign-compare -Wmissing-prototypes -Wold-style-declaration -Wtype-limits -Woverride-init -Wunused -Wstrict-prototypes -Wuninitialized -std=c99 -g -pthread -pedantic -Wall -Wextra -fstack-protector-strong -O2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -D_GNU_SOURCE -DCOWER_VERSION=\"17\" -D_FORTIFY_SOURCE=2  -c -o cower.o src/cower.c
cc -Wclobbered -Wempty-body -Wfloat-equal -Wignored-qualifiers -Wmissing-declarations -Wmissing-parameter-type -Wsign-compare -Wmissing-prototypes -Wold-style-declaration -Wtype-limits -Woverride-init -Wunused -Wstrict-prototypes -Wuninitialized -std=c99 -g -pthread -pedantic -Wall -Wextra -fstack-protector-strong -O2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -D_GNU_SOURCE -DCOWER_VERSION=\"17\" -D_FORTIFY_SOURCE=2  -c -o aur.o src/aur.c
cc -Wclobbered -Wempty-body -Wfloat-equal -Wignored-qualifiers -Wmissing-declarations -Wmissing-parameter-type -Wsign-compare -Wmissing-prototypes -Wold-style-declaration -Wtype-limits -Woverride-init -Wunused -Wstrict-prototypes -Wuninitialized -std=c99 -g -pthread -pedantic -Wall -Wextra -fstack-protector-strong -O2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -D_GNU_SOURCE -DCOWER_VERSION=\"17\" -D_FORTIFY_SOURCE=2  -c -o package.o src/package.c
pod2man --section=1 --center="Cower Manual" --name="COWER" --release="cower 17" README.pod cower.1
src/cower.c: In function ‘parse_options’:
src/cower.c:1194:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
         cfg.sortorder = SORT_REVERSE;
         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~
src/cower.c:1195:7: note: here
       case OP_SORT:
       ^~~~
cc -pthread  -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now  cower.o aur.o package.o  -lcurl -lalpm -lyajl -larchive -o cower
==> Entering fakeroot environment...
==> Starting package()...
install -D -m755 cower "/home/cody/z-AUR-Auto/aurt-built/cower/pkg/cower/usr/bin/cower"
install -D -m644 cower.1 "/home/cody/z-AUR-Auto/aurt-built/cower/pkg/cower/usr/share/man/man1/cower.1"
install -D -m644 extra/bash_completion "/home/cody/z-AUR-Auto/aurt-built/cower/pkg/cower/usr/share/bash-completion/completions/cower"
install -D -m644 extra/zsh_completion "/home/cody/z-AUR-Auto/aurt-built/cower/pkg/cower/usr/share/zsh/site-functions/_cower"
install -D -m644 config "/home/cody/z-AUR-Auto/aurt-built/cower/pkg/cower/usr/share/doc/cower/config"
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issue...
==> Creating package "cower"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: cower 17-2 (Wed Dec  6 11:50:08 PST 2017)
==> Installing package cower with pacman -U...
[sudo] password for cody: 
warning: cower-17-2 is up to date -- skipping
loading packages...
 there is nothing to do

  aurt's done exit code 0 'zero is good!'



$ aurt -R cower
-----------------------------------------------------------------------
 aurt, a tiny AUR assistant.   UEAGE: aurt [option] [package]        
 [-I] install [-R] remove [-h] help [-l] pacman log [no combinations] 
-----------------------------------------------------------------------

    Removing cower with pacman -Rns and rm -r /home/cody/z-AUR-Auto/aurt-built/cower and cower.log

----------------------------------------------------
 PACMAN:

[sudo] password for cody: 
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: pacaur: removing cower breaks dependency 'cower'
----------------------------------------------------

----------------------------------------------------
 ls -al /home/cody/z-AUR-Auto/aurt-built

total 32
drwxr-xr-x 4 cody cody 4096 Dec  6 11:35 .
drwxr-xr-x 3 cody cody 4096 Dec  5 11:38 ..
drwxr-xr-x 5 cody cody 4096 Dec  6 11:35 cower
-rw-r--r-- 1 cody cody  459 Dec  6 11:37 cower.log
-rw-r--r-- 1 cody cody 1041 Dec  6 11:29 .log
drwxr-xr-x 5 cody cody 4096 Dec  6 01:58 pkgbrowser
-rw-r--r-- 1 cody cody 4755 Dec  6 01:58 pkgbrowser.log
----------------------------------------------------

  Deleting files mentioned above.
  Proceed? y


----------------------------------------------------
 ls -al /home/cody/z-AUR-Auto/aurt-built

total 24
drwxr-xr-x 3 cody cody 4096 Dec  6 11:37 .
drwxr-xr-x 3 cody cody 4096 Dec  5 11:38 ..
-rw-r--r-- 1 cody cody 1041 Dec  6 11:29 .log
drwxr-xr-x 5 cody cody 4096 Dec  6 01:58 pkgbrowser
-rw-r--r-- 1 cody cody 4755 Dec  6 01:58 pkgbrowser.log
----------------------------------------------------

   Remove function completed. - exit code 0 

  aurt's done exit code 0 'zero is good!'
$ aurt -h
-----------------------------------------------------------------------
 aurt, a tiny AUR assistant.   UEAGE: aurt [option] [package]        
 [-I] install [-R] remove [-h] help [-l] pacman log [no combinations] 
-----------------------------------------------------------------------


  ################## aurt: a tiny aur helper ##################


          #    Usage: aurt [option] [package name]    #

          #    Option: -I = Install AUR package       #

          #    Option: -R = Remove  AUR package       #

          #    Option: -h = This help message         #

  # -I checks 4 udates, builds if avail, installs in this order #
   # -R option = pacman -Rns + aurt removes package build dir #

              EXAMPLE:    $ aurt -I pkgbrowser


  ###############################################################

     __
    '. \
     '- \
      / /_         .---.
     / | \\,.\/--.//    )
     |  \//        )/  /
      \  ' ^ ^    /    )____.----..  6
       '.____.    .___/            \._)
          .\/.                      )
           '\                       /
           _/ \/    ).        )    (
          /#  .!    |        /\    /
          \  C// #  /'-----''/ #  /
       .   'C/ |    |    |   |    |mrf  ,
       \), .. .'OOO-'. ..'OOO'OOO-'. ..\(,

  aurt's done exit code 0 'zero is good!'

Last edited by Cody Learner (2017-12-06 21:28:08)

Online

#6 2017-12-06 22:21:29

Alad
Wiki Admin/IRC Op/TU
From: The Land of The Bloat
Registered: 2014-05-04
Posts: 1,678
Website

Re: aurt, yet another, but very minamilistic AUR assistant

Cody Learner wrote:
slithery wrote:

Some of your variables need quoting, run it through shellcheck.net to see what I mean.

Do people tend to all have distinctive styles of writing shell, or is it pretty standardized?

There's some technical aspects that verge on style, such as avoiding echo and using [[ instead of [ or test. Other constructs have definite drawbacks, such as parsing "ls" output and should be avoided. In doubt, check BashFAQ:

http://mywiki.wooledge.org/BashFAQ

You mean like the one below? Would you put the "Already up to date." into another variable or? I'm sure there are cleaner ways to check for updates, but this one just popped into thought while working on it. Are there any others that stand out as needing attention? Oh and in case it's not obvious and if I screwed up on my methods, I try avoid git for the most part. It hurts my brain for some reason.

Checking for git updates is unfortunately not a trivial matter since "git fetch" always returns 0 for some reason. You can however use git rev-parse, which doesn't depend on locale output (if you stick to checking the string "Already up to date", you should prefix the command with LC_MESSAGES=C). See the example below.

Running git pull to check for updates, then delete the directory to start clean with clone.

If you want to start fresh, you can just run "git reset --hard HEAD" with "git merge" since that doesn't involve the overhead of cloning a repository all over. For example:

https://github.com/AladW/aurutils/blob/ … ch#L10-L34

I've used pacaur for some time. I have looked at the script and was honestly completely lost.

I think anyone who looks at that script will inevitably be completely lost, regardless of experience level.

For the help and show log options, the positional variables are unset. This leads to a .log file being produced on the base directory. The log is of whatever is on my screen. I could I do a if else to disable logging for those options, but hopefully learn of something simpler.

I suggest looking into getopts.

http://wiki.bash-hackers.org/howto/getopts_tutorial

Last edited by Alad (2017-12-06 22:28:36)


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby
Honest Alad's Package Emporium—Now with added bugs! (Closed until further notice)

Offline

#7 2017-12-06 23:40:51

Eschwartz
Bug Wrangler
Registered: 2014-08-08
Posts: 1,306

Re: aurt, yet another, but very minamilistic AUR assistant

In addition to what was mentioned above, I'm slightly triggered by your use of POSIX [ in a bash script...

Either use bash [[ or declare your script to run with #!/bin/sh and scrupulously avoid bashisms.

...

You're also *extremely inconsistent about quoting, as in you'll take the same command and quote it once, then fail to quote it the next time. FWIW you can just standardize on *not* quoting inside a bash [[ keyword, since that is one of the significant reasons why the [[ keyword exists in preference to the [ builtin.

Offline

#8 2017-12-08 02:02:49

Cody Learner
Member
Registered: 2017-12-06
Posts: 7

Re: aurt, yet another, but very minamilistic AUR assistant

OK, I revised things, implementing more KISS this time. The new version comes in at ~ 40 lines.

Again, I've done minimal testing so you all (not you guys) know the drill. Appreciate all the feedback and hope to learn enough to create a really decent quality script in the end. Need to spend some time with getopts. I removed the -l "cat pacman.log" and the -h help add on for the time being. I need to reevaluate logging implementation as well. Likely overkill other than for testing.

@Alad, Thanks for the rev-parse and other git related info. I ended up using it BIG time to get away from "Already up to date" in test. Didn't think about how fragile that was, different language would break it. Makes sense now! Got rid of all the non essential echo messages, etc.  You mentioned parsing ls. Is using test on the filesystem doing that? Echo, are you talking in just using it for messages and the clutter it can cause, or more as in redirecting it to append files. Can't think of any other possible uses or abuses off top of my head? I do reference Greg's bash page often when I get stuck. I'd actually recommend to include gregs with bash and whatever term need to know for anyone learning shell. Nice source of info. Still want to learn about getopts. I need to read and play around with it.I just spent some time with positional variables testing in mini scripts to get my head around the concept.


@Eschwartz, Lol I honestly just overlooked that. At my level of shell scripting, the thought of POSIX, bash, zsh and or any other compatibility differences are well beyond me. Just trying to get solid footing on the basics. With that said though, it would be cool to make it compatible with at least the popular ones here. You think bash and zshell would cover it? How much different for what I'm doing with this script? I've never looked into the requirements, only see it mentioned occasionally. Quoting, well I do need to get that down,. For some reason I started {using} for variables, prior to that, it was "quotes". Somehow in the transition, I think I got worse with consistent quoting. Shellcheck had me quoting where I would have not thought to, but I'm sure it's better safe than sorry. Thanks for the heads up on [[ keyword stuff. Good to know. I also hope to eventually pick up all the correct terminology so I can communicate in a meaningful way.

Keep it coming guys. Please continue to point out anything I may want to change, new concepts, sources of info, terminology etc.

Ran aurt on a google-chrome update today. Seemed like a quick update. Is it possible AUR pac-helpers could slow down the compile times. I'd think they all make use of makepkg directly. Probably just me, a my widget has to be faster than your widget thing.

EDIT: Shellcheck online, trying to get me to double quote and or escape in this line. Tried implementing their recommended, still flagged. It works OK in bash on my system. https://github.com/koalaman/shellcheck/wiki/SC1083

[[ $(git -C ${builddir} rev-parse HEAD) = $(git -C ${builddir} rev-parse @{upstream}) ]]
#!/bin/bash
# [attributes: @Arch Linux: Trilby, "Pacman Development Team", Alad]  [DEPS: sudo base-devel git]

echo "aurt AUR helper -- USAGE: $ aurt [-I]=install [-R]=remove [package]"

basedir=${HOME}/z-AUR-Auto/aurt-built
builddir=${HOME}/z-AUR-Auto/aurt-built/${2}

install() {
      if [[ -d ${builddir}/.git ]] &&
	[[ $(git -C ${builddir} rev-parse HEAD) = $(git -C ${builddir} rev-parse @{upstream}) ]]
	then
	echo; echo "    Git reports ${2} is up to date. NOTHING TO DO, EXITING." ;echo ;exit
     fi
      if [[ -d ${builddir}/.git ]] ; then
	cd "${builddir}" || exit
	"git reset --hard HEAD"
	"git merge"
      else
	cd "${basedir}" || exit
	git clone https://aur.archlinux.org/"${2}".git
     fi
	cd "${builddir}" || exit
	makepkg -si --needed
}

remove() {
	ls -al "${basedir}";
	echo ; echo "Runing sudo pacman -Rns ${2}, sudo rm -r ${builddir}" ;
	echo "Do you want to delete ${builddir} now? [Y/n]." ; echo
	"sudo pacman -Rns" "${2}"
	"sudo rm -r" "${builddir}"
}

# Run Functions
	if [[ ${1} == "-I" ]]; then
    	install "${@}"
	elif [[ ${1} == "-R" ]]; then
	remove "${@}"
	fi

Last edited by Cody Learner (2017-12-08 02:07:23)

Online

#9 2017-12-08 02:39:43

Eschwartz
Bug Wrangler
Registered: 2014-08-08
Posts: 1,306

Re: aurt, yet another, but very minamilistic AUR assistant

You do not have to worry about how many shells you are compatible with, a script will only ever be run with a specific shell -- the one in your shebang, which is #!/bin/bash.

You only ever care about the shebang you specified.

While #!/bin/sh can be any of several different shells that are POSIX-compatible, including bash (using bash's POSIX sh mode), sticking to POSIX is all you need. If you are targeting some other shell, then target that shell.

Most commonly people will simply target #!/bin/bash as it is both powerful and broadly available, and they don't want to have to think about whether a specific feature is defined by POSIX.

Cody Learner wrote:

For some reason I started {using} for variables, prior to that, it was "quotes". Somehow in the transition, I think I got worse with consistent quoting.

Using {} braces is usually a stylistic choice, unless you are using the less common instances of 1) "${foo}bar" in which case the braces delimit the variable name, or 2) some variation of "${foo:-fallback value}" and other variable modifiers listed in the bash manpage under "Parameter Expansion".
On the other hand, quoting is in no way a style choice, as it is exceedingly common for variables to contain whitespace or be vulnerable to unpredictable user-supplied content. Always quote any variable that can contain unknown content, and to be extra safe you might want to get in the habit of quoting every other variable too.

...

"git reset --hard HEAD"

I have no idea what you thought this was. By quoting it, you told the shell to tokenize this as a string literal. There is no "git reset --hard HEAD" binary in your $PATH, therefore this will not work. Why on earth are you quoting non-variables now? Did you try running this?

Also please fix your indentation, the if, then, and fi keywords should always line up and the commands inside should be indented. I would reimplement your option parsing as something like:

if (( $# != 2 )); then
    echo "You need to specify exactly two arguments, aborting..."
    exit 1
fi
case $1 in
    -I)
        command=install
        ;;
    -R)
        command=remove
        ;;
esac
shift

$command "$2"

In the more general case, this general framework for option parsing (usually wrapped in `while (( $# )); do ...; done` to consume all arguments) will be far superior for tracking what you are actually doing. Also case will often be a lot nicer than if else loops, and shell arithmetic via (( $# )) to test if the number of arguments is a nonzero number is nicer than [[ $# -gt 0 ]] for testing how many options you have... so why not use it since this is bash anyway.

Offline

#10 2017-12-08 03:00:58

Trilby
Forum Fellow
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 17,588
Website

Re: aurt, yet another, but very minamilistic AUR assistant

This is a bit tangential, but I'll note that I have repented of my former ways of recommending '[[' over '[' when using bash.  It is true that bash's built in [[ is notably faster than calling /usr/bin/[, but no one ever explicitly calls /usr/bin/[.  The result of the following may come as a surprise to some (run this in bash):

type [

Whether you use [ or [[ in a script with a bash shebang is irrelevant for efficiency: bash will do the same thing with either one.  However, if you use [ then you make life easier for anyone who hopes to port your scripts to some other shell.

By all means break from POSIX conformance when it provides a benefit in the shell you use, but please do not break from POSIX for no benefit at all: use [ and bash, zsh, and mksh will use their own efficient built in test, while ash, dash, and the like will still be able to run the same code.


Resist the GNU world order.

Online

#11 2017-12-08 03:16:03

Eschwartz
Bug Wrangler
Registered: 2014-08-08
Posts: 1,306

Re: aurt, yet another, but very minamilistic AUR assistant

I don't see anything to repent over. tongue

I'm aware that [ is a builtin, and never thought that its negatives included slowness. (I suppose it is possible that there is some incredibly insignificant implementation detail between a given builtin and a given keyword that would cause [[ to be faster, but that is a bit of a stretch....) The [[ keyword is still superior, as it elegantly handles quoted, unquoted, and empty variables, supports && as well as || thereby removing the temptation to use -a, allows pattern matching and globbing when doing string comparison, treats syntax errors as, well, syntax errors and aborts the script rather than commands failing halfway through the script with an unchecked error code, etc. Apparently the > test only supports locale collation when using bash [[ which is a feature I will probably not take advantage of, not really being a > user, but still...

It also looks nicer, and if you have any intention of porting the script you should stop playing silly games and write it in POSIX sh from the beginning.

http://mywiki.wooledge.org/BashFAQ/031

I remain adamant that you should always use [[ in bash. Half of those reasons are nice things you will almost certainly want to use, and the other half are just sane behavior in basic use.

Last edited by Eschwartz (2017-12-08 03:19:35)

Offline

#12 2017-12-08 11:44:30

Trilby
Forum Fellow
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 17,588
Website

Re: aurt, yet another, but very minamilistic AUR assistant

Thanks for the explanation - that makes sense, though I still disagree about preferentially using [[ when one does not need any of those extra features of [[ - like in the context of the script this thread is about.

As for writing in POSIX sh in the first place, I fully support that!  You can still use your favorite shell to actually run the script, in which case modern feature-full shells will run the script more efficiently than older or minimal shells, but it will still run and not just completely crap out on those other shells.

My view is to write POSIX first.  Add shell-specific features only when they actually add a benefit to the script at hand (and don't hesitate to in those cases) but not just as a matter of habit.


Resist the GNU world order.

Online

#13 2017-12-08 13:16:02

Eschwartz
Bug Wrangler
Registered: 2014-08-08
Posts: 1,306

Re: aurt, yet another, but very minamilistic AUR assistant

I'd go one step further and say that older or minimal shells will run the script more efficiently than modern featureful shells, as long as they don't completely error on incompatible syntax. tongue

It is trivial to replace /bin/sh on an Arch system with a symlink to *dash*, and possibly use a pacman hook to reset the symlink after any pacman update touches /bin/sh -- see the Dash page on our wiki. POSIX-compatible scripts will actually run quite a bit faster afterwards with a lot less overhead, although that may not be saying much considering the average speed of initializing a bash shell, and the RAM on the average system.

It's also quite useful for catching accidental bashisms in your POSIX scripts, since Arch defaults to using *bash* as the /bin/sh implementation and bash will actually offer an enhanced superset of true sh even when running in POSIX compatibility mode.

...

I can definitely get behind writing POSIX from the start. I've seen a lot of code from Earnestly recently, who claims that his new habit of trying to implement everything in pure sh has caused him to have to think about what he's doing all the time, and learn all sorts of neat tricks as well as write much cleaner code in the process. His latest project, sx, completely replaces both startx and xinit, with less than 70 lines of sh: https://github.com/Earnestly/sx
Unfortunately, POSIX still doesn't have the ability to `read -r -d ''` or use arrays other than "$@" which is disappointing... dash does implement the local keyword though, even though it isn't (yet?) POSIX.

Last edited by Eschwartz (2017-12-08 13:21:28)

Offline

#14 2017-12-08 21:15:24

Alad
Wiki Admin/IRC Op/TU
From: The Land of The Bloat
Registered: 2014-05-04
Posts: 1,678
Website

Re: aurt, yet another, but very minamilistic AUR assistant

You mentioned parsing ls. Is using test on the filesystem doing that?

Well, you didn't parse ls here (which is good), but I wanted to mention it anyway since it's one of the most common mistakes in shell scripting.

http://mywiki.wooledge.org/ParsingLs

Echo, are you talking in just using it for messages and the clutter it can cause, or more as in redirecting it to append files. Can't think of any other possible uses or abuses off top of my head?

https://unix.stackexchange.com/question … -than-echo

However I wouldn't use either echo or printf to append to files, especially if that implies adding a ">>" on every line (imagine if you want to change the output file, you'd have to change it on every line with "<<" increasing the risk of mistakes). Use cat EOF instead.

cat <<EOF
something
somethingelse
EOF >somefile

Last edited by Alad (2017-12-08 21:16:10)


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby
Honest Alad's Package Emporium—Now with added bugs! (Closed until further notice)

Offline

#15 2017-12-08 21:31:34

Trilby
Forum Fellow
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 17,588
Website

Re: aurt, yet another, but very minamilistic AUR assistant

Purely stylistic, but I've always found the following approach to be easier to read, but I post it mainly to highlight the option:

cat <<EOF > somefile
something
something else
EOF

Resist the GNU world order.

Online

#16 2017-12-09 05:15:51

Cody Learner
Member
Registered: 2017-12-06
Posts: 7

Re: aurt, yet another, but very minamilistic AUR assistant

@ echo or cat >, I found it handy for embedded ARM stuff, where I was only adding a line or two using a serial connection to try fix things.

@ heredocs,  I've done some strange (to me) things with heredocs, root user, to user and back, chroot, placing scripts within scripts. Seems like a very useful feature.

@ Style, I'm trying to make things work without quite knowing enough. Style to me is when things run as intended rather than crashing. I am making an effort to get a better understanding of whats stylish and whats not. If only it wasn't subjective.

EDIT: Strike through useless rambling below.


OK, passing the buck on those misplaced quotes, it's all my editor, shellcheck, poor eyesight and my new pup's fault, lol. Trilby, how to teach the dog to fix my scripts?


Seriously, I want to slow down a bit. Getting in a big rush, minimal testing and review, (leading to errors.)


running it online shellcheck with a strange editor, posting it without further review or testing, is obviously not going well. I'll hold off posting aurt until it's ready for review by some very smart programmers, without further embarrassing myself! I'll post the search script though.


I've deleted pacaur to see how things go without it. Feeling pretty confident that aurt slim version is ready for real testing. Did a little more work on it, added back cat pacman.log, made up little search script that lets aurt use cower for basic AUR searching. Put a little temp "rm .log" band-aide on the .log thing till I do a little more research. 

After spending some time with cower, thinking I can get all the functionality of using (pacman with pkgbrowser + pacaur), with (pacman and aurt + cower).


It goes without saying though, it takes very little, to glue together pacman, makepkg, and git for a very nice AUR handler. Likely depends on ones personal preferences more than anything. Has the switch to git for AUR made things a bunch simpler than prior to it? If so, it's ironic that git has made it easier. I've always thought of git off as something to look into after you've mastered Linux, shell, Python, C, and half a dozen others as a test, to indicate if you're smart enough to get it. One more thing. To test outdated AUR package updating, I tried editing pkgname/.git/refs/heads/master directly, and somewhat predictably, it just errors git. Is it possible roll back git repo or package so it resembles an outdated condition for testing?EDIT: Never mind git question. Found a solution.


Follow up on post #8 above shellcheck issue, I ended up escaping the curly brackets (code below) so shellcheck stops complaining. It still works for me. I then went to Alad's github to look at similar code, to see how he did it, and it's slightly different from what I did. I plan to follow up with some reading so I know for sure whats going on.

From this line:

 [[ $(git -C ${builddir} rev-parse HEAD) = $(git -C ${builddir} rev-parse @{upstream}) ]] 

Edited this part:

 @\{upstream\} 

Edit for clarity:  Cower is amazingly fast at AUR searches. It seems I may have unintentionally slowed it down via the script implementing cower use in aurt. More testing is needed to verify. If testing proves it has slowed down, my first thought would be to focus on the line count and wc.
See anything obviously wrong with this?

#!/bin/sh
# This script is a wrapper for cower: [url]https://github.com/falconindy[/url]
# Attribute: Dave Reisner aka falconindy @ Arch Linux
# Please use cower directly for full feature set searches and more.

echo "Searching ............"
    echo
    cower -qs --by=name "$1"
    number=$(cower -qs --by=name "$1" | wc -l)
    echo
    echo " Found: "${number}" packages above with '"$1"' in name."
    echo
    echo " If there is an exact match, details shown below."
    echo
    cower -i "$1"
    echo

I've searched from aurt with aurt -F <package>:  a few times so far. I know the echo's = ugly. Looking for alternative to retain line spacing for readability without using them.

elif [[ $1 == -F ]]; then
    aurt-find "${2}"
$ aurt -F cower
-------------------------------------------------------------------------------------------------
 aurt, the tiny AUR helper.   UEAGE: aurt [option] [package]     
 [-I] install [-R] remove [-F] find [-h] help [-l] pacman log 
-------------------------------------------------------------------------------------------------
Searching ............
cower
cower-git

 Found: 2 packages above with 'cower' in name.

 If there is an exact match, details shown below.

Repository     : aur
Name           : cower [installed]
Version        : 17-2
URL            : [url]http://github.com/falconindy/cower[/url]
AUR Page       : [url]https://aur.archlinux.org/packages/cower[/url]
Keywords       : aur  
Depends On     : curl  pacman  yajl  
Makedepends    : perl  
License        : MIT  
Votes          : 957
Popularity     : 26.76
Out of Date    : No
Maintainer     : falconindy
Submitted      : Wed 29 Dec 2010 06:30:37 PM PST
Last Modified  : Mon 24 Apr 2017 07:27:21 AM PDT
Description    : A simple AUR agent with a pretentious name

Last edited by Cody Learner (2017-12-09 20:59:50)

Online

#17 2017-12-09 13:52:47

2ManyDogs
Member
Registered: 2012-01-15
Posts: 1,988

Re: aurt, yet another, but very minamilistic AUR assistant

aurt, the tiny AUR helper.   UEAGE: aurt [option] [package]  

Is this supposed to be "USAGE:" ?

Code Learner wrote:

Amazing how fast cower searches on it's own. I may have slow it down

Why would you slow it down if it works?

(or, after reading more of your long post, do you mean "slow it down" as in slow down your work on the script so you understand more)?

Last edited by 2ManyDogs (2017-12-09 13:55:10)

Offline

#18 2017-12-09 20:11:11

Cody Learner
Member
Registered: 2017-12-06
Posts: 7

Re: aurt, yet another, but very minamilistic AUR assistant

2ManyDogs wrote:

Is this supposed to be "USAGE:" ?

Code Learner wrote:

Amazing how fast cower searches on it's own. I may have slow it down

Why would you slow it down if it works?

Yea UEAGE s/b USAGE:   Yes it is very unclear, I'll edit it, and sorry at the long rambling post, I'll try to stay more focused.

2ManyDogs wrote:

do you mean "slow it down" as in slow down your work on the script so you understand more)?

Yes exactly.

Some Thoughts:  I'm obviously quite inexperienced with scripting. Part of my motivation posting the scripts here was so they would be community reviewed and critiqued, leading to improvements, all transparently. Community reviewed and input for community use.

Ultimately, I'd like to be able offer a useful solution for handling AUR stuff. Implemented in a manner that is minimalist enough so the user could easily review and edit the script for personal preferences.

This may be due to my lack coding knowledge and experience, but I find myself wondering how some of the AUR solutions ended up so complicated (from my perspective). I prefer handling AUR stuff hands on, one at a time, but have only ~ dozen or so packages installed. If one had a lot of AUR packages installed, and preferred a similar level of automation for the AUR, as pacman provides for official repos, I could imagine the complexity involved, requiring a complex solution.

My goal with the script/s is on the opposite end of the spectrum. Just bring together some existing tools, in a minimal solution, for the sake of convenience.

Last edited by Cody Learner (2017-12-09 21:19:45)

Online

#19 2017-12-09 23:27:06

Alad
Wiki Admin/IRC Op/TU
From: The Land of The Bloat
Registered: 2014-05-04
Posts: 1,678
Website

Re: aurt, yet another, but very minamilistic AUR assistant

This may be due to my lack coding knowledge and experience, but I find myself wondering how some of the AUR solutions ended up so complicated (from my perspective). I prefer handling AUR stuff hands on, one at a time, but have only ~ dozen or so packages installed. If one had a lot of AUR packages installed, and preferred a similar level of automation for the AUR, as pacman provides for official repos, I could imagine the complexity involved, requiring a complex solution.

I see two reasons for the complexity. One is that complex problems require complex solutions, as you put it. People with 500+ AUR packages aren't rare and effectively handling random PKGBUILDs of random quality is anything but trivial.

Second is that the AUR and makepkg itself are lacking on some aspects regarding automation, see this list: https://github.com/AladW/aurutils/issues/20

(there's also the reason that most people look for a quick fix rather than think through a proper solution... but I digress)

Ultimately, I'd like to be able offer a useful solution for handling AUR stuff. Implemented in a manner that is minimalist enough so the user could easily review and edit the script for personal preferences. (...) My goal with the script/s is on the opposite end of the spectrum. Just bring together some existing tools, in a minimal solution, for the sake of convenience.

That's pretty much why I split up aurutils in 10 different scripts - create a clear frame for every task and use whatever you need or want, including suitable modifications.

Last edited by Alad (2017-12-09 23:29:08)


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby
Honest Alad's Package Emporium—Now with added bugs! (Closed until further notice)

Offline

#20 2017-12-11 03:27:51

Cody Learner
Member
Registered: 2017-12-06
Posts: 7

Re: aurt, yet another, but very minamilistic AUR assistant

Alad, I have very briefly looked at your scripts. I really like the concept of splitting them up for ease of implementation.  I do plan to look closer and give some of them a spin in the future.

Thanks all and ........  [CHECK] one off my bucket list.

Attempt to contribute something useful to the community that hopefully goes well.

Online

Board footer

Powered by FluxBB