1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-05 17:15:02 -05:00
Commit Graph

191 Commits

Author SHA1 Message Date
Dan McGee
624a878701 pactest: generate sync DB's in memory
Sync database are no longer exploded on the filesystem. Rework the logic
used to generate our test databases so we can create them completely in
memory without having to write the individual files to disk at all. The
local database is unaffected.

Note that several shortcomings in libalpm parsing were discovered by
this change, which have since been temporarily patched around in this
test suite:

* archive_fgets() did not properly handle a file that ended in a
  non-newline, and would silently drop the data in this line.
* sync database with only the file entries and not the directories would
  fail to parse properly, and even cause segfaults in some cases.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-24 01:36:48 -05:00
Dan McGee
63335859d1 pactest: refactor install file creation
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-24 01:36:48 -05:00
Dan McGee
f15cce1d41 pactest: move filelist/backup generation into package object
These are definite methods that operate on a package, so move them there
which cleans up util a bit more.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-24 01:36:48 -05:00
Dan McGee
3ace8ceb23 pactest: make pmfile a bit more pythonic
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-24 01:36:48 -05:00
Dan McGee
11d8418737 pactest: small cleanups and chmod -x most files
Remove empty docstrings, small and easy pylint fixes, etc.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-24 01:36:48 -05:00
Dan McGee
763d638ca1 pactest: clean up database section writing
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-24 01:36:48 -05:00
Dan McGee
a8c3202836 pactest: add isize attribute, fix url attribute
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-24 01:36:47 -05:00
Kerrick Staley
3d4bf3b3fd Fixed outdated documentation in test/pacman/README
test/pacman/README mentioned the -A flag, which no longer exists.

Signed-off-by: Kerrick Staley <mail@kerrickstaley.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-22 11:13:52 -05:00
Dan McGee
81e6071e0f pactest: add retcode=0 to several tests
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-20 00:36:01 -05:00
Dan McGee
beffab02c4 pactest: only create install file if necessary
We were testing whether there were any values in the array, rather than
looking if the values contained anything.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-08 02:48:52 -05:00
Dan McGee
cc25576f8b Use standard errno codes in return from _alpm_archive_fgets
This allows us to not require the context (e.g. handle) when calling
this function. Also beef up the checks in the two callers of this
function to bail if the last return code is not ARCHIVE_EOF, which is
the expected value.

This requires a change to one of the pactest return codes and the
overall result of the test, but results in a much safer operating
condition whereby invalid database entries will stop the operation.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-03 14:37:51 -05:00
Dan McGee
142c2132cf Add two currently failing test cases from bug reports
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-02 17:20:45 -05:00
Dan McGee
11fb9c7674 Merge branch 'maint'
Conflicts:
	lib/libalpm/trans.c
	src/pacman/query.c
2011-05-19 17:17:32 -05:00
Dan McGee
aec60e3782 Fix segfault when uninstalling broken backed-up symlink
Issue FS#24230. If a symlink is broken and included in the removal
process of a package, we blew up and segfaulted due to
alpm_compute_md5sum() returning NULL and then performing a strcmp()
operation.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-16 11:50:13 -05:00
Dan McGee
93f02f5793 Add test for FS#24230, dead backup symlink removal
This currently causes a segfault, which is bad news.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-16 11:32:33 -05:00
Dan McGee
3000b6b473 pactest: treat symlinks with more respect
Don't call os.stat() when we should be using os.lstat(); this allows us
to actually test dead symlinks that don't have a corresponding file. Add
a new LINK_EXIST rule that complements FILE_EXIST for a similar purpose.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-16 11:31:26 -05:00
Dan McGee
d360153bc6 pactest: run with root in /tmp and clean up automatically
This moves the generated root/ directory into /tmp, or at least a path
returned by tempfile.mkdtemp(), by default. This can make test runs
significantly faster if done when /tmp is a tmpfs.

