Age | Commit message (Collapse) | Author |
|
Our internal vercmp function was the only user of this, and it no longer
relies on it.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
free() is designed to do nothing if it is passed a NULL pointer, so there is
no need to check for it on our end. Change/fix the macro.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This crude function allows reading from an archive on a line-by-line basis
similar to the familiar fgets() call on a FILE stream. This is the first
step in being able to read DB entries straight from an archive.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
test_delta_md5sum and test_pkg_md5sum were simple wrappers to test_md5sum,
and only used once, so not very useful. I removed them.
Also, test_md5sum and alpm_pkg_checkmd5sum functions were a bit duplicated,
so I refactored them with a new _alpm_test_md5sum function in libalpm/util.c
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
|
|
[Xav: removed unneeded makepath_internal function, and fixed the permission
value : 1777 -> 01777]
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This also affects all structures with static strings, such as depmiss,
conflict, etc. This should help a lot with memory usage, and hopefully make
things a bit more "idiot proof".
Currently our pactest pass/fail rate is identical before and after this
patch. This is not to say it is a perfect patch- I have yet to pull valgrind
out. However, this should be quite safe to use in all situations from here
on out, and we can start plugging the memleaks.
Original-work-by: Aaron Griffin <aaronmgriffin@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Update the GPL boilerplate to direct people to the GNU website for a copy of
the license, as well as bump all of Judd's copyrights to 2007.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Run the kernel's cleanfile script on all of our source files.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Legacy code is hitting the trash here. Remove unnecessary _alpm_time2string
time storage abstraction in favor of just writing the time_t value to the
disk.
The only drawback is that everyone's sync DBs will have to be updated at
least once so that the lastupdate values are stored right. :)
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
|
|
Linux lstat follows POSIX standards and dereferences a symlink pointing
to a directory if there is a trailing slash. For purposes of libalpm, we
don't want this so make a lstat wrapper that suppresses this behavior.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
%d was used, which worked for Linux and FreeBSD. Not so for Darwin. The
warning was probably spat out when compiling on x68_64 as well, but no
developers use this architecture as their primary one.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
These macros take the place of the common 4 or 5 line blocks of code we had
in most places that called malloc or calloc. This should reduce some code
duplication and make memory allocation more standard in libalpm.
Highlights:
* Note that the MALLOC macro actually uses calloc, this is just for safety
so that memory is initialized to 0. This can be easily changed in one
place.
* One malloc call was completely eliminated- it made more sense to do it
on the stack.
* The use of RET_ERR in public functions (mainly the alpm_*_new functions)
was standardized, this makes sense so pm_errno is set.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Anything dealing with libintl and localization should be correctly guarded
inside an ENABLE_NLS block on both the pacman and libalpm sides.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Delta files will be used if the size is smaller than a percent
(MAX_DELTA_RATIO) of the package size.
Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Change the default visibility of libalpm functions to internal instead of
hidden- this allows for slightly better optimization because it tells GCC
that the function can never be called outside of the current module (see
http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html).
Also added some attributes to the pacman print functions so that they check
the format strings being passed to them.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
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>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
In order to best resolve bug 6404, move some cachedir handling stuff out of
sync.c and into util.c and create two new functions: filecache_find and
filecache_setup. sync.c was rewritten to use these, and alpm_fetch_pkgurl
now also uses these routines.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Remove versioncmp.c by moving all functions to locations that make sense.
Move replacement functions (for building without glibc) into util.c where
they belong, and do proper checks for them instead of using __sun__, etc.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
The scriptlet calling had some unneeded complexity for the time being
which we aren't using here. Let's get rid of it until we find a good way
to implement it correctly.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Remove the logmask functionality from the backend as it has been moved to
the frontend, and change the logging callback function to use pm_printf.
In addition, make much better use of va_list- use the args list instead
of a arbitrarily chosen string to print to in the logging functions.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This change allows us to use all autoconf specified paths, most notably
$(localstatedir). It is quite a change and touches a lot of files, as
all references to the DB and cache were done with the ROOTDIR as a prefix.
* add --lock command-line option to pacman to specify the location of the
lockfile (this can now be specified at configure time by setting the
$localstatedir path).
* Rip quite a few settings out of configure.ac as they are now picked by
setting the paths during configure or make.
* Fix bug with /tmp fallback for sync downloads not working correctly
(related to root location, now the system tmp dir is used).
* Simplified the parameters to some libalpm functions, and added get/set
for the new lockfile option.
* Renamed several of the DEFS to names without the PM_ prefix.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Small change (addition of a 'strreplace' function) which replaces
any $repo tokens found in a server line with the name of the repo
or section being processed.
While this is more simplistic than suggestions on flyspray, it works
and I think it is cleaner. Merits can be discussed further.
Ref: FS#6389
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
|
|
* Remove some unnecessary conditional compiling in util.h- move the
functions tha required it to trans.c (along with a bunch of new header
includes).
* Clean up util.h a bit- remove some header includes, remove universal
libarchive include and only put it in the files that need it.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Replaced calls to the STRNCPY macro with the actual strncpy function, and
pacman passes all pactests.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Remove inclusion of libintl.h from all files, because we can do it once
in util.c where the _() macro is defined.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
* Moved entirely to alpm_pkg_get_* accessors, to read data on demand
* Mostly removed the INFRQ_ parameters from outside the be_files backend (making
the backend more extensible in the long run)
* packages created from _alpm_db_scan now have the db and origin set (making
accessors actually work for these packages)
* removed _alpm_db_ensure_pkgcache
* totally revamped the _alpm_checkconflicts function, making it cleaner and
easier to read (and thus fix in the long run) - maintainable code ftw
NOTE: feel free to rename the functions... I couldn't think of anything better
* removed an extra loop in sync.c:find_replacements - no sense in looping over
an entire DB while strcmp'ing the name, when we have get_pkgfromcache
Other:
* package struct "license" -> "licenses"
* Created _alpm_sync_find (duplicate code in some places, find_pkginsync
* Minor const correctness changes along the way
* fixed a couple extra '/' pathing issues (non-issues really)
* removed a duplicate pkg_cmp function
|
|
want the actual number of characters, not the number of bytes.
* Added a TODO to take care of later in scriptlet processing.
|
|
unbelievable amount of strcmp() calls (25 million) due to the list searching.
This has been reimplemented with a set-intersection scheme, due to the fact
that file lists are always ordered. - NEEDS TESTING
* Minor clean up, "globalized" the str_cmp helper to match the alpm comparison
signature, so we can use it elsewhere.
|
|
* gcc visiblity changes
Also modified _alpm_versioncmp -> alpm_versioncmp (public function) as per K.
Piche's suggestions
|
|
optimizations in order to make the code much more readable and
type-checkable. Every enum in the library now has it's own type that
should be used instead of the generic 'unsigned char'. In addition,
several #define statements dealing with constants were converted to
enums.
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
|
|
* renamed pmlist_t -> alpm_list_t
* made alpm_list_t a public type (alpm_list.h header)
* removed additional storage for registered DBs in pacman source
* some code cleanup
* removed duplicate (pm)list_display functions from pacman source
* misc code cleanup
|
|
Addition of a forced fflush in an attempt to diagnose mutli-logging
Removal of varargs from the internal logaction function, they are handled in
alpm_logaction just fine
|
|
* avoid repeated regex compilations (regex for search string do not
change while scanning the package database)
* remove needless string duplication (regex function do not change target
string nor free them)
* code cleanup
This patch improves search performance:
bash-3.2$ time ./src/pacman/pacman.static.old -Ss "(database|web).*server" >/dev/null
real 0m1.026s
user 0m0.544s
sys 0m0.208s
bash-3.2$ time ./src/pacman/pacman.static -Ss "(database|web).*server" >/dev/null
real 0m0.777s
user 0m0.456s
sys 0m0.128s
bash-3.2$
|
|
* Modified some dependancy checking
* Changed "performing local database upgrade" message to be more clear
* Change 'usize' to 'isize' in database files
* Scriptlet output is now sent to pacman's log file
* Limited some debugging output to be more clear
|
|
machine - still pending
* Addition of _alpm_pkg_makefilename to simplify the with/without -ARCH prefix
scheme we're going with for the interim
|
|
* Addition of hacky architecture check in the _splitname function
* Removal of libfetch from the archlinux proper - it has been renamed to
libdownload and can be found at http://phraktured.net/libdownload
* Merge of _some_ of the Frugalware makepkg change - this may still be
incomplete
* Removal of libftp from cvs proper
* PKGBUILD manpage now says 'PKGBUILD' instead of FrugalBuild (he he)
|
|
* Furthered the "lazy caching" to force the pkgcache to read nothing
(INFRQ_NONE) by default. Anything requiring package data should now check
the infolevel of each package and attempt to update it. This could be
ironed out a bit more later (by using the front-end get_info function
* Switched to libfetch. Drastic changes to the download code and the callback
progress bar functions. Also fixed the return value of
_alpm_downloadfiles_forreal. Downloading now supports http, ftp, https, and
files urls, along with 'mtime's and numerous other fancy features from
libfetch.
|
|
from db to whatever format we need.
|
|
* Removed the PMList typedef, in favor of the same naming scheme other
structs use 'pmlist_t'
* Added a time stamp on debug output, to make it more informational
* Moved alpm_db_register to _alpm_db_register, making the public function
not take a callback parameter
|
|
handling changes (support [sections] to carry over to included files - this
helps with backwards compatibility with existing pacman config files)
|
|
|
|
|
|
|
|
- code cleanup
|