aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Woodward2004-10-20 17:30:03 +0000
committerJason Woodward2004-10-20 17:30:03 +0000
commit40de5ddc1cacefe15e5910b5743abf771e297592 (patch)
tree686c09c00e6d4103e203c14786e152ff24311646 /src
parenta21f2f5f1a9d99ba9b74076246dd72f0406070fd (diff)
downloadslapt-get-40de5ddc1cacefe15e5910b5743abf771e297592.tar.gz
tightened the scope of some variables
Diffstat (limited to 'src')
-rw-r--r--src/action.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/action.c b/src/action.c
index df53bc0..1116b08 100644
--- a/src/action.c
+++ b/src/action.c
@@ -24,8 +24,6 @@ void pkg_action_install(const rc_config *global_config,const pkg_action_args_t *
transaction tran;
struct pkg_list *installed_pkgs;
struct pkg_list *avail_pkgs;
- pkg_info_t *pkg = NULL;
- pkg_info_t *installed_pkg = NULL;
sg_regex pkg_regex;
printf( _("Reading Package Lists... ") );
@@ -39,6 +37,8 @@ void pkg_action_install(const rc_config *global_config,const pkg_action_args_t *
init_regex(&pkg_regex,PKG_LOG_PATTERN);
for(i = 0; i < action_args->count; i++){
+ pkg_info_t *pkg = NULL;
+ pkg_info_t *installed_pkg = NULL;
/* Use regex to see if they specified a particular version */
execute_regex(&pkg_regex,action_args->pkgs[i]);
@@ -185,7 +185,6 @@ void pkg_action_list_installed(void){
/* remove/uninstall pkg */
void pkg_action_remove(const rc_config *global_config,const pkg_action_args_t *action_args){
int i;
- pkg_info_t *pkg;
struct pkg_list *installed_pkgs;
struct pkg_list *available;
transaction tran;
@@ -195,6 +194,8 @@ void pkg_action_remove(const rc_config *global_config,const pkg_action_args_t *a
init_transaction(&tran);
for(i = 0; i < action_args->count; i++){
+ pkg_info_t *pkg;
+
if( (pkg = get_newest_pkg(installed_pkgs,action_args->pkgs[i])) != NULL){
int c;
struct pkg_list *deps;
@@ -357,7 +358,6 @@ void pkg_action_upgrade_all(const rc_config *global_config){
int i;
struct pkg_list *installed_pkgs;
struct pkg_list *avail_pkgs;
- pkg_info_t *update_pkg;
transaction tran;
printf(_("Reading Package Lists... "));
@@ -369,6 +369,7 @@ void pkg_action_upgrade_all(const rc_config *global_config){
init_transaction(&tran);
for(i = 0; i < installed_pkgs->pkg_count;i++){
+ pkg_info_t *update_pkg;
/* see if we have an available update for the pkg */
update_pkg = get_newest_pkg(