If you are debugging a failed test, use the new --keep-root option to
not clean up and pactest will print the location of the generated root/
test directory.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-05 11:12:26 -05:00
Dan McGee
791928dc48 Header inclusion cleanup
This does touch a lot of things, and hopefully doesn't break things on
other platforms, but allows us to also clean up a bunch of crud that no
longer needs to be there.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-20 20:09:13 -05:00
Dan McGee
c5addd94e3 Merge branch 'maint'
Conflicts:
	lib/libalpm/be_sync.c
	lib/libalpm/db.c
	src/pacman/util.c
2011-04-05 00:49:30 -05:00
Dan McGee
38e5a4a54f test: fix invalid usage of 'type -p'
The vercmptest script needs to be invoked as a bash script for this to
be valid; the -p operator is interpreted as an argument to look up by
sh. This goes way back to commit 3bf9448943, done to solve
http://mailman.archlinux.org/pipermail/pacman-dev/2008-July/007180.html.

Saw this problem running in a virtual machine where sh is not bash, but
in fact dash:

    user@debian-powerpc:~/projects/pacman$ ./test/util/vercmptest.sh
    src/util/vercmp-p: not found
    src/util/vercmp is src/util/vercmp
    vercmp binary (src/util/vercmp) could not be located

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-04 19:03:27 -05:00
Dave Reisner
c02556e290 Rely on the return value of type instead of its output
Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-27 20:15:20 -05:00
Xavier Chantry
f9505063f8 Added gpg verification options per repo to the config file.
Once we do this, add support for VerifySig to pactest. We just check if
the repo name contains Always, Never or Optional to determine the value
of VerifySig. The default is Never. pacman uses Always by default but
this is not suitable for pactest.

Original-work-by: shankar <jatheendra@gmail.com>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23 03:35:50 -05:00
Dan McGee
5b962f0d1c Add a pactest showing failed GPG verification
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23 03:16:29 -05:00
Dan McGee
cedc633757 Add a few pactests for PGP integration
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23 02:33:07 -05:00
Dan McGee
39da0198cd Add PGP signature support to pactest
Allow pkg.pgpsig to end up in the created sync databases.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23 02:22:00 -05:00
Pang Yan Han
58df372be6 Fix handling of ignored packages
Noted in FS#23342. When the user attempts to install an ignored package
and answers no when asked whether to install it, pacman bails out with:

"error: target not found: packagename"

This is because satisfiers are not found for the package and execution
continues to process_group(), where the package is treated as a group
(which does not exist).

In addition, test ignore006.py is updated with PACMAN_RETCODE=0 since
saying no to installing an ignored package should not be considered an
error.

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20 11:17:41 -05:00
Dan McGee
d68635e7c2 pactest: use actual regexes in OUTPUT rules
I managed to just make deptest001.py fail by changing a DEBUG-level
logger in commit b12be99c89. This should not be this fickle. Enhance the
OUTPUT rule to use an actual Python re object when looking for matches,
and make a lot of the rules use stronger patterns to match with.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-01 14:24:13 -06:00
Allan McRae
e8f799ba83 pactest for removing a required empty directory
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-27 13:26:56 -06:00
Dan McGee
ab49bf6fa9 Add test case for util-linux/util-linux-ng name switch and deps
This case currently fails, but highlights a failure in our install
process I experienced the other day. Because we don't do replacement
uninstalls inline with the rest of the upgrade uninstalls, we can have a
time on our system where a critical package is not installed.

I hope no one ever renames glibc.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-25 07:57:41 -06:00
Dan McGee
2f96764058 Continue resolving dependencies rather than bailing on first error
This allows error messages emitted by the frontend to be a bit more
descriptive and not have the annoying "well why didn't you tell me that
the first time" problem. If a package had multiple missing deps, we
would bail on the first one before rather than finish processing all
missing dependencies, and only print one error message. Instead,
continue through this entire set of missing deps and append all eventual
errors.

