aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--FAQ40
-rw-r--r--FAQ.html40
-rw-r--r--doc/slapt-get.86
-rw-r--r--po/cs.po3
-rw-r--r--po/de.po3
-rw-r--r--po/el.po3
-rw-r--r--po/en.po3
-rw-r--r--po/es.po3
-rw-r--r--po/es_ES.po3
-rw-r--r--po/fr.po3
-rw-r--r--po/it.po3
-rw-r--r--po/nl.po3
-rw-r--r--po/no.po3
-rw-r--r--po/pl.po3
-rw-r--r--po/pt_BR.po3
-rw-r--r--po/pt_PT.po3
-rw-r--r--po/slapt-get.pot3
-rw-r--r--po/sv.po3
-rw-r--r--po/vi.po3
-rw-r--r--src/action.c29
-rw-r--r--src/configuration.c1
-rw-r--r--src/configuration.h1
-rw-r--r--src/main.c5
-rw-r--r--src/main.h1
25 files changed, 132 insertions, 40 deletions
diff --git a/ChangeLog b/ChangeLog
index 654ad9c..6ad0ebc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
0.9.9f Jan 06, 2005
+ * added --remove-obsolete option for dist-upgrade (see FAQ #9 and #28)
* fixed bug in gen_short_pkg_description with installed packages that are
missing a description, triggered by the new --search functionality looking
at installed packages
diff --git a/FAQ b/FAQ
index 9ffa2f7..5a04d9d 100644
--- a/FAQ
+++ b/FAQ
@@ -164,6 +164,15 @@ Frequenty Asked Questions:
### then, let slapt-get upgrade the rest
$ slapt-get --dist-upgrade
+ ### or you can specify --remove-obsolete to remove
+ ### all depreciated packages. CAUTION: this can only
+ ### take into consideration packages that are available
+ ### from your current sources. Thus self made packages
+ ### will be considered obsolete as well. Only use this
+ ### if you have been using Slackware packages exclusively.
+ ### You can also use this option for information purposes.
+ $ slapt-get --dist-upgrade --remove-obsolete
+
Then follow the rest of the directions in UPGRADE.TXT.
* Note: you might be able to get away with just doing a --dist-upgrade after
@@ -176,7 +185,7 @@ Frequenty Asked Questions:
specify slapt-get to install a disk set like so:
### install all gnome and X packages
- $ slapt-get --search './slackware/gnome|./slackware/x'|awk '{print $1}'| \
+ $ slapt-get --search '^./slackware/gnome$|^./slackware/x$'|awk '{print $1}'| \
xargs -r slapt-get --install
Do the same for all your installed disk sets, such as gnome, x, xap, l, n, etc.
@@ -602,7 +611,8 @@ Frequenty Asked Questions:
28. I am tracking current, how do I keep the base disk set up to date?
- If you are tracking current, --dist-upgrade may be more useful than --upgrade.
+ If you are tracking current, --dist-upgrade is more appropriate than
+ --upgrade.
Even if you aren't intentionally switching to a newer distribution,
--dist-upgrade will ensure that the base set is always present while at the
@@ -612,6 +622,12 @@ Frequenty Asked Questions:
disk set change versions (cxxlibs and sed come to mind). This will reinstall
those base packages that may have lesser version numbers.
+ --dist-upgrade --remove-obsolete will remove any packages that Pat has removed
+ from current. CAUTION: this can only take into consideration packages that
+ are available from your current sources. Thus self made packages will be
+ considered obsolete as well. Only use this if you have been using Slackware
+ packages exclusively. You can also use this option for information purposes.
+
29. How would I script an ldd dependency hack with slapt-get?
@@ -845,25 +861,9 @@ Frequenty Asked Questions:
If you are tracking current or are dist-upgrading to a new release, you will
encounter packages that you have installed that are no longer required or
part of the basic slackware install. If you only have the official slackware
- package sources in your slapt-getrc file, then you can use the following
- as either a command or a script to remove those obsoleted packages:
-
- for pkg in `slapt-get --installed|awk '{print $1}'`;do if [ -z "`slapt-get --search ${pkg}`" ]; then slapt-get --remove ${pkg};fi;done
-
- or as a script:
-
- #!/bin/sh
- # this script uses slapt-get to remove obsoleted packages
- # slapt-getrc must only have official package sources for the
- # current release you are tracking
- for pkg in `./slapt-get --installed|awk '{print $1}'`
- do
- if [ -z "`./slapt-get --search ${pkg}`" ]
- then
- echo ./slapt-get --remove ${pkg}
- fi
- done
+ package sources in your slapt-getrc file, then you can do the following:
+ # slapt-get --dist-upgrade --remove-obsolete
41. What provisions have you made for dialup users?
diff --git a/FAQ.html b/FAQ.html
index 7e67a11..61d9e32 100644
--- a/FAQ.html
+++ b/FAQ.html
@@ -178,6 +178,15 @@
### then, let slapt-get upgrade the rest
$ slapt-get --dist-upgrade
+ ### or you can specify --remove-obsolete to remove
+ ### all depreciated packages. CAUTION: this can only
+ ### take into consideration packages that are available
+ ### from your current sources. Thus self made packages
+ ### will be considered obsolete as well. Only use this
+ ### if you have been using Slackware packages exclusively.
+ ### You can also use this option for information purposes.
+ $ slapt-get --dist-upgrade --remove-obsolete
+
Then follow the rest of the directions in UPGRADE.TXT.
* Note: you might be able to get away with just doing a --dist-upgrade after
@@ -190,7 +199,7 @@
specify slapt-get to install a disk set like so:
### install all gnome and X packages
- $ slapt-get --search './slackware/gnome|./slackware/x'|awk '{print $1}'| \
+ $ slapt-get --search '^./slackware/gnome$|^./slackware/x$'|awk '{print $1}'| \
xargs -r slapt-get --install
Do the same for all your installed disk sets, such as gnome, x, xap, l, n, etc.
@@ -616,7 +625,8 @@
<A NAME="slgFAQ28"><B>28. I am tracking current, how do I keep the base disk set up to date?</B></A>
- If you are tracking current, --dist-upgrade may be more useful than --upgrade.
+ If you are tracking current, --dist-upgrade is more appropriate than
+ --upgrade.
Even if you aren't intentionally switching to a newer distribution,
--dist-upgrade will ensure that the base set is always present while at the
@@ -626,6 +636,12 @@
disk set change versions (cxxlibs and sed come to mind). This will reinstall
those base packages that may have lesser version numbers.
+ --dist-upgrade --remove-obsolete will remove any packages that Pat has removed
+ from current. CAUTION: this can only take into consideration packages that
+ are available from your current sources. Thus self made packages will be
+ considered obsolete as well. Only use this if you have been using Slackware
+ packages exclusively. You can also use this option for information purposes.
+
<A NAME="slgFAQ29"><B>29. How would I script an ldd dependency hack with slapt-get?</B></A>
@@ -859,25 +875,9 @@
If you are tracking current or are dist-upgrading to a new release, you will
encounter packages that you have installed that are no longer required or
part of the basic slackware install. If you only have the official slackware
- package sources in your slapt-getrc file, then you can use the following
- as either a command or a script to remove those obsoleted packages:
-
- for pkg in `slapt-get --installed|awk '{print $1}'`;do if [ -z "`slapt-get --search ${pkg}`" ]; then slapt-get --remove ${pkg};fi;done
-
- or as a script:
-
- #!/bin/sh
- # this script uses slapt-get to remove obsoleted packages
- # slapt-getrc must only have official package sources for the
- # current release you are tracking
- for pkg in `./slapt-get --installed|awk '{print $1}'`
- do
- if [ -z "`./slapt-get --search ${pkg}`" ]
- then
- echo ./slapt-get --remove ${pkg}
- fi
- done
+ package sources in your slapt-getrc file, then you can do the following:
+ # slapt-get --dist-upgrade --remove-obsolete
<A NAME="slgFAQ41"><B>41. What provisions have you made for dialup users?</B></A>
diff --git a/doc/slapt-get.8 b/doc/slapt-get.8
index aa288d3..f5dbf3b 100644
--- a/doc/slapt-get.8
+++ b/doc/slapt-get.8
@@ -53,6 +53,9 @@ slapt-get \- frontend to pkgtools
[
.B --config []
]
+[
+.B --remove-obsolete
+]
.LP
.B targets:
[
@@ -134,6 +137,9 @@ Show the download statistics
.TP
.B --config []
Specify file location of slapt-get configuration. This overrides the default location, /etc/slapt-get/slapt-getrc.
+.TP
+.B --remove-obsolete
+Remove installed packages that are no longer available. This works for dist-upgrade only. This removes packages that are no longer available from any current package sources, but are currently installed. Be careful as this will also remove custom built packages.
.SH TARGETS
.TP
.B --update
diff --git a/po/cs.po b/po/cs.po
index 8659b84..334aa2b 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -490,3 +490,6 @@ msgstr "vyisti pouze cache starch, nedostupnch balk"
msgid "required too long [%s:%d]\n"
msgstr "required pli dlouh [%s:%d]\n"
+msgid "remove obsolete packages (dist-upgrade only)"
+msgstr ""
+
diff --git a/po/de.po b/po/de.po
index 109daca..cd3a5f7 100644
--- a/po/de.po
+++ b/po/de.po
@@ -490,3 +490,6 @@ msgstr "nur alte, nicht mehr verfgbare Pakete aus Zwischenspeicher entfernen"
msgid "required too long [%s:%d]\n"
msgstr "required zu lang [ %s:%d]\n"
+msgid "remove obsolete packages (dist-upgrade only)"
+msgstr ""
+
diff --git a/po/el.po b/po/el.po
index 173b548..9cf5ec8 100644
--- a/po/el.po
+++ b/po/el.po
@@ -484,3 +484,6 @@ msgstr " (%d) .\n"
msgid "required too long [%s:%d]\n"
msgstr ""
+msgid "remove obsolete packages (dist-upgrade only)"
+msgstr ""
+
diff --git a/po/en.po b/po/en.po
index c25884d..9d072b6 100644
--- a/po/en.po
+++ b/po/en.po
@@ -488,3 +488,6 @@ msgstr "only purge cache of older, unreacheable pkgs"
msgid "required too long [%s:%d]\n"
msgstr "required too long [%s:%d]\n"
+msgid "remove obsolete packages (dist-upgrade only)"
+msgstr "remove obsolete packages (dist-upgrade only)"
+
diff --git a/po/es.po b/po/es.po
index 0d98e79..6ef5ea0 100644
--- a/po/es.po
+++ b/po/es.po
@@ -488,3 +488,6 @@ msgstr ""
msgid "required too long [%s:%d]\n"
msgstr "requerido demasiado largo [%s:%d]\n"
+msgid "remove obsolete packages (dist-upgrade only)"
+msgstr ""
+
diff --git a/po/es_ES.po b/po/es_ES.po
index 6111baa..795ea50 100644
--- a/po/es_ES.po
+++ b/po/es_ES.po
@@ -488,3 +488,6 @@ msgstr ""
msgid "required too long [%s:%d]\n"
msgstr "requerido demasiado largo [%s:%d]\n"
+msgid "remove obsolete packages (dist-upgrade only)"
+msgstr ""
+
diff --git a/po/fr.po b/po/fr.po
index b189f61..6a091dd 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -490,3 +490,6 @@ msgstr ""
msgid "required too long [%s:%d]\n"
msgstr ""
+msgid "remove obsolete packages (dist-upgrade only)"
+msgstr ""
+
diff --git a/po/it.po b/po/it.po
index 3b710df..d925d5f 100644
--- a/po/it.po
+++ b/po/it.po
@@ -488,3 +488,6 @@ msgstr ""
msgid "required too long [%s:%d]\n"
msgstr "richiesto troppo lungo [%s:%d]\n"
+msgid "remove obsolete packages (dist-upgrade only)"
+msgstr ""
+
diff --git a/po/nl.po b/po/nl.po
index 7fda80a..34679d3 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -488,3 +488,6 @@ msgstr ""
msgid "required too long [%s:%d]\n"
msgstr ""
+msgid "remove obsolete packages (dist-upgrade only)"
+msgstr ""
+
diff --git a/po/no.po b/po/no.po
index 28d624c..6b0ccc6 100644
--- a/po/no.po
+++ b/po/no.po
@@ -488,3 +488,6 @@ msgstr ""
msgid "required too long [%s:%d]\n"
msgstr "kreves for lang [%s:%d]\n"
+msgid "remove obsolete packages (dist-upgrade only)"
+msgstr ""
+
diff --git a/po/pl.po b/po/pl.po
index 5420ca5..d0d2a4e 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -489,3 +489,6 @@ msgstr "usu tylko stare, niedostpne pkgs z cache"
msgid "required too long [%s:%d]\n"
msgstr "required za duy [%s:%d]\n"
+msgid "remove obsolete packages (dist-upgrade only)"
+msgstr ""
+
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 229bafb..6eb4255 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -487,3 +487,6 @@ msgstr ""
msgid "required too long [%s:%d]\n"
msgstr ""
+msgid "remove obsolete packages (dist-upgrade only)"
+msgstr ""
+
diff --git a/po/pt_PT.po b/po/pt_PT.po
index 9b3eccc..db767e4 100644
--- a/po/pt_PT.po
+++ b/po/pt_PT.po
@@ -487,3 +487,6 @@ msgstr "eliminar da cache apenas os pacotes antigos, desactualizados"
msgid "required too long [%s:%d]\n"
msgstr "requerido muito longo [%s:%d]\n"
+msgid "remove obsolete packages (dist-upgrade only)"
+msgstr ""
+
diff --git a/po/slapt-get.pot b/po/slapt-get.pot
index a56c44a..1c5ce36 100644
--- a/po/slapt-get.pot
+++ b/po/slapt-get.pot
@@ -490,3 +490,6 @@ msgstr ""
msgid "required too long [%s:%d]\n"
msgstr ""
+msgid "remove obsolete packages (dist-upgrade only)"
+msgstr ""
+
diff --git a/po/sv.po b/po/sv.po
index f1dfb10..10f976b 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -488,3 +488,6 @@ msgstr ""
msgid "required too long [%s:%d]\n"
msgstr ""
+msgid "remove obsolete packages (dist-upgrade only)"
+msgstr ""
+
diff --git a/po/vi.po b/po/vi.po
index 3ff0e76..534b87f 100644
--- a/po/vi.po
+++ b/po/vi.po
@@ -491,3 +491,6 @@ msgstr "chỉ xoá những gói phần mềm cũ, không đọc được"
msgid "required too long [%s:%d]\n"
msgstr "yêu cầu quá dài [%s:%d]\n"
+msgid "remove obsolete packages (dist-upgrade only)"
+msgstr ""
+
diff --git a/src/action.c b/src/action.c
index 5414b90..fed191e 100644
--- a/src/action.c
+++ b/src/action.c
@@ -473,6 +473,35 @@ void pkg_action_upgrade_all(const rc_config *global_config){
/* free_pkg_list(matches); */
free(matches->pkgs);
free(matches);
+
+ /* remove obsolete packages if prompted to */
+ if( global_config->remove_obsolete == 1 ){
+ int r;
+
+ for(r = 0; r < installed_pkgs->pkg_count; r++){
+
+ /* if we can't find the installed package in our available pkg list, it must be obsolete */
+ if( get_newest_pkg(avail_pkgs,installed_pkgs->pkgs[r]->name) == NULL ){
+ struct pkg_list *deps;
+ int c;
+ /*
+ any packages that require this package we are about to remove should be
+ scheduled to remove as well
+ */
+ deps = is_required_by(global_config,avail_pkgs,installed_pkgs->pkgs[r]);
+ for(c = 0; c < deps->pkg_count; c++ ){
+ if( get_newest_pkg(installed_pkgs,deps->pkgs[c]->name) != NULL )
+ add_remove_to_transaction(&tran,deps->pkgs[c]);
+ }
+ free(deps->pkgs);
+ free(deps);
+ add_remove_to_transaction(&tran,installed_pkgs->pkgs[r]);
+ }
+
+ }
+
+ }/* end if remove_obsolete */
+
}
for(i = 0; i < installed_pkgs->pkg_count;i++){
diff --git a/src/configuration.c b/src/configuration.c
index 6e3f4cd..5f7e418 100644
--- a/src/configuration.c
+++ b/src/configuration.c
@@ -50,6 +50,7 @@ rc_config *read_rc_config(const char *file_name){
global_config->re_install = 0;
global_config->exclude_list = NULL;
global_config->working_dir[0] = '\0';
+ global_config->remove_obsolete = 0;
rc = open_file(file_name,"r");
if( rc == NULL ) exit(1);
diff --git a/src/configuration.h b/src/configuration.h
index fc28e65..f90063f 100644
--- a/src/configuration.h
+++ b/src/configuration.h
@@ -48,6 +48,7 @@ typedef struct {
int disable_dep_check;
int print_uris;
int dl_stats;
+ int remove_obsolete;
} rc_config;
rc_config *read_rc_config(const char *file_name);
diff --git a/src/main.c b/src/main.c
index 7532e14..78b9a8b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -58,6 +58,7 @@ int main( int argc, char *argv[] ){
{"S",0, 0, SHOW_STATS_OPT},
{"config",1, 0, CONFIG_OPT},
{"autoclean", 0, 0, AUTOCLEAN_OPT},
+ {"remove-obsolete", 0, 0, OBSOLETE_OPT},
{0, 0, 0, 0},
};
@@ -172,6 +173,9 @@ int main( int argc, char *argv[] ){
case AUTOCLEAN_OPT: /* clean old old package versions */
do_action = AUTOCLEAN;
break;
+ case OBSOLETE_OPT: /* remove obsolete packages */
+ global_config->remove_obsolete = 1;
+ break;
default:
usage();
exit(1);
@@ -305,6 +309,7 @@ void usage(void){
printf(" --print-uris - %s\n",_("print URIs only, do not download"));
printf(" --show-stats|-S - %s\n",_("show download statistics"));
printf(" --config [] - %s\n",_("specify alternate slapt-getrc location"));
+ printf(" --remove-obsolete - %s\n",_("remove obsolete packages (dist-upgrade only)"));
}
void version_info(void){
diff --git a/src/main.h b/src/main.h
index 8edd103..35008c4 100644
--- a/src/main.h
+++ b/src/main.h
@@ -71,6 +71,7 @@ enum action {
#define SHOW_STATS_OPT 'S'
#define CONFIG_OPT 'C'
#define AUTOCLEAN_OPT 'a'
+#define OBSOLETE_OPT 'O'
#define DEBUG 0
#define DO_NOT_UNLINK_BAD_FILES 1