aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2003-10-16 01:15:55 +0000
committerJason Woodward2003-10-16 01:15:55 +0000
commit51444b1a54a47ae45bc1ba668e88867fd9e430de (patch)
tree40a96600e05d50ed0d2b5108f0506f8d7c1c1003
parentad0157cf029c7b55bfa9fd174ea3f83ee98c39f5 (diff)
downloadslapt-get-51444b1a54a47ae45bc1ba668e88867fd9e430de.tar.gz
patch data is now fetched from patches/PACKAGES.TXT instead of parsing patches/FILE_LIST
get_newest_pkg_with_description() is now not needed... removed
-rw-r--r--ChangeLog4
-rw-r--r--FAQ23
-rw-r--r--Makefile2
-rw-r--r--src/action.c4
-rw-r--r--src/curl.h10
-rw-r--r--src/main.h2
-rw-r--r--src/package.c23
-rw-r--r--src/package.h21
8 files changed, 60 insertions, 29 deletions
diff --git a/ChangeLog b/ChangeLog
index 9b995e3..14c3f91 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
+0.9.6c Oct 15, 2003
+ * patch data is now fetched from patches/PACKAGES.TXT instead of
+ parsing patches/FILE_LIST
+
0.9.6b Oct 14, 2003
* fixed bug when removing pkg by base pkg name and removepkg wouldn't find
entry in /var/log/packages. Thanks to DanB at mojolin dot com and
diff --git a/FAQ b/FAQ
index b1a0d06..eea4aab 100644
--- a/FAQ
+++ b/FAQ
@@ -16,6 +16,7 @@ Frequenty Asked Questions:
13. How can I install every available package?
14. What if I only want to upgrade one package?
15. What about Dropline support?
+16. How can I generate an exclude list for an entire disk set?
@@ -220,3 +221,25 @@ Frequenty Asked Questions:
upgraded, either put the package names into the exception list or use
interactive mode (do not use --no-prompt, use --interactive).
+16. How can I generate an exclude list for an entire disk set?
+
+ You can use this script to generate a listing of packages to add to your
+ exlude list:
+
+ #!/bin/sh
+ # this should gen an exclude list for a particular dir set (first arg to script)
+ DIR=$1
+ F=0
+ for pkg in `./slapt-get --list|awk '{print $1}'`
+ do
+ if [ -n "`./slapt-get --show ${pkg}|grep 'Package Location'|awk '{print $3}'|egrep "\W+${DIR}"`" ]; then
+ if [ $F == 1 ]; then
+ echo -n ,$pkg
+ else
+ echo -n $pkg
+ fi
+ F=1
+ fi
+ done
+ echo
+
diff --git a/Makefile b/Makefile
index fa055e0..6667e81 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
PROGRAM_NAME=slapt-get
-VERSION=0.9.6b
+VERSION=0.9.6c
ARCH=i386
RELEASE=1
CC=gcc
diff --git a/src/action.c b/src/action.c
index ee3c7d6..79584f3 100644
--- a/src/action.c
+++ b/src/action.c
@@ -205,7 +205,7 @@ void pkg_action_show(const char *pkg_name){
available_pkgs = get_available_pkgs();
- pkg = get_newest_pkg_with_description(available_pkgs->pkgs,pkg_name,available_pkgs->pkg_count);
+ pkg = get_newest_pkg(available_pkgs->pkgs,pkg_name,available_pkgs->pkg_count);
if( pkg != NULL ){
printf("Package Name: %s\n",pkg->name);
@@ -261,7 +261,7 @@ void pkg_action_update(const rc_config *global_config){
patches_list_fh = tmpfile();
if( get_mirror_data_from_source(patches_list_fh,global_config->sources.url[i],PATCHES_LIST) == 0 ){
rewind(patches_list_fh); /* make sure we are back at the front of the file */
- available_pkgs = parse_file_list(patches_list_fh);
+ available_pkgs = parse_packages_txt(patches_list_fh);
write_pkg_data(global_config->sources.url[i],pkg_list_fh,available_pkgs);
free_pkg_list(available_pkgs);
}
diff --git a/src/curl.h b/src/curl.h
index 460e2ad..63ee1be 100644
--- a/src/curl.h
+++ b/src/curl.h
@@ -19,7 +19,17 @@
#define USE_CURL_PROGRESS 0
/* FUNCTION DEFINITIONS */
+
+/* this is the main download routine */
int download_data(FILE *,const char *);
+
+/*
+ this fills FILE with data from url, used for PACKAGES.TXT and CHECKSUMS
+*/
int get_mirror_data_from_source(FILE *,const char *,const char *);
+
+/* download pkg, cals download_data */
char *download_pkg(const rc_config *,pkg_info_t *);
+
+/* callback for curl progress */
int progress_callback(void *,double,double,double,double);
diff --git a/src/main.h b/src/main.h
index 3940c39..cd3dd1d 100644
--- a/src/main.h
+++ b/src/main.h
@@ -67,7 +67,7 @@ enum action {
#define DO_NOT_UNLINK_BAD_FILES 0
#define PKG_LIST "PACKAGES.TXT"
#define PKG_LIST_L "package_data"
-#define PATCHES_LIST "patches/FILE_LIST"
+#define PATCHES_LIST "patches/PACKAGES.TXT"
#define PATCHDIR "patches/"
#define REMOVE_CMD "/sbin/removepkg "
#define INSTALL_CMD "/sbin/installpkg "
diff --git a/src/package.c b/src/package.c
index 92a4a5c..3e42ae6 100644
--- a/src/package.c
+++ b/src/package.c
@@ -436,29 +436,6 @@ pkg_info_t *get_newest_pkg(pkg_info_t **pkgs,const char *pkg_name,int pkg_count)
return pkg;
}
-/*
- this one is used when we want a description... mostly trying to avoid update packages..
- we can assume the first pkg we come across will have some sort of description.
- subsequent listed pkgs that have the same name will more than likely be duplicate
- or updates.
-*/
-pkg_info_t *get_newest_pkg_with_description(pkg_info_t **pkgs,const char *pkg_name,int pkg_count){
- int iterator;
- pkg_info_t *pkg = NULL;
- for(iterator = 0; iterator < pkg_count; iterator++ ){
-
- /* if pkg has same name as our requested pkg */
- if( (strcmp(pkgs[iterator]->name,pkg_name)) == 0 ){
-
- if( pkg == NULL ){
- pkg = pkgs[iterator];
- }
- }
-
- }
- return pkg;
-}
-
/* parse the update list */
struct pkg_list *parse_file_list(FILE *fh){
size_t getline_len;
diff --git a/src/package.h b/src/package.h
index c6f1b62..6ee2f89 100644
--- a/src/package.h
+++ b/src/package.h
@@ -57,34 +57,51 @@ struct pkg_upgrade_list {
/*
* FUNCTION DEFINITIONS
*/
+
/* parse the PACKAGES.TXT file */
struct pkg_list *parse_packages_txt(FILE *);
struct pkg_list *get_available_pkgs(void);
+
/* retrieve list of installed pkgs */
struct pkg_list *get_installed_pkgs(void);
-/* return list of update pkgs */
+
+/*
+ This used to be used to parse the file list for updates,
+ until I realized patches/PACKAGES.TXT existed
+ Legacy, might be useful one day.
+*/
struct pkg_list *parse_file_list(FILE *);
+
/* generate a short description */
char *gen_short_pkg_description(pkg_info_t *);
+
/* retrieve the newest pkg from pkg_info_t list */
pkg_info_t *get_newest_pkg(pkg_info_t **,const char *,int);
-pkg_info_t *get_newest_pkg_with_description(pkg_info_t **,const char *,int);
+
/* install pkg */
int install_pkg(const rc_config *,pkg_info_t *);
+
/* upgrade pkg */
int upgrade_pkg(const rc_config *,pkg_info_t *,pkg_info_t *);
+
/* remove pkg */
int remove_pkg(const rc_config *,pkg_info_t *);
+
/* free memory allocated for pkg_list struct */
void free_pkg_list(struct pkg_list *);
+
/* exclude pkg based on pkg name */
int is_excluded(const rc_config *,const char *);
+
/* lookup md5sum of file */
void get_md5sum(const rc_config *,pkg_info_t *,char *);
+
/* compare package versions */
int cmp_pkg_versions(char *, char *);
+
/* analyze the pkg version hunk by hunk */
int break_down_pkg_version(int *,char *);
+
/* get available, installed, and update pkgs all in one */
/* write pkg data to disk */
void write_pkg_data(const char *,FILE *,struct pkg_list *);