The added pactest tests this case, as the to be installed package has
two missing dependencies. However, pactest does not actually test or see
the difference in output from before and after, so it passes in both
cases, but it is clearly visible in the logs.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-25 07:55:16 -06:00
Dan McGee
d4d304cdb7 Various small spelling fixes and small tweaks
Nothing that changes behavior here. Spelling fixes and pushing a
variable down to the scope it is used.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-25 07:53:11 -06:00
Dan McGee
09e582b411 Add a new removal smoke test
Hint: this will really stress hash table removal.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-04 09:55:46 +10:00
Florian Pritz
111e07d0be make -d less strict; add -dd option
-d skips checking the version of a dependency.

-dd skips the whole dependency check.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Florian Pritz <bluewind@server-speed.net>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-31 10:49:53 -06:00
Xavier Chantry
b8d01dace8 add pactests for -Sdd
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-31 10:45:36 -06:00
Dan McGee
09f9f24331 Allow both cleanmethod values to be specified at the same time
No reason to disallow this- it allows keeping even more packages around in
the cache. Test cases included for this case and to ensure the default
behavior is preserved.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-31 09:38:14 -06:00
Dan McGee
d6a9436143 Add three clean cache tests
The first two are rather standard tests of our two available clean options,
and the third is attempting to test a reported bug (and failing to make the
given case fail).

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-31 09:37:20 -06:00
Dan McGee
2d5ec02d7c pactest: allow checking for cache file existence
This will allow some tests to be added for cache cleaning.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-31 09:37:20 -06:00
Xavier Chantry
f2fcf7eeb1 pacman/sync: rewrite target handling
This uses the new public functions to handle targets from the frontend,
like it used to be :
1) alpm_find_dbs_satisfier to find (optionally versioned) package or
provision
2) alpm_find_grp_pkgs to find members for a groups
3) alpm_add_pkg to finally add the pmpkg_t from 1 or 2

Of course, this adds more code to the frontend, but it completely
deprecates sync_target and sync_dbtarget interfaces.

This all-in-one interfaces felt wrong and left no control to the
frontend. A good frontend should just use alpm_add_pkg, with pkg coming
from alpm_db_get_pkg (for normal targets), alpm_find_dbs_satisfier (for
versioned provisions) or alpm_find_grp_pkgs (for groups).

This also opens the way to provide a better group handling in pacman
without constraint from libalpm and callbacks.

In ignore006, only the retcode changes, because no package was found to
satisfy the target (the only possible package is ignored).

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
2011-01-29 19:33:16 +01:00
Xavier Chantry
4097c98c1e Add interactive provider selection
If there are multiple providers in one db, pacman used to just stop at
the first one (both during dependency resolution or for pacman -S
'provision' which uses the same code).

This adds a new conversation callback so that the user can choose which
provider to install. By default (user press enter or --noconfirm), the
first provider is still chosen, so for example the behavior of sync402
and 403 is preserved. But at least the user now has the possibility to
make the right choice in a manual run.

If one of the provider is already installed, it is picked for
reinstall/upgrade, so that provision 002/003 pactest now pass.

$ pacman -S community/smtp-server
:: There are 3 providers available for smtp-server:
   1) courier-mta  2) esmtp  3) exim

