Included options are -g, -i, -s, and -l
All of these will sync the DB if -y is specified and permissions are
appropriate.
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Packages and DBs now support using the UNIX epoch (seconds since Jan 1, 1970)
for use in builddate and installdate. This will only affect newly built
packages. Old existing packages with the text format are still supported, but
this is deprecated.
In the case of removal of text time support, this code will fail gracefully,
returning the start of the epoch for broken packages.
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
In most cases, we want to fully scan a package when we load it, which serves
as a integrity verification check. However, there are times when it is only
desired to read the metadata and nothing else, so allow the caller of pkg_load
to choose the behavior they need.
This pays big dividends in speeding up pacman cache cleaning functionality.
Old (729 packages):
real 1m43.717s
user 1m20.785s
sys 0m2.993s
New (729 packages):
real 0m25.607s
user 0m19.389s
sys 0m0.543s
Signed-off-by: Dan McGee <dan@archlinux.org>
pacman/callback.c already did the work I set out to do with this commit, so
update the comments accordingly in the frontend and backend.
Signed-off-by: Dan McGee <dan@archlinux.org>
Partial cache cleaning was eliminated in a previous commit because it relied
on package naming conventions. Re-add it the correct way- we actually open
up each package in the cache and get a name and version out of it. If the
name and version match that of an installed package, keep it. If the package
is not installed or the version does not match the locally-installed version,
get rid of it.
This can easily be modified if some other heuristic of keeping and removing
packages is desired, or if we should clean out the cache dir of any files
that are not packages, etc.
The biggest current problem with this new approach- speed. Here is one run
on my local machine, going from 1643 to 729 packages in the cache (753 in
the local DB):
real 4m25.829s
user 3m22.527s
sys 0m6.713s
This is likely best addressed by the package loading scheme, which may be
loading the entirety of each package archive, which is a waste when we only
need the .PKGINFO file read.
Signed-off-by: Dan McGee <dan@archlinux.org>
Previously, package names must match a specified scheme or they will cause
pacman add operations to fail. This is not a very intelligent or necessary
way to act, so remove the dependency on the name of the package to be
installed and read all relevant information from the metadata instead.
This does have one causality to be addressed later- pacman cache cleaning
functionality, which has never been phenomenal, just lost most capability.
Signed-off-by: Dan McGee <dan@archlinux.org>
I suppose -Qii could be used for other things than displaying
the list of backup files, but currently, it's the only one,
so that's how I documented it..
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Add some alpm functions for getting optdepends, have makepkg include them
in the PKGINFO file, and have a pacman -Qi operation display the raw string
as stored by libalpm.
Signed-off-by: Dan McGee <dan@archlinux.org>
If we don't have asciidoc installed or enabled, we should still have a
successful make. However, we want to ensure 'make dist' fails without
asciidoc. This commit should ensure this.
Signed-off-by: Dan McGee <dan@archlinux.org>
As seen with the recent upgrade of pacman and the removal of the
pacman.d/current mirrorlist, files that were formerly in the backup array
get deleted upon their removal, which could be dangerous. Instead, we should
use the combined backup array of the old and new package. This fix should
address this issue in a relatively straightforward way.
In addition, old files should be moved to pacsave locations as expected.
Signed-off-by: Dan McGee <dan@archlinux.org>
That is the problem mentioned by Nagy there (with suggestions for fixing it) :
http://www.archlinux.org/pipermail/pacman-dev/2007-August/009082.html
If a dependency conflicts with a local package and has to replace it,
the PM_SYNC_TYPE_DEPEND information is lost, and the resulting install
reason is wrong (the package is marked as explictly installed).
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
remove048 is the case mentioned there (fails in 3.0 but works in 3.1) :
http://www.archlinux.org/pipermail/pacman-dev/2007-September/009294.html
It's the same as remove046 with -R instead of -Rc.
sync060 is a case reported this morning on IRC :
a pacman -Su wanted to replace gensplashutils by gensplash,
but pacman said gensplashutils was required by initscripts-gensplash,
while initscripts-gensplash was not even installed.
This is also fixed in the current 3.1 code though.
upgrade02{4,5} are the backup handling problem I described there :
http://www.archlinux.org/pipermail/pacman-dev/2007-September/009376.html
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
installdate should never be present in a package descfile, so get rid of it.
With the last commit, we also don't need the util strtoupper function.
Signed-off-by: Dan McGee <dan@archlinux.org>
This fix FS#8081. The tr_TR locale has known issue with case insensitive
comparisons, mostly because upper(i) != I.
So the .PKGINFO files generated by makepkg MUST contain all keywords in lowercases now.
This was already done, but was not mandatory.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
The mistake fixed in commit 26441cf65c
was actually done at two places.
This fix the second one.
Also remove one unnecessary newline introduced by
commit d34b2c4ed8
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
When calling a function of the alpm_option_get_* group, you get a segfault
if you don't call alpm_initialize() first. With this patch those functions
set pm_errno to PM_ERR_HANDLE_NULL and return an error value if handle ==
NULL.
(Dan: modified to meet pacman coding standards)
Signed-off-by: Stefano Esposito <stefano.esposito87@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
To keep working correctly with url like :
ftp://ftp.archlinux.org/$repo/os/i686
rankmirrors will now replace $repo by core.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
My two previous hacks related to this part
(8038190c7c and
b15a5194d1) were caused by the lack of
understanding of a feature introduced a while ago:
Better control over CTRL-C interruptions -- do not leave the DB in an
inconsistent state (54008798ef).
Now I have been looking at this commit, and the added feature is indeed
interesting. The main problem I had with it is that it does a rather
unusual use of alpm_trans_release, which caused a few problems that I tried
to fix in a weird way. I think these problems were caused by the fact that
there weren't any difference between "interrupt transaction" and "release a
transaction which failed" actions from the alpm_trans_release POV. So I
decided to add a new function instead, alpm_trans_interrupt, which is
called on Ctrl+C, and which only sets trans->state to STATE_INTERRUPTED so
that remove_commit and add_commit can exit cleanly at a safe moment. This
allowed me to revert my two previous hacks as well.
Also ensure we handle SIGINT correctly in all cases- if a transaction is
not ongoing, then we can free the transaction and exit quickly.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
This reverts commit dfc85cb5f5
and b6f3fe6957.
This DB check is already in testdb (among others).
Also testdb now uses the db path set at make time by default,
so specifying the db path is optional.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
I'm currently working on python bindings for alpm written in pyrex. While
working i found that declaring alpm_strerror as
char * alpm_strerror (void)
instead of
char * alpm_strerror (int err)
and then using pm_errno in the implementation instead of err, could make it
more bindings-friendly.
Dan: cleaned up and added void to declaration. Instead of replacing existing
function, add a new function called 'alpm_strerrorlast(void)'.
Signed-off-by: Stefano Esposito <stefano.esposito87@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
repo-add, repo-remove:
'bsdtar -c * | ...' doesn't work (you need '-f -'). Code clean up
eliminated this bug.
Removed the multiple checksum support, pacman now only supports MD5, so
there's no need for the database to contain multiple checksums.
Quote all variables containing file/dir names to prevent paths
containing spaces from causing problems.
Add msg, warning and error functions.
General code clean up.
pacman-optimize:
Use a sub-directory in /tmp for working files to make it easier to clean
up at the end.
Add quotes round $@ in die and die_r, otherwise printf can't display the
message correctly.
makepkg:
Disable colour output if stderr is not a tty.
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
I wonder how many tools / scripts deal directly with the sync databases under /var/lib/pacman/ ,
I doubt these are the only ones.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
One string in de.po differed pretty strongly with its translated version.
It may still be totally wrong as far as translations go, but it compiles
now. Get translater to check.
Also, ensure the proper dbpath gets set in the db when it's created.
Signed-off-by: Travis Willard <travis@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>