summaryrefslogtreecommitdiffstats
path: root/base/pkg-get-awk/pkg-get.awk
diff options
context:
space:
mode:
authortnut <thierryn1 at hispeed dot ch>2011-02-06 18:33:24 +0100
committertnut <thierryn1 at hispeed dot ch>2011-02-06 18:33:24 +0100
commite93f7441c3c63340e47e0354591894dbc44a4a59 (patch)
treee01d224bee7d5fb1b085754ab10badec2efb5854 /base/pkg-get-awk/pkg-get.awk
parent03d5570085a2e57c1a353f9e2c07995999298c22 (diff)
downloadnutyx-extra-e93f7441c3c63340e47e0354591894dbc44a4a59.tar.gz
nutyx-extra-e93f7441c3c63340e47e0354591894dbc44a4a59.tar.bz2
nutyx-extra-e93f7441c3c63340e47e0354591894dbc44a4a59.tar.xz
nutyx-extra-e93f7441c3c63340e47e0354591894dbc44a4a59.zip
pkg-get-awk, maj 0.3.1-1
Diffstat (limited to 'base/pkg-get-awk/pkg-get.awk')
-rwxr-xr-xbase/pkg-get-awk/pkg-get.awk39
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)
}
}
+ }
}