Which one do you want to install?
Enter a number (default=1):

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
2011-01-29 19:33:15 +01:00
Dan McGee
ce089e1b97 pactest: pass entire test to rule.check()
We were piecemeal passing fields from the test object in and it was getting
out of hand, and future work would have added yet another argument. Instead,
just pass the entire test object and entrust the rule to get what it needs.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-29 12:15:15 -06:00
Dan McGee
6e71922e6c Add a few new provides tests
These deal with already-installed packages and how they should be the
preferred provider in cases where provider selection now occurs. A few
involve multiple sync repos.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22 16:29:32 -06:00
Dan McGee
a99e7272b8 pactest: sort repos by alpha order in config file
The order was non-deterministic before, and just happened to work for
sync023.py as it was written. Ensure there is some sort of predictable
ordering.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22 16:29:32 -06:00
Dan McGee
b3d71bf7d0 pactest: use new-style python classes
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22 16:29:32 -06:00
Dan McGee
32727efc38 pactest: revamp modified logic
Remove all logic dealing with PKG_MODIFIED as this rule no longer exists.
This removes a bunch of unnecessary stat and checksum logic that most of the
time we were never even using. Also update the file modified checks to mark
every file created using mkfile() with an older time so any modified checks
will just work without hacks.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22 11:19:21 -06:00
Dan McGee
5699f2c94c Modify all pactests to not use PKG_MODIFIED
All conditions that this particular rule tested are better served by using a
more specific rule, whether that be checking a package version or whether
files inside the package have changed or still exist.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22 11:19:17 -06:00
Dan McGee
2a3b5e40bc pactest: pylint changes for pmdb
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22 11:14:42 -06:00
Dan McGee
8f711a7181 pactest: pylint changes for util
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22 11:14:42 -06:00
Dan McGee
ff96649eeb pactest: pylint changes for pmtest
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22 11:14:42 -06:00
Dan McGee
d94346ede2 pactest: pylint changes for pmpkg
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22 11:14:42 -06:00
Dan McGee
946f4af7f3 pactest: pylint changes for pmrule
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22 11:14:42 -06:00
Dan McGee
2c6be06bba pactest: pylint changes for pmenv
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22 11:14:42 -06:00
Dan McGee
505ad87e67 pactest: pylint changes for pactest
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22 11:14:42 -06:00
Dan McGee
0de314205f pactest: pylint changes for pmfile
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22 11:14:42 -06:00
Dan McGee
bf46e04614 Remove epoch as an independent field
Instead, go the same route we have always taken with version-release in
libalpm and treat it all as one piece of information. Makepkg is the only
script that knows about epoch as a distinct value; from there on out we will
parse out the components as necessary.

This makes the code a lot simpler as far as epoch handling goes. The
downside here is that we are tossing some compatibility to the wind;
packages using force will have to be rebuilt with an incremented epoch to
keep their special status.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-21 19:30:45 -06:00
Dan McGee
5c46ba14f7 Allow version comparison to contain epoch specifier
Adapting from RPM, follow the [epoch:]version[-release] syntax. We can also
borrow some of their parsing code for our purposes (thanks!).  Add some new
tests to our vercmp shell script tester for epoch comparisons, and then make
the code work with these newfangled epoch specifiers.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-21 19:30:45 -06:00
Dan McGee
e068b58507 pactest: add more testing for epoch
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-21 19:30:45 -06:00
Dan McGee
50f446886b pactest: Rename epoch pactests
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-21 19:30:45 -06:00
Dan McGee
c49f198042 Add a pactest for the situation in FS#7524
Confirming the current behavior. And yes, the error message is still no
better than it was when this was reported 3.5 years ago.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-21 09:07:12 -06:00
Dan McGee
b04a56dbe9 Add two pactests with non-trivial file counts
These are probably useful anyway, but also exposed the double file list bug
that will be fixed in a later commit.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-11 18:44:26 -06:00
Dan McGee
0d4dd09993 pactest: build the filelist using a set()
This will prevent duplicates, which we had plenty of once I made a few tests
that had a list of files greater than the normal two. The previous logic was
not working quite right.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-11 18:43:28 -06:00
Dan McGee
a9cbd15260 pactest: correctly write epoch and force as necessary
We were missing this in a few places; also add the ability to check the
outcome via a new rule type.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-10 10:51:35 -06:00
Dan McGee
46eda12c1b pactest: Use booleans where it makes sense
No need to use 0/1 when we can use False/True for the force option.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-05 20:55:57 -06:00
Dan McGee
e57c3efeaa pactest: remove dead function
Stopped being used after commit fa933df65b.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-05 20:55:13 -06:00
Dan McGee
08d885fda5 Merge branch 'maint'
Conflicts:
	lib/libalpm/sync.c
	test/pacman/tests/ignore007.py
