Age | Commit message (Collapse) | Author | Files | Lines |
|
Remove now unused struct pkginfo name member.
|
|
It represents only the package name of the dependency. Later deppossi
will grow an architecture parameter that will allow us to transform
that pkgset into the correct pkginfo (depending on the context).
Note that this transformation depends on the dependency type
(possi->up->dep_type) and as such it won't be done at parsing time
but rather every time that we need to analyze a specific dependency.
[hertzog@debian.org: (Sponsored-by: Linaro Limited)
- Update code for new location of depended struct.
- Update call sites for pkg_db_find() returning pkginfo. ]
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
Reverse dependencies only consider the package name and not the package
architecture, so they should logically be part of pkgset and not pkgbin.
To reflect this, the next commit will fix struct depossi so that its ed
member points to a pkgset.
Sponsored-by: Linaro Limited
[guillem@debian.org:
- Move reverse dependencies into a new anonymous depended struct,
instead of two members; available_revdeps and installed_revdeps. ]
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
Two new options to dpkg, needed for multiarch:
* --foreign-architecture lets you specify that packages for the
named architecture should be installable without the use of
--force-architecture.
* --print-foreign-architectures prints out a space-separated list of all
architectures so configured, so that front-ends can query the list.
Sponsored-by: Linaro Limited
[guillem@debian.org:
- Move dpkg option to the correct section in the man page.
- Add --help output for both options.
- Handle arch_foreign and arch_unknown separately in set_foreign_arch().
- Be consistent with naming of arch plural with the rest of the code.
- Rename act_foreignarches to act_printforeignarches. ]
Based-on-patch-by: Steve Langasek <steve.langasek@canonical.com>
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
|
|
Sponsored-by: Linaro Limited
[guillem@debian.org:
- Distinguish between missing and empty Architecture field. ]
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
This field will allow to satisfy dependencies between packages of
different architectures (beyond Architecture: all), and co-install
a package with the same name but different architecture.
The permitted values are:
* “no”
This value is equivalent to the current default, the omission of the
field.
* “same“
This package is co-installable with itself, but it must not be used to
satisfy the dependency of any package of a different architecture from
itself.
* “foreign”
The package is not co-installable with itself, but should be allowed
to satisfy the dependencies of a package of a different architecture
from itself.
* “allowed”
This permits the reverse-dependencies of the package to annotate their
Depends: field to indicate that a foreign architecture version of the
package satisfies the dependencies, but does not change the resolution
of any existing dependencies.
|
|
[guillem@debian.org:
- Rename disappear_package to pkg_disappear.
- Rename infavor argument to infavour.
- Update debug output. ]
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
|
|
This fixes two related issues when the FIGETBSZ ioctl fails, it avoids
a file descriptor leak because we can get the block size before the
loop, and avoids a segfault when sorting the package array due to the
cliendata possibly being NULL on some of the package entries because
we can bail out before performing the actual sorting.
We use the Linux specific statfs(2), because it does way less work than
statvfs(3) and the surrounding code is already non-portable due to its
dependency on FIEMAP.
LP: #872734
|
|
The change in commit a36cadba41b19d5908bdfcb658cf01af07c1436a was wrongly
assuming that all packages would be in one of the states
triggers-awaited, triggers-pending or installed when
trig_transitional_activate kicks in.
That is not the case and the status reset should hence only be done when
the current status is already such that the trigger information are
meaningful. transitional_interest_callback_ro() is already taking care
to not add anything in the Triggers-Pending field when the status
is such that it would not make sense.
Reported-by: Hector Oron <hector.oron@gmail.com>
|
|
Instead of using /etc use a known to exist directory in the build tree,
and instead of hardcoding /bin/true, let the command module find it
in the PATH.
|
|
The leak on cmpversions() does not pose any issue on normal operation as
the program will exit immediately and the memory will be freed by the
system, but once --command-fd is enabled, it could actually be a problem
due to a long running dpkg process leaking repeatedly.
The leak on parse_db_version() is actually problematic as it can act
repeatedly if there's tons of warnings when parsing.
Regression introduced in commit ccc26399f2f0e295da1206c5ce81fe81a5dc0e21.
Reported-by: Niels Thykier <niels@thykier.net>
|
|
The bogus versions might get fed into «dpkg --compare-versions» by
way of maintainer scripts, which would get the bogus versions from
the database, somewhere dpkg still allows those to exist.
|
|
This allows to merge back the parseversion_lax() and
version_strict_check() functions into a single parseversion(), which
performs all the validation, but issues different types of dpkg_error
messages on error. Which simplifies parse_db_version() and will allow
for callers to distinguish the error conditions and handle them as
they see fit.
|
|
This function is an equivalent of the GNU basename, but this one will
work consistently on any system regardless of libc used.
|
|
|
|
This makes it more natural to manage the directory names, and avoids
some doubled slashes.
|
|
Closes: #639997
|
|
This will help the user diagnose which file was affected and in
correcting the situation, which in most cases is due to file system
breakage, or non POSIX compliance.
Closes: #639229
|
|
|
|
|
|
Normal files tagged as a conffile are not tagged with
fnnf_deferred_rename and due to this the hardlinking code
was assuming that the target is in its final location
already. This is obviously not the case for a conffile.
Fix the code so that the hardlinking logic takes into account
the fact that conffiles are unpacked in .dpkg-new and stay
there until the configuration phase.
Reported-by: Igor Pashev <pashev.igor@gmail.com>
|
|
Found by codespell.
|
|
Unify the reference to the Packages-file to match the one used on the
man pages and on the --help output.
Closes: #628055
|
|
This fixes two issues related to making the new file contents available
through an alternative but final path before
1) the one "carrying" the content has been fsync()ed, to avoid getting
garbage on system failure.
2) the deferred fsync() on the main path has been performed, avoiding
a possible error when reopening the file for writing if it's currently
under execution.
Deferring the hardlink is safe as they are always after the tar entry
containing the actual file data.
Regression introduced in commit 9cd41fdda1c27169c52d73b3b3ce71991d724994.
Closes: #635683
Reported-by: Niko Tyni <ntyni@debian.org>
Based-on-patch-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
root
|
|
The circumstances are not entirely clear because clear_istobes() is
called earlier in the code and should already ensure that clientdata
is allocated for all packages in the database but the stack trace
reported leaves no room for any other interpretation. We must protect
the access to tpkg->clientdata in findbreakcycle() with
ensure_package_clientdata(tpkg).
Probably that some other parts of the code might create new packages in the
in-memory database depending on some specific conditions. It might be that
those conditions only hold for a multiarch-enabled dpkg for example if
the code looks up a package entry for an alternative architecture and
would thus create the package on the fly.
This is pure speculation because I did not push the investigations that
far. It might be something entirely different but it doesn't matter much
because the proposed fix is the same and just ensures that we respect
our API by protecting the access to clientdata.
See https://bugs.launchpad.net/ubuntu/+source/dpkg/+bug/733414 for
details.
|
|
|
|
|
|
The current implementation demanded libdpkg users to define thisname
themselves, which is not really a nice interface to offer to programs.
Closes: #631757
|
|
Instead define it in myopt.c and initialize it through a new argument to
myopt().
|
|
Warning introduced in commit fc625d161382abc41b984ca9ee1e32ad4f295c67.
|
|
Missed in commit fc625d161382abc41b984ca9ee1e32ad4f295c67.
|
|
|
|
When unpacking a directory missing in the file system with that path
shared by at least one other package, from a package that is Replaced
by other packages, assume the missing path is a shared directory and
avoid setting ‘keepexisting’ and as such returning prematurely from
tarobject(), because in that case we need to recreate the lost
directory. As a side effect this also prevents printing the message
“Replaced by files in installed package” which is bogus in this case,
as directories are always shared.
Regression introduced in commit 00e5640a99be03aba40c9e08a663b90d8f8aa797.
Closes: #631808
|
|
|
|
Those variants do not put triggering packages in triggers-awaited status
and thus do not record the package with the corresponding pending triggers
in the Triggers-Awaited field.
This should be used for triggers which do not provide essential
functionality when we can safely consider that the triggering packages
are able to satisfy dependencies even if the trigger processing
has not yet happened.
|
|
If "installed-prerm upgrade" fails, dpkg tries to run "new-prerm
failed-upgrade" so that newer versions of packages can work-around
a bug in the prerm of the installed package.
In the case of downgrade this logic doesn't make any sense since
the oldest version can't be aware of the bug in the newest version
(that did not exist when the prerm of the oldest version was
written).
Thus we're disabling the fallback in case of a downgrade or a
reinstallation of the same version.
|
|
The pending triggers were removed because the postinst has just been
run, unfortunately in some cases it would restore the status to
pending-triggers. This is notably the case when a package is
removed while being in triggers-pending and when the prerm fails.
In fact it was not correct to remove the pending triggers in this
function because only "postinst configure" should clear the pending
triggers. Thus move the removal of the pending triggers to
deferred_configure() in src/configure.c and reset the status
to its "normal" value when the target status is one of triggers-awaited,
triggers-pending or installed.
With this change, it's no longer possible to have a status of
triggers-pending without any pending trigger in trigpend_head.
Note that despite this change, the pending triggers are lost
during a failed removal because dpkg switches the package to
halfconfigured before running "prerm remove" and modstatdb_note()
drops the pending triggers in that situation.
|
|
trig_transitional_activate() is emptying Triggers-Pending without
ensuring that the status is set back to something which is not
triggers-pending. In theory it's ok because the trig_parse_ci()
call is supposed to reactivate all the triggers. But if there's no
triggers file any more then we're effectively introducing a skew
which is going to be fatal the next time we try to write down
the status file.
The disparition of the triggers file can happen with file system problems,
bad user manipulation or even an old dpkg bug that kept triggers alive
when in fact the trigger was dropped from the package. Or the triggers
file has effectively been removed in the package but the user has restored
an old status file with a triggers-pending status that the current package
should no longer be able to generate.
In other words, properly resetting the status in
trig_transitional_activate() makes dpkg more robust.
|
|
Before this change, a package removal would not remove the triggers
information from the internal files. When you reinstalled the same
package without any trigger, dpkg would improperly believe that
the package implemented some triggers.
However the triggers were correctly unregistered during a package
upgrade that dropped the triggers.
With this commit, we also remove triggers interest file that are empty and
thus no longer needed.
|
|
When a directory is kept during removal to be later dealt with during
purge, due to the directory containing conffiles from the same package,
it not being empty, etc, we should keep all its parent to make sure
when the subsequent trial is performed they are properly cleaned up.
Closes: #454694
Based-on-patch-by: Ondřej Surý <ondrej@debian.org>
|
|
This makes sure the files list is correct after the conffiles have been
removed from disk and the status db has been updated.
|
|
The function removal_bulk_remove_leftover_dirs() was supposed to be
called only w/ left over dirs, but removal_bulk_remove_configfiles()
does not remove them from the file list when unlinking.
Do not check if the directory needs to be preserved if the package has
conffiles inside, because it should have none, although it would match
given that the file list still contains conffiles.
Do not preserve any lingering conffiles in the file list as they are
no longer on disk anyway.
|
|
This generalizes the function to exclude any desired file namenode
flag and not just fnnf_elide_other_lists. It also gets rid of the
bool variable which is generally a bad interface to change function
behaviour when it should really be a named flag or a mask.
|
|
Using bool to pass flags to a function already taking several arguments
is generally a bad interface, as it's not clear from the call sites what
each of them refer to. Switch to a proper enum with named flags instead.
|
|
The push_cleanup() call takes a pointer to the fd variable which resides
in the stack. In case of error and stack unwinding due to longjmp, the
value of fd might get overwritten by subsequent stack usage. Thus this
kind of variables need to be static so that their value cannot change
on stack rollback.
|
|
This should make it clear we are referring to a stdio stream, and not
the future planned ‘struct file’.
|
|
The code was treating symlinks to directories as directories, but then
it was trying to rmdir(2) them, which failed. In such case just verify
it's a symlink and unlink(2) them instead.
|