From 5e5c2d317d9afe7327a75a6c35099510e1f8bb9c Mon Sep 17 00:00:00 2001 From: tnut Date: Sun, 27 Mar 2011 15:49:30 +0200 Subject: pkg-get, remplacé par pkg-get-awk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/pkg-get-awk/.footprint.i686 | 13 - base/pkg-get-awk/.footprint.x86_64 | 13 - base/pkg-get-awk/.md5sum.i686 | 4 - base/pkg-get-awk/.md5sum.x86_64 | 4 - base/pkg-get-awk/Pkgfile | 25 -- base/pkg-get-awk/pkg-get-awk.conf | 11 - base/pkg-get-awk/pkg-get.awk | 829 ------------------------------------- base/pkg-get-awk/pkg-get.po | 204 --------- base/pkg-get-awk/syn | 51 --- base/pkg-get/.footprint.i686 | 14 +- base/pkg-get/.footprint.x86_64 | 14 +- base/pkg-get/.md5sum.i686 | 5 +- base/pkg-get/.md5sum.x86_64 | 5 +- base/pkg-get/Pkgfile | 38 +- base/pkg-get/pkg-get-awk.conf | 11 + base/pkg-get/pkg-get.awk | 829 +++++++++++++++++++++++++++++++++++++ base/pkg-get/pkg-get.po | 204 +++++++++ base/pkg-get/syn | 29 +- 18 files changed, 1101 insertions(+), 1202 deletions(-) delete mode 100644 base/pkg-get-awk/.footprint.i686 delete mode 100644 base/pkg-get-awk/.footprint.x86_64 delete mode 100644 base/pkg-get-awk/.md5sum.i686 delete mode 100644 base/pkg-get-awk/.md5sum.x86_64 delete mode 100644 base/pkg-get-awk/Pkgfile delete mode 100644 base/pkg-get-awk/pkg-get-awk.conf delete mode 100755 base/pkg-get-awk/pkg-get.awk delete mode 100644 base/pkg-get-awk/pkg-get.po delete mode 100644 base/pkg-get-awk/syn create mode 100644 base/pkg-get/pkg-get-awk.conf create mode 100755 base/pkg-get/pkg-get.awk create mode 100644 base/pkg-get/pkg-get.po (limited to 'base') diff --git a/base/pkg-get-awk/.footprint.i686 b/base/pkg-get-awk/.footprint.i686 deleted file mode 100644 index 9dd0582f4..000000000 --- a/base/pkg-get-awk/.footprint.i686 +++ /dev/null @@ -1,13 +0,0 @@ -drwxr-xr-x root/root etc/ --rw-rw-r-- root/root etc/pkg-get-awk.conf -lrwxrwxrwx root/root etc/pkg-get.conf -> pkg-get-awk.conf -drwxr-xr-x root/root usr/ -drwxr-xr-x root/root usr/bin/ -lrwxrwxrwx root/root usr/bin/pkg-get -> pkg-get.awk --rwxr-xr-x root/root usr/bin/pkg-get.awk --rwxr-xr-x root/root usr/bin/syn.awk -drwxr-xr-x root/root usr/share/ -drwxr-xr-x root/root usr/share/locale/ -drwxr-xr-x root/root usr/share/locale/en/ -drwxr-xr-x root/root usr/share/locale/en/LC_MESSAGES/ --rw-r--r-- root/root usr/share/locale/en/LC_MESSAGES/pkg-get.mo diff --git a/base/pkg-get-awk/.footprint.x86_64 b/base/pkg-get-awk/.footprint.x86_64 deleted file mode 100644 index 9dd0582f4..000000000 --- a/base/pkg-get-awk/.footprint.x86_64 +++ /dev/null @@ -1,13 +0,0 @@ -drwxr-xr-x root/root etc/ --rw-rw-r-- root/root etc/pkg-get-awk.conf -lrwxrwxrwx root/root etc/pkg-get.conf -> pkg-get-awk.conf -drwxr-xr-x root/root usr/ -drwxr-xr-x root/root usr/bin/ -lrwxrwxrwx root/root usr/bin/pkg-get -> pkg-get.awk --rwxr-xr-x root/root usr/bin/pkg-get.awk --rwxr-xr-x root/root usr/bin/syn.awk -drwxr-xr-x root/root usr/share/ -drwxr-xr-x root/root usr/share/locale/ -drwxr-xr-x root/root usr/share/locale/en/ -drwxr-xr-x root/root usr/share/locale/en/LC_MESSAGES/ --rw-r--r-- root/root usr/share/locale/en/LC_MESSAGES/pkg-get.mo diff --git a/base/pkg-get-awk/.md5sum.i686 b/base/pkg-get-awk/.md5sum.i686 deleted file mode 100644 index b86a7301c..000000000 --- a/base/pkg-get-awk/.md5sum.i686 +++ /dev/null @@ -1,4 +0,0 @@ -3e833be041e5cb66c747c1d6b9a6258b pkg-get-awk.conf -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 deleted file mode 100644 index b86a7301c..000000000 --- a/base/pkg-get-awk/.md5sum.x86_64 +++ /dev/null @@ -1,4 +0,0 @@ -3e833be041e5cb66c747c1d6b9a6258b pkg-get-awk.conf -342244762702ba95327867a4aba29a93 pkg-get.awk -bf4713f8f6976dd4d2d860fe6b4b03d0 pkg-get.po -4d89f89107b269e1579a7e4a440eddb1 syn diff --git a/base/pkg-get-awk/Pkgfile b/base/pkg-get-awk/Pkgfile deleted file mode 100644 index 7ef55d5c1..000000000 --- a/base/pkg-get-awk/Pkgfile +++ /dev/null @@ -1,25 +0,0 @@ -# Description: Un gestionnaire de paquets binaires pour NuTyX léger et rapide -# URL: http://www.nutyx.org -# Maintainer: NuTyX core team -# Packager: guy_ - -name=pkg-get-awk -version=0.3.2 -release=3 -source=(syn pkg-get.awk pkg-get-awk.conf pkg-get.po) - -PKGMK_KEEP_LOCALES=yes - -build() { - msgfmt pkg-get.po -o pkg-get.mo - mkdir -p $PKG/usr/bin - install -m 755 pkg-get.awk $PKG/usr/bin - install -m 755 syn $PKG/usr/bin/syn.awk - ln -s pkg-get.awk $PKG/usr/bin/pkg-get - mkdir -p $PKG/etc - install -m 664 pkg-get-awk.conf $PKG/etc - sed -i "s/uname-m/`uname -m`/g" $PKG/etc/pkg-get-awk.conf - ln -s pkg-get-awk.conf $PKG/etc/pkg-get.conf - mkdir -p $PKG/usr/share/locale/en/LC_MESSAGES - install -m 644 pkg-get.mo $PKG/usr/share/locale/en/LC_MESSAGES -} diff --git a/base/pkg-get-awk/pkg-get-awk.conf b/base/pkg-get-awk/pkg-get-awk.conf deleted file mode 100644 index 82e53979b..000000000 --- a/base/pkg-get-awk/pkg-get-awk.conf +++ /dev/null @@ -1,11 +0,0 @@ -### -# /etc/pkg-get.conf -# -# pkg-get configuration file -# Dépot des paquets NuTyX -# Activez le dépot test pour profiter des mise à jour test -# pkgdir /srv/NuTyX/test|http://nutyx.meticul.eu/attapu/uname-m/test -pkgdir /srv/NuTyX/release|http://nutyx.meticul.eu/pakxe/uname-m/release -# runscripts: if "yes" pre-post install scripts are -# automatically executed. Handle with care. -runscripts yes diff --git a/base/pkg-get-awk/pkg-get.awk b/base/pkg-get-awk/pkg-get.awk deleted file mode 100755 index d8e526a80..000000000 --- a/base/pkg-get-awk/pkg-get.awk +++ /dev/null @@ -1,829 +0,0 @@ -#! /usr/bin/awk -f -# _ _ _ -# _ __ | | ____ _ __ _ ___| |_ __ ___ _| | __ -# | '_ \| |/ / _` |___ / _` |/ _ \ __| / _` \ \ /\ / / |/ / -# | |_) | < (_| |___| (_| | __/ |_ _ | (_| |\ V V /| < -# | .__/|_|\_\__, | \__, |\___|\__| (_) \__,_| \_/\_/ |_|\_\ -# |_| |___/ |___/ -# -# A binary package management utility - - -function configs( a, i, k, n, old_FS) -{ - n=split(ENVIRON["_"],a,"/") - NPKG = a[n] - VERSION = "0.3.2" - DATE = "2011-03-11" - - # defauts - CONF = "/etc/pkg-get.conf" - VERSFILE = "/var/lib/pkg/nutyx-version" - DB = "/var/lib/pkg/db" - LOCKER = "/var/lib/pkg/pkg-get.locker" - PRE = "n" - POST = "n" - PKGDIR[0] = "/srv/NuTyX/release/" - load_NUTYX_VERSION() - "uname -p " | getline ENV; close("uname -p") - WEBDIR[0] = "http://nutyx.meticul.eu/" NUTYX_VERSION "/" ENV "/release/" - - # arguments - OPER=(ARGC>1) ? ARGV[1] : "" - PKG =(ARGC>2) ? ARGV[2] : "" - for (i=2; i0) { - print "ERREUR", rc - exit 1 - } - if (!("-im" in tb_OPT)) - verif_md5sum(tb_PKGDIR[a[1]], pak) - } - } -} - - -function dsearch( old_FS, j, FILE) -{ - old_FS = FS - FS="[:#]" - for (j=0; j0) { - if (index($1,ARGV[2]) || index($5,ARGV[2])) - print $1 - } - } - close(FILE) - FS = old_FS -} - - -function help() -{ - version() - print "\033[1;33m" _"Usage:" "\033[1;0m" - print " " NPKG " current - " _"affiche la version installée de " - print " " NPKG " dependent - " _"affiche la liste des paquets dépendants de " - print " " NPKG " depends - " _"affiche la liste des dépendances de " - print " " NPKG " depinst - " _"installe et ses(leurs) dépendances" - print " " NPKG " diff - " _"affiche la liste des paquets obsolètes" - print " " NPKG " dsearch - " _"cherche les paquets dont le nom/la description contient " - print " " NPKG " help - " _"affiche cette aide" - print " " NPKG " info - " _"affiche les informations concernant " - print " " NPKG " isinst - " _"affiche si est installé" - print " " NPKG " install - " _"installe " - print " " NPKG " list - " _"affiche la liste des paquets disponibles dans les dépôts" - print " " NPKG " listinst - " _"affiche la liste des paquets installés" - print " " NPKG " listlocked - " _"affiche la liste des paquets verrouillés" - print " " NPKG " lock - " _"verrouille (empêche la mise à jour)" - print " " NPKG " path - " _"affiche le répertoire d'installtion de " - print " " NPKG " quickdep - " _"affiche la liste abrégée des dépendances de " - print " " NPKG " quickdiff - " _"affiche la liste abrégée des paquets obsolètes" - print " " NPKG " readme - " _"affiche les informations README de si existantes" - print " " NPKG " search - " _"cherche les paquets dont le nom contient " - print " " NPKG " sync - " _"synchronise avec le dépôt" - print " " NPKG " sysup - " _"met à jour les paquets obsolètes, télécharge si nécessaire" - print " " NPKG " unlock - " _"déverrouille (permet la mise à jour)" - print " " NPKG " update - " _"met à jour , télécharge si nécessaire" - print " " NPKG " version - " _"affiche la version de ce script" - print "\033[1;33m" _"Exemple:" "\033[1;0m" - print " " NPKG " depends k3b" -} - - -function info( a, b, c, cmd, g, gline, n, rline, out) -{ - load_REPO() - cmd = "grep ^" PKG " " tb_PKGDIR[PKG] REPO - cmd | getline rline - if (rline) { - close(cmd) - split (rline, a, ":") - split (a[1], b, "#") - print _"Nom " " : " PKG - cmd = "grep " PKG " " tb_PKGDIR[PKG] GRP " 2>&1" - cmd | getline gline - close(cmd) - split (gline, g, ":") - if (g[1]=="grep") - print _"Groupe" " : " - else - print _"Groupe" " : " g[1] - split(b[2], c, "-") - print "Version" " : " c[1] - sub(".pkg.tar.xz","",c[2]) - print "Release" " : " c[2] - print "Description" " : " a[4] - print "URL" " : " tb_WEBDIR[PKG] a[1] - print "Md5sum" " : " a[3] - print _"Taille" " : " a[2] - load_DEPS() - print _"Dépend de " " : " tb_DEPS[PKG] - out="" - if (tb_PRE[PKG]=="yes") - out = out "pre-install " - if (tb_POST[PKG]=="yes") - out = out "post-install " - if (tb_READ[PKG]=="yes") - out = out "readme" - print _"Fichiers" " : " out - } else - print _"Paquet" " '" PKG "' " _"non trouvé" -} - - -function install( i) -{ - verif_if_root() - load_REPO() - if (!(PKG in tb_REPO)) { - print _"Paquet" " " _"indisponible" ": "PKG - exit 1 - } - load_DB() - for (i=1; i<=nPKG; i++) { - if (tb_PKG[i] in tb_DB) - print _"Le paquet" " " tb_PKG[i] " " _"est déjà installé" - else - install2_update2(tb_PKG[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 - 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 - if ("--dry" in tb_OPT) { - print "\033[1;37m" cmd "\033[1;0m" - } else { - while ((cmd | getline) >0) - 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) { - print "\033[1;33m" cmd "\033[1;0m" - } else { - while ((cmd | getline) >0) - print - close(cmd) - } - } -} - - -function isinst() -{ - load_DB() - if (PKG in tb_DB) - print _"Le paquet" " " PKG " " _"est installé" - else - print _"Le paquet" " " PKG " " _"n'est pas installé" -} - - -function list( old_FS, FILE, j, prev) -{ - old_FS = FS - FS="#" - for (j=0; j0) { - if ($1 != prev) { - print $1 - prev = $1 - } - } - close(FILE) - } - FS = old_FS -} - - -function listinst( old_FS, old_RS, fl) -{ - old_FS = FS; FS = "\t" - old_RS = RS; RS = "" - while (getline < DB) - print $1 - close(DB) - FS = old_FS - RS = old_RS -} - - -function listlocked() -{ - while (getline < LOCKER) - print $1 - close(LOCKER) -} - - -function load_DB( old_FS, old_RS, fl, pak) -{ - old_FS=FS; FS="\n" - old_RS=RS; RS="" - while (getline < DB) - tb_DB[$1]=$2 - close(DB) - FS=old_FS - RS=old_RS -} - - -function load_DEPS( j, FILE) -{ - for (j=0; j0) { - if (!($1 in tb_DEPS)) { - tb_DEPS[$1] = $3 - tb_DEP_TRT[$1] = 0 - tb_DEP_DIR[$1] = PKGDIR[j] - } - } - close(FILE) - } -} - - -function load_LOCKER() -{ - while (getline < LOCKER) - tb_LOCK[$1] = 1 - close(LOCKER) -} - - -function load_NUTYX_VERSION( old_FS) -{ - old_FS = FS - FS = "-" - getline < VERSFILE - if ($1=="2010") NUTYX_VERSION = "attapu" - else if ($1=="2011") NUTYX_VERSION = "pakxe" - close(VERSFILE) - FS = old_FS -} - - -function load_RDEPS( a, FILE, i, j, n) -{ - for (j=0; j0) { - n=split($3, a, ",") - for (i=1; i<=n; i++) { - if (a[i] in tb_RDEPS) { - if (!index(tb_RDEPS[a[i]],$1)) - tb_RDEPS[a[i]] = tb_RDEPS[a[i]] "," $1 - } else { - tb_RDEPS[a[i]] = $1 - } - } - } - close(FILE) - } -} - - -function load_REPO( FILE, j, old_FS) -{ - old_FS = FS - FS="[:#]" - for (j=0; j>LOCKER - } - close(LOCKER) -} - - -function path( a, cmd, j) -{ - load_REPO() - if (!PKG) - print NPKG ": 'path' " _"demande un argument" - else - print tb_PKGDIR[PKG] -} - - -function printff() -{ - print _"Désolé, fonction" " " OPER " " _"indisponible" "..." - exit 1 -} - - -function quickdep() -{ - load_DB() - load_DEPS() - load_REPO() - quickdep2(PKG) - printf ("%s\n",PKG) -} - - -function quickdep2(Pkg, a, i, n) -{ - n=split(tb_DEPS[Pkg],a,",") - for (i=1; i<=n; i++) { - if (tb_DEP_TRT[a[i]]==0) { - tb_DEP_TRT[a[i]]++ - if (a[i] in tb_DEPS) - quickdep2(a[i]) - printf("%s ", a[i]) - } - } -} - - -function quickdiff(Dest, a, i, n, pak) -{ - load_DB() - load_LOCKER() - load_REPO() - for (pak in tb_DB) - a[pak]=pak - n=asort(a) - delete tb_PKG - nPKG=0 - for (i=1;i<=n;i++) { - pak=a[i] - if ((pak in tb_REPO) && (!(pak in tb_LOCK)) && (tb_DB[pak]!=tb_REPO[pak])) { - if (Dest=="tb") - tb_PKG[++nPKG] = pak - else - printf("%s ", pak) - } - } - printf("\n") -} - - -function quickhelp() { - print "\033[1;33m" _"Usage" "\033[1;0m: " NPKG " command [package2 ... packageN] [options]" - print "\033[1;33m" _"Quelques commandes" "\033[1;0m:" - print " sync " _"synchronise avec le dépôt" - print " depinst " _"installe package(s) et ses(leurs) dépendances" - print " info " _"informations concernant le package" - print " sysup " _"met à jour les paquets obsolètes" - print " diff " _"affiche la liste des paquets obsolètes" - print "\033[1;33m" _"Quelques options:" "\033[1;0m" - print " -do " _"télécharge seulement" - print " --install-scripts " _"utilise les scripts install" - print " -r " _"utilise" " " _"pour" " pkgadd" - print "\033[1;33m" _"Examples" "\033[1;0m:" - print " " NPKG " install sqlite pysqlite" - print " " NPKG " help" - print _"Pour d'autres commandes et examples, voir la page de manuel" -} - - -function readme( fl, j, FILE) -{ - for (j=0; j0) { - if (fl==1) { - if (index($0,"##### PKGREADME: ")) - exit - print $0 - } - if (index($0,"##### PKGREADME: "PKG)) - fl=1 - } - close(FILE) - } -} - - -function search( j, FILE, old_FS) -{ - old_FS = FS - FS="[:#]" - for (j=0; j0) { - if (index($1,ARGV[2])) - print $1 - } - close(FILE) - } - FS = old_FS -} - - -function sync( cmd, i, j, pak, rc) -{ - verif_if_root() - pak[1]="PKGREPO" - pak[2]="PKGDEPS" - pak[3]="PKGREAD" - pak[4]="PKGINST" - pak[5]="PKGGRP" - for (j=0; j "") { - for (i=1; i<=4; i++) { - cmd="wget -q -O "PKGDIR[j] pak[i] " " WEBDIR[j] pak[i] - if ("--dry" in tb_OPT) { - print "\033[1;34m" cmd "\033[1;0m" - } else { - rc=system(cmd) - if (rc>0) { - print "ERREUR", rc - exit 1 - } - } - } - } - } -} - - -function sysup( i) -{ - quickdiff("tb") - update() -} - - -function unlock( i, n, fl, tb_LCK) -{ - verif_if_root() - while (getline < LOCKER) { - fl="y" - for (i=1; i<=nPKG; i++) - if ($1==tb_PKG[i]) - fl = "n" - if (fl=="y") - tb_LCK[++n] = $1 - } - close(LOCKER) - printf("") > LOCKER - for (i=1; i<=n; i++) - print tb_LCK[i] >> LOCKER - close(LOCKER) -} - - -function update( i, pak) -{ - verif_if_root() - load_LOCKER() - load_REPO() - load_DB() - for (i=1; i<=nPKG; i++) { - 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") - } - } -} - - -function verif_if_root( cmd) -{ - if (!("--dry" in tb_OPT)) { - cmd="whoami" - cmd | getline - if ($1 !="root") { - print "\033[1;31m" _"Veuillez exécuter ce programme en tant que root !" "\033[1;0m" - exit 1 - } - close(cmd) - } -} - - -function verif_md5sum(dir, pk, cmd, md5, a, rep) -{ - cmd="md5sum " dir pk - cmd | getline - split($0,md5," ") - close(cmd) - split(pk,a,"#") - if (md5[1]!=tb_MD5[a[1]]) { - print "-------> " _"ERREUR" ": " _"md5sum erroné pour " a[1] - print _"requis" ": " tb_MD5[a[1]] - print _"trouvé" ": " md5[1] - print "Supprimer " dir pk " ?" - getline rep - if (rep=="y") { - cmd = "rm " dir pk - while ((cmd | getline) > 0) - print - close(cmd) - } - exit 1 - } -} - - -function version() -{ - print NPKG " " VERSION " (" DATE ")" -} - - -function wrongparm() -{ - version() - print _"Paramètre" " '" OPER "' " _"erroné" - exit 1 -} - - -#------------------------------------------------ -# -# M A I N -# -#------------------------------------------------ - -BEGIN { - configs() - - if (OPER=="") quickhelp() - else if (OPER=="current") current() - else if (OPER=="dependent") dependent() - else if (OPER=="depends") depends() - else if (OPER=="depinst") rc=depinst() - else if (OPER=="diff") diff() - else if (OPER=="dsearch") dsearch() - else if (OPER=="help") help() - else if (OPER=="info") info() - else if (OPER=="install") install() - else if (OPER=="isinst") isinst() - else if (OPER=="list") list() - else if (OPER=="listinst") listinst() - else if (OPER=="listlocked") listlocked() - else if (OPER=="lock") lock() - else if (OPER=="path") path() - else if (OPER=="printf") printff() - else if (OPER=="quickdep") quickdep() - else if (OPER=="quickdiff") quickdiff() - else if (OPER=="readme") readme() - else if (OPER=="search") search() - else if (OPER=="sync") sync() - else if (OPER=="sysup") sysup() - else if (OPER=="unlock") unlock() - else if (OPER=="update") update() - else if (OPER=="version") version() - else wrongparm() - - exit -} diff --git a/base/pkg-get-awk/pkg-get.po b/base/pkg-get-awk/pkg-get.po deleted file mode 100644 index d0d83732c..000000000 --- a/base/pkg-get-awk/pkg-get.po +++ /dev/null @@ -1,204 +0,0 @@ -msgid "Paquet" -msgstr "Package" - -msgid "non install\303\251" -msgstr "not installed" - -msgid "- d\303\251pendences ([i] = install\303\251, [u] = mise \303\240 jour possible)" -msgstr "- dependencies ([i] = installed, [u] = upgradable)" - -msgid "Diff\303\251rences entre paquets install\303\251s et paquets disponibles dans le d\303\251p\303\264ts:\n" -msgstr "Differences between installed packages and packages availables in the repository\n" - -msgid "Install\303\251" -msgstr "Installed" - -msgid "Disponible dans les d\303\251p\303\264ts\n" -msgstr "Available in the repositories\n" - -msgid "Usage:" -msgstr "Usage:" - -msgid "affiche la version install\303\251e de " -msgstr "show installed version of " - -msgid "affiche la liste des paquets d\303\251pendants de " -msgstr "list packages dependents of " - -msgid "affiche la liste des d\303\251pendances de " -msgstr "list dependencies of " - -msgid "installe et ses(leurs) d\303\251pendances" -msgstr "install and their dependencies" - -msgid "affiche la liste des paquets obsol\303\250tes" -msgstr "list outdated packages" - -msgid "cherche les paquets dont le nom/la description contient " -msgstr "search for packages which name or description contain " - -msgid "affiche cette aide" -msgstr "display help screen" - -msgid "affiche les informations concernant " -msgstr "show information about " - -msgid "affiche si est install\303\251" -msgstr "display whether a package is installed" - -msgid "installe " -msgstr "install " - -msgid "affiche la liste des paquets disponibles dans les d\303\251p\303\264ts" -msgstr "list packages available in repositories" - -msgid "affiche la liste des paquets install\303\251s" -msgstr "list installed packages" - -msgid "affiche la liste des paquets verrouill\303\251s" -msgstr "list locked packages" - -msgid "verrouille (emp\303\252che la mise \303\240 jour)" -msgstr "lock " -msgstr "show local path of " - -msgid "affiche la liste abr\303\251g\303\251e des d\303\251pendances de " -msgstr "show a brief list of dependencies for " - -msgid "affiche la liste abr\303\251g\303\251e des paquets obsol\303\250tes" -msgstr "show a brief list of outdated packages" - -msgid "affiche les informations README de si existantes" -msgstr "print README information (if available) for the package" - -msgid "cherche les paquets dont le nom contient " -msgstr "search for packages which name contains " - -msgid "met \303\240 jour les paquets obsol\303\250tes, t\303\251l\303\251charge si n\303\251cessaire" -msgstr "update outdated packages, download if necessary" - -msgid "d\303\251verrouille (permet la mise \303\240 jour)" -msgstr "unlock , t\303\251l\303\251charge si n\303\251cessaire" -msgstr "update , download if necessary" - -msgid "affiche la version de ce script" -msgstr "show this script version" - -msgid "Exemple:" -msgstr "Exemple:" - -msgid "Nom " -msgstr "Name" - -msgid "Groupe" -msgstr "Group " - -msgid "Taille" -msgstr "Size " - -msgid "D\303\251pend de " -msgstr "Depends on" - -msgid "non trouv\303\251" -msgstr "not found" - -msgid "Le paquet" -msgstr "The package" - -msgid "est install\303\251" -msgstr "is installed" - -msgid "est déjà install\303\251" -msgstr "is already installed" - -msgid "n'est pas install\303\251" -msgstr "isn't installed" - -msgid "D\303\251sol\303\251, fonction" -msgstr "Sorry, function" - -msgid "indisponible" -msgstr "unavailable" - -msgid "Usage" -msgstr "Usage" - -msgid "Quelques commandes" -msgstr "Some comands" - -msgid "synchronise avec le d\303\251p\303\264t" -msgstr "syncronize local packages with the ones from the remote repository" - -msgid "installe package(s) et ses(leurs) d\303\251pendances" -msgstr "install given packages and relative dependencies" - -msgid "informations concernant le package" -msgstr "show information about package" - -msgid "met \303\240 jour les paquets obsol\303\250tes" -msgstr "update all outdated packages" - -msgid "Quelques options:" -msgstr "Some options:" - -msgid "utilise les scripts install" -msgstr "use install scripts" - -msgid "Examples" -msgstr "Examples" - -msgid "Pour d'autres commandes et examples, voir la page de manuel" -msgstr "For other commands and samples, see the pkg-get(8) man page" - -msgid "paquet \303\240 mettre \303\240 jour:" -msgstr "updatable package" - -msgid "Veuillez ex\303\251cuter ce programme en tant que root !" -msgstr "Please run this script as root !" - -msgid "Param\303\250tre" -msgstr "Parameter" - -msgid "erron\303\251" -msgstr "wrong" - -msgid "Fichiers" -msgstr "Files " - -msgid "demande un argument" -msgstr "requires an argument" - -msgid "t\303\251l\303\251charge seulement" -msgstr "download only" - -msgid "utilise" -msgstr "use" - -msgid "pour" -msgstr "for" - -msgid "ERREUR" -msgstr "ERROR" - -msgid "md5sum erron\303\251 pour " -msgstr "md5sum mismatching for " - -msgid "requis" -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" - diff --git a/base/pkg-get-awk/syn b/base/pkg-get-awk/syn deleted file mode 100644 index 95284d529..000000000 --- a/base/pkg-get-awk/syn +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -MediaDepot=/media/cdrom/depot -Depot=/srv/NuTyX -find_cd() { -EXPECT_LABEL="nutyxcd" -let PKGNB=0 -for SYS in /sys/block/sd* /sys/block/sr* ; do - if [ ! -d "$SYS" ]; then continue; fi - DEV=/dev/${SYS##*/} - LABEL=`dd if=$DEV bs=1 skip=32808 count=32 2>/dev/null` - if [ $LABEL == $EXPECT_LABEL ] 2>/dev/null ; then - mkdir -p /media/cdrom 2>/dev/null - mount $DEV /media/cdrom - if [ ! -d /media/cdrom/depot ]; then - umount -n /media/cdrom - fi - break - fi -done -} -if [ ! "$EUID" -eq 0 ]; then - echo "Seul le compte root peut synchroniser les ports NuTyX" - exit 1 -fi -if ! mountpoint /media/cdrom > /dev/null; then - find_cd -fi -for i in `cat /etc/pkg-get.conf |grep -v ^#|grep http|cut -d "|" -f 1|cut -d" " -f2|cut -d"/" -f4` -do - if [ -a $Depot/$i ]; then - rm -r $Depot/$i - fi - mkdir -p $Depot/$i -done -pkg-get sync -for i in `cat /etc/pkg-get.conf |grep -v ^#|grep http|cut -d "|" -f 1|cut -d" " -f2|cut -d"/" -f4` -do - if [ -d $MediaDepot/$i ]; then - rm -r $Depot/$i > /dev/null 2>&1 - mkdir -p $Depot/$i - for j in $MediaDepot/$i/*.xz - do - let PKGNB=$PKGNB+1 - fj=`basename $j` - ln -sf $MediaDepot/$i/$fj $Depot/$i/$fj - echo -n -e "$PKGNB Paquets trouvés sur le média\r" - done - echo "$PKGNB Paquets trouvés sur le média" - cp $MediaDepot/$i/PKG* $Depot/$i/ - fi -done diff --git a/base/pkg-get/.footprint.i686 b/base/pkg-get/.footprint.i686 index 60666b99f..9dd0582f4 100644 --- a/base/pkg-get/.footprint.i686 +++ b/base/pkg-get/.footprint.i686 @@ -1,9 +1,13 @@ drwxr-xr-x root/root etc/ +-rw-rw-r-- root/root etc/pkg-get-awk.conf +lrwxrwxrwx root/root etc/pkg-get.conf -> pkg-get-awk.conf drwxr-xr-x root/root usr/ drwxr-xr-x root/root usr/bin/ --rwxr-xr-x root/root usr/bin/pkg-repgen +lrwxrwxrwx root/root usr/bin/pkg-get -> pkg-get.awk +-rwxr-xr-x root/root usr/bin/pkg-get.awk +-rwxr-xr-x root/root usr/bin/syn.awk drwxr-xr-x root/root usr/share/ -drwxr-xr-x root/root usr/share/man/ -drwxr-xr-x root/root usr/share/man/man8/ --rw-r--r-- root/root usr/share/man/man8/pkg-get.8.gz --rw-r--r-- root/root usr/share/man/man8/pkg-repgen.8.gz +drwxr-xr-x root/root usr/share/locale/ +drwxr-xr-x root/root usr/share/locale/en/ +drwxr-xr-x root/root usr/share/locale/en/LC_MESSAGES/ +-rw-r--r-- root/root usr/share/locale/en/LC_MESSAGES/pkg-get.mo diff --git a/base/pkg-get/.footprint.x86_64 b/base/pkg-get/.footprint.x86_64 index 60666b99f..9dd0582f4 100644 --- a/base/pkg-get/.footprint.x86_64 +++ b/base/pkg-get/.footprint.x86_64 @@ -1,9 +1,13 @@ drwxr-xr-x root/root etc/ +-rw-rw-r-- root/root etc/pkg-get-awk.conf +lrwxrwxrwx root/root etc/pkg-get.conf -> pkg-get-awk.conf drwxr-xr-x root/root usr/ drwxr-xr-x root/root usr/bin/ --rwxr-xr-x root/root usr/bin/pkg-repgen +lrwxrwxrwx root/root usr/bin/pkg-get -> pkg-get.awk +-rwxr-xr-x root/root usr/bin/pkg-get.awk +-rwxr-xr-x root/root usr/bin/syn.awk drwxr-xr-x root/root usr/share/ -drwxr-xr-x root/root usr/share/man/ -drwxr-xr-x root/root usr/share/man/man8/ --rw-r--r-- root/root usr/share/man/man8/pkg-get.8.gz --rw-r--r-- root/root usr/share/man/man8/pkg-repgen.8.gz +drwxr-xr-x root/root usr/share/locale/ +drwxr-xr-x root/root usr/share/locale/en/ +drwxr-xr-x root/root usr/share/locale/en/LC_MESSAGES/ +-rw-r--r-- root/root usr/share/locale/en/LC_MESSAGES/pkg-get.mo diff --git a/base/pkg-get/.md5sum.i686 b/base/pkg-get/.md5sum.i686 index 94160a452..b86a7301c 100644 --- a/base/pkg-get/.md5sum.i686 +++ b/base/pkg-get/.md5sum.i686 @@ -1 +1,4 @@ -4255529e512555b8759dc939305b708c pkg-get-0.5.2.tar.gz +3e833be041e5cb66c747c1d6b9a6258b pkg-get-awk.conf +342244762702ba95327867a4aba29a93 pkg-get.awk +bf4713f8f6976dd4d2d860fe6b4b03d0 pkg-get.po +4d89f89107b269e1579a7e4a440eddb1 syn diff --git a/base/pkg-get/.md5sum.x86_64 b/base/pkg-get/.md5sum.x86_64 index 94160a452..b86a7301c 100644 --- a/base/pkg-get/.md5sum.x86_64 +++ b/base/pkg-get/.md5sum.x86_64 @@ -1 +1,4 @@ -4255529e512555b8759dc939305b708c pkg-get-0.5.2.tar.gz +3e833be041e5cb66c747c1d6b9a6258b pkg-get-awk.conf +342244762702ba95327867a4aba29a93 pkg-get.awk +bf4713f8f6976dd4d2d860fe6b4b03d0 pkg-get.po +4d89f89107b269e1579a7e4a440eddb1 syn diff --git a/base/pkg-get/Pkgfile b/base/pkg-get/Pkgfile index 204985eb1..35be7e055 100644 --- a/base/pkg-get/Pkgfile +++ b/base/pkg-get/Pkgfile @@ -1,23 +1,25 @@ -# Description: Outil de gestion de paquets binaires pour NuTyX -# URL: http://www.varlock.com et nutyx.org -# Maintainer: thierryn1 at hispeed dot ch -# Packager: thierryn1 at hispeed dot ch +# Description: Un gestionnaire de paquets binaires pour NuTyX léger et rapide +# URL: http://www.nutyx.org +# Maintainer: NuTyX core team +# Packager: guy_ name=pkg-get -version=0.5.2 -release=2 -source=(http://nutyx.meticul.eu/files/$name-$version.tar.gz) +version=0.3.2 +release=3 +source=(syn pkg-get.awk pkg-get-awk.conf pkg-get.po) + +PKGMK_KEEP_LOCALES=yes build() { -ARCH_=`uname -m` - cd $name-$version - make PREFIX=$PKG/usr CFGDIR=$PKG/etc install - mkdir -p $PKG/usr/share - mv $PKG/usr/{man,share/man} - rm $PKG/etc/pkg-get.conf - rm $PKG/usr/bin/pkg-get - if [ "$ARCH_" == "x86_64" ]; then - sed -i "s/i686/x86_64/" $PKG/usr/bin/pkg-repgen - fi + msgfmt pkg-get.po -o pkg-get.mo + mkdir -p $PKG/usr/bin + install -m 755 pkg-get.awk $PKG/usr/bin + install -m 755 syn $PKG/usr/bin/syn + ln -s pkg-get.awk $PKG/usr/bin/pkg-get + mkdir -p $PKG/etc + install -m 664 pkg-get-awk.conf $PKG/etc + sed -i "s/uname-m/`uname -m`/g" $PKG/etc/pkg-get-awk.conf + ln -s pkg-get-awk.conf $PKG/etc/pkg-get.conf + mkdir -p $PKG/usr/share/locale/en/LC_MESSAGES + install -m 644 pkg-get.mo $PKG/usr/share/locale/en/LC_MESSAGES } - diff --git a/base/pkg-get/pkg-get-awk.conf b/base/pkg-get/pkg-get-awk.conf new file mode 100644 index 000000000..82e53979b --- /dev/null +++ b/base/pkg-get/pkg-get-awk.conf @@ -0,0 +1,11 @@ +### +# /etc/pkg-get.conf +# +# pkg-get configuration file +# Dépot des paquets NuTyX +# Activez le dépot test pour profiter des mise à jour test +# pkgdir /srv/NuTyX/test|http://nutyx.meticul.eu/attapu/uname-m/test +pkgdir /srv/NuTyX/release|http://nutyx.meticul.eu/pakxe/uname-m/release +# runscripts: if "yes" pre-post install scripts are +# automatically executed. Handle with care. +runscripts yes diff --git a/base/pkg-get/pkg-get.awk b/base/pkg-get/pkg-get.awk new file mode 100755 index 000000000..d8e526a80 --- /dev/null +++ b/base/pkg-get/pkg-get.awk @@ -0,0 +1,829 @@ +#! /usr/bin/awk -f +# _ _ _ +# _ __ | | ____ _ __ _ ___| |_ __ ___ _| | __ +# | '_ \| |/ / _` |___ / _` |/ _ \ __| / _` \ \ /\ / / |/ / +# | |_) | < (_| |___| (_| | __/ |_ _ | (_| |\ V V /| < +# | .__/|_|\_\__, | \__, |\___|\__| (_) \__,_| \_/\_/ |_|\_\ +# |_| |___/ |___/ +# +# A binary package management utility + + +function configs( a, i, k, n, old_FS) +{ + n=split(ENVIRON["_"],a,"/") + NPKG = a[n] + VERSION = "0.3.2" + DATE = "2011-03-11" + + # defauts + CONF = "/etc/pkg-get.conf" + VERSFILE = "/var/lib/pkg/nutyx-version" + DB = "/var/lib/pkg/db" + LOCKER = "/var/lib/pkg/pkg-get.locker" + PRE = "n" + POST = "n" + PKGDIR[0] = "/srv/NuTyX/release/" + load_NUTYX_VERSION() + "uname -p " | getline ENV; close("uname -p") + WEBDIR[0] = "http://nutyx.meticul.eu/" NUTYX_VERSION "/" ENV "/release/" + + # arguments + OPER=(ARGC>1) ? ARGV[1] : "" + PKG =(ARGC>2) ? ARGV[2] : "" + for (i=2; i0) { + print "ERREUR", rc + exit 1 + } + if (!("-im" in tb_OPT)) + verif_md5sum(tb_PKGDIR[a[1]], pak) + } + } +} + + +function dsearch( old_FS, j, FILE) +{ + old_FS = FS + FS="[:#]" + for (j=0; j0) { + if (index($1,ARGV[2]) || index($5,ARGV[2])) + print $1 + } + } + close(FILE) + FS = old_FS +} + + +function help() +{ + version() + print "\033[1;33m" _"Usage:" "\033[1;0m" + print " " NPKG " current - " _"affiche la version installée de " + print " " NPKG " dependent - " _"affiche la liste des paquets dépendants de " + print " " NPKG " depends - " _"affiche la liste des dépendances de " + print " " NPKG " depinst - " _"installe et ses(leurs) dépendances" + print " " NPKG " diff - " _"affiche la liste des paquets obsolètes" + print " " NPKG " dsearch - " _"cherche les paquets dont le nom/la description contient " + print " " NPKG " help - " _"affiche cette aide" + print " " NPKG " info - " _"affiche les informations concernant " + print " " NPKG " isinst - " _"affiche si est installé" + print " " NPKG " install - " _"installe " + print " " NPKG " list - " _"affiche la liste des paquets disponibles dans les dépôts" + print " " NPKG " listinst - " _"affiche la liste des paquets installés" + print " " NPKG " listlocked - " _"affiche la liste des paquets verrouillés" + print " " NPKG " lock - " _"verrouille (empêche la mise à jour)" + print " " NPKG " path - " _"affiche le répertoire d'installtion de " + print " " NPKG " quickdep - " _"affiche la liste abrégée des dépendances de " + print " " NPKG " quickdiff - " _"affiche la liste abrégée des paquets obsolètes" + print " " NPKG " readme - " _"affiche les informations README de si existantes" + print " " NPKG " search - " _"cherche les paquets dont le nom contient " + print " " NPKG " sync - " _"synchronise avec le dépôt" + print " " NPKG " sysup - " _"met à jour les paquets obsolètes, télécharge si nécessaire" + print " " NPKG " unlock - " _"déverrouille (permet la mise à jour)" + print " " NPKG " update - " _"met à jour , télécharge si nécessaire" + print " " NPKG " version - " _"affiche la version de ce script" + print "\033[1;33m" _"Exemple:" "\033[1;0m" + print " " NPKG " depends k3b" +} + + +function info( a, b, c, cmd, g, gline, n, rline, out) +{ + load_REPO() + cmd = "grep ^" PKG " " tb_PKGDIR[PKG] REPO + cmd | getline rline + if (rline) { + close(cmd) + split (rline, a, ":") + split (a[1], b, "#") + print _"Nom " " : " PKG + cmd = "grep " PKG " " tb_PKGDIR[PKG] GRP " 2>&1" + cmd | getline gline + close(cmd) + split (gline, g, ":") + if (g[1]=="grep") + print _"Groupe" " : " + else + print _"Groupe" " : " g[1] + split(b[2], c, "-") + print "Version" " : " c[1] + sub(".pkg.tar.xz","",c[2]) + print "Release" " : " c[2] + print "Description" " : " a[4] + print "URL" " : " tb_WEBDIR[PKG] a[1] + print "Md5sum" " : " a[3] + print _"Taille" " : " a[2] + load_DEPS() + print _"Dépend de " " : " tb_DEPS[PKG] + out="" + if (tb_PRE[PKG]=="yes") + out = out "pre-install " + if (tb_POST[PKG]=="yes") + out = out "post-install " + if (tb_READ[PKG]=="yes") + out = out "readme" + print _"Fichiers" " : " out + } else + print _"Paquet" " '" PKG "' " _"non trouvé" +} + + +function install( i) +{ + verif_if_root() + load_REPO() + if (!(PKG in tb_REPO)) { + print _"Paquet" " " _"indisponible" ": "PKG + exit 1 + } + load_DB() + for (i=1; i<=nPKG; i++) { + if (tb_PKG[i] in tb_DB) + print _"Le paquet" " " tb_PKG[i] " " _"est déjà installé" + else + install2_update2(tb_PKG[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 + 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 + if ("--dry" in tb_OPT) { + print "\033[1;37m" cmd "\033[1;0m" + } else { + while ((cmd | getline) >0) + 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) { + print "\033[1;33m" cmd "\033[1;0m" + } else { + while ((cmd | getline) >0) + print + close(cmd) + } + } +} + + +function isinst() +{ + load_DB() + if (PKG in tb_DB) + print _"Le paquet" " " PKG " " _"est installé" + else + print _"Le paquet" " " PKG " " _"n'est pas installé" +} + + +function list( old_FS, FILE, j, prev) +{ + old_FS = FS + FS="#" + for (j=0; j0) { + if ($1 != prev) { + print $1 + prev = $1 + } + } + close(FILE) + } + FS = old_FS +} + + +function listinst( old_FS, old_RS, fl) +{ + old_FS = FS; FS = "\t" + old_RS = RS; RS = "" + while (getline < DB) + print $1 + close(DB) + FS = old_FS + RS = old_RS +} + + +function listlocked() +{ + while (getline < LOCKER) + print $1 + close(LOCKER) +} + + +function load_DB( old_FS, old_RS, fl, pak) +{ + old_FS=FS; FS="\n" + old_RS=RS; RS="" + while (getline < DB) + tb_DB[$1]=$2 + close(DB) + FS=old_FS + RS=old_RS +} + + +function load_DEPS( j, FILE) +{ + for (j=0; j0) { + if (!($1 in tb_DEPS)) { + tb_DEPS[$1] = $3 + tb_DEP_TRT[$1] = 0 + tb_DEP_DIR[$1] = PKGDIR[j] + } + } + close(FILE) + } +} + + +function load_LOCKER() +{ + while (getline < LOCKER) + tb_LOCK[$1] = 1 + close(LOCKER) +} + + +function load_NUTYX_VERSION( old_FS) +{ + old_FS = FS + FS = "-" + getline < VERSFILE + if ($1=="2010") NUTYX_VERSION = "attapu" + else if ($1=="2011") NUTYX_VERSION = "pakxe" + close(VERSFILE) + FS = old_FS +} + + +function load_RDEPS( a, FILE, i, j, n) +{ + for (j=0; j0) { + n=split($3, a, ",") + for (i=1; i<=n; i++) { + if (a[i] in tb_RDEPS) { + if (!index(tb_RDEPS[a[i]],$1)) + tb_RDEPS[a[i]] = tb_RDEPS[a[i]] "," $1 + } else { + tb_RDEPS[a[i]] = $1 + } + } + } + close(FILE) + } +} + + +function load_REPO( FILE, j, old_FS) +{ + old_FS = FS + FS="[:#]" + for (j=0; j>LOCKER + } + close(LOCKER) +} + + +function path( a, cmd, j) +{ + load_REPO() + if (!PKG) + print NPKG ": 'path' " _"demande un argument" + else + print tb_PKGDIR[PKG] +} + + +function printff() +{ + print _"Désolé, fonction" " " OPER " " _"indisponible" "..." + exit 1 +} + + +function quickdep() +{ + load_DB() + load_DEPS() + load_REPO() + quickdep2(PKG) + printf ("%s\n",PKG) +} + + +function quickdep2(Pkg, a, i, n) +{ + n=split(tb_DEPS[Pkg],a,",") + for (i=1; i<=n; i++) { + if (tb_DEP_TRT[a[i]]==0) { + tb_DEP_TRT[a[i]]++ + if (a[i] in tb_DEPS) + quickdep2(a[i]) + printf("%s ", a[i]) + } + } +} + + +function quickdiff(Dest, a, i, n, pak) +{ + load_DB() + load_LOCKER() + load_REPO() + for (pak in tb_DB) + a[pak]=pak + n=asort(a) + delete tb_PKG + nPKG=0 + for (i=1;i<=n;i++) { + pak=a[i] + if ((pak in tb_REPO) && (!(pak in tb_LOCK)) && (tb_DB[pak]!=tb_REPO[pak])) { + if (Dest=="tb") + tb_PKG[++nPKG] = pak + else + printf("%s ", pak) + } + } + printf("\n") +} + + +function quickhelp() { + print "\033[1;33m" _"Usage" "\033[1;0m: " NPKG " command [package2 ... packageN] [options]" + print "\033[1;33m" _"Quelques commandes" "\033[1;0m:" + print " sync " _"synchronise avec le dépôt" + print " depinst " _"installe package(s) et ses(leurs) dépendances" + print " info " _"informations concernant le package" + print " sysup " _"met à jour les paquets obsolètes" + print " diff " _"affiche la liste des paquets obsolètes" + print "\033[1;33m" _"Quelques options:" "\033[1;0m" + print " -do " _"télécharge seulement" + print " --install-scripts " _"utilise les scripts install" + print " -r " _"utilise" " " _"pour" " pkgadd" + print "\033[1;33m" _"Examples" "\033[1;0m:" + print " " NPKG " install sqlite pysqlite" + print " " NPKG " help" + print _"Pour d'autres commandes et examples, voir la page de manuel" +} + + +function readme( fl, j, FILE) +{ + for (j=0; j0) { + if (fl==1) { + if (index($0,"##### PKGREADME: ")) + exit + print $0 + } + if (index($0,"##### PKGREADME: "PKG)) + fl=1 + } + close(FILE) + } +} + + +function search( j, FILE, old_FS) +{ + old_FS = FS + FS="[:#]" + for (j=0; j0) { + if (index($1,ARGV[2])) + print $1 + } + close(FILE) + } + FS = old_FS +} + + +function sync( cmd, i, j, pak, rc) +{ + verif_if_root() + pak[1]="PKGREPO" + pak[2]="PKGDEPS" + pak[3]="PKGREAD" + pak[4]="PKGINST" + pak[5]="PKGGRP" + for (j=0; j "") { + for (i=1; i<=4; i++) { + cmd="wget -q -O "PKGDIR[j] pak[i] " " WEBDIR[j] pak[i] + if ("--dry" in tb_OPT) { + print "\033[1;34m" cmd "\033[1;0m" + } else { + rc=system(cmd) + if (rc>0) { + print "ERREUR", rc + exit 1 + } + } + } + } + } +} + + +function sysup( i) +{ + quickdiff("tb") + update() +} + + +function unlock( i, n, fl, tb_LCK) +{ + verif_if_root() + while (getline < LOCKER) { + fl="y" + for (i=1; i<=nPKG; i++) + if ($1==tb_PKG[i]) + fl = "n" + if (fl=="y") + tb_LCK[++n] = $1 + } + close(LOCKER) + printf("") > LOCKER + for (i=1; i<=n; i++) + print tb_LCK[i] >> LOCKER + close(LOCKER) +} + + +function update( i, pak) +{ + verif_if_root() + load_LOCKER() + load_REPO() + load_DB() + for (i=1; i<=nPKG; i++) { + 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") + } + } +} + + +function verif_if_root( cmd) +{ + if (!("--dry" in tb_OPT)) { + cmd="whoami" + cmd | getline + if ($1 !="root") { + print "\033[1;31m" _"Veuillez exécuter ce programme en tant que root !" "\033[1;0m" + exit 1 + } + close(cmd) + } +} + + +function verif_md5sum(dir, pk, cmd, md5, a, rep) +{ + cmd="md5sum " dir pk + cmd | getline + split($0,md5," ") + close(cmd) + split(pk,a,"#") + if (md5[1]!=tb_MD5[a[1]]) { + print "-------> " _"ERREUR" ": " _"md5sum erroné pour " a[1] + print _"requis" ": " tb_MD5[a[1]] + print _"trouvé" ": " md5[1] + print "Supprimer " dir pk " ?" + getline rep + if (rep=="y") { + cmd = "rm " dir pk + while ((cmd | getline) > 0) + print + close(cmd) + } + exit 1 + } +} + + +function version() +{ + print NPKG " " VERSION " (" DATE ")" +} + + +function wrongparm() +{ + version() + print _"Paramètre" " '" OPER "' " _"erroné" + exit 1 +} + + +#------------------------------------------------ +# +# M A I N +# +#------------------------------------------------ + +BEGIN { + configs() + + if (OPER=="") quickhelp() + else if (OPER=="current") current() + else if (OPER=="dependent") dependent() + else if (OPER=="depends") depends() + else if (OPER=="depinst") rc=depinst() + else if (OPER=="diff") diff() + else if (OPER=="dsearch") dsearch() + else if (OPER=="help") help() + else if (OPER=="info") info() + else if (OPER=="install") install() + else if (OPER=="isinst") isinst() + else if (OPER=="list") list() + else if (OPER=="listinst") listinst() + else if (OPER=="listlocked") listlocked() + else if (OPER=="lock") lock() + else if (OPER=="path") path() + else if (OPER=="printf") printff() + else if (OPER=="quickdep") quickdep() + else if (OPER=="quickdiff") quickdiff() + else if (OPER=="readme") readme() + else if (OPER=="search") search() + else if (OPER=="sync") sync() + else if (OPER=="sysup") sysup() + else if (OPER=="unlock") unlock() + else if (OPER=="update") update() + else if (OPER=="version") version() + else wrongparm() + + exit +} diff --git a/base/pkg-get/pkg-get.po b/base/pkg-get/pkg-get.po new file mode 100644 index 000000000..d0d83732c --- /dev/null +++ b/base/pkg-get/pkg-get.po @@ -0,0 +1,204 @@ +msgid "Paquet" +msgstr "Package" + +msgid "non install\303\251" +msgstr "not installed" + +msgid "- d\303\251pendences ([i] = install\303\251, [u] = mise \303\240 jour possible)" +msgstr "- dependencies ([i] = installed, [u] = upgradable)" + +msgid "Diff\303\251rences entre paquets install\303\251s et paquets disponibles dans le d\303\251p\303\264ts:\n" +msgstr "Differences between installed packages and packages availables in the repository\n" + +msgid "Install\303\251" +msgstr "Installed" + +msgid "Disponible dans les d\303\251p\303\264ts\n" +msgstr "Available in the repositories\n" + +msgid "Usage:" +msgstr "Usage:" + +msgid "affiche la version install\303\251e de " +msgstr "show installed version of " + +msgid "affiche la liste des paquets d\303\251pendants de " +msgstr "list packages dependents of " + +msgid "affiche la liste des d\303\251pendances de " +msgstr "list dependencies of " + +msgid "installe et ses(leurs) d\303\251pendances" +msgstr "install and their dependencies" + +msgid "affiche la liste des paquets obsol\303\250tes" +msgstr "list outdated packages" + +msgid "cherche les paquets dont le nom/la description contient " +msgstr "search for packages which name or description contain " + +msgid "affiche cette aide" +msgstr "display help screen" + +msgid "affiche les informations concernant " +msgstr "show information about " + +msgid "affiche si est install\303\251" +msgstr "display whether a package is installed" + +msgid "installe " +msgstr "install " + +msgid "affiche la liste des paquets disponibles dans les d\303\251p\303\264ts" +msgstr "list packages available in repositories" + +msgid "affiche la liste des paquets install\303\251s" +msgstr "list installed packages" + +msgid "affiche la liste des paquets verrouill\303\251s" +msgstr "list locked packages" + +msgid "verrouille (emp\303\252che la mise \303\240 jour)" +msgstr "lock " +msgstr "show local path of " + +msgid "affiche la liste abr\303\251g\303\251e des d\303\251pendances de " +msgstr "show a brief list of dependencies for " + +msgid "affiche la liste abr\303\251g\303\251e des paquets obsol\303\250tes" +msgstr "show a brief list of outdated packages" + +msgid "affiche les informations README de si existantes" +msgstr "print README information (if available) for the package" + +msgid "cherche les paquets dont le nom contient " +msgstr "search for packages which name contains " + +msgid "met \303\240 jour les paquets obsol\303\250tes, t\303\251l\303\251charge si n\303\251cessaire" +msgstr "update outdated packages, download if necessary" + +msgid "d\303\251verrouille (permet la mise \303\240 jour)" +msgstr "unlock , t\303\251l\303\251charge si n\303\251cessaire" +msgstr "update , download if necessary" + +msgid "affiche la version de ce script" +msgstr "show this script version" + +msgid "Exemple:" +msgstr "Exemple:" + +msgid "Nom " +msgstr "Name" + +msgid "Groupe" +msgstr "Group " + +msgid "Taille" +msgstr "Size " + +msgid "D\303\251pend de " +msgstr "Depends on" + +msgid "non trouv\303\251" +msgstr "not found" + +msgid "Le paquet" +msgstr "The package" + +msgid "est install\303\251" +msgstr "is installed" + +msgid "est déjà install\303\251" +msgstr "is already installed" + +msgid "n'est pas install\303\251" +msgstr "isn't installed" + +msgid "D\303\251sol\303\251, fonction" +msgstr "Sorry, function" + +msgid "indisponible" +msgstr "unavailable" + +msgid "Usage" +msgstr "Usage" + +msgid "Quelques commandes" +msgstr "Some comands" + +msgid "synchronise avec le d\303\251p\303\264t" +msgstr "syncronize local packages with the ones from the remote repository" + +msgid "installe package(s) et ses(leurs) d\303\251pendances" +msgstr "install given packages and relative dependencies" + +msgid "informations concernant le package" +msgstr "show information about package" + +msgid "met \303\240 jour les paquets obsol\303\250tes" +msgstr "update all outdated packages" + +msgid "Quelques options:" +msgstr "Some options:" + +msgid "utilise les scripts install" +msgstr "use install scripts" + +msgid "Examples" +msgstr "Examples" + +msgid "Pour d'autres commandes et examples, voir la page de manuel" +msgstr "For other commands and samples, see the pkg-get(8) man page" + +msgid "paquet \303\240 mettre \303\240 jour:" +msgstr "updatable package" + +msgid "Veuillez ex\303\251cuter ce programme en tant que root !" +msgstr "Please run this script as root !" + +msgid "Param\303\250tre" +msgstr "Parameter" + +msgid "erron\303\251" +msgstr "wrong" + +msgid "Fichiers" +msgstr "Files " + +msgid "demande un argument" +msgstr "requires an argument" + +msgid "t\303\251l\303\251charge seulement" +msgstr "download only" + +msgid "utilise" +msgstr "use" + +msgid "pour" +msgstr "for" + +msgid "ERREUR" +msgstr "ERROR" + +msgid "md5sum erron\303\251 pour " +msgstr "md5sum mismatching for " + +msgid "requis" +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" + diff --git a/base/pkg-get/syn b/base/pkg-get/syn index d29fcd6f7..95284d529 100644 --- a/base/pkg-get/syn +++ b/base/pkg-get/syn @@ -25,23 +25,22 @@ fi if ! mountpoint /media/cdrom > /dev/null; then find_cd fi -if [ ! -L /depot ]; then - for i in `cat /etc/pkg-get.conf |grep -v ^#|grep http|cut -d "|" -f 1|cut -d" " -f2|cut -d"/" -f4` - do - if [ -a $Depot/$i ]; then - rm -r $Depot/$i - fi - done - pkg-get sync - for i in `cat /etc/pkg-get.conf |grep -v ^#|grep http|cut -d "|" -f 1|cut -d" " -f2|cut -d"/" -f4` - do +for i in `cat /etc/pkg-get.conf |grep -v ^#|grep http|cut -d "|" -f 1|cut -d" " -f2|cut -d"/" -f4` +do + if [ -a $Depot/$i ]; then + rm -r $Depot/$i + fi + mkdir -p $Depot/$i +done +pkg-get sync +for i in `cat /etc/pkg-get.conf |grep -v ^#|grep http|cut -d "|" -f 1|cut -d" " -f2|cut -d"/" -f4` +do if [ -d $MediaDepot/$i ]; then rm -r $Depot/$i > /dev/null 2>&1 mkdir -p $Depot/$i for j in $MediaDepot/$i/*.xz do let PKGNB=$PKGNB+1 - fj=`basename $j` ln -sf $MediaDepot/$i/$fj $Depot/$i/$fj echo -n -e "$PKGNB Paquets trouvés sur le média\r" @@ -49,10 +48,4 @@ if [ ! -L /depot ]; then echo "$PKGNB Paquets trouvés sur le média" cp $MediaDepot/$i/PKG* $Depot/$i/ fi - done -else - for i in `cat /etc/pkg-get.conf |grep -v ^#|grep http|cut -d "|" -f 1|cut -d" " -f2|cut -d"/" -f4` - do - rsync -avuz --delete-before rsync://nutyx.meticul.eu/nutyx/attapu/i686/$i/ $Depot/$i/ - done -fi +done -- cgit v1.2.3-70-g09d2