diff options
author | Esteban Carnevale <alfplayer@mailoo.org> | 2014-12-16 13:30:47 -0300 |
---|---|---|
committer | Esteban Carnevale <alfplayer@mailoo.org> | 2014-12-16 16:45:14 -0300 |
commit | a5cfafe3cf6cf3536d4dfc8b1279071f4fba68f3 (patch) | |
tree | 3ec92d1397782a3c1dcd7094faf4afd2c56c0b2a | |
parent | e2b688407eae8db10340de47da777d5330bbaa6a (diff) |
libredbdiff-standalone: Replace command name variable name
-rwxr-xr-x | libredbdiff-standalone | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libredbdiff-standalone b/libredbdiff-standalone index 859f862..63f17a2 100755 --- a/libredbdiff-standalone +++ b/libredbdiff-standalone @@ -5,7 +5,7 @@ # Compare package versions of latest packages in Parabola and Arch # The main version of this script is in libretools: https://projects.parabola.nu/packages/libretools.git/tree/src/abslibre-tools/libredbdiff -name="Libredbdiff" +progname="Libredbdiff" baseconfpath="/etc/libredbdiff" basedbpath="/var/lib/libredbdiff" @@ -29,7 +29,7 @@ error() { echo -e "Error. $@" > /dev/stderr ; exit 1; } if [[ $# == 1 ]] ; then [[ $1 == -n ]] && UPDATE=0 - [[ $1 =~ ^(-h|--help)$ ]] && { echo -e "${name}. Show [libre] packages that need to be updated from Arch repositories.\n\nUsage:\nlibredbdiff\t\tInitialize (first run) or update pacman databases\nlibredbdiff -n\t\tPrint results" ; exit 0 ; } + [[ $1 =~ ^(-h|--help)$ ]] && { echo -e "${progname}. Show [libre] packages that need to be updated from Arch repositories.\n\nUsage:\nlibredbdiff\t\tInitialize (first run) or update pacman databases\nlibredbdiff -n\t\tPrint results" ; exit 0 ; } elif [[ $# != 0 ]] ; then error "Bad arguments. Nothing done." else @@ -37,9 +37,9 @@ else fi if (( $UPDATE )) ; then - [[ $EUID != 0 ]] && { error "To initialize $name or update $name pacman databases, the script must be run as root. Nothing done." ; } + [[ $EUID != 0 ]] && { error "To initialize $progname or update $progname pacman databases, the script must be run as root. Nothing done." ; } - [[ -d "$baseconfpath" && -d "$basedbpath" && -d "$dbpath" && -d "$dbpatharch" && -e "${conffile}" && -e "${conffilearch}" && -e "${mirrorlist}" && -e "${mirrorlist}" ]] || { echo "${name} files are missing. Initializing." ; init=1 ; } + [[ -d "$baseconfpath" && -d "$basedbpath" && -d "$dbpath" && -d "$dbpatharch" && -e "${conffile}" && -e "${conffilearch}" && -e "${mirrorlist}" && -e "${mirrorlist}" ]] || { echo "${progname} files are missing. Initializing." ; init=1 ; } createdir() { if [[ ! -e $1 ]] ; then @@ -115,18 +115,18 @@ if (( $UPDATE )) ; then setmirror "Arch" "$mirrorarch" "$mirrorlistarch" fi - echo -e "\nSynchronizing $name pacman databases for Parabola" + echo -e "\nSynchronizing $progname pacman databases for Parabola" pacman --config "${conffile}" -b "${dbpath}" -Sy || error "Failed to synchronize pacman database for Parabola. Exiting." - echo -e "\nSynchronizing $name pacman databases for Arch" + echo -e "\nSynchronizing $progname pacman databases for Arch" pacman --config "${conffilearch}" -b "${dbpatharch}" -Sy || error "Failed to synchronize pacman database for Arch. Exiting." echo - echo "$name pacman databases are updated. $name is ready. Run libredbdiff -n to print results." + echo "$progname pacman databases are updated. $progname is ready. Run libredbdiff -n to print results." exit 0 else filenotfound() { - [[ ! -r $1 ]] && { error "Could not read $1. Nothing done.\nIt may be necessary to run libredbdiff without arguments as root to initialize ${name}." ; } + [[ ! -r $1 ]] && { error "Could not read $1. Nothing done.\nIt may be necessary to run libredbdiff without arguments as root to initialize ${progname}." ; } } filenotfound "${dbpath}" filenotfound "${dbpatharch}" @@ -178,11 +178,11 @@ while read -a line ; do verarch["${line[0]}"]="${line[1]}" done < <(pacman --dbpath "${dbpatharch}" --config "${conffilearch}" -Ss | grep -v '^ ' | awk -F/ '{print $2}') -expac --config "${conffile}" -S '%r/%n %v %S' > /tmp/${name}.parabola-packages +expac --config "${conffile}" -S '%r/%n %v %S' > /tmp/${progname}.parabola-packages for repo in ${repos} ; do echo "[$repo]" - awk -F/ -v repo="$repo" '$1 == repo {print $2}' /tmp/${name}.parabola-packages | while read -a line ; do + awk -F/ -v repo="$repo" '$1 == repo {print $2}' /tmp/${progname}.parabola-packages | while read -a line ; do ver["${line[0]}"]="${line[1]}" provides[${line[0]}]="${line[@]:2}" pkgname=${line[0]} |