summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2005-03-09 17:00:32 +0000
committerJason Woodward2005-03-09 17:00:32 +0000
commit6a5f1d60f2286179f14fff4af0217e2f9b1083e7 (patch)
treebc04c6926f6d6a5d2b5a1c4830d327aced07ac43
parent9393d75f466445c1cc41239b28cce4c87f64068d (diff)
downloadslapt-get-6a5f1d60f2286179f14fff4af0217e2f9b1083e7.tar.gz
added --available option to only show packages available from the current sources. --list shows available and installed. --installed shows only the installed with a new output format.
-rw-r--r--ChangeLog5
-rw-r--r--Makefile2
-rw-r--r--doc/slapt-get.810
-rw-r--r--po/cs.po7
-rw-r--r--po/de.po7
-rw-r--r--po/el.po7
-rw-r--r--po/en.po7
-rw-r--r--po/es.po7
-rw-r--r--po/es_ES.po7
-rw-r--r--po/fr.po7
-rw-r--r--po/it.po7
-rw-r--r--po/nl.po7
-rw-r--r--po/no.po7
-rw-r--r--po/pl.po7
-rw-r--r--po/pt_BR.po7
-rw-r--r--po/pt_PT.po7
-rw-r--r--po/slapt-get.pot7
-rw-r--r--po/sv.po7
-rw-r--r--po/vi.po7
-rw-r--r--slack-desc2
-rw-r--r--src/action.c90
-rw-r--r--src/action.h3
-rw-r--r--src/main.c14
-rw-r--r--src/main.h3
24 files changed, 148 insertions, 93 deletions
diff --git a/ChangeLog b/ChangeLog
index c206d58..5096413 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
-0.9.9j Mar 08, 2005
+0.9.9j Mar 09, 2005
+ * added --available option to only show packages available from the current
+ sources. --list shows available and installed. --installed shows only
+ the installed with a new output format.
0.9.9i Mar 06, 2005
* set CURLOPT_HTTPAUTH to CURLAUTH_ANY for NTLM proxy users
diff --git a/Makefile b/Makefile
index f68d607..09c2ecc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
PROGRAM_NAME=slapt-get
-VERSION=0.9.9i
+VERSION=0.9.9j
ARCH=i386
RELEASE=1
CC=gcc
diff --git a/doc/slapt-get.8 b/doc/slapt-get.8
index a89563e..84849e2 100644
--- a/doc/slapt-get.8
+++ b/doc/slapt-get.8
@@ -83,6 +83,9 @@ slapt-get \- frontend to pkgtools
.B --list
]
[
+.B --available
+]
+[
.B --installed
]
[
@@ -165,10 +168,13 @@ Search available packages. Applies POSIX and extended regular expression
to the names, locations, and descriptions of packages.
.TP
.B --list
-List available packages.
+List all packages, installed and available.
+.TP
+.B --available
+List available packages only. This will show you the packages present on your current sources.
.TP
.B --installed
-List installed packages.
+List installed packages only.
.TP
.B --clean
Purge cached/downloaded packages from WORKINGDIR (/var/slapt-get/ by default).
diff --git a/po/cs.po b/po/cs.po
index 7f371f3..aeec678 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.9i\n"
+"Project-Id-Version: 0.9.9j\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2005-02-20 19:06+0500\n"
+"PO-Revision-Date: 2005-03-09 11:08+0500\n"
"Last-Translator: Oto Petrik <oto.petrik@centrum.cz>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -240,6 +240,9 @@ msgstr "[jmno balku] - uka popis balku"
msgid "[expression] - search available pkgs"
msgstr "[vraz] - hledej dostupn balky"
+msgid "list pkgs"
+msgstr "vypi balky"
+
msgid "list available pkgs"
msgstr "vypi dostupn balky"
diff --git a/po/de.po b/po/de.po
index c09ca6e..435451a 100644
--- a/po/de.po
+++ b/po/de.po
@@ -5,9 +5,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.9i\n"
+"Project-Id-Version: 0.9.9j\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2005-02-20 19:06+0500\n"
+"PO-Revision-Date: 2005-03-09 11:08+0500\n"
"Last-Translator: Niklas Volbers <mithrandir42@web.de>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -239,6 +239,9 @@ msgstr "[Paketname] - Paketbeschreibung anzeigen"
msgid "[expression] - search available pkgs"
msgstr "[Ausdruck] - nach verfgbaren Paketen suchen"
+msgid "list pkgs"
+msgstr "Liste Pakete auf"
+
msgid "list available pkgs"
msgstr "Liste vorhanden Pakete auf"
diff --git a/po/el.po b/po/el.po
index d9d9a87..3b3d39f 100644
--- a/po/el.po
+++ b/po/el.po
@@ -5,9 +5,9 @@
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.9i\n"
+"Project-Id-Version: 0.9.9j\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2005-02-20 19:06+0500\n"
+"PO-Revision-Date: 2005-03-09 11:08+0500\n"
"Last-Translator: Savvas Eftratiadis <pigouinos@mailworks.org.\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -239,6 +239,9 @@ msgstr "[pkg ] - "
msgid "[expression] - search available pkgs"
msgstr "[expression] - "
+msgid "list pkgs"
+msgstr " "
+
msgid "list available pkgs"
msgstr " "
diff --git a/po/en.po b/po/en.po
index 21804ad..4409aed 100644
--- a/po/en.po
+++ b/po/en.po
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.9i\n"
+"Project-Id-Version: 0.9.9j\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2005-02-20 19:06+0500\n"
+"PO-Revision-Date: 2005-03-09 11:08+0500\n"
"Last-Translator: Jason Woodward <woodwardj@jaos.org>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -240,6 +240,9 @@ msgstr "[pkg name] - show pkg description"
msgid "[expression] - search available pkgs"
msgstr "[expression] - search available pkgs"
+msgid "list pkgs"
+msgstr "list pkgs"
+
msgid "list available pkgs"
msgstr "list available pkgs"
diff --git a/po/es.po b/po/es.po
index 042049d..7b3d77f 100644
--- a/po/es.po
+++ b/po/es.po
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.9i\n"
+"Project-Id-Version: 0.9.9j\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2005-02-20 19:06+0500\n"
+"PO-Revision-Date: 2005-03-09 11:08+0500\n"
"Last-Translator: Ruben Gutierrez <ruben@snpp.com.ar>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -240,6 +240,9 @@ msgstr "[nombre del pkg] - muestra la descripcin del pkg"
msgid "[expression] - search available pkgs"
msgstr "[expresin] - busca pkgs disponibles"
+msgid "list pkgs"
+msgstr "lista los pkgs"
+
msgid "list available pkgs"
msgstr "lista los pkgs disponibles"
diff --git a/po/es_ES.po b/po/es_ES.po
index 5b648e9..2e1694f 100644
--- a/po/es_ES.po
+++ b/po/es_ES.po
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.9i\n"
+"Project-Id-Version: 0.9.9j\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2005-02-20 19:06+0500\n"
+"PO-Revision-Date: 2005-03-09 11:08+0500\n"
"Last-Translator: Ruben Gutierrez <ruben@snpp.com.ar>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -240,6 +240,9 @@ msgstr "[nombre del pkg] - muestra la descripcin del pkg"
msgid "[expression] - search available pkgs"
msgstr "[expresin] - busca pkgs disponibles"
+msgid "list pkgs"
+msgstr "muestra el listado de pkgs"
+
msgid "list available pkgs"
msgstr "muestra el listado de pkgs disponibles"
diff --git a/po/fr.po b/po/fr.po
index d6982f1..a631a45 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.9i\n"
+"Project-Id-Version: 0.9.9j\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2005-02-20 19:06+0500\n"
+"PO-Revision-Date: 2005-03-09 11:08+0500\n"
"Last-Translator: Jason Woodward <woodwardj@jaos.org>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -240,6 +240,9 @@ msgstr ""
msgid "[expression] - search available pkgs"
msgstr ""
+msgid "list pkgs"
+msgstr "pkgs de liste"
+
msgid "list available pkgs"
msgstr "pkgs disponibles de liste"
diff --git a/po/it.po b/po/it.po
index 80c42c5..c5ce161 100644
--- a/po/it.po
+++ b/po/it.po
@@ -6,9 +6,9 @@
#,fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.9i\n"
+"Project-Id-Version: 0.9.9j\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2005-02-20 19:06+0500\n"
+"PO-Revision-Date: 2005-03-09 11:08+0500\n"
"Last-Translator: Francesco Gigli <jaramir@slack.it>\n"
"Language-Team: Italian <tp@lists.linux.it>\n"
"MIME-Version: 1.0\n"
@@ -240,6 +240,9 @@ msgstr "[nome/i pacchetto] - visualizza descrizione pacchetto/i specificato"
msgid "[expression] - search available pkgs"
msgstr "[espressione] - cerca i pacchetti disponibili"
+msgid "list pkgs"
+msgstr "elenca i pacchetti"
+
msgid "list available pkgs"
msgstr "elenca i pacchetti disponibili"
diff --git a/po/nl.po b/po/nl.po
index 7a49f9b..e8b26b8 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.9i\n"
+"Project-Id-Version: 0.9.9j\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2005-02-20 19:06+0500\n"
+"PO-Revision-Date: 2005-03-09 11:08+0500\n"
"Last-Translator: Jason Woodward <woodwardj@jaos.org>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -240,6 +240,9 @@ msgstr "[pkg naam] - toon beschrijving"
msgid "[expression] - search available pkgs"
msgstr "[term] - zoek beschikbare pkgs"
+msgid "list pkgs"
+msgstr "Toon pkgs"
+
msgid "list available pkgs"
msgstr "Toon beschikbare pkgs"
diff --git a/po/no.po b/po/no.po
index 11a4591..dee6d33 100644
--- a/po/no.po
+++ b/po/no.po
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.9i\n"
+"Project-Id-Version: 0.9.9j\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2005-02-20 19:06+0500\n"
+"PO-Revision-Date: 2005-03-09 11:08+0500\n"
"Last-Translator: Joran Kvalvaag <jk@nerdworks.org>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -240,6 +240,9 @@ msgstr "[pakkenavn] - vis pakkebeskrivelse"
msgid "[expression] - search available pkgs"
msgstr "[uttrykk] - finn tilgjengelige pakker"
+msgid "list pkgs"
+msgstr "vis pakker"
+
msgid "list available pkgs"
msgstr "vis tilgjengelige pakker"
diff --git a/po/pl.po b/po/pl.po
index f3e2095..7b77b57 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.9i\n"
+"Project-Id-Version: 0.9.9j\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2005-02-23 08:22+0500\n"
+"PO-Revision-Date: 2005-03-09 11:08+0500\n"
"Last-Translators: Sajmon <sajmon@tenboard.com>, Paul Blazejowski <paulb@blazebox.homeip.net>, nixon <nixon@klub.chip.pl> and simon <ssiimm@poczta.onet.pl>\n"
"Language-Team: polish <slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -241,6 +241,9 @@ msgstr "[nazwa pkg] - poka opis pkg"
msgid "[expression] - search available pkgs"
msgstr "[wyraenie] - szukaj dostpnych pkgs"
+msgid "list pkgs"
+msgstr "wywietl pkgs"
+
msgid "list available pkgs"
msgstr "wywietl dostpne pkgs"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 5790ca9..e66c326 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.9i\n"
+"Project-Id-Version: 0.9.9j\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2005-02-20 19:06+0500\n"
+"PO-Revision-Date: 2005-03-09 11:08+0500\n"
"Last-Translator: Henrique Pinto <henrique.pinto@kdemail.net>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -239,6 +239,9 @@ msgstr "[nome do pacote] - mostra descrio do pacote"
msgid "[expression] - search available pkgs"
msgstr "[expresso] - busca por pacotes disponveis"
+msgid "list pkgs"
+msgstr "lista pacotes"
+
msgid "list available pkgs"
msgstr "lista pacotes disponveis"
diff --git a/po/pt_PT.po b/po/pt_PT.po
index 6111817..e2452cb 100644
--- a/po/pt_PT.po
+++ b/po/pt_PT.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.9i\n"
+"Project-Id-Version: 0.9.9j\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2005-02-20 19:06+0500\n"
+"PO-Revision-Date: 2005-03-09 11:08+0500\n"
"Last-Translator: Miguel Santinho <msantinho@simplicidade.com>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -239,6 +239,9 @@ msgstr "[nome do pacote] - mostra descrio do pacote"
msgid "[expression] - search available pkgs"
msgstr "[expresso] - pesquisa por pacotes disponveis"
+msgid "list pkgs"
+msgstr "lista pacotes"
+
msgid "list available pkgs"
msgstr "lista pacotes disponveis"
diff --git a/po/slapt-get.pot b/po/slapt-get.pot
index 24d4ce9..f389b7b 100644
--- a/po/slapt-get.pot
+++ b/po/slapt-get.pot
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.9i\n"
+"Project-Id-Version: 0.9.9j\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2005-02-20 19:06+0500\n"
+"PO-Revision-Date: 2005-03-09 11:08+0500\n"
"Last-Translator: Jason Woodward <woodwardj@jaos.org>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -240,6 +240,9 @@ msgstr ""
msgid "[expression] - search available pkgs"
msgstr ""
+msgid "list pkgs"
+msgstr ""
+
msgid "list available pkgs"
msgstr ""
diff --git a/po/sv.po b/po/sv.po
index f761969..e5e3862 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.9i\n"
+"Project-Id-Version: 0.9.9j\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2005-02-20 19:06+0500\n"
+"PO-Revision-Date: 2005-03-09 11:08+0500\n"
"Last-Translator: Joel Bjurman <ypolt@lediga.st>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -240,6 +240,9 @@ msgstr "[paketnamn] - visa paketbeskrivning"
msgid "[expression] - search available pkgs"
msgstr "[skord] - sk tillgngliga paket"
+msgid "list pkgs"
+msgstr "lista paket"
+
msgid "list available pkgs"
msgstr "lista tillgngliga paket"
diff --git a/po/vi.po b/po/vi.po
index d9d3805..2a2561b 100644
--- a/po/vi.po
+++ b/po/vi.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.9i\n"
+"Project-Id-Version: 0.9.9j\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2005-02-20 19:06+0500\n"
+"PO-Revision-Date: 2005-03-09 11:08+0500\n"
"Last-Translator: Nguyễn Văn Vũ <vncasper@yahoo.com>\n"
"Language-Team: gnome-vi <gnomevi-list@lists.sourceforge.net>\n"
"MIME-Version: 1.0\n"
@@ -241,6 +241,9 @@ msgstr ""
msgid "[expression] - search available pkgs"
msgstr "[biểu thức] - tìm kiếm các gói phần mềm hiện có theo điều kiện"
+msgid "list pkgs"
+msgstr "list pkgs"
+
msgid "list available pkgs"
msgstr "liệt kê các gói phần mềm hiện có"
diff --git a/slack-desc b/slack-desc
index bfd0fba..20df31c 100644
--- a/slack-desc
+++ b/slack-desc
@@ -9,7 +9,7 @@
slapt-get: slapt-get (APT like system for Slackware)
slapt-get: slapt-get is an APT like system for Slackware package management.
slapt-get:
-slapt-get: * See /usr/doc/slapt-get-0.9.9i/ for complete documentation.
+slapt-get: * See /usr/doc/slapt-get-0.9.9j/ for complete documentation.
slapt-get: * You will also want to customize /etc/slapt-get/slapt-getrc,
slapt-get: using a local mirror. www.slackware.com may be very busy.
slapt-get: * Support:
diff --git a/src/action.c b/src/action.c
index e355a50..7c94e84 100644
--- a/src/action.c
+++ b/src/action.c
@@ -142,7 +142,7 @@ void pkg_action_install(const rc_config *global_config,const pkg_action_args_t *
}
/* list pkgs */
-void pkg_action_list(void){
+void pkg_action_list(const int show){
struct pkg_list *pkgs = NULL;
struct pkg_list *installed_pkgs = NULL;
unsigned int i;
@@ -150,45 +150,52 @@ void pkg_action_list(void){
pkgs = get_available_pkgs();
installed_pkgs = get_installed_pkgs();
- for(i = 0; i < pkgs->pkg_count; i++ ){
- /* this should eliminate the printing of updates */
- if( strstr(pkgs->pkgs[i]->description,"no description") == NULL ){
- unsigned int bool_installed = 0;
- char *short_description = gen_short_pkg_description(pkgs->pkgs[i]);
-
- /* is it installed? */
- if( get_exact_pkg(installed_pkgs,pkgs->pkgs[i]->name,pkgs->pkgs[i]->version) != NULL )
- bool_installed = 1;
-
- printf("%s %s [inst=%s]: %s\n",
- pkgs->pkgs[i]->name,
- pkgs->pkgs[i]->version,
- bool_installed == 1
+ if( show == LIST || show == AVAILABLE ){
+ for(i = 0; i < pkgs->pkg_count; i++ ){
+ /* this should eliminate the printing of updates */
+ if( strstr(pkgs->pkgs[i]->description,"no description") == NULL ){
+ unsigned int bool_installed = 0;
+ char *short_description = gen_short_pkg_description(pkgs->pkgs[i]);
+
+ /* is it installed? */
+ if( get_exact_pkg(installed_pkgs,pkgs->pkgs[i]->name,pkgs->pkgs[i]->version) != NULL )
+ bool_installed = 1;
+
+ printf("%s %s [inst=%s]: %s\n",
+ pkgs->pkgs[i]->name,
+ pkgs->pkgs[i]->version,
+ bool_installed == 1
? _("yes")
: _("no"),
- (short_description == NULL) ? "" : short_description
- );
- free(short_description);
+ (short_description == NULL) ? "" : short_description
+ );
+ free(short_description);
+ }
}
}
- for(i = 0; i < installed_pkgs->pkg_count;++i){
- char *short_description = NULL;
- if( get_exact_pkg(pkgs,
- installed_pkgs->pkgs[i]->name,
- installed_pkgs->pkgs[i]->version
- ) != NULL
- ) continue;
-
- short_description = gen_short_pkg_description(installed_pkgs->pkgs[i]);
+ if( show == LIST || show == INSTALLED ){
+ for(i = 0; i < installed_pkgs->pkg_count;++i){
+ char *short_description = NULL;
+
+ if( show == LIST ){
+ if( get_exact_pkg(pkgs,
+ installed_pkgs->pkgs[i]->name,
+ installed_pkgs->pkgs[i]->version
+ ) != NULL
+ ) continue;
+ }
- printf("%s %s [inst=%s]: %s\n",
- installed_pkgs->pkgs[i]->name,
- installed_pkgs->pkgs[i]->version,
- _("yes"),
- (short_description == NULL) ? "" : short_description
- );
+ short_description = gen_short_pkg_description(installed_pkgs->pkgs[i]);
+
+ printf("%s %s [inst=%s]: %s\n",
+ installed_pkgs->pkgs[i]->name,
+ installed_pkgs->pkgs[i]->version,
+ _("yes"),
+ (short_description == NULL) ? "" : short_description
+ );
free(short_description);
+ }
}
free_pkg_list(pkgs);
@@ -196,23 +203,6 @@ void pkg_action_list(void){
}
-/* list installed pkgs */
-void pkg_action_list_installed(void){
- unsigned int i;
- struct pkg_list *installed_pkgs = NULL;
-
- installed_pkgs = get_installed_pkgs();
-
- for(i = 0; i < installed_pkgs->pkg_count; i++ ){
- printf("%s - %s\n",
- installed_pkgs->pkgs[i]->name,
- installed_pkgs->pkgs[i]->version
- );
- }
-
- free_pkg_list(installed_pkgs);
-}
-
/* remove/uninstall pkg */
void pkg_action_remove(const rc_config *global_config,const pkg_action_args_t *action_args){
unsigned int i;
diff --git a/src/action.h b/src/action.h
index ce7395b..79e8f7d 100644
--- a/src/action.h
+++ b/src/action.h
@@ -25,8 +25,7 @@ pkg_action_args_t *init_pkg_action_args(int arg_count);
void free_pkg_action_args(pkg_action_args_t *paa);
void pkg_action_install(const rc_config *global_config,const pkg_action_args_t *action_args);
-void pkg_action_list(void);
-void pkg_action_list_installed(void);
+void pkg_action_list(const int show);
void pkg_action_remove(const rc_config *global_config,const pkg_action_args_t *action_args);
void pkg_action_search(const char *pattern);
void pkg_action_show(const char *pkg_name);
diff --git a/src/main.c b/src/main.c
index 3ce64da..3437c0b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -59,6 +59,7 @@ int main( int argc, char *argv[] ){
{"config",1, 0, CONFIG_OPT},
{"autoclean", 0, 0, AUTOCLEAN_OPT},
{"remove-obsolete", 0, 0, OBSOLETE_OPT},
+ {"available", 0, 0, AVAILABLE_OPT},
{0, 0, 0, 0},
};
@@ -180,6 +181,9 @@ int main( int argc, char *argv[] ){
case OBSOLETE_OPT: /* remove obsolete packages */
global_config->remove_obsolete = TRUE;
break;
+ case AVAILABLE_OPT: /* show available packages */
+ do_action = AVAILABLE;
+ break;
default:
usage();
free_rc_config(global_config);
@@ -262,10 +266,10 @@ int main( int argc, char *argv[] ){
pkg_action_upgrade_all(global_config);
break;
case LIST:
- pkg_action_list();
+ pkg_action_list(LIST);
break;
case INSTALLED:
- pkg_action_list_installed();
+ pkg_action_list(INSTALLED);
break;
case CLEAN:
/* clean out local cache */
@@ -278,6 +282,9 @@ int main( int argc, char *argv[] ){
case AUTOCLEAN:
purge_old_cached_pkgs(global_config, NULL, NULL);
break;
+ case AVAILABLE:
+ pkg_action_list(AVAILABLE);
+ break;
case USAGE:
default:
printf("main.c(l.%d): This should never be reached\n", __LINE__);
@@ -303,7 +310,8 @@ void usage(void){
printf(" --remove %s\n",_("[pkg name(s)] - remove specified pkg(s)"));
printf(" --show %s\n",_("[pkg name] - show pkg description"));
printf(" --search %s\n",_("[expression] - search available pkgs"));
- printf(" --list - %s\n",_("list available pkgs"));
+ printf(" --list - %s\n",_("list pkgs"));
+ printf(" --available - %s\n",_("list available pkgs"));
printf(" --installed - %s\n",_("list installed pkgs"));
printf(" --clean - %s\n",_("purge cached pkgs"));
printf(" --autoclean - %s\n",_("only purge cache of older, unreacheable pkgs"));
diff --git a/src/main.h b/src/main.h
index 5bf0665..eb7a385 100644
--- a/src/main.h
+++ b/src/main.h
@@ -45,7 +45,7 @@
enum action {
USAGE = 0, UPDATE, INSTALL, REMOVE, SHOW, SEARCH, UPGRADE,
- LIST, INSTALLED, CLEAN, SHOWVERSION, AUTOCLEAN
+ LIST, INSTALLED, CLEAN, SHOWVERSION, AUTOCLEAN, AVAILABLE
};
#define UPDATE_OPT 'u'
@@ -73,6 +73,7 @@ enum action {
#define CONFIG_OPT 'C'
#define AUTOCLEAN_OPT 'a'
#define OBSOLETE_OPT 'O'
+#define AVAILABLE_OPT 'A'
#define DEBUG 0
#define DO_NOT_UNLINK_BAD_FILES 1