1
0
mirror of https://gitlab.com/JKANetwork/jka-toolkit.git synced 2026-02-18 02:51:33 +01:00

Merge branch 'hotfix' of gitlab.com:JKANetwork/jka-toolkit

This commit is contained in:
JoseluCross
2016-06-11 14:55:15 +02:00
4 changed files with 64 additions and 90 deletions

View File

@@ -10,14 +10,14 @@
export TEXTDOMAIN='apw' export TEXTDOMAIN='apw'
export TEXTDOMAINDIR='/usr/share/locale' export TEXTDOMAINDIR='/usr/share/locale'
#Version variable #Version variable
version="1.7.1" version="1.8"
#This option is for make if case insensitive #This option is for make if case insensitive
shopt -s nocasematch shopt -s nocasematch
#Basic info echo #Basic info echo
case "$1" in case "$1" in
*h) h|-h)
printf -- "$(gettext "apw - A Packager Wrapper, a Idea from JKA Network, version %s")" "$version" printf -- "$(gettext "apw - A Packager Wrapper, a Idea from JKA Network, version %s")" "$version"
echo echo
echo "$(gettext " Usage: apw <option> [packages]")" echo "$(gettext " Usage: apw <option> [packages]")"
@@ -91,8 +91,7 @@ if [[ -z $packages && ( $1 != *u* && $1 != *c* ) ]];then
fi fi
for (( i=3; i<=$#; i++ )) for (( i=3; i<=$#; i++ ))
do do
valtmp=$(echo $* | cut -f$i -d" ") packages="$packages $(echo $* | cut -f$i -d" ")"
packages="$packages $valtmp"
done done
#Check if is dnf in RedHat, or apt in Debian, new tools #Check if is dnf in RedHat, or apt in Debian, new tools
@@ -106,7 +105,7 @@ fi
#Command wrapper #Command wrapper
updating="$(gettext "Updating system")" updating="$(gettext "Updating system")"
case "$1" in case "$1" in
*U) U|-U)
echo $updating echo $updating
case "$SO" in case "$SO" in
apt) apt)
@@ -116,7 +115,7 @@ case "$1" in
yum | dnf | zypper) yum | dnf | zypper)
$SO update;; $SO update;;
esac;; esac;;
*Uf) Uf|-Uf)
echo $(gettext "Force updating system") echo $(gettext "Force updating system")
case "$SO" in case "$SO" in
apt) apt)
@@ -127,18 +126,19 @@ case "$1" in
echo "$(gettext "Not supported on your distribution. Doing -U instead")" echo "$(gettext "Not supported on your distribution. Doing -U instead")"
$SO update;; $SO update;;
esac;; esac;;
*Uy) Uy|-Uy)
echo $updating echo $updating
case "$SO" in case "$SO" in
apt) apt)
apt update && apt -y upgrade;; apt update && apt -y upgrade;;
pacman) pacman)
pacman -Syu $packages --noconfirm;; pacman -Syu $packages --noconfirm;;
yum | dnf | zypper) yum | dnf)
echo "$(gettext "Not supported on your distribution. Doing -U instead")" $SO -y update;;
$SO update;; zypper)
$SO --non-interactive update;;
esac;; esac;;
*I) I|-I)
printf -- "$(gettext "You are going to install %s and dependencies")" "$packages" printf -- "$(gettext "You are going to install %s and dependencies")" "$packages"
echo echo
case "$SO" in case "$SO" in
@@ -149,7 +149,7 @@ case "$1" in
yum | dnf | zypper) yum | dnf | zypper)
$SO install $packages;; $SO install $packages;;
esac;; esac;;
*Iy) Iy|-Iy)
printf -- "$(gettext "You are going to install %s and dependencies")" "$packages" printf -- "$(gettext "You are going to install %s and dependencies")" "$packages"
echo echo
case "$SO" in case "$SO" in
@@ -157,11 +157,12 @@ case "$1" in
apt update && apt -y install $packages;; apt update && apt -y install $packages;;
pacman) pacman)
pacman -Syu $packages --noconfirm --needed;; pacman -Syu $packages --noconfirm --needed;;
yum | dnf | zypper) yum | dnf)
echo "$(gettext "Not supported on your distribution. Doing -I instead")" $SO -y install $packages;;
$SO install $packages;; zypper)
$SO --non-interactive install $packages;;
esac;; esac;;
*Ir) Ir|-Ir)
printf -- "$(gettext "You are going to reinstall %s")" "$packages" printf -- "$(gettext "You are going to reinstall %s")" "$packages"
echo echo
case "$SO" in case "$SO" in
@@ -172,18 +173,19 @@ case "$1" in
yum | dnf | zypper) yum | dnf | zypper)
$SO reinstall $packages;; $SO reinstall $packages;;
esac;; esac;;
*Iry) Iry|-Iry)
printf -- "$(gettext "You are going to reinstall %s")" "$packages" printf -- "$(gettext "You are going to reinstall %s")" "$packages"
case "$SO" in case "$SO" in
apt) apt)
apt update && apt -y install --reinstall $packages;; apt update && apt -y install --reinstall $packages;;
pacman) pacman)
pacman -Syu $packages --noconfirm;; pacman -Syu $packages --noconfirm;;
yum | dnf | zypper) yum | dnf)
echo "$(gettext "Not supported on your distribution. Doing -Ir instead")" $SO -y reinstall $packages;;
$SO reinstall $packages;; zypper)
$SO --non-interactive reinstall $packages;;
esac;; esac;;
*R) R|-R)
printf -- "$(gettext "You are going to remove %s")" "$packages" printf -- "$(gettext "You are going to remove %s")" "$packages"
case "$SO" in case "$SO" in
apt) apt)
@@ -193,18 +195,19 @@ case "$1" in
yum | dnf | zypper) yum | dnf | zypper)
$SO remove $packages;; $SO remove $packages;;
esac;; esac;;
*Ry) Ry|-Ry)
printf -- "$(gettext "You are going to remove %s")" "$packages" printf -- "$(gettext "You are going to remove %s")" "$packages"
case "$SO" in case "$SO" in
apt) apt)
apt -y remove $packages;; apt -y remove $packages;;
pacman) pacman)
pacman -R $packages --noconfirm;; pacman -R $packages --noconfirm;;
yum | dnf | zypper) yum | dnf)
echo "$(gettext "Not supported on your distribution. Doing -R instead")" $SO -y remove $packages;;
$SO remove $packages;; zypper)
$SO --non-interactive remove $packages;;
esac;; esac;;
*Rd) Rd|-Rd)
printf -- "$(gettext "Removing %s along with his dependencies that are not more in use")" "$packages" printf -- "$(gettext "Removing %s along with his dependencies that are not more in use")" "$packages"
echo echo
case "$SO" in case "$SO" in
@@ -213,7 +216,7 @@ case "$1" in
*) *)
echo "$(gettext "Not supported on your distribution")";; echo "$(gettext "Not supported on your distribution")";;
esac;; esac;;
*Rdy) Rdy|-Rdy)
printf -- "$(gettext "Removing %s along with his dependencies that are not more in use")" "$packages" printf -- "$(gettext "Removing %s along with his dependencies that are not more in use")" "$packages"
echo echo
case "$SO" in case "$SO" in
@@ -222,7 +225,7 @@ case "$1" in
*) *)
echo "$(gettext "Not supported on your distribution")";; echo "$(gettext "Not supported on your distribution")";;
esac;; esac;;
*C) C|-C)
echo "$(gettext "Cleaning package manager")" echo "$(gettext "Cleaning package manager")"
case "$SO" in case "$SO" in
apt) apt)
@@ -237,19 +240,21 @@ case "$1" in
dnf) dnf)
dnf clean all --enablerepo=\*;; dnf clean all --enablerepo=\*;;
zypper) zypper)
echo "$(gettext "Not supported on your distribution")";; zypper clean;;
esac;; esac;;
*Cd) Cd|-Cd)
echo "$(gettext "Cleaning system from dependencies that are not in use (BE CAREFUL, ONLY ADVANCED)")" echo "$(gettext "Cleaning system from dependencies that are not in use (BE CAREFUL, ONLY ADVANCED)")"
case "$SO" in case "$SO" in
apt) apt)
apt autoremove --purge;; apt autoremove --purge;;
pacman) pacman)
pacman -Rs $(pacman -Qdtq);; pacman -Rs $(pacman -Qdtq);;
zypper)
zypper --clean-deps;;
*) *)
echo "$(gettext "Not supported on your distribution")";; echo "$(gettext "Not supported on your distribution")";;
esac;; esac;;
*S) S|-S)
printf -- "$(gettext "Searching %s")" "$packages" printf -- "$(gettext "Searching %s")" "$packages"
echo echo
case "$SO" in case "$SO" in
@@ -258,7 +263,7 @@ case "$1" in
apr | yum | dnf | zypper) apr | yum | dnf | zypper)
$SO search $packages;; $SO search $packages;;
esac;; esac;;
*F) F|-F)
printf -- "$(gettext "Installing files: %s")" "$packages" printf -- "$(gettext "Installing files: %s")" "$packages"
echo echo
case "$SO" in case "$SO" in
@@ -274,10 +279,3 @@ case "$1" in
echo "$(gettext "Use apw -h for help")" echo "$(gettext "Use apw -h for help")"
exit;; exit;;
esac esac
if [[ $SO = "pacman" ]];then
case "$1" in
*Rd)
pacman -Rs $packages;;
esac
fi

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-06-08 16:38+0200\n" "POT-Creation-Date: 2016-06-10 23:59+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -82,7 +82,7 @@ msgstr ""
msgid "apw - A Packager Wrapper" msgid "apw - A Packager Wrapper"
msgstr "" msgstr ""
#: apw:39 apw:274 #: apw:39 apw:279
msgid "Use apw -h for help" msgid "Use apw -h for help"
msgstr "" msgstr ""
@@ -108,15 +108,15 @@ msgstr ""
msgid "No package specified, aborting" msgid "No package specified, aborting"
msgstr "" msgstr ""
#: apw:107 #: apw:106
msgid "Updating system" msgid "Updating system"
msgstr "" msgstr ""
#: apw:120 #: apw:119
msgid "Force updating system" msgid "Force updating system"
msgstr "" msgstr ""
#: apw:127 apw:138 #: apw:126
msgid "Not supported on your distribution. Doing -U instead" msgid "Not supported on your distribution. Doing -U instead"
msgstr "" msgstr ""
@@ -124,52 +124,40 @@ msgstr ""
msgid "You are going to install %s and dependencies" msgid "You are going to install %s and dependencies"
msgstr "" msgstr ""
#: apw:161 #: apw:166 apw:177
msgid "Not supported on your distribution. Doing -I instead"
msgstr ""
#: apw:165 apw:176
msgid "You are going to reinstall %s" msgid "You are going to reinstall %s"
msgstr "" msgstr ""
#: apw:183 #: apw:189 apw:199
msgid "Not supported on your distribution. Doing -Ir instead"
msgstr ""
#: apw:187 apw:197
msgid "You are going to remove %s" msgid "You are going to remove %s"
msgstr "" msgstr ""
#: apw:204 #: apw:211 apw:220
msgid "Not supported on your distribution. Doing -R instead"
msgstr ""
#: apw:208 apw:217
msgid "Removing %s along with his dependencies that are not more in use" msgid "Removing %s along with his dependencies that are not more in use"
msgstr "" msgstr ""
#: apw:214 apw:223 apw:240 apw:250 #: apw:217 apw:226 apw:255
msgid "Not supported on your distribution" msgid "Not supported on your distribution"
msgstr "" msgstr ""
#: apw:226 #: apw:229
msgid "Cleaning package manager" msgid "Cleaning package manager"
msgstr "" msgstr ""
#: apw:243 #: apw:246
msgid "" msgid ""
"Cleaning system from dependencies that are not in use (BE CAREFUL, ONLY " "Cleaning system from dependencies that are not in use (BE CAREFUL, ONLY "
"ADVANCED)" "ADVANCED)"
msgstr "" msgstr ""
#: apw:253 #: apw:258
msgid "Searching %s" msgid "Searching %s"
msgstr "" msgstr ""
#: apw:262 #: apw:267
msgid "Installing files: %s" msgid "Installing files: %s"
msgstr "" msgstr ""
#: apw:273 #: apw:278
msgid "Invalid option especified" msgid "Invalid option especified"
msgstr "" msgstr ""

Binary file not shown.

View File

@@ -92,7 +92,7 @@ msgstr "\tAñadir y a -U o -I (-Uy -Iy -Iry) para autoconfirmar la operación"
msgid "apw - A Packager Wrapper" msgid "apw - A Packager Wrapper"
msgstr "apw - A Package Wrapper" msgstr "apw - A Package Wrapper"
#: apw:39 apw:274 #: apw:39 apw:279
msgid "Use apw -h for help" msgid "Use apw -h for help"
msgstr "Usa apw -h para ver la ayuda" msgstr "Usa apw -h para ver la ayuda"
@@ -122,15 +122,15 @@ msgstr ""
msgid "No package specified, aborting" msgid "No package specified, aborting"
msgstr "Ningún paquete especificado, cerrando" msgstr "Ningún paquete especificado, cerrando"
#: apw:107 #: apw:106
msgid "Updating system" msgid "Updating system"
msgstr "Actualizando el sistema" msgstr "Actualizando el sistema"
#: apw:120 #: apw:119
msgid "Force updating system" msgid "Force updating system"
msgstr "Forzando la actualización del sistema" msgstr "Forzando la actualización del sistema"
#: apw:127 apw:138 #: apw:126
msgid "Not supported on your distribution. Doing -U instead" msgid "Not supported on your distribution. Doing -U instead"
msgstr "No soportado en tu distribución. Usando -U en su lugar" msgstr "No soportado en tu distribución. Usando -U en su lugar"
@@ -138,39 +138,27 @@ msgstr "No soportado en tu distribución. Usando -U en su lugar"
msgid "You are going to install %s and dependencies" msgid "You are going to install %s and dependencies"
msgstr "Vas a instalar %s y sus dependencias" msgstr "Vas a instalar %s y sus dependencias"
#: apw:161 #: apw:166 apw:177
msgid "Not supported on your distribution. Doing -I instead"
msgstr "No soportado en tu distribución. Usando -I en su lugar"
#: apw:165 apw:176
msgid "You are going to reinstall %s" msgid "You are going to reinstall %s"
msgstr "Vas a reinstalar %s" msgstr "Vas a reinstalar %s"
#: apw:183 #: apw:189 apw:199
msgid "Not supported on your distribution. Doing -Ir instead"
msgstr "No soportado en tu distribución. Usando -Ir en su lugar"
#: apw:187 apw:197
msgid "You are going to remove %s" msgid "You are going to remove %s"
msgstr "Vas a borrar %s" msgstr "Vas a borrar %s"
#: apw:204 #: apw:211 apw:220
msgid "Not supported on your distribution. Doing -R instead"
msgstr "No soportado en tu distribución. Usando -R en su lugar"
#: apw:208 apw:217
msgid "Removing %s along with his dependencies that are not more in use" msgid "Removing %s along with his dependencies that are not more in use"
msgstr "Quitando %s junto con las dependencias que no están más en uso" msgstr "Quitando %s junto con las dependencias que no están más en uso"
#: apw:214 apw:223 apw:240 apw:250 #: apw:217 apw:226 apw:255
msgid "Not supported on your distribution" msgid "Not supported on your distribution"
msgstr "No soportado en tu distribución" msgstr "No soportado en tu distribución"
#: apw:226 #: apw:229
msgid "Cleaning package manager" msgid "Cleaning package manager"
msgstr "Limpiando gestor de paquetes" msgstr "Limpiando gestor de paquetes"
#: apw:243 #: apw:246
msgid "" msgid ""
"Cleaning system from dependencies that are not in use (BE CAREFUL, ONLY " "Cleaning system from dependencies that are not in use (BE CAREFUL, ONLY "
"ADVANCED)" "ADVANCED)"
@@ -178,14 +166,14 @@ msgstr ""
"Limpiar el sistema de dependencias que no están en uso (CUIDADO, SOLO " "Limpiar el sistema de dependencias que no están en uso (CUIDADO, SOLO "
"EXPERIMENTADOS)" "EXPERIMENTADOS)"
#: apw:253 #: apw:258
msgid "Searching %s" msgid "Searching %s"
msgstr "Buscando %s" msgstr "Buscando %s"
#: apw:262 #: apw:267
msgid "Installing files: %s" msgid "Installing files: %s"
msgstr "Instalando archivos: %s" msgstr "Instalando archivos: %s"
#: apw:273 #: apw:278
msgid "Invalid option especified" msgid "Invalid option especified"
msgstr "Opción inválida seleccionada" msgstr "Opción inválida seleccionada"