- internalize scripts so we can use them before unpacking packages.
- moves some required metadata checks out of the package unpack stage
so errors do not leave the system in a half unpacked state.
xbps_transaction_files will be changed later to use the loaded
files.plist instead of opening each binary package on its own again.
HTTP connections are cached for performance, but they end up being
leaked when running configure scripts. To avoid this, close the
connection cache after all downloads are finished.
Closes: #326 [via git-merge-pr]
This reverts commit be7d8cfaf1.
This commit missed some previous copyrights mentioned,
in general I think its better to have this per-file to
follow who wrote what and when.
This commit implements multiple performance improvements
to the transaction code:
- Don't process xbps_pkg_name() N times each time we access
its package dictionary (via pkgdb or rpool), just do it once
at xbps_pkgdb_init() time. At pkgdb init time, it just creates
a property in pkgdb, "pkgname". At rpool time, each time a
package is accessed, the "pkgname" string property is added.
- The package transaction dictionary contains the "transaction"
object to know what's the pkg type. This has been changed to an
uint8, this simplifies the logic and it's faster than checking
a string object. See xbps_trans_type_t and xbps_transaction_pkg_type().
- Fixed the issue that was marked with XXX in transaction shlibs
checking code. This has been fixed and improved and resources are
now just freed as expected.
- Simplified random code all over the place, avoiding unnecessary
allocations or operations.
- Rename some transaction files to have a better description.
This is my first rototill to the code in 2020.
Added `-D, --download-only` flag to allow downloading
packages to the cache without attempting to install them.
Contributed by Toyam Cox via #9
Adapted to master by yours truly.
Close#9
- Rather than using a POSIX named semaphore use a POSIX lock (lockf(3))
for pkgdb for writers. Writers that cannot acquire the pkgdb lock will
get EAGAIN rather then being blocked.
- Due to using a file lock we cannot write the pkgdb every time a package
is being unpacked, configured or removed. Instead pkgdb is only written
at the end of a specific point in the transaction (unpack, configure, remove)
or via xbps_pkgdb_unlock().
The list of required external deps is now confuse, libarchive and openssl.
libxbps now includes a wrapper for proplib prefixed with xbps_ rather than prop_.
Instead a two stage approach is necessary when packages for target arch
are installed:
- XBPS_TARGET_ARCH=arch xbps-install foo <- only unpack
- xbps-reconfigure -a <- configure natively or via an emulator
These are the core interfaces in the new API:
rpool - Interface to interact with the repository pool.
rindex - Interface to interact with repository indexes.
pkgdb - Interface to interact with local packages.
transaction - Interface to interact with a transaction.
This also brings new repository index format, making the index file
per architecture and being incompatible with previous versions.
The transaction frequency flush option has been removed, and due to
the nature of package states it was causing more harm than good.
More changes coming soon, but the API shall remain stable from now on.
xbps_fetch_file:
- A temp file is created with .part extension to improve resuming.
- Files are downloaded in cwd.
- Switch to futimens(2) and fsync(2).
xbps_repository_sync_index:
- Do not create local repodir in metadir if it already exists.
- Simplify the code thanks to new xbps_fetch_file().