summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2011-10-28 20:13:22 -0400
committerDave Reisner <dreisner@archlinux.org>2011-10-28 20:13:22 -0400
commit261c9a958100e9a9aeda5d976788199ddbe182a2 (patch)
treef4b882b5bdc63d63ed1be9dd546a1c73a0ad41c4
parent47fd57041c010b3202e76942097a3385ea6ef695 (diff)
downloadexpac-261c9a958100e9a9aeda5d976788199ddbe182a2.tar.xz
ignore -S and -Q options for -p.
This is a little odd, but since -p has no meaning for -S, this is (for now) safe.
-rw-r--r--README.pod3
-rw-r--r--expac.c40
2 files changed, 20 insertions, 23 deletions
diff --git a/README.pod b/README.pod
index 3924b40..97db8f3 100644
--- a/README.pod
+++ b/README.pod
@@ -54,8 +54,7 @@ sequence specified with a capital letter. The default value is two spaces.
=item B<-p, --file>
-Interpret targets as paths to local files. This option only makes sense with the
--Q option.
+Interpret targets as paths to local files.
=item B<-t, --timefmt> <format>
diff --git a/expac.c b/expac.c
index 13f4a08..d36bd1e 100644
--- a/expac.c
+++ b/expac.c
@@ -597,33 +597,31 @@ int main(int argc, char *argv[]) {
}
/* ensure sane defaults */
- if (!dblist) {
- if (localpkg) {
- /* load each target as a package */
- for (i = targets; i; i = alpm_list_next(i)) {
- alpm_pkg_t *pkg;
- int err;
-
- err = alpm_pkg_load(handle, i->data, 0,
- ALPM_SIG_PACKAGE|ALPM_SIG_PACKAGE_OPTIONAL, &pkg);
- if (err) {
- fprintf(stderr, "error: %s: %s\n", (const char*)i->data,
- alpm_strerror(alpm_errno(handle)));
- continue;
- }
- results = alpm_list_add(results, pkg);
- }
- } else {
- local = true;
- dblist = alpm_list_add(dblist, db_local);
- }
+ if (!dblist && !localpkg) {
+ local = true;
+ dblist = alpm_list_add(dblist, db_local);
}
delim = delim ? delim : DEFAULT_DELIM;
listdelim = listdelim ? listdelim : DEFAULT_LISTDELIM;
timefmt = timefmt ? timefmt : DEFAULT_TIMEFMT;
- if (!localpkg) {
+ if (localpkg) {
+ /* load each target as a package */
+ for (i = targets; i; i = alpm_list_next(i)) {
+ alpm_pkg_t *pkg;
+ int err;
+
+ err = alpm_pkg_load(handle, i->data, 0,
+ ALPM_SIG_PACKAGE|ALPM_SIG_PACKAGE_OPTIONAL, &pkg);
+ if (err) {
+ fprintf(stderr, "error: %s: %s\n", (const char*)i->data,
+ alpm_strerror(alpm_errno(handle)));
+ continue;
+ }
+ results = alpm_list_add(results, pkg);
+ }
+ } else {
results = resolve_pkg(targets);
if (!results) {
ret = 1;