summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2008-11-25 05:08:34 +0000
committerJason Woodward2008-11-25 05:08:34 +0000
commit9c93560701f95046335c0a69cac26a81969df01e (patch)
treed04c7f3a66373268cc00982d2e6c40ee83ff8073
parent8d31622d3a7d3d6dc6fd109756baf56b56a7c799 (diff)
downloadslapt-get-9c93560701f95046335c0a69cac26a81969df01e.tar.gz
* (libslapt) added slapt_write_rc_config (incorporating from gslapt)
* (libslapt) added parsing of disabled sources (instead of ignoring what gslapt creates). * test updates * Added source priority support based on patch submitted by Ken Milmore
-rw-r--r--ChangeLog7
-rw-r--r--FAQ45
-rw-r--r--FAQ.html45
-rw-r--r--Makefile2
-rw-r--r--README14
-rw-r--r--doc/libslapt.349
-rw-r--r--example.slapt-getrc43
-rw-r--r--po/bg.po28
-rw-r--r--po/cs.po28
-rw-r--r--po/cz.po28
-rw-r--r--po/de.po28
-rw-r--r--po/el.po28
-rw-r--r--po/en.po28
-rw-r--r--po/es.po28
-rw-r--r--po/es_ES.po28
-rw-r--r--po/fr.po28
-rw-r--r--po/id.po28
-rw-r--r--po/it.po28
-rw-r--r--po/ja.po28
-rw-r--r--po/nl.po28
-rw-r--r--po/no.po28
-rw-r--r--po/pl.po28
-rw-r--r--po/pt_BR.po28
-rw-r--r--po/pt_PT.po28
-rw-r--r--po/ro.po28
-rw-r--r--po/ru.po28
-rw-r--r--po/sk.po28
-rw-r--r--po/sl.po28
-rw-r--r--po/slapt-get.pot28
-rw-r--r--po/sv.po28
-rw-r--r--po/tr.po28
-rw-r--r--po/uk.po28
-rw-r--r--po/vi.po28
-rw-r--r--po/zh_CN.po28
-rw-r--r--src/action.c8
-rw-r--r--src/common.c36
-rw-r--r--src/common.h19
-rw-r--r--src/configuration.c265
-rw-r--r--src/configuration.h28
-rw-r--r--src/package.c108
-rw-r--r--src/package.h5
-rw-r--r--t/data/rc12
-rw-r--r--t/test.c16
-rw-r--r--t/test_configuration.c4
-rw-r--r--t/test_curl.c15
-rw-r--r--t/test_packages.c106
-rw-r--r--t/test_transaction.c1
47 files changed, 1360 insertions, 214 deletions
diff --git a/ChangeLog b/ChangeLog
index d6fce28..02384c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
-0.9.12f Nov 23, 2008
+0.10.0 Nov 25, 2008
+ * (libslapt) added slapt_write_rc_config (incorporating from gslapt)
+ * (libslapt) added parsing of disabled sources (instead of ignoring what
+ gslapt creates).
+ * test updates
+ * Added source priority support based on patch submitted by Ken Milmore
* Added support for ikg extension (requested by Miguel Reynosso)
* Fix for MD5 string length (Thanks to Boris Popov)
diff --git a/FAQ b/FAQ
index c7aa7a6..728d41d 100644
--- a/FAQ
+++ b/FAQ
@@ -57,6 +57,7 @@ Frequently Asked Questions:
54. Why am I getting "GPGME: Invalid crypto engine"?
55. How do I support GPG signature verification in my package repository?
56. What does "GPGME: Bad file descriptor, GPG key could not be imported." mean?
+57. How do I assign priorities to my package sources?
@@ -1210,3 +1211,47 @@ Frequently Asked Questions:
Make sure the /proc file system is mounted.
+57. How do I assign priorities to my package sources?
+
+ The source priority feature is intended for keeping installed packages closely
+ synchronised with a trusted repository, rather than upgrading based on package
+ version numbers. This can be useful for tracking the patches which are
+ applied to official Slackware releases, or for following Slackware-current,
+ where package version numbers are occasionally regressed due to stability
+ issues or for other reasons. Another use for this feature is where the user
+ maintains a local repository of customised packages which are to be used in
+ preference to those on the public mirrors.
+
+ Every SOURCE mentioned in the slapt-getrc file is assigned a priority number,
+ which is a non-negative integer that defaults to 0. Priority is assigned by
+ appending :{PRIORITY} to the source URI. For example:
+
+ SOURCE={url}:DEFAULT is the default, lowest priority
+ SOURCE={url}:PREFERRED assigns more weight to this source
+ SOURCE={url}:OFFICIAL even more weight, used to denote official sources
+ SOURCE={url}:CUSTOM highest priority, for your custom package source
+
+ PRIORITY of DEFAULT gives the usual slapt-get behaviour, whereby packages are
+ upgraded based on their version numbers. A package from a source with the
+ default priority will upgrade the installed package only if the package from
+ the source has a higher version number. This is effectively never used but is
+ included for completeness.
+
+ The priorities of PREFERRED, OFFICIAL, and CUSTOM allow the packages from a
+ mirror to be tracked more closely. A package from a source with a priority
+ higher than DEFAULT will "upgrade" the installed package whenever the version
+ strings differ, regardless of whether this is an upgrade or a downgrade in
+ terms of version number comparison. Where a package is available in different
+ versions from several different sources, the package from the source with the
+ greatest priority will be used for upgrade. Version numbers are only
+ considered in the event of a tie between two packages from sources with the
+ same priority.
+
+ Packages within the patches sub directory always have a slightly increased
+ priority of those within the rest of the package source. This is particularly
+ useful for tracking official Slackware patches.
+
+ The example slapt-getrc in the source tarball or in the slapt-get directory
+ within /usr/doc/ provides example usage of package source priority assignment.
+
+
diff --git a/FAQ.html b/FAQ.html
index c7ff571..c127d63 100644
--- a/FAQ.html
+++ b/FAQ.html
@@ -71,6 +71,7 @@
<a href="#slgFAQ54">54. Why am I getting "GPGME: Invalid crypto engine"?</a>
<a href="#slgFAQ55">55. How do I support GPG signature verification in my package repository?</a>
<a href="#slgFAQ56">56. What does "GPGME: Bad file descriptor, GPG key could not be imported." mean?</a>
+<a href="#slgFAQ57">57. How do I assign priorities to my package sources?</a>
@@ -1224,6 +1225,50 @@
Make sure the /proc file system is mounted.
+<a name="slgFAQ57"><b>57. How do I assign priorities to my package sources?</b></a>
+
+ The source priority feature is intended for keeping installed packages closely
+ synchronised with a trusted repository, rather than upgrading based on package
+ version numbers. This can be useful for tracking the patches which are
+ applied to official Slackware releases, or for following Slackware-current,
+ where package version numbers are occasionally regressed due to stability
+ issues or for other reasons. Another use for this feature is where the user
+ maintains a local repository of customised packages which are to be used in
+ preference to those on the public mirrors.
+
+ Every SOURCE mentioned in the slapt-getrc file is assigned a priority number,
+ which is a non-negative integer that defaults to 0. Priority is assigned by
+ appending :{PRIORITY} to the source URI. For example:
+
+ SOURCE={url}:DEFAULT is the default, lowest priority
+ SOURCE={url}:PREFERRED assigns more weight to this source
+ SOURCE={url}:OFFICIAL even more weight, used to denote official sources
+ SOURCE={url}:CUSTOM highest priority, for your custom package source
+
+ PRIORITY of DEFAULT gives the usual slapt-get behaviour, whereby packages are
+ upgraded based on their version numbers. A package from a source with the
+ default priority will upgrade the installed package only if the package from
+ the source has a higher version number. This is effectively never used but is
+ included for completeness.
+
+ The priorities of PREFERRED, OFFICIAL, and CUSTOM allow the packages from a
+ mirror to be tracked more closely. A package from a source with a priority
+ higher than DEFAULT will "upgrade" the installed package whenever the version
+ strings differ, regardless of whether this is an upgrade or a downgrade in
+ terms of version number comparison. Where a package is available in different
+ versions from several different sources, the package from the source with the
+ greatest priority will be used for upgrade. Version numbers are only
+ considered in the event of a tie between two packages from sources with the
+ same priority.
+
+ Packages within the patches sub directory always have a slightly increased
+ priority of those within the rest of the package source. This is particularly
+ useful for tracking official Slackware patches.
+
+ The example slapt-getrc in the source tarball or in the slapt-get directory
+ within /usr/doc/ provides example usage of package source priority assignment.
+
+
</pre>
diff --git a/Makefile b/Makefile
index c620e16..34931d4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
PACKAGE=slapt-get
-VERSION=0.9.12f
+VERSION=0.10.0
ARCH=$(shell uname -m | sed -e "s/i[3456]86/i386/")
LIBDIR=/usr/lib
RELEASE=1
diff --git a/README b/README
index b07920d..b394ce1 100644
--- a/README
+++ b/README
@@ -108,6 +108,17 @@ Table of Contents:
official mirrors. Third party packages might not be
as rigorously tested as official packages.
+ Every SOURCE mentioned in the slapt-getrc file is assigned a priority
+ number, which is a non-negative integer that defaults to 0. Priority
+ is assigned by appending :{PRIORITY} to the source URI. For example:
+
+ SOURCE={url}:DEFAULT is the default, lowest priority
+ SOURCE={url}:PREFERRED assigns more weight to this source
+ SOURCE={url}:OFFICIAL even more weight, used to denote official sources
+ SOURCE={url}:CUSTOM highest priority, for your custom package source
+
+ See the FAQ for more information.
+
* WORKINGDIR will hold the package data and downloaded packages.
This directory will be created automatically as permissions
allow.
@@ -243,3 +254,6 @@ Table of Contents:
Reteaua PTM <admin at ptm dot ro> contributed the Romanian translation.
+ Ken Milmore <ken dot milmore at googlemail dot com> contributed the initial
+ source priority support.
+
diff --git a/doc/libslapt.3 b/doc/libslapt.3
index c6a6aae..43e9c2e 100644
--- a/doc/libslapt.3
+++ b/doc/libslapt.3
@@ -95,19 +95,38 @@ and is freed by a call to the \fIslapt_free_rc_config\fP() function.
.B "void slapt_free_rc_config(slapt_rc_config *global_config);"
.sp
.TP
+The slapt-getrc configuration can be written back out with \fIslapt_write_rc_config\fP.
+.sp
+.B "int slapt_write_rc_config(const slapt_rc_config *global_config, const char *location);"
+.sp
+.TP
The progress callback is a function that is called while data is being downloaded. It is in the format of \fBint slapt_progress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);\fP
.sp
.TP
+Package sources are represented by the \fIslapt_source_t\fP type. They are created, destroyed, and interacted with using the following functions:
+.sp
+.nf
+ typedef struct {
+ char *url;
+ SLAPT_PRIORITY_T priority;
+ SLAPT_BOOL_T disabled;
+ } slapt_source_t;
+.sp
+.B slapt_source_t *slapt_init_source(const char *s);
+.B void slapt_free_source(slapt_source_t *src);
+.fi
+.sp
+.TP
The \fIstruct slapt_source_list\fP stores the package sources. Sources can be added and removed with \fIslapt_add_source\fP() and \fIslapt_remove_source\fP(). Typically, \fIslapt_rc_config->sources\fP is passed as the first argument, but it could be any pointer to a \fIstruct slapt_source_list\fP that is created by \fIslapt_init_source_list\fP().
.sp
.nf
struct slapt_source_list {
- char **url;
+ slapt_source_t **src;
unsigned int count;
};
.sp
.B "struct slapt_source_list *slapt_init_source_list(void);"
-.B "void slapt_add_source(struct slapt_source_list *list,const char *s);"
+.B "void slapt_add_source(struct slapt_source_list *list, slapt_source_t *s);"
.B "void slapt_remove_source (struct slapt_source_list *list, const char *s);"
.B "void slapt_free_source_list(struct slapt_source_list *list);"
.fi
@@ -150,6 +169,8 @@ slapt-get stores packages within \fIslapt_pkg_info_t\fP objects.
char *file_ext;
unsigned int size_c;
unsigned int size_u;
+ unsigned int priority;
+ SLAPT_BOOL_T installed;
} slapt_pkg_info_t;
.fi
.sp
@@ -227,11 +248,11 @@ Passing a package to \fIinstallpkg\fP, \fIupgradepkg\fP, and \fIremovepkg\fP is
.fi
.sp
.TP
-Comparing package versions is done with the \fIslapt_cmp_pkgs\fP macro. It calls \fIslapt_cmp_pkg_versions\fP() which returns just like strcmp, greater than 0 if a is greater than b, less than 0 if a is less than b, or 0 if a and b are equal.
+Comparing package versions is done with the \fIslapt_cmp_pkgs\fP functions. It calls \fIslapt_cmp_pkg_versions\fP() which returns just like strcmp, greater than 0 if a is greater than b, less than 0 if a is less than b, or 0 if a and b are equal.
.sp
.nf
.B "int slapt_cmp_pkg_versions(const char *a, const char *b);"
-.B "#define slapt_cmp_pkgs(x,y) slapt_cmp_pkg_versions(x->version,y->version)"
+.B "int slapt_cmp_pkgs(slapt_pkg_info_t *a, slapt_pkg_info_t *b);"
.fi
.sp
.TP
@@ -550,6 +571,26 @@ Miscellaneous functionality within libslapt.
} slapt_code_t;
.sp
.B "const char *slapt_strerror(slapt_code_t code);"
+.sp
+.nf
+ typedef enum {
+ SLAPT_PRIORITY_DEFAULT = 0,
+ SLAPT_PRIORITY_DEFAULT_PATCH,
+ SLAPT_PRIORITY_PREFERRED,
+ SLAPT_PRIORITY_PREFERRED_PATCH,
+ SLAPT_PRIORITY_OFFICIAL,
+ SLAPT_PRIORITY_OFFICIAL_PATCH,
+ SLAPT_PRIORITY_CUSTOM,
+ SLAPT_PRIORITY_CUSTOM_PATCH
+ } SLAPT_PRIORITY_T;
+.sp
+.B #define SLAPT_PRIORITY_DEFAULT_TOKEN "DEFAULT"
+.B #define SLAPT_PRIORITY_PREFERRED_TOKEN "PREFERRED"
+.B #define SLAPT_PRIORITY_OFFICIAL_TOKEN "OFFICIAL"
+.B #define SLAPT_PRIORITY_CUSTOM_TOKEN "CUSTOM"
+.sp
+.B /* return human readable priority */
+.B const char *slapt_priority_to_str(SLAPT_PRIORITY_T priority);
.fi
.sp
.SH LINKING WITH LIBSLAPT
diff --git a/example.slapt-getrc b/example.slapt-getrc
index 2a7c4a5..560d4af 100644
--- a/example.slapt-getrc
+++ b/example.slapt-getrc
@@ -13,28 +13,28 @@ EXCLUDE=^kernel-.*,^glibc.*,.*-[0-9]+dl$,^devs$,^udev$,aaa_elflibs,x86_64
# base url to directory with a PACKAGES.TXT
# can point to any release, ie: 9.0, 10.0, current, etc
# you should really choose from an example mirror url below
-#SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-8.1/
-#SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-9.0/
-#SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-9.1/
-#SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-10.0/
-#SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-10.1/
-#SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-10.2/
-#SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-11.0/
-#SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-12.0/
-SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-12.1/
-#SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-current/
+#SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-8.1/:OFFICIAL
+#SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-9.0/:OFFICIAL
+#SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-9.1/:OFFICIAL
+#SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-10.0/:OFFICIAL
+#SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-10.1/:OFFICIAL
+#SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-10.2/:OFFICIAL
+#SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-11.0/:OFFICIAL
+#SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-12.0/:OFFICIAL
+SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-12.1/:OFFICIAL
+#SOURCE=ftp://ftp.slackware.com/pub/slackware/slackware-current/:OFFICIAL
# slapt source
-#SOURCE=http://software.jaos.org/slackpacks/8.1/
-#SOURCE=http://software.jaos.org/slackpacks/9.0/
-#SOURCE=http://software.jaos.org/slackpacks/9.1/
-#SOURCE=http://software.jaos.org/slackpacks/10.0/
-#SOURCE=http://software.jaos.org/slackpacks/10.1/
-#SOURCE=http://software.jaos.org/slackpacks/10.2/
-#SOURCE=http://software.jaos.org/slackpacks/11.0/
-#SOURCE=http://software.jaos.org/slackpacks/12.0/
-SOURCE=http://software.jaos.org/slackpacks/12.1/
-#SOURCE=http://software.jaos.org/slackpacks/current/
+#SOURCE=http://software.jaos.org/slackpacks/8.1/:OFFICIAL
+#SOURCE=http://software.jaos.org/slackpacks/9.0/:OFFICIAL
+#SOURCE=http://software.jaos.org/slackpacks/9.1/:OFFICIAL
+#SOURCE=http://software.jaos.org/slackpacks/10.0/:OFFICIAL
+#SOURCE=http://software.jaos.org/slackpacks/10.1/:OFFICIAL
+#SOURCE=http://software.jaos.org/slackpacks/10.2/:OFFICIAL
+#SOURCE=http://software.jaos.org/slackpacks/11.0/:OFFICIAL
+#SOURCE=http://software.jaos.org/slackpacks/12.0/:OFFICIAL
+SOURCE=http://software.jaos.org/slackpacks/12.1/:OFFICIAL
+#SOURCE=http://software.jaos.org/slackpacks/current/:OFFICIAL
# you can use multiple sources, such as linuxpackages.net
# (not recommended on production servers, see README)
@@ -103,10 +103,11 @@ SOURCE=http://software.jaos.org/slackpacks/12.1/
# pull from your cdrom
-#SOURCE=file:///mnt/cdrom/
+#SOURCE=file:///mnt/cdrom/:CUSTOM
# slackware mirrors to choose from
+#SOURCE=http://slackware.oc9.org/slackware-12.1/
#SOURCE=http://slackware.mirrors.pair.com/slackware-12.1/
#SOURCE=http://carroll.cac.psu.edu/pub/linux/distributions/slackware/slackware-12.1/
#SOURCE=http://darkstar.ist.utl.pt/slackware/slackware-12.1/
diff --git a/po/bg.po b/po/bg.po
index 65889d9..f570517 100644
--- a/po/bg.po
+++ b/po/bg.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+0500\n"
"Last-Translator: Victor Keranov <victor_keranov@mail.bg>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -506,3 +506,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/cs.po b/po/cs.po
index 30ce586..4e06729 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+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"
@@ -506,3 +506,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/cz.po b/po/cz.po
index 054a5a1..e45597c 100644
--- a/po/cz.po
+++ b/po/cz.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+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"
@@ -510,3 +510,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/de.po b/po/de.po
index 80d8b36..7af05af 100644
--- a/po/de.po
+++ b/po/de.po
@@ -6,9 +6,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+0500\n"
"Last-Translator: Manfred Mueller <nekdesk@nekdesk.de>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -508,3 +508,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/el.po b/po/el.po
index be324a3..baa52b0 100644
--- a/po/el.po
+++ b/po/el.po
@@ -5,9 +5,9 @@
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+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"
@@ -506,3 +506,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/en.po b/po/en.po
index 165d82b..c0c0e79 100644
--- a/po/en.po
+++ b/po/en.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+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"
@@ -506,3 +506,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/es.po b/po/es.po
index 4c578e1..669541d 100644
--- a/po/es.po
+++ b/po/es.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+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"
@@ -506,3 +506,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/es_ES.po b/po/es_ES.po
index 5c725b3..f020e28 100644
--- a/po/es_ES.po
+++ b/po/es_ES.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+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"
@@ -506,3 +506,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/fr.po b/po/fr.po
index 76fa469..6be9a6d 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+0500\n"
"Last-Translators: Verachten Bruno <gounthar@gmail.com>, solsTiCe d'Hiver <solstice.dhiver@laposte.net>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -506,3 +506,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/id.po b/po/id.po
index fba9c18..4eb2afa 100644
--- a/po/id.po
+++ b/po/id.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+0500\n"
"Last-Translator: Kemas Antonius <kyantonius@kyantonius.com>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -506,3 +506,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/it.po b/po/it.po
index 6a03e2c..84daec6 100644
--- a/po/it.po
+++ b/po/it.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+0500\n"
"Last-Translator: Francesco Gigli <jaramir@slack.it>\n"
"Language-Team: Italian <tp@lists.linux.it>\n"
"MIME-Version: 1.0\n"
@@ -506,3 +506,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/ja.po b/po/ja.po
index 536b401..7b85e00 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -6,9 +6,9 @@
# JW <J_W@somewhere.c0.jp>, 2006.
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2006-03-08 19:49+0900\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+0500\n"
"Last-Translator: JW <J_W@somewhere.c0.jp>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -508,3 +508,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/nl.po b/po/nl.po
index f6c38f4..2d270e5 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+0500\n"
"Last-Translator: Stefan Koopmanschap <stefan@electronicmusicworld.com>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -506,3 +506,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/no.po b/po/no.po
index a711cc9..58d7664 100644
--- a/po/no.po
+++ b/po/no.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+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"
@@ -506,3 +506,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/pl.po b/po/pl.po
index 0f73abf..348e6ed 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+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"
@@ -507,3 +507,27 @@ msgstr "Nieznany bd"
msgid "Not Found\n"
msgstr "Nie znaleziono\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/pt_BR.po b/po/pt_BR.po
index ff034e5..1306a66 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+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"
@@ -506,3 +506,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/pt_PT.po b/po/pt_PT.po
index 42be6ff..f7efd6a 100644
--- a/po/pt_PT.po
+++ b/po/pt_PT.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+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"
@@ -506,3 +506,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/ro.po b/po/ro.po
index 5570cb9..590328b 100644
--- a/po/ro.po
+++ b/po/ro.po
@@ -4,9 +4,9 @@
# Reteaua PTM <admin@ptm.ro>
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12e\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2008-03-22 02:10+0200\n"
-"PO-Revision-Date: 2008-04-27 18:16+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+0500\n"
"Last-Translator: Zion <admin@ptm.ro>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -505,3 +505,27 @@ msgstr "Eroare necunoscuta"
msgid "Not Found\n"
msgstr "Nu a fost gasit\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/ru.po b/po/ru.po
index b4023ec..18f5ef4 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12c\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2005-09-07 23:24 EEST\n"
-"PO-Revision-Date: 2007-10-27 22:02+0400\n"
+"PO-Revision-Date: 2008-11-24 00:41+0500\n"
"Language-Team: DeepStyle Team <hottab@deepstyle.org.ua>, <ru@li.org>, sin <digitalhunger@gmail.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=KOI8-R\n"
@@ -507,3 +507,27 @@ msgstr " "
msgid "Not Found\n"
msgstr " \n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/sk.po b/po/sk.po
index ff5a5d3..ba54c3b 100644
--- a/po/sk.po
+++ b/po/sk.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2005-06-23 21:28+0500\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+0500\n"
"Last-Translator: Erik Gyepes <depi@depi.sk>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -506,3 +506,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/sl.po b/po/sl.po
index 897c562..c00560f 100644
--- a/po/sl.po
+++ b/po/sl.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2005-03-09\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+0500\n"
"Last-Translator: Uros Trsavec <utrsav@walla.com>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -506,3 +506,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/slapt-get.pot b/po/slapt-get.pot
index fe4c5ef..9f77ffd 100644
--- a/po/slapt-get.pot
+++ b/po/slapt-get.pot
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+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"
@@ -506,3 +506,27 @@ msgstr ""
msgid "Not Found\n"
msgstr ""
+msgid "Default"
+msgstr ""
+
+msgid "Default Patch"
+msgstr ""
+
+msgid "Preferred"
+msgstr ""
+
+msgid "Preferred Patch"
+msgstr ""
+
+msgid "Official"
+msgstr ""
+
+msgid "Official Patch"
+msgstr ""
+
+msgid "Custom"
+msgstr ""
+
+msgid "Custom Patch"
+msgstr ""
+
diff --git a/po/sv.po b/po/sv.po
index a2b376f..fad22c0 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+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"
@@ -506,3 +506,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/tr.po b/po/tr.po
index 1c4d7a4..6baf288 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -4,9 +4,9 @@
# Bekir SONAT <bekirsonat@kde.org.tr>, 2006.
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+0500\n"
"Last-Translator: Bekir SONAT <bekirsonat@kde.org.tr>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -506,3 +506,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/uk.po b/po/uk.po
index 22eec36..86db2c7 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2005-09-07 23:24 EEST\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+0500\n"
"Last-Translators: sin <digitalhunger@gmail.com>\n"
"Language-Team: DeepStyle Team <hottab@deepstyle.org.ua>\n"
"MIME-Version: 1.0\n"
@@ -507,3 +507,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/vi.po b/po/vi.po
index a8bf2cb..d0e1223 100644
--- a/po/vi.po
+++ b/po/vi.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+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"
@@ -508,3 +508,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 166ba78..7de817b 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: 0.9.12b\n"
+"Project-Id-Version: 0.10.0\n"
"POT-Creation-Date: 2003-11-03 14:28+0000\n"
-"PO-Revision-Date: 2007-09-18 20:51+0500\n"
+"PO-Revision-Date: 2008-11-24 00:41+0500\n"
"Last-Translator: Yang Jinsong <shannleon@gmail.com>\n"
"Language-Team: slapt-get-devel <slapt-get-devel@software.jaos.org>\n"
"MIME-Version: 1.0\n"
@@ -506,3 +506,27 @@ msgstr "Unknown error"
msgid "Not Found\n"
msgstr "Not Found\n"
+msgid "Default"
+msgstr "Default"
+
+msgid "Default Patch"
+msgstr "Default Patch"
+
+msgid "Preferred"
+msgstr "Preferred"
+
+msgid "Preferred Patch"
+msgstr "Preferred Patch"
+
+msgid "Official"
+msgstr "Official"
+
+msgid "Official Patch"
+msgstr "Official Patch"
+
+msgid "Custom"
+msgstr "Custom"
+
+msgid "Custom Patch"
+msgstr "Custom Patch"
+
diff --git a/src/action.c b/src/action.c
index 899dddf..489fcfa 100644
--- a/src/action.c
+++ b/src/action.c
@@ -429,6 +429,7 @@ void slapt_pkg_action_show(const char *pkg_name)
printf(gettext("Package Name: %s\n"),pkg->name);
printf(gettext("Package Mirror: %s\n"),pkg->mirror);
+ printf(gettext("Package Priority: %s\n"),slapt_priority_to_str(pkg->priority));
printf(gettext("Package Location: %s\n"),pkg->location);
printf(gettext("Package Version: %s\n"),pkg->version);
printf(gettext("Package Size: %d K\n"),pkg->size_c);
@@ -781,10 +782,9 @@ void slapt_pkg_action_add_keys(const slapt_rc_config *global_config)
for(s = 0; s < global_config->sources->count; s++)
{
FILE *gpg_key = NULL;
- printf(gettext("Retrieving GPG key [%s]..."), global_config->sources->url[s]);
- gpg_key = slapt_get_pkg_source_gpg_key (global_config,
- global_config->sources->url[s],
- &compressed);
+ const char *source_url = global_config->sources->src[s]->url;
+ printf(gettext("Retrieving GPG key [%s]..."), source_url);
+ gpg_key = slapt_get_pkg_source_gpg_key (global_config, source_url, &compressed);
if (gpg_key != NULL)
{
slapt_code_t r = slapt_add_pkg_source_gpg_key(gpg_key);
diff --git a/src/common.c b/src/common.c
index b3ca397..94bca2c 100644
--- a/src/common.c
+++ b/src/common.c
@@ -36,7 +36,12 @@ FILE *slapt_open_file(const char *file_name,const char *mode)
/* initialize regex structure and compile the regular expression */
slapt_regex_t *slapt_init_regex(const char *regex_string)
{
- slapt_regex_t *r = slapt_malloc(sizeof *r);
+ slapt_regex_t *r;
+
+ if (regex_string == NULL)
+ return NULL;
+
+ r = slapt_malloc(sizeof *r);
r->nmatch = SLAPT_MAX_REGEX_PARTS;
r->reg_return = -1;
@@ -321,8 +326,33 @@ const char *slapt_strerror(slapt_code_t code)
case SLAPT_CHECKSUMS_MISSING_KEY:
return gettext("No key for verification");
#endif
- };
-
+ default:
return gettext("Unknown error");
+ };
}
+const char *slapt_priority_to_str(SLAPT_PRIORITY_T priority)
+{
+
+ switch(priority) {
+ case SLAPT_PRIORITY_DEFAULT:
+ return gettext("Default");
+ case SLAPT_PRIORITY_DEFAULT_PATCH:
+ return gettext("Default Patch");
+ case SLAPT_PRIORITY_PREFERRED:
+ return gettext("Preferred");
+ case SLAPT_PRIORITY_PREFERRED_PATCH:
+ return gettext("Preferred Patch");
+ case SLAPT_PRIORITY_OFFICIAL:
+ return gettext("Official");
+ case SLAPT_PRIORITY_OFFICIAL_PATCH:
+ return gettext("Official Patch");
+ case SLAPT_PRIORITY_CUSTOM:
+ return gettext("Custom");
+ case SLAPT_PRIORITY_CUSTOM_PATCH:
+ return gettext("Custom Patch");
+ default:
+ return NULL;
+ };
+
+}
diff --git a/src/common.h b/src/common.h
index 27d4a3d..2aa29b3 100644
--- a/src/common.h
+++ b/src/common.h
@@ -26,6 +26,22 @@ typedef enum {
SLAPT_DOWNLOAD_INCOMPLETE
} slapt_code_t;
+typedef enum {
+ SLAPT_PRIORITY_DEFAULT = 0,
+ SLAPT_PRIORITY_DEFAULT_PATCH,
+ SLAPT_PRIORITY_PREFERRED,
+ SLAPT_PRIORITY_PREFERRED_PATCH,
+ SLAPT_PRIORITY_OFFICIAL,
+ SLAPT_PRIORITY_OFFICIAL_PATCH,
+ SLAPT_PRIORITY_CUSTOM,
+ SLAPT_PRIORITY_CUSTOM_PATCH
+} SLAPT_PRIORITY_T;
+
+#define SLAPT_PRIORITY_DEFAULT_TOKEN "DEFAULT"
+#define SLAPT_PRIORITY_PREFERRED_TOKEN "PREFERRED"
+#define SLAPT_PRIORITY_OFFICIAL_TOKEN "OFFICIAL"
+#define SLAPT_PRIORITY_CUSTOM_TOKEN "CUSTOM"
+
typedef struct {
regmatch_t pmatch[SLAPT_MAX_REGEX_PARTS];
regex_t regex;
@@ -54,4 +70,5 @@ __inline void *slapt_calloc(size_t n,size_t s);
/* return human readable error */
const char *slapt_strerror(slapt_code_t code);
-
+/* return human readable priority */
+const char *slapt_priority_to_str(SLAPT_PRIORITY_T priority);
diff --git a/src/configuration.c b/src/configuration.c
index 120e223..88f9b09 100644
--- a/src/configuration.c
+++ b/src/configuration.c
@@ -69,33 +69,42 @@ slapt_rc_config *slapt_read_rc_config(const char *file_name)
/* check to see if it has our key and value seperated by our token */
/* and extract them */
- if ( getline_buffer[0] == '#' ) {
- continue;
- }
-
- if ( strstr(getline_buffer,SOURCE_TOKEN) != NULL ) {
+ if ( strstr(getline_buffer,SLAPT_SOURCE_TOKEN) != NULL ) {
/* SOURCE URL */
- if ( strlen(getline_buffer) > strlen(SOURCE_TOKEN) ) {
- slapt_add_source(global_config->sources,getline_buffer +
- strlen(SOURCE_TOKEN));
+ if ( strlen(getline_buffer) > strlen(SLAPT_SOURCE_TOKEN) ) {
+ slapt_source_t *s = slapt_init_source(getline_buffer + strlen(SLAPT_SOURCE_TOKEN));
+ if (s != NULL) {
+ slapt_add_source(global_config->sources,s);
+ }
+ }
+
+ } else if ( strstr(getline_buffer,SLAPT_DISABLED_SOURCE_TOKEN) != NULL ) {
+ /* DISABLED SOURCE */
+
+ if (strlen(getline_buffer) > strlen(SLAPT_DISABLED_SOURCE_TOKEN) ) {
+ slapt_source_t *s = slapt_init_source(getline_buffer + strlen(SLAPT_DISABLED_SOURCE_TOKEN));
+ if (s != NULL) {
+ s->disabled = SLAPT_TRUE;
+ slapt_add_source(global_config->sources,s);
+ }
}
- } else if ( strstr(getline_buffer,WORKINGDIR_TOKEN) != NULL ) {
+ } else if ( strstr(getline_buffer,SLAPT_WORKINGDIR_TOKEN) != NULL ) {
/* WORKING DIR */
- if ( strlen(getline_buffer) > strlen(WORKINGDIR_TOKEN) ) {
+ if ( strlen(getline_buffer) > strlen(SLAPT_WORKINGDIR_TOKEN) ) {
strncpy(
global_config->working_dir,
- getline_buffer + strlen(WORKINGDIR_TOKEN),
- (strlen(getline_buffer) - strlen(WORKINGDIR_TOKEN))
+ getline_buffer + strlen(SLAPT_WORKINGDIR_TOKEN),
+ (strlen(getline_buffer) - strlen(SLAPT_WORKINGDIR_TOKEN))
);
global_config->working_dir[
- (strlen(getline_buffer) - strlen(WORKINGDIR_TOKEN))
+ (strlen(getline_buffer) - strlen(SLAPT_WORKINGDIR_TOKEN))
] = '\0';
}
- } else if ( strstr(getline_buffer,EXCLUDE_TOKEN) != NULL ) {
+ } else if ( strstr(getline_buffer,SLAPT_EXCLUDE_TOKEN) != NULL ) {
/* exclude list */
slapt_free_exclude_list(global_config->exclude_list);
global_config->exclude_list = parse_exclude(getline_buffer);
@@ -286,93 +295,58 @@ void slapt_free_exclude_list(struct slapt_exclude_list *list)
struct slapt_source_list *slapt_init_source_list(void)
{
struct slapt_source_list *list = slapt_malloc(sizeof *list);
- list->url = slapt_malloc(sizeof *list->url);
+ list->src = slapt_malloc(sizeof *list->src);
list->count = 0;
return list;
}
-void slapt_add_source(struct slapt_source_list *list,const char *s)
+void slapt_add_source(struct slapt_source_list *list,slapt_source_t *s)
{
- char **realloc_tmp;
- int source_len = 0;
+ slapt_source_t **realloc_tmp;
if ( s == NULL )
return;
- source_len = strlen(s);
-
- realloc_tmp = realloc(list->url,sizeof *list->url * (list->count + 1) );
+ realloc_tmp = realloc(list->src,sizeof *list->src * (list->count + 1) );
if ( realloc_tmp == NULL )
return;
- list->url = realloc_tmp;
-
- if ( s[source_len - 1] == '/' ) {
-
- list->url[ list->count ] = strndup(s,source_len);
- list->url[ list->count ][source_len] = '\0';
-
- } else {
-
- list->url[ list->count ] = slapt_malloc(
- sizeof *list->url[list->count] * (source_len + 2)
- );
- list->url[list->count][0] = '\0';
-
- list->url[list->count] = strncat(
- list->url[list->count],
- s,
- source_len
- );
-
- if (isblank(list->url[list->count][source_len - 1]) == 0) {
- list->url[list->count] = strncat(list->url[list->count], "/", 1);
- } else {
- if (list->url[list->count][source_len - 2] == '/') {
- list->url[list->count][source_len - 2] = '/';
- list->url[list->count][source_len - 1] = '\0';
- } else {
- list->url[list->count][source_len - 1] = '/';
- }
- }
-
- list->url[list->count][source_len + 1] = '\0';
-
- }
+ list->src = realloc_tmp;
+ list->src[list->count] = s;
++list->count;
}
void slapt_remove_source (struct slapt_source_list *list, const char *s)
{
- char *tmp = NULL;
+ slapt_source_t *src_to_discard = NULL;
unsigned int i = 0;
while ( i < list->count ) {
- if ( strcmp(s,list->url[i]) == 0 && tmp == NULL ) {
- tmp = list->url[i];
+ if ( strcmp(s,list->src[i]->url) == 0 && src_to_discard == NULL ) {
+ src_to_discard = list->src[i];
}
- if ( tmp != NULL && (i+1 < list->count) ) {
- list->url[i] = list->url[i + 1];
+ if ( src_to_discard != NULL && (i+1 < list->count) ) {
+ list->src[i] = list->src[i + 1];
}
++i;
}
- if ( tmp != NULL ) {
- char **realloc_tmp;
+ if ( src_to_discard != NULL ) {
+ slapt_source_t **realloc_tmp;
int count = list->count - 1;
if ( count < 1 )
count = 1;
- free(tmp);
+ slapt_free_source(src_to_discard);
- realloc_tmp = realloc(list->url,sizeof *list->url * count );
+ realloc_tmp = realloc(list->src,sizeof *list->src * count );
if ( realloc_tmp != NULL ) {
- list->url = realloc_tmp;
+ list->src = realloc_tmp;
if (list->count > 0)
--list->count;
}
@@ -386,9 +360,9 @@ void slapt_free_source_list(struct slapt_source_list *list)
unsigned int i;
for (i = 0; i < list->count; ++i) {
- free(list->url[i]);
+ slapt_free_source(list->src[i]);
}
- free(list->url);
+ free(list->src);
free(list);
}
@@ -401,3 +375,160 @@ SLAPT_BOOL_T slapt_is_interactive(const slapt_rc_config *global_config)
return interactive;
}
+
+static void slapt_source_parse_attributes(slapt_source_t *s, const char *string)
+{
+ int offset = 0;
+ int len = strlen(string);
+
+ while (offset < len) {
+ char *token = NULL;
+
+ if (strchr(string + offset, ',') != NULL) {
+ size_t token_len = strcspn(string + offset, ",");
+ if (token_len > 0) {
+ token = strndup(string + offset, token_len);
+ offset += token_len + 1;
+ }
+ } else {
+ token = strdup(string + offset);
+ offset += len;
+ }
+
+ if (token != NULL) {
+
+ if (strcmp(token,SLAPT_PRIORITY_DEFAULT_TOKEN) == 0) {
+ s->priority = SLAPT_PRIORITY_DEFAULT;
+ } else if (strcmp(token,SLAPT_PRIORITY_PREFERRED_TOKEN) == 0) {
+ s->priority = SLAPT_PRIORITY_PREFERRED;
+ } else if (strcmp(token,SLAPT_PRIORITY_OFFICIAL_TOKEN) == 0) {
+ s->priority = SLAPT_PRIORITY_OFFICIAL;
+ } else if (strcmp(token,SLAPT_PRIORITY_CUSTOM_TOKEN) == 0) {
+ s->priority = SLAPT_PRIORITY_CUSTOM;
+ } else {
+ fprintf(stderr,"Unknown token: %s\n", token);
+ }
+ }
+
+ }
+
+}
+
+slapt_source_t *slapt_init_source(const char *s)
+{
+ slapt_source_t *src;
+ unsigned int source_len = 0;
+ unsigned int attribute_len = 0;
+ slapt_regex_t *attribute_regex = NULL;
+ char *source_string = NULL;
+ char *attribute_string = NULL;
+
+ if (s == NULL)
+ return NULL;
+
+ src = slapt_malloc(sizeof *src);
+ src->priority = SLAPT_PRIORITY_DEFAULT;
+ src->disabled = SLAPT_FALSE;
+ source_len = strlen(s);
+
+ /* parse for :[attr] in the source url */
+ if ((attribute_regex = slapt_init_regex(SLAPT_SOURCE_ATTRIBUTE_REGEX)) == NULL) {
+ exit(EXIT_FAILURE);
+ }
+ slapt_execute_regex(attribute_regex,s);
+ if (attribute_regex->reg_return == 0) {
+ /* if we find an attribute string, extract it */
+ attribute_string = slapt_regex_extract_match(attribute_regex, s, 1);
+ attribute_len = strlen(attribute_string);
+ source_string = strndup(s, source_len - attribute_len);
+ } else {
+ /* otherwise we just dup the const string */
+ source_string = strndup(s, source_len);
+ }
+ slapt_free_regex(attribute_regex);
+
+
+ /* now add a trailing / if not already there */
+ source_len = strlen(source_string);
+ if ( source_string[source_len - 1] == '/' ) {
+
+ src->url = strdup(source_string);
+
+ } else {
+
+ src->url = slapt_malloc(sizeof *src->url * (source_len + 2));
+ src->url[0] = '\0';
+
+ src->url = strncat(
+ src->url,
+ source_string,
+ source_len
+ );
+
+ if (isblank(src->url[source_len - 1]) == 0) {
+ src->url = strncat(src->url, "/", 1);
+ } else {
+ if (src->url[source_len - 2] == '/') {
+ src->url[source_len - 2] = '/';
+ src->url[source_len - 1] = '\0';
+ } else {
+ src->url[source_len - 1] = '/';
+ }
+ }
+
+ src->url[source_len + 1] = '\0';
+
+ }
+
+ free(source_string);
+
+ /* now parse the attribute string */
+ if (attribute_string != NULL) {
+ slapt_source_parse_attributes(src, attribute_string + 1);
+ free(attribute_string);
+ }
+
+ return src;
+}
+
+void slapt_free_source(slapt_source_t *src)
+{
+ free(src->url);
+ free(src);
+}
+
+int slapt_write_rc_config(const slapt_rc_config *global_config, const char *location)
+{
+ unsigned int i;
+ FILE *rc;
+
+ rc = slapt_open_file(location,"w+");
+ if (rc == NULL)
+ return -1;
+
+ fprintf(rc,"%s%s\n",SLAPT_WORKINGDIR_TOKEN,global_config->working_dir);
+
+ fprintf(rc,"%s",SLAPT_EXCLUDE_TOKEN);
+ for (i = 0;i < global_config->exclude_list->count;++i) {
+ if ( i+1 == global_config->exclude_list->count) {
+ fprintf(rc,"%s",global_config->exclude_list->excludes[i]);
+ }else{
+ fprintf(rc,"%s,",global_config->exclude_list->excludes[i]);
+ }
+ }
+ fprintf(rc,"\n");
+
+ for (i = 0; i < global_config->sources->count;++i) {
+ slapt_source_t *src = global_config->sources->src[i];
+
+ if (global_config->sources->src[i]->disabled == SLAPT_TRUE)
+ fprintf(rc,"%s%s\n",SLAPT_DISABLED_SOURCE_TOKEN, src->url);
+ else
+ fprintf(rc,"%s%s\n",SLAPT_SOURCE_TOKEN, src->url);
+ }
+
+ fclose(rc);
+
+ return 0;
+}
+
diff --git a/src/configuration.h b/src/configuration.h
index 388e6f0..7dbeb39 100644
--- a/src/configuration.h
+++ b/src/configuration.h
@@ -1,21 +1,29 @@
-#define SOURCE_TOKEN "SOURCE="
-#define WORKINGDIR_TOKEN "WORKINGDIR="
-#define WORKINGDIR_TOKEN_LEN 256
-#define EXCLUDE_TOKEN "EXCLUDE="
+#define SLAPT_SOURCE_TOKEN "SOURCE="
+#define SLAPT_DISABLED_SOURCE_TOKEN "#DISABLED="
+#define SLAPT_WORKINGDIR_TOKEN "WORKINGDIR="
+#define SLAPT_WORKINGDIR_TOKEN_LEN 256
+#define SLAPT_EXCLUDE_TOKEN "EXCLUDE="
+#define SLAPT_SOURCE_ATTRIBUTE_REGEX "(:[A-Z_,]+)$"
struct slapt_exclude_list {
char **excludes;
unsigned int count;
};
+typedef struct {
+ char *url;
+ SLAPT_PRIORITY_T priority;
+ SLAPT_BOOL_T disabled;
+} slapt_source_t;
+
struct slapt_source_list {
- char **url;
+ slapt_source_t **src;
unsigned int count;
};
typedef struct {
- char working_dir[WORKINGDIR_TOKEN_LEN];
+ char working_dir[SLAPT_WORKINGDIR_TOKEN_LEN];
struct slapt_source_list *sources;
struct slapt_exclude_list *exclude_list;
int(*progress_cb)(void *,double,double,double,double);
@@ -55,13 +63,19 @@ void slapt_add_exclude(struct slapt_exclude_list *list,const char *e);
void slapt_remove_exclude(struct slapt_exclude_list *list,const char *e);
void slapt_free_exclude_list(struct slapt_exclude_list *list);
+/* create, destroy the source struct */
+slapt_source_t *slapt_init_source(const char *s);
+void slapt_free_source(slapt_source_t *src);
+
/*
add or remove a package source url to the source list.
commonly called with global_config->source_list
*/
struct slapt_source_list *slapt_init_source_list(void);
-void slapt_add_source(struct slapt_source_list *list,const char *s);
+void slapt_add_source(struct slapt_source_list *list, slapt_source_t *s);
void slapt_remove_source (struct slapt_source_list *list, const char *s);
void slapt_free_source_list(struct slapt_source_list *list);
SLAPT_BOOL_T slapt_is_interactive(const slapt_rc_config *);
+
+int slapt_write_rc_config(const slapt_rc_config *global_config, const char *location);
diff --git a/src/package.c b/src/package.c
index 0dd10ac..a623a60 100644
--- a/src/package.c
+++ b/src/package.c
@@ -66,6 +66,7 @@ struct slapt_pkg_list *slapt_parse_packages_txt(FILE *pkg_list_fh)
{
slapt_regex_t *name_regex = NULL,
*mirror_regex = NULL,
+ *priority_regex = NULL,
*location_regex = NULL,
*size_c_regex = NULL,
*size_u_regex = NULL;
@@ -85,6 +86,9 @@ struct slapt_pkg_list *slapt_parse_packages_txt(FILE *pkg_list_fh)
if ((mirror_regex = slapt_init_regex(SLAPT_PKG_MIRROR_PATTERN)) == NULL) {
exit(EXIT_FAILURE);
}
+ if ((priority_regex = slapt_init_regex(SLAPT_PKG_PRIORITY_PATTERN)) == NULL) {
+ exit(EXIT_FAILURE);
+ }
if ((location_regex = slapt_init_regex(SLAPT_PKG_LOCATION_PATTERN)) == NULL) {
exit(EXIT_FAILURE);
}
@@ -138,6 +142,20 @@ struct slapt_pkg_list *slapt_parse_packages_txt(FILE *pkg_list_fh)
}
}
+ /* priority */
+ f_pos = ftell(pkg_list_fh);
+ if (getline(&getline_buffer, &getline_len, pkg_list_fh) != EOF) {
+
+ slapt_execute_regex(priority_regex, getline_buffer);
+
+ if (priority_regex->reg_return == 0) {
+ tmp_pkg->priority = atoi(slapt_regex_extract_match(priority_regex, getline_buffer, 1));
+ } else {
+ /* priority isn't provided... rewind one line */
+ fseek(pkg_list_fh, (ftell(pkg_list_fh) - f_pos) * -1, SEEK_CUR);
+ }
+ }
+
/* location */
if ((getline(&getline_buffer,&getline_len,pkg_list_fh) != EOF)) {
@@ -655,6 +673,9 @@ struct slapt_pkg_list *slapt_get_installed_pkgs(void)
tmp_pkg->mirror[0] = '\0';
}
+ /* mark as installed */
+ tmp_pkg->installed = SLAPT_TRUE;
+
slapt_add_pkg_to_pkg_list(list,tmp_pkg);
tmp_pkg = NULL;
@@ -1011,6 +1032,25 @@ static void slapt_free_pkg_version_parts(struct slapt_pkg_version_parts *parts)
free(parts);
}
+int slapt_cmp_pkgs(slapt_pkg_info_t *a, slapt_pkg_info_t *b)
+{
+ int greater = 1,lesser = -1,equal = 0;
+
+ /* if either of the two packages is installed, we look
+ for the same version to bail out early if possible */
+ if (a->installed == SLAPT_TRUE || b->installed == SLAPT_TRUE)
+ if (strcasecmp(a->version,b->version) == 0)
+ return equal;
+
+ /* check the priorities */
+ if(a->priority > b->priority)
+ return greater;
+ else if(a->priority < b->priority)
+ return lesser;
+
+ return slapt_cmp_pkg_versions(a->version, b->version);
+}
+
int slapt_cmp_pkg_versions(const char *a, const char *b)
{
unsigned int position = 0;
@@ -1115,7 +1155,7 @@ int slapt_cmp_pkg_versions(const char *a, const char *b)
/*
* If both have the same # of version parts, non-standard version convention,
- * then we fall back on strcmp.
+ * then we fall back on strverscmp.
*/
if (strchr(a,'-') == NULL && strchr(b,'-') == NULL)
return strverscmp(a,b);
@@ -1210,6 +1250,7 @@ void slapt_write_pkg_data(const char *source_url,FILE *d_file,
} else {
fprintf(d_file,"PACKAGE MIRROR: %s\n",source_url);
}
+ fprintf(d_file,"PACKAGE PRIORITY: %d\n", pkgs->pkgs[i]->priority);
fprintf(d_file,"PACKAGE LOCATION: %s\n",pkgs->pkgs[i]->location);
fprintf(d_file,"PACKAGE SIZE (compressed): %d K\n",pkgs->pkgs[i]->size_c);
fprintf(d_file,"PACKAGE SIZE (uncompressed): %d K\n",pkgs->pkgs[i]->size_u);
@@ -1887,46 +1928,39 @@ int slapt_update_pkg_cache(const slapt_rc_config *global_config)
FILE *tmp_signature_f = NULL;
FILE *tmp_checksum_to_verify_f = NULL;
#endif
+ const char *source_url = global_config->sources->src[i]->url;
+ SLAPT_PRIORITY_T source_priority = global_config->sources->src[i]->priority;
+
+ if (global_config->sources->src[i]->disabled == SLAPT_TRUE)
+ continue;
/* download our SLAPT_PKG_LIST */
- printf(gettext("Retrieving package data [%s]..."),
- global_config->sources->url[i]);
- available_pkgs =
- slapt_get_pkg_source_packages(global_config,
- global_config->sources->url[i],
- &compressed);
+ printf(gettext("Retrieving package data [%s]..."), source_url);
+
+ available_pkgs = slapt_get_pkg_source_packages(global_config, source_url, &compressed);
if (available_pkgs == NULL) {
source_dl_failed = 1;
continue;
}
/* download SLAPT_PATCHES_LIST */
- printf(gettext("Retrieving patch list [%s]..."),
- global_config->sources->url[i]);
- patch_pkgs =
- slapt_get_pkg_source_patches(global_config,
- global_config->sources->url[i],
- &compressed);
+ printf(gettext("Retrieving patch list [%s]..."), source_url);
+
+ patch_pkgs = slapt_get_pkg_source_patches(global_config, source_url, &compressed);
/* download checksum file */
- printf(gettext("Retrieving checksum list [%s]..."),
- global_config->sources->url[i]);
- tmp_checksum_f =
- slapt_get_pkg_source_checksums(global_config,
- global_config->sources->url[i],
- &compressed);
+ printf(gettext("Retrieving checksum list [%s]..."), source_url);
+ tmp_checksum_f = slapt_get_pkg_source_checksums(global_config, source_url, &compressed);
#ifdef SLAPT_HAS_GPGME
- printf(gettext("Retrieving checksum signature [%s]..."), global_config->sources->url[i]);
- tmp_signature_f = slapt_get_pkg_source_checksums_signature (global_config,
- global_config->sources->url[i],
- &compressed);
+ printf(gettext("Retrieving checksum signature [%s]..."), source_url);
+ tmp_signature_f = slapt_get_pkg_source_checksums_signature (global_config,source_url, &compressed);
+
/* if we downloaded the compressed checksums, open it raw (w/o gunzipping) */
if (compressed == 1)
{
- char *filename = slapt_gen_filename_from_url(global_config->sources->url[i],
- SLAPT_CHECKSUM_FILE_GZ);
+ char *filename = slapt_gen_filename_from_url(source_url, SLAPT_CHECKSUM_FILE_GZ);
tmp_checksum_to_verify_f = slapt_open_file(filename,"r");
free(filename);
} else {
@@ -1935,7 +1969,7 @@ int slapt_update_pkg_cache(const slapt_rc_config *global_config)
if (tmp_signature_f != NULL && tmp_checksum_to_verify_f != NULL) {
slapt_code_t verified = SLAPT_CHECKSUMS_NOT_VERIFIED;
- printf(gettext("Verifying checksum signature [%s]..."), global_config->sources->url[i]);
+ printf(gettext("Verifying checksum signature [%s]..."), source_url);
verified = slapt_gpg_verify_checksums(tmp_checksum_to_verify_f, tmp_signature_f);
if (verified == SLAPT_CHECKSUMS_VERIFIED) {
printf("%s\n",gettext("Verified"));
@@ -1962,11 +1996,8 @@ int slapt_update_pkg_cache(const slapt_rc_config *global_config)
#endif
if (source_dl_failed != 1) {
- printf(gettext("Retrieving ChangeLog.txt [%s]..."),
- global_config->sources->url[i]);
- slapt_get_pkg_source_changelog(global_config,
- global_config->sources->url[i],
- &compressed);
+ printf(gettext("Retrieving ChangeLog.txt [%s]..."), source_url);
+ slapt_get_pkg_source_changelog(global_config, source_url, &compressed);
}
if (tmp_checksum_f != NULL) {
@@ -1987,9 +2018,12 @@ int slapt_update_pkg_cache(const slapt_rc_config *global_config)
if (mirror_len == 0)
free(p->mirror);
- p->mirror = strdup(global_config->sources->url[i]);
+ p->mirror = strdup(source_url);
}
+ /* set the priority of the package based on the source */
+ p->priority = source_priority;
+
slapt_add_pkg_to_pkg_list(new_pkgs,p);
}
available_pkgs->free_pkgs = SLAPT_FALSE;
@@ -2006,9 +2040,12 @@ int slapt_update_pkg_cache(const slapt_rc_config *global_config)
if (mirror_len == 0)
free(p->mirror);
- p->mirror = strdup(global_config->sources->url[i]);
+ p->mirror = strdup(source_url);
}
+ /* set the priority of the package based on the source, plus 1 for the patch priority */
+ p->priority = source_priority + 1;
+
slapt_add_pkg_to_pkg_list(new_pkgs,p);
}
patch_pkgs->free_pkgs = SLAPT_FALSE;
@@ -2112,9 +2149,12 @@ __inline slapt_pkg_info_t *slapt_init_pkg(void)
pkg->suggests = slapt_malloc(sizeof *pkg->suggests);
pkg->suggests[0] = '\0';
-
pkg->md5[0] = '\0';
+ pkg->priority = SLAPT_PRIORITY_DEFAULT;
+
+ pkg->installed = SLAPT_FALSE;
+
return pkg;
}
diff --git a/src/package.h b/src/package.h
index 835b377..7bf2d9d 100644
--- a/src/package.h
+++ b/src/package.h
@@ -4,6 +4,7 @@
#define SLAPT_PKG_VER "(.*)[\\-](.*)[\\-](.*)"
#define SLAPT_PKG_NAME_PATTERN "^PACKAGE NAME:[ ]{1,}(.*{1,})\\-(.*[\\-].*[\\-].*)(\\.[tgblzik]+)[ ]{0,}$"
#define SLAPT_PKG_MIRROR_PATTERN "^PACKAGE MIRROR:[ ]+(.*)$"
+#define SLAPT_PKG_PRIORITY_PATTERN "^PACKAGE PRIORITY:[ ]+([0-9]{1,})$"
#define SLAPT_PKG_LOCATION_PATTERN "^PACKAGE LOCATION:[ ]+(.*)$"
#define SLAPT_PKG_SIZEC_PATTERN "^PACKAGE SIZE [(]+compressed[)]{1,}:[ ]{1,}([0-9]{1,}) K$"
#define SLAPT_PKG_SIZEU_PATTERN "^PACKAGE SIZE [(]+uncompressed[)]{1,}:[ ]{1,}([0-9]{1,}) K$"
@@ -46,6 +47,8 @@ typedef struct {
char *file_ext;
unsigned int size_c;
unsigned int size_u;
+ unsigned int priority;
+ SLAPT_BOOL_T installed;
} slapt_pkg_info_t;
struct slapt_pkg_list {
@@ -206,7 +209,7 @@ size_t slapt_get_pkg_file_size(const slapt_rc_config *global_config,
0 if a and b are equal
*/
int slapt_cmp_pkg_versions(const char *a, const char *b);
-#define slapt_cmp_pkgs(x,y) slapt_cmp_pkg_versions(x->version,y->version)
+int slapt_cmp_pkgs(slapt_pkg_info_t *a, slapt_pkg_info_t *b);
/*
resolve dependencies
diff --git a/t/data/rc1 b/t/data/rc1
index 991717c..15c0129 100644
--- a/t/data/rc1
+++ b/t/data/rc1
@@ -1,3 +1,3 @@
WORKINGDIR=data/slapt-get
EXCLUDE=^kernel-.*,^alsa-.*,^glibc.*,.*-[0-9]+dl$,^devs$,^udev$,aaa_elflibs,x86_64
-SOURCE=http://software.jaos.org/slackpacks/11.0/
+SOURCE=http://software.jaos.org/slackpacks/12.1/
diff --git a/t/test.c b/t/test.c
index 5b67cad..2834f63 100644
--- a/t/test.c
+++ b/t/test.c
@@ -17,9 +17,23 @@ slapt_pkg_info_t pkg = {
"",
".tgz",
115,
- 440
+ 440,
+ SLAPT_PRIORITY_DEFAULT,
+ SLAPT_TRUE
};
+int _progress_cb(void *clientp, double dltotal, double dlnow,
+ double ultotal, double ulnow)
+{
+ (void) clientp;
+ (void) dltotal;
+ (void) dlnow;
+ (void) ultotal;
+ (void) ulnow;
+ return 0;
+}
+
+
Suite *slapt_test_suite()
{
Suite *s = suite_create ("Slapt");
diff --git a/t/test_configuration.c b/t/test_configuration.c
index 36d23ca..5a3d150 100644
--- a/t/test_configuration.c
+++ b/t/test_configuration.c
@@ -68,11 +68,13 @@ END_TEST
START_TEST (test_source_list)
{
+ slapt_source_t *src = slapt_init_source("http://www.test.org/dist");
struct slapt_source_list *s = slapt_init_source_list();
fail_if (s == NULL);
fail_if (s->count != 0);
- slapt_add_source(s,"http://www.test.org/dist/");
+ fail_if (src == NULL);
+ slapt_add_source(s, src);
fail_if (s->count != 1);
slapt_remove_source (s,"http://www.test.org/dist/");
diff --git a/t/test_curl.c b/t/test_curl.c
index 276ce48..a7f792e 100644
--- a/t/test_curl.c
+++ b/t/test_curl.c
@@ -1,24 +1,15 @@
#include "test_curl.h"
extern slapt_pkg_info_t pkg;
-
-static int _progress_cb(void *clientp, double dltotal, double dlnow,
- double ultotal, double ulnow)
-{
- (void) clientp;
- (void) dltotal;
- (void) dlnow;
- (void) ultotal;
- (void) ulnow;
- return 0;
-}
+extern int _progress_cb(void *clientp, double dltotal, double dlnow,
+ double ultotal, double ulnow);
START_TEST (test_slapt_get_mirror_data_from_source)
{
FILE *f = NULL;
const char *err = NULL;
slapt_rc_config *rc = slapt_read_rc_config("./data/rc1");
- const char *url = "http://software.jaos.org/slackpacks/10.0/";
+ const char *url = rc->sources->src[0]->url;
char *packages = "PACKAGES.TXT";
char *packages_gz = "PACKAGES.TXT.gz";
char *checksums = "CHECKSUMS.md5";
diff --git a/t/test_packages.c b/t/test_packages.c
index 5969655..5fcda61 100644
--- a/t/test_packages.c
+++ b/t/test_packages.c
@@ -1,6 +1,8 @@
#include "test_packages.h"
extern slapt_pkg_info_t pkg;
+extern int _progress_cb(void *clientp, double dltotal, double dlnow,
+ double ultotal, double ulnow);
START_TEST (test_struct_pkg)
{
@@ -71,6 +73,9 @@ START_TEST (test_pkg_info)
/* retrieve the packages changelog entry, if any. Returns NULL otherwise */
/* char *slapt_get_pkg_changelog(const slapt_pkg_info_t *pkg); */
+ fail_unless (pkg.priority == SLAPT_PRIORITY_DEFAULT);
+ fail_unless (strcmp(slapt_priority_to_str(pkg.priority),gettext("Default")) == 0);
+
slapt_free_rc_config(rc);
}
END_TEST
@@ -163,6 +168,98 @@ START_TEST (test_pkgtool)
}
END_TEST
+/*
+http://software.jaos.org/pipermail/slapt-get-devel/2008-November/000762.html
+
+* When comparing two packages on mirrors:
+
+ - The package with the highest priority wins, but:
+ - If the priorities tie, then the package with the highest version
+ number wins.
+
+ * When comparing an installed package with a mirror package:
+
+ - If the two packages have *exactly* the same version string, then they
+ compare equal, regardless of priorities.
+ - Otherwise, the package with the highest priority wins. (Taking the
+ priority of the installed package as zero). But:
+ - If the priorities tie, then the package with the highest version
+ number wins.
+*/
+START_TEST (test_pkg_version)
+{
+ slapt_pkg_info_t mirror_pkg1 = {
+ "8598a2a6d683d098b09cdc938de1e3c7",
+ "gslapt",
+ "0.3.15-i386-1",
+ "http://software.jaos.org/slackpacks/11.0/",
+ ".",
+ "gslapt: gslapt (GTK slapt-get, an APT like system for Slackware)\n",
+ "",
+ "",
+ "",
+ ".tgz",
+ 115,
+ 440,
+ SLAPT_PRIORITY_PREFERRED,
+ SLAPT_FALSE
+ };
+ slapt_pkg_info_t mirror_pkg2 = {
+ "8598a2a6d683d098b09cdc938de1e3c7",
+ "gslapt",
+ "0.3.15-i386-2",
+ "http://software.jaos.org/slackpacks/11.0/",
+ ".",
+ "gslapt: gslapt (GTK slapt-get, an APT like system for Slackware)\n",
+ "",
+ "",
+ "",
+ ".tgz",
+ 115,
+ 440,
+ SLAPT_PRIORITY_DEFAULT,
+ SLAPT_FALSE
+ };
+ slapt_pkg_info_t installed_pkg = {
+ "8598a2a6d683d098b09cdc938de1e3c7",
+ "gslapt",
+ "0.3.15-i386-1",
+ "http://software.jaos.org/slackpacks/11.0/",
+ ".",
+ "gslapt: gslapt (GTK slapt-get, an APT like system for Slackware)\n",
+ "",
+ "",
+ "",
+ ".tgz",
+ 115,
+ 440,
+ SLAPT_PRIORITY_DEFAULT,
+ SLAPT_TRUE
+ };
+
+ /* mirror_pkg1 has a higher priority, and should win */
+ fail_unless (slapt_cmp_pkgs(&mirror_pkg1,&mirror_pkg2) == 1);
+
+ /* both have the same priority, mirror_pkg2 has a higher version and should win */
+ mirror_pkg1.priority = SLAPT_PRIORITY_DEFAULT;
+ fail_unless (slapt_cmp_pkgs(&mirror_pkg1,&mirror_pkg2) == -1);
+
+ /* installed_pkg and mirror_pkg1 have the exact same version and should be
+ equal regardless of priority */
+ fail_unless (slapt_cmp_pkgs(&installed_pkg,&mirror_pkg1) == 0);
+
+ /* installed_pkg has a higher priority and should win, regardless of the
+ fact that mirror_pkg2 has a higher version */
+ installed_pkg.priority = SLAPT_PRIORITY_PREFERRED;
+ fail_unless (slapt_cmp_pkgs(&installed_pkg,&mirror_pkg2) == 1);
+
+ /* when the priorities are the same, the package with the higher version
+ always wins */
+ installed_pkg.priority = SLAPT_PRIORITY_DEFAULT;
+ fail_unless (slapt_cmp_pkgs(&installed_pkg,&mirror_pkg2) == -1);
+
+}
+END_TEST
START_TEST (test_version)
{
@@ -256,10 +353,12 @@ END_TEST
START_TEST (test_network)
{
+ char *cwd = get_current_dir_name();
slapt_rc_config *rc = slapt_read_rc_config("./data/rc1");
+ rc->progress_cb = _progress_cb; /* silence */
/* must chdir to working dir */
- /* fail_unless (slapt_update_pkg_cache(rc) == 0); */
+ chdir(rc->working_dir);
/* write pkg data to disk
void slapt_write_pkg_data(const char *source_url,FILE *d_file,
@@ -277,7 +376,11 @@ START_TEST (test_network)
const char *url);
*/
+ fail_unless (slapt_update_pkg_cache(rc) == 0);
+
+ chdir(cwd);
slapt_free_rc_config(rc);
+ free(cwd);
}
END_TEST
@@ -293,6 +396,7 @@ Suite *packages_test_suite()
tcase_add_test (tc, test_pkg_list);
tcase_add_test (tc, test_pkg_search);
tcase_add_test (tc, test_pkgtool);
+ tcase_add_test (tc, test_pkg_version);
tcase_add_test (tc, test_version);
tcase_add_test (tc, test_dependency);
tcase_add_test (tc, test_cache);
diff --git a/t/test_transaction.c b/t/test_transaction.c
index 2452944..4cfb95c 100644
--- a/t/test_transaction.c
+++ b/t/test_transaction.c
@@ -74,6 +74,7 @@ START_TEST (test_transaction_dependencies)
in the transaction
void slapt_generate_suggestions(slapt_transaction_t *tran);
*/
+ slapt_generate_suggestions(t);
slapt_free_transaction(t);
slapt_free_rc_config(rc);