summaryrefslogtreecommitdiffstats
path: root/base/pkg-get-awk
diff options
context:
space:
mode:
authorguy <guy@rougemin.(none)>2011-03-11 20:21:25 +0100
committerguy <guy@rougemin.(none)>2011-03-11 20:21:25 +0100
commit2146b34a23ea197e8c15502817ef2a88f49a8741 (patch)
tree1ea5767eff55636ab06c5e76c12ac377d32916d4 /base/pkg-get-awk
parent700655c977c4ad4d180caf0f2d3781dc79d18649 (diff)
downloadnutyx-extra-2146b34a23ea197e8c15502817ef2a88f49a8741.tar.gz
nutyx-extra-2146b34a23ea197e8c15502817ef2a88f49a8741.tar.bz2
nutyx-extra-2146b34a23ea197e8c15502817ef2a88f49a8741.tar.xz
nutyx-extra-2146b34a23ea197e8c15502817ef2a88f49a8741.zip
pkg-get-awk, corrections
Diffstat (limited to 'base/pkg-get-awk')
-rw-r--r--base/pkg-get-awk/.md5sum.i6864
-rw-r--r--base/pkg-get-awk/.md5sum.x86_644
-rw-r--r--base/pkg-get-awk/Pkgfile2
-rwxr-xr-xbase/pkg-get-awk/pkg-get.awk93
-rw-r--r--base/pkg-get-awk/pkg-get.po10
5 files changed, 47 insertions, 66 deletions
diff --git a/base/pkg-get-awk/.md5sum.i686 b/base/pkg-get-awk/.md5sum.i686
index bf84ee720..b86a7301c 100644
--- a/base/pkg-get-awk/.md5sum.i686
+++ b/base/pkg-get-awk/.md5sum.i686
@@ -1,4 +1,4 @@
3e833be041e5cb66c747c1d6b9a6258b pkg-get-awk.conf
-ffa7b0d0e3c7d458655ca017a655ade4 pkg-get.awk
-90192f1d0ab45079f8c479c25479e0c6 pkg-get.po
+342244762702ba95327867a4aba29a93 pkg-get.awk
+bf4713f8f6976dd4d2d860fe6b4b03d0 pkg-get.po
4d89f89107b269e1579a7e4a440eddb1 syn
diff --git a/base/pkg-get-awk/.md5sum.x86_64 b/base/pkg-get-awk/.md5sum.x86_64
index bf84ee720..b86a7301c 100644
--- a/base/pkg-get-awk/.md5sum.x86_64
+++ b/base/pkg-get-awk/.md5sum.x86_64
@@ -1,4 +1,4 @@
3e833be041e5cb66c747c1d6b9a6258b pkg-get-awk.conf
-ffa7b0d0e3c7d458655ca017a655ade4 pkg-get.awk
-90192f1d0ab45079f8c479c25479e0c6 pkg-get.po
+342244762702ba95327867a4aba29a93 pkg-get.awk
+bf4713f8f6976dd4d2d860fe6b4b03d0 pkg-get.po
4d89f89107b269e1579a7e4a440eddb1 syn
diff --git a/base/pkg-get-awk/Pkgfile b/base/pkg-get-awk/Pkgfile
index 39b939a38..7ef55d5c1 100644
--- a/base/pkg-get-awk/Pkgfile
+++ b/base/pkg-get-awk/Pkgfile
@@ -5,7 +5,7 @@
name=pkg-get-awk
version=0.3.2
-release=2
+release=3
source=(syn pkg-get.awk pkg-get-awk.conf pkg-get.po)
PKGMK_KEEP_LOCALES=yes
diff --git a/base/pkg-get-awk/pkg-get.awk b/base/pkg-get-awk/pkg-get.awk
index 4cb30ce2a..d8e526a80 100755
--- a/base/pkg-get-awk/pkg-get.awk
+++ b/base/pkg-get-awk/pkg-get.awk
@@ -14,7 +14,7 @@ function configs( a, i, k, n, old_FS)
n=split(ENVIRON["_"],a,"/")
NPKG = a[n]
VERSION = "0.3.2"
- DATE = "2011-03-10"
+ DATE = "2011-03-11"
# defauts
CONF = "/etc/pkg-get.conf"
@@ -42,14 +42,6 @@ function configs( a, i, k, n, old_FS)
tb_PKG[++nPKG]=ARGV[i]
}
-# print "* PKG:"
-# print " OPER = "OPER
-# for (i=1; i<=nPKG; i++)
-# print " PKG[" i "] = " tb_PKG[i]
-# print "* OPT:"
-# for (Opt in tb_OPT)
-# print " " Opt " " tb_OPT[Opt]
-
# divers
cmd="uname -m"
cmd | getline ARCH
@@ -355,21 +347,16 @@ function install( i)
function install2_update2(Pkg, Oper, cmd, i, pak)
{
-###
if (!(Pkg in tb_REPO)) {
print "\033[1;31m" _"Paquet" " " Pkg " " _"indisponible" "\033[1;0m"
return
}
-###
if (tb_REPO[Pkg] != "" ) {
pak=Pkg"#"tb_REPO[Pkg] ".pkg.tar.xz"
download(pak)
}
if ("-do" in tb_OPT)
return
-## load_DB()
-## if (Pkg in tb_DB)
-## return
print _"Installation de" " " Pkg
if (PRE=="y" && tb_PRE[Pkg]=="yes") { # pre-install
cmd = "/bin/bash " tb_PKGDIR[Pkg] "/PKGINST " Pkg "_pre_install"
@@ -389,9 +376,9 @@ function install2_update2(Pkg, Oper, cmd, i, pak)
print
close(cmd)
}
-###
+
tb_DB[Pkg]=tb_REPO[Pkg]
-###
+
if (POST=="y" && tb_POST[Pkg]=="yes") { # post-install
cmd = "/bin/bash " tb_PKGDIR[Pkg] "/PKGINST " Pkg "_post_install"
if ("--dry" in tb_OPT) {
@@ -435,24 +422,13 @@ function list( old_FS, FILE, j, prev)
function listinst( old_FS, old_RS, fl)
{
-# if (PROCINFO["version"]) { # gawk
- old_FS = FS; FS = "\t"
- old_RS = RS; RS = ""
- while (getline < DB)
- print $1
- close(DB)
- FS = old_FS
- RS = old_RS
-# } else { # awka
-# while (getline < DB) {
-# if (fl==0)
-# print $1
-# fl++
-# if (NF==0)
-# fl=0
-# }
-# close(DB)
-# }
+ old_FS = FS; FS = "\t"
+ old_RS = RS; RS = ""
+ while (getline < DB)
+ print $1
+ close(DB)
+ FS = old_FS
+ RS = old_RS
}
@@ -466,26 +442,13 @@ function listlocked()
function load_DB( old_FS, old_RS, fl, pak)
{
-# if (PROCINFO["version"]) { # gawk
- old_FS=FS; FS="\n"
- old_RS=RS; RS=""
- while (getline < DB)
- tb_DB[$1]=$2
- close(DB)
- FS=old_FS
- RS=old_RS
-# } else { # awka
-# while (getline < DB) {
-# if (fl==1)
-# tb_DB[pak]=$1
-# if (fl==0)
-# pak=$1
-# fl++
-# if (NF==0)
-# fl=0
-# }
-# close(DB)
-# }
+ old_FS=FS; FS="\n"
+ old_RS=RS; RS=""
+ while (getline < DB)
+ tb_DB[$1]=$2
+ close(DB)
+ FS=old_FS
+ RS=old_RS
}
@@ -532,7 +495,6 @@ function load_RDEPS( a, FILE, i, j, n)
while ((getline < FILE) >0) {
n=split($3, a, ",")
for (i=1; i<=n; i++) {
-# tb_RDEPS[a[i]] = (a[i] in tb_RDEPS) ? tb_RDEPS[a[i]] "," $1 : $1
if (a[i] in tb_RDEPS) {
if (!index(tb_RDEPS[a[i]],$1))
tb_RDEPS[a[i]] = tb_RDEPS[a[i]] "," $1
@@ -750,17 +712,26 @@ function unlock( i, n, fl, tb_LCK)
}
-function update( i)
+function update( i, pak)
{
verif_if_root()
load_LOCKER()
load_REPO()
- load_DB() ##
+ load_DB()
for (i=1; i<=nPKG; i++) {
- if (!(tb_PKG[i] in tb_LOCK) && !(tb_PKG[i] in tb_DB)) {
- print _"paquet à mettre à jour:" " " tb_PKG[i]
- install2_update2(tb_PKG[i], "-u")
- }
+ pak = tb_PKG[i]
+ if (pak in tb_LOCK)
+ print pak ": " _"paquet verouillé !"
+ else
+ if (!(pak in tb_DB))
+ print pak ": " _"pas de mise à jour d'un paquet non installé !"
+ else
+ if (tb_DB[pak]==tb_REPO[pak])
+ print pak ": " _"paquet déjà à la dernière version"
+ else {
+ print _"paquet à mettre à jour:" " " pak
+ install2_update2(pak, "-u")
+ }
}
}
diff --git a/base/pkg-get-awk/pkg-get.po b/base/pkg-get-awk/pkg-get.po
index 0230e2019..d0d83732c 100644
--- a/base/pkg-get-awk/pkg-get.po
+++ b/base/pkg-get-awk/pkg-get.po
@@ -192,3 +192,13 @@ msgstr "required"
msgid "trouv\303\251"
msgstr "found"
+
+msgid "paquet verrouill\303\251"
+msgstr "locked package"
+
+msgid "pas de mise \303\240 jour d'un paquet non install\303\251"
+msgstr "no update for a not installed package"
+
+msgid "paquet d\303\251j\303\240 install\303\251"
+msgstr "already installed package"
+