2010-12-30 09:41:46 -06:00
Jakob Gruber
6ddc115c7f Respect Ignore{Pkg,Group} for group members
Fixes FS#19854.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-30 09:35:03 -06:00
Jakob Gruber
58ee249c86 Tests: Sync group which includes ignored pkgs
* FS#19854 (--ignore is ignored with groups)

* http://www.archlinux.org/pipermail/pacman-dev/2009-June/008847.html
  (operation aborts when a package from a group is ignored/and user chooses
  not to install it)

If a group member is ignored, we expect
a) a question whether to install
b) after saying 'no' to a), the ignored member not to be installed
c) all other group members to be installed
d) pacman to execute successfully

Signed-off-by: Dan McGee <dan@archlinux.org>
(cherry picked from commit 9d0b33fd33)
2010-12-30 09:35:03 -06:00
Dan McGee
e3c19569cf Add pactest to test long archive reads
This creates two packages with extremely long description lines (500KB and
600 KB), causing our archive read code to perform reallocation to store the
whole contents. One of the packages will successfully read while the other
will fail for the time being.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-21 14:58:17 -06:00
Dan McGee
fbcc427754 pactest: allow testing of package description
And modify the code to not print the full rule string if it is more than 40
characters long; truncate it instead.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-21 14:58:17 -06:00
Allan McRae
8f3b485517 Update pactest suite for change in db structure
Merging desc and depends files in sync and local db.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-12 21:42:41 -06:00
Xavier Chantry
abefa23341 alpm/remove.c : respect --dbonly during remove-upgrade
When a -Sk or -Uk operation induced a removal of an existing local
package, --dbonly was not in effect and the files were all removed.

Fixing this behavior was already marked as TODO in database012 pactest
------------
TODO: I honestly think the above should NOT delete the original les, it
hould upgrade the DB entry without touching anything on the file stem.
E.g. this test should be the same as:
   pacman -R --dbonly dummy && pacman -U --dbonly dummy.pkg.tar.gz
------------

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
[Dan: small coding style touchup]
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-12 20:19:24 -06:00
Xavier Chantry
ce96f39ac9 pactest: use valgrind.supp file
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-18 16:51:38 -05:00
Jakob Gruber
8f2eaa51c2 Tests: '-S repo/group' syntax
when calling '-S repo/group', only group members in <repo> should should
be installed (group members in other repos are ignored)

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-18 16:51:38 -05:00
Jakob Gruber
9d0b33fd33 Tests: Sync group which includes ignored pkgs
* FS#19854 (--ignore is ignored with groups)

* http://www.archlinux.org/pipermail/pacman-dev/2009-June/008847.html
  (operation aborts when a package from a group is ignored/and user chooses
  not to install it)

If a group member is ignored, we expect
a) a question whether to install
b) after saying 'no' to a), the ignored member not to be installed
c) all other group members to be installed
d) pacman to execute successfully

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-18 16:51:38 -05:00
Dan McGee
73886504d7 Add several pactests for epoch code
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13 23:29:27 -05:00
Dan McGee
8aa7ed5a7e Add epoch support to pactest
This adds epoch support to pactest, while still producing packages and
database entries the same way makepkg and repo-add currently do in a
backward compatible fashion (still including the 'force' option).

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13 23:29:26 -05:00
Jakob Gruber
827258f32e CLI args: reorganize parsing
Split parsing of CLI arguments into separate functions:

parsearg_op (operations)
parsearg_global (global options)
parsearg_{database,query,remove,sync,deptest,upgrade}

Organization strictly follows the manpage (even where the manpage is
incorrect) - these cases will be fixed in the following commits.

Switch cases are copy/pasted and statements unrelated to chosen
operation are deleted.

Parsing logic adjusted as follows:

1) Parse operation
2) If we can bail out early (duplicate op, help/version requested) do so
3) Parse arguments again:
    foreach arg:
        if arg is operation:
            continue
        tryparse_args_specific_to_op
        if unsuccessful tryparse_args_global
        if unsuccessful print error message and exit

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-11 20:57:26 -05:00
Xavier Chantry
53b41afbe8 pactest: fix typo in ignore001
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-11 17:02:03 -05:00
Jakob Gruber
46ffd342a4 CLI args: add pactest with an invalid combination
Pacman should catch cases in which the passed arguments don't apply to the
current operation (sync/query/...).

Also see FS#20950.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-11 10:06:57 -05:00
Xavier Chantry
fa933df65b pactest: fix gensync
gensync generated a sync.db file with PKGINFO syntax, this is not quite what
pacman expects.

Also the file was only added to the Server path:
	root/var/pub/sync/sync.db
but it was not available in the normal sync db path:
	root/var/lib/pacman/sync/sync.db

Change gensync() to generate var/lib/pacman/sync/sync.db and then copy it to
var/pub/sync/sync.db (this is used by sync200 -Sy test).

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-11 10:06:57 -05:00
Xavier Chantry
67068b64b9 pactest: use simpler method to create tar
Just like in 24fc623e1a8bf905cf0367f9bd40bc5bd6034378, apply to pmdb
gensync as well.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-11 10:06:57 -05:00
Dan McGee
bef19a266b Merge branch 'maint' 2010-10-05 11:15:56 -05:00
Rémy Oudompheng
302188b169 Make testsuite python-2.7 compatible
os.walk(".") adds a prefix of "./" to filenames in python-2.7 which
causes libalpm not to like archives generated in the testsuite resulting
in widespread failure.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-05 11:14:24 -05:00
Dan McGee
d14a98db25 Merge branch 'maint' 2010-08-27 11:19:05 -05:00
Jonathan Conder
90c45f7bbe pactest: add shell to fake root environment
Adds a shell to the fake root set up for pactests, which was not needed
previously due to a bug (debian #582847) in fakechroot.

Signed-off-by: Jonathan Conder <j@skurvy.no-ip.org>
2010-08-27 10:58:08 -05:00
Dan McGee
ddc4130c97 Merge branch 'maint' 2010-07-27 10:18:35 -05:00
Dan McGee
f8d7cd6b26 Maintain a list of seen packages when installing a group
As reported in FS#20221, we don't always do the right thing when installing
a group and using the --needed option. This was due to the code pulling
packages based on what was already in the transaction's add list, but
completely ignoring the fact that we may have already seen and skipped this
same package in an earlier repository.

Add a list to the private _alpm_sync_pkg() function that allows us to have
this extra information so we don't mistakenly downgrade a package when using
--needed.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-27 10:10:55 -05:00
Dan McGee
e702f56ea6 Add two pactests for group and --needed interaction
The first step for resolving FS#20221. sync023 is the case from the bug
report; sync022 is already working fine but we have no tests at all that
test the --needed option in any form.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-27 10:10:55 -05:00
Allan McRae
68dcabdfbe Remove DBEXT usage
With commit 5dffef78, the repo database always has a symlink
of the form reponame.db.  Use that filename and let libarchive
determine the compression type.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-07 07:25:55 -05:00
Dan McGee
6c00ca8f23 Handle sync target + ignore properly
Rather than say we can't find the target after saying "No, I guess I don't
want to install this", we should make sure the ignored status gets passed
all the way through. This fixes FS#19866.

Pactest is also included that failed before due to the fact that we normally
treat an unfound package as a reason to exit with a non-zero status.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-20 15:19:19 -05:00
Dan McGee
0ac96d94ec Move vercmp tests into util/ testing directory
Now that not everything is in 'pactest/', we can separate out the parts a
bit more and leave the pacman/ directory to be just pactest.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-02 13:24:22 -05:00
Allan McRae
844d82fad8 Move pacman test suite
Move the test suite to test/pacman in order to make a logical
location for a future makepkg test suite.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-02 13:14:51 -05:00