diff options
Diffstat (limited to 'base/pkg-get-awk/pkg-get.awk')
-rwxr-xr-x | base/pkg-get-awk/pkg-get.awk | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/base/pkg-get-awk/pkg-get.awk b/base/pkg-get-awk/pkg-get.awk index 5478a7a0e..f7574c0b2 100755 --- a/base/pkg-get-awk/pkg-get.awk +++ b/base/pkg-get-awk/pkg-get.awk @@ -172,7 +172,11 @@ function depinst( i) load_DEPS() load_REPO() for (i=1; i<=nPKG; i++) { - depinst2(tb_PKG[i]) + if (tb_PKG[i] in tb_DB) { + print _"Le paquet" " " tb_PKG[i] " " _"est déjà installé" + + } + else depinst2(tb_PKG[i]) } return rc } @@ -222,7 +226,7 @@ function download(pak, a, cmd, j, pakw, rep, WEBREPO) if (rep=="y") { pakw = pak sub("#", "%23", pakw) - cmd="wget --no-directories --tries=3 --waitretry=3 "tb_PKGDIR[a[1]] pak " " WEBREPO pakw + cmd="wget --no-directories --tries=3 --waitretry=3 -O "tb_PKGDIR[a[1]] pak " " WEBREPO pakw if ("--dry" in tb_OPT) { print "\033[1;34m" cmd "\033[1;0m" } else { @@ -326,9 +330,14 @@ function info( a, b, c, cmd, g, gline, n, rline, out) function install( i) { verif_if_root() + load_DB() load_REPO() for (i=1; i<=nPKG; i++) { - install2(tb_PKG[i], " ") + if (tb_PKG[i] in tb_DB) { + print _"Le paquet" " " tb_PKG[i] " " _"est déjà installé" + + } + else install2(tb_PKG[i], " ") } } @@ -341,15 +350,20 @@ function install2(Pkg, Oper, cmd, i, pak) } if ("-do" in tb_OPT) return - - if (PRE=="y" && tb_PRE[Pkg]=="yes") { # pre-install - cmd = "/bin/bash " tb_PKGDIR[Pkg] "/PKGINST " Pkg "_pre_install" - if ("--dry" in tb_OPT) { - print "\033[1;33m" cmd "\033[1;0m" - } else { - while ((cmd | getline) >0) - print - close(cmd) + load_DB() + if (Pkg in tb_DB) { + return + } + else { + print _"Installation de" " " Pkg + if (PRE=="y" && tb_PRE[Pkg]=="yes") { # pre-install + cmd = "/bin/bash " tb_PKGDIR[Pkg] "/PKGINST " Pkg "_pre_install" + if ("--dry" in tb_OPT) { + print "\033[1;33m" cmd "\033[1;0m" + } else { + while ((cmd | getline) >0) + print + close(cmd) } } cmd = "pkgadd " AARGS " " Oper " " tb_PKGDIR[Pkg] pak # Oper==" " : insert ; Oper=="-u" : update @@ -370,6 +384,7 @@ function install2(Pkg, Oper, cmd, i, pak) close(cmd) } } + } } |