0.5.15cnc5-alt1

- Specfile cleanup.
- Rediffed patches.
- Fixed --help/--version segfault.
- Fixed some compilation warnings.
- Relocated methods to /usr/lib/apt/methods/.
This commit is contained in:
Дмитрий Левин 2004-01-16 19:01:26 +00:00
parent 4ef124c6d0
commit 0501f88ac1
448 changed files with 87274 additions and 26710 deletions

View File

@ -1,5 +1,5 @@
copy: *.8
copy: *.conf
copy: *.old
copy: *.patch
copy: *.po
copy: *.rsync

497
ChangeLog-rpm.old Normal file
View File

@ -0,0 +1,497 @@
* Mon Jun 10 2002 Ivan Zakharyaschev <imz@altlinux.ru> 0.3.19cnc55-alt6
- fixes in genbasedir from apt-utils:
+ srclist generation: now it correctly includes the information on produced
binaries (the list was empty before), and also correctly treats --mapi
(the fixed bug caused misbehaviour of 'apt-get source', in the "2nd branch
of DoSource()" as referenced by me in previous changelogs);
+ --flat option.
* Sun Jun 09 2002 Ivan Zakharyaschev <imz@altlinux.ru> 0.3.19cnc55-alt5
- renamed the 'build' subpackage to 'utils' (because there is already
an 'apt-build' project at freshmeat.net).
* Sun Jun 09 2002 Ivan Zakharyaschev <imz@altlinux.ru> 0.3.19cnc55-alt4
- separate subpkg 'build': analoguous to rpm-build, contains teh utilities to
generate indices (as a consequence less dependencies of 'apt' pkg,
little size);
- fix the work of 'apt-get source' for source packages with multiple binaries
with help of feedback and debugging patches from Anton Denisov
<fire@kgpu.kamchatka.ru> (only the first branch of control flow in DoSource()
is fixed, but that should be enough for normal use).
* Tue Mar 26 2002 Dmitry V. Levin <ldv@alt-linux.org> 0.3.19cnc55-alt3
- Added librpm-4.0.4 build support.
- Built with librpm-4.0.4, updated buildrequires.
* Thu Mar 21 2002 Dmitry V. Levin <ldv@alt-linux.org> 0.3.19cnc55-alt2
- Added kernel-aureal and NVIDIA_kernel to default AllowedDupPkgs.
- Updated patch for pkgRPMPM::ExecRPM.
- Reenabled rsh method.
- Updated rpmpriorities.
- fixed genbasedir patch.
- Set explicit Packager tag.
- Dropped obsolete trigger.
- libapt: Conflicts: apt < %version-%release.
- Renamed patches.
* Wed Mar 13 2002 Alexander Bokovoy <ab@altlinux.ru> 0.3.19cnc55-alt1
- apt-0.3.19cnc55 integrated
- Fixed:
+ rpmpm-exec_rpm patch
+ genbasedir
- Removed:
+ rpmpm-nodeps patch (already upstream)
+ rsh method (already upstream)
* Mon Dec 10 2001 Dmitry V. Levin <ldv@alt-linux.org> 0.3.19cnc53-alt6
- Fixed rpm --nodeps option usage in pkgRPMPM::ExecRPM (#0000215).
* Fri Nov 23 2001 Dmitry V. Levin <ldv@alt-linux.org> 0.3.19cnc53-alt5
- Applied scoring algorithm patch (Stelian Pop <stelian.pop@fr.alcove.com>)
- Updated package requires.
* Mon Nov 19 2001 Dmitry V. Levin <ldv@alt-linux.org> 0.3.19cnc53-alt4
- Dropped outdated pofile (already upstream).
- Corrected "Executing RPM" message generation.
* Fri Nov 16 2001 Dmitry V. Levin <ldv@alt-linux.org> 0.3.19cnc53-alt3
- Updated patches: genbasedir, configure-db3, i18n.
* Thu Nov 15 2001 Alexander Bokovoy <ab@altlinux.ru> 0.3.19cnc53-alt2
+ apt-0.3.19cnc53-2cl integrated. Most of our patches moved to upstream
- Fixed (from Conectiva's changelog):
+ fixed bug in mirror patch
+ cleaned up gen{pkg,src}list (Alexander Bokovoy <ab@altlinux.ru
+ fixed crash bug in genpkglist
+ configure.in patch to detect rpmdb (Stelian Pop <stelian.pop@fr.alcove.com>)
+ * Skips correctly over empty package directories
+ * Adds the --bz2only argument which makes genbasedir
+ to generate only the .bz2 compressed versions of pkglist
+ and srclist (space gain...)
+ * Doesn't change the timestamps on pkglists/srclists if
+ the contents are not modified (making possible for example
+ to make several consecutive runs of genbasedir without
+ having the apt clients download the indexes again and again).
+ * Some minor cleanups (remove the temporary files in /tmp
+ at the end of the script etc).
+ (Stelian Pop <stelian.pop@fr.alcove.com>)
+ cleanup patch for gensrclist (Stelian Pop <stelian.pop@fr.alcove.com>)
+ fixed multi-arch pkg handling (Stelian Pop <stelian.pop@fr.alcove.com>)
+ updated russian translation (Alexander Bokovoy <ab@altlinux.ru>
+ updated i18n (Dmitry Levin <ldv@alt-linux.org>)
+ replaced Apt::GPG::Pubring with Apt::GPG::PubringPath
also uses --homedir instead of --keyring in gpg
(Alexander Bokovoy <ab@altlinux.ru>)
+ patch to detect replaced (instead of just removed) packages
Dmitry Levin <ldv@alt-linux.org>
+ updated mirrors patch
+ Fixed mirrors infinite loop bug (closes: #4420).
+ Fixed error handling.
- Added:
+ added kernel-tape to default AllowedDupPkgs
+ added patch to fix bug in genbasedir with empty dirs
(Stelian Pop <stelian.pop@fr.alcove.com>)
+ added -K (RPM::Check-Signatures) option to verify rpm sigs
+ Added mirrors patch.
* Fri Nov 02 2001 Dmitry V. Levin <ldv@alt-linux.org> 0.3.19cnc52-alt6
- Initial build with rpm4.
* Thu Oct 04 2001 Dmitry V. Levin <ldv@altlinux.ru> 0.3.19cnc52-alt5
- Fixed i18n support and probably smth else
(configure.in, config.h.in and i18n.h were broken, kojima sux).
- Implemented 18n for apt-pkg/rpm, updated POTFILES.in and russian translation.
* Mon Oct 01 2001 Dmitry V. Levin <ldv@altlinux.ru> 0.3.19cnc52-alt4
- Removed "^(kernel|alsa)[0-9]*-headers" from RPM::HoldPkgs list.
- Added (experimental) replaced packages support.
* Fri Sep 07 2001 Ivan Zakharyaschev <imz@altlinux.ru> 0.3.19cnc52-alt3.1
- apt-cdrom fix (patch 6) reworked: apt-cdrom used to not detect a second
list file (srclist) if both (pkglist and srclist) were present in one
directory on the disk (in non-thorough mode); hopefully now it works how
we expect it to do.
* Thu Aug 09 2001 Dmitry V. Levin <ldv@altlinux.ru> 0.3.19cnc52-alt3
- Libification.
- Reworked compilation options again: we add only '-fno-exceptions' now.
* Tue Aug 07 2001 Dmitry V. Levin <ldv@altlinux.ru> 0.3.19cnc52-alt2
- More code cleanup in tools/gen{pkg,src}list.cc.
- Added %optflags_nocpp to compilation options.
* Mon Aug 06 2001 Alexander Bokovoy <ab@altlinux.ru> 0.3.19cnc52-alt1
- cnc52, gcc 3 and Solaris fixes
- RPM4 check is disabled for the moment
- File method fix has been integrated into mainstream
- RPM::RemoveOptions, RPM::UpdateOptions have been added
- Generation of Package list fixed
* Thu Aug 02 2001 Dmitry V. Levin <ldv@altlinux.ru> 0.3.19cnc51-alt4
- Added trigger for better apt-conf-* migration.
* Tue Jul 31 2001 Dmitry V. Levin <ldv@altlinux.ru> 0.3.19cnc51-alt3
- Updated:
+ rpmpriorities,
+ AllowedDupPkgs,
+ HoldPkgs.
- Moved *.list to apt-conf-* packages.
* Fri Jul 20 2001 Alexander Bokovoy <ab@altlinux.ru> 0.3.19cnc51-alt2
- Fixed:
+ Bug in file method which prevented authentication from working correctly
* Fri Jul 20 2001 Alexander Bokovoy <ab@altlinux.ru> 0.3.19cnc51-alt1
- cnc51
* Wed Jun 27 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc46-alt2
- cnc46
- kernel(|24)-{headers,source} added to HoldPkgs
- REPOSITORIO-APT-HOWTO added (Portugal)
- AllowedDupPackages -> AllowedDupPkgs
* Thu Jun 07 2001 Dmitry V. Levin <ldv@altlinux.ru> 0.3.19cnc38-alt4
- Various fixes in /usr/bin/genbasedir.
* Thu May 17 2001 Dmitry V. Levin <ldv@altlinux.ru> 0.3.19cnc38-alt3
- Fixed build.
- Updated rpmpriorities.
* Mon Apr 16 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc38-alt2
- More duplicate packages from kernel series allowed.
* Sun Apr 15 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc38-alt1
- cnc38
- Updated:
+ apt-cdrom now works correctly
+ default architecture has been changed to i586
+ ssh method as wrapper to rsh one
* Mon Mar 19 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc37-ipl3mdk
- Updated:
+ New patch for genbasedir to allow pass default key to GnuPG
* Sun Mar 18 2001 Dmitry V. Levin <ldv@altlinux.ru> 0.3.19cnc37-ipl2mdk
- Fixed:
+ Build/installation of manpages without yodl sources;
+ Uncompressed small patches.
- Updated:
+ AllowedDupPackages list according to new kernel naming scheme;
+ URLs to use new domain name.
* Sat Mar 17 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc37-ipl1mdk
- Fixed:
+ APT::GPG::Pubring renamed to APT::GPG::PubringPath
+ Pubring support patch changed to use --homedir instead of --keyring
- Updated:
+ APT cnc37
+ Fingerprint and repository sources changed to reflect ALT Linux
new public key ring
* Mon Feb 19 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc36-ipl4mdk
- Sisyphus source repository added to sources.list
* Mon Feb 19 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc36-ipl3mdk
- New version
* Fri Feb 16 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc35-ipl2mdk
- Static library compilation added
- Static library goes to apt-devel-static due sizes of library
* Thu Feb 15 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc35-ipl1mdk
- New version
- Rsh method from upstream apt-get ported
- Spec file follows libification of rpm now
* Mon Jan 22 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc32-ipl4mdk
- New upstream version
- Russian translation updated
- Rebuild with new RPM library
* Mon Jan 22 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc28-ipl1mdk
- New upstream version
- cnc28 still lacks correct GNUPG checking code, our patch is neccessary.
- Genbasedir slightly patched again.
* Sun Jan 21 2001 Alexander Bokovoy <ab@avilink.net> ipl11mdk
- Typo in methods/gpg.cc fixed.
* Sun Jan 21 2001 Alexander Bokovoy <ab@avilink.net> ipl10mdk
- APT::GPG::Pubring option to specify default gnupg public ring added to check
distributors' signs automatically via default pubring in RPM package
- ftp user password changed to IPL one.
* Tue Jan 09 2001 Dmitry V. Levin <ldv@fandra.org> 0.3.19cnc27-ipl7mdk
- Specfile cleanup.
* Mon Jan 08 2001 Alexander Bokovoy <ab@avilink.net> ipl5mdk
- genbasedir help message fixed
* Mon Jan 08 2001 Alexander Bokovoy <ab@avilink.net> ipl4mdk
- Integration with main IPL package:
- Russian translation for command line messages added
- Russian translation of package summary/description
* Thu Jan 04 2001 AEN <aen@logic.ru>
- Real Sisyphus URL & IPLabs Fingerptint added
- changed rpmpriorities
* Thu Jan 04 2001 AEN <aen@logic.ru>
- build for RE
* Tue Dec 12 2000 Frederic Lepied <flepied@mandrakesoft.com> 0.3.19cnc27-1mdk
- first mandrake version.
* Thu Dec 07 2000 Andreas Hasenack <andreas@conectiva.com>
- damn! Wrong URL in sources.list, atualizacoes.conectiva.com
doesn't exist, of course...
* Thu Dec 07 2000 Andreas Hasenack <andreas@conectiva.com>
- updated sources.list with new mirrors and new download tree
- removed (noreplace) for the sources.list file for this
upgrade. It will be easier for the user. The (noreplace)
should be back in place after this update as we expect no
further big modifications for that file, only new mirrors.
* Wed Dec 06 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- fixed prob in vendors.list
* Tue Dec 05 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc27
* Wed Nov 08 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc26
* Mon Nov 06 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc25
* Thu Nov 02 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc24
* Thu Nov 02 2000 Rud<E1> Moura <ruda@conectiva.com>
- updated source.list (again)
* Thu Nov 02 2000 Rud<E1> Moura <ruda@conectiva.com>
- updated source.list
* Wed Nov 01 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc23
- added cache directories for gen{pkg,src}list
- pt_BR manpages
* Tue Oct 31 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc22
- Requires -> PreReq in apt-devel
* Mon Oct 30 2000 Alfredo Kojima <kojima@conectiva.com>
- collapsed libapt-pkg-devel and -doc to apt-devel
* Mon Oct 30 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc21
* Sun Oct 29 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc20
* Sun Oct 29 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc19
- added gensrclist
- support for apt-get source
* Fri Oct 27 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc18
* Thu Oct 26 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc17
- new manpages
* Wed Oct 25 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc16
* Sun Oct 22 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc15
* Sat Oct 21 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc14
* Thu Oct 19 2000 Claudio Matsuoka <claudio@conectiva.com>
- new upstream release: 0.3.9cnc13
* Tue Oct 17 2000 Eliphas Levy Theodoro <eliphas@conectiva.com>
- added rpmpriorities to filelist and install
* Tue Oct 17 2000 Claudio Matsuoka <claudio@conectiva.com>
- updated to 0.3.19cnc12
- fresh CVS snapshot including: support to Acquire::ComprExtension,
debug messages removed, fixed apt-cdrom, RPM DB path, rpmlib call
in pkgRpmLock::Close(), package priority kludge removed, i18n
improvements, and genbasedir/genpkglist updates.
- handling language setting in genpkglist to make aptitude happy
* Wed Oct 11 2000 Alfredo K. Kojima <kojima@conectiva.com>
- released version 0.3.19cnc11
- fixed problem with shard lib symlinks
* Tue Oct 10 2000 Alfredo K. Kojima <kojima@conectiva.com>
- released version 0.3.19cnc10
* Mon Oct 02 2000 Claudio Matsuoka <claudio@conectiva.com>
- fixed brown paper bag bug with method permissions
- added parameter --sign to genbasedir
- added html/text doc files
* Sat Sep 30 2000 Claudio Matsuoka <claudio@conectiva.com>
- bumped to 0.3.19cnc9
- added vendors.list
- added gpg method
- fixed minor stuff to make Aptitude work
- added missing manpages
- fixed shared libs
- split in apt, libapt-pkg, libapt-pkg-devel, libapt-pkg-doc
- rewrote genbasedir in shell script (original was in TCL)
- misc cosmetic changes
* Tue Sep 26 2000 Alfredo K. Kojima <kojima@conectiva.com>
- released version 0.3.19cnc8
* Wed Sep 20 2000 Alfredo K. Kojima <kojima@conectiva.com>
- released version 0.3.19cnc7
* Mon Sep 18 2000 Alfredo K. Kojima <kojima@conectiva.com>
- released version 0.3.19cnc6
* Sat Sep 16 2000 Alfredo K. Kojima <kojima@conectiva.com>
- released version 0.3.19cnc5
* Fri Sep 15 2000 Alfredo K. Kojima <kojima@conectiva.com>
- released version 0.3.19cnc4
* Tue Sep 12 2000 Alfredo K. Kojima <kojima@conectiva.com>
- released version 0.3.19cnc3
* Tue Sep 05 2000 Alfredo K. Kojima <kojima@conectiva.com>
- renamed package to apt, with version 0.3.19cncV
* Tue Sep 05 2000 Alfredo K. Kojima <kojima@conectiva.com>
- 0.10
- added genpkglist and rapt-config
- program names changed back to apt-*
* Mon Sep 04 2000 Alfredo K. Kojima <kojima@conectiva.com>
- 0.9
* Mon Sep 04 2000 Alfredo K. Kojima <kojima@conectiva.com>
- 0.8
* Mon Sep 04 2000 Alfredo K. Kojima <kojima@conectiva.com>
- 0.7
* Fri Sep 01 2000 Alfredo K. Kojima <kojima@conectiva.com>
- fixed typo in sources.list
* Thu Aug 31 2000 Alfredo K. Kojima <kojima@conectiva.com>
- version 0.6
* Thu Aug 31 2000 Alfredo K. Kojima <kojima@conectiva.com>
- version 0.5
* Thu Aug 31 2000 Alfredo K. Kojima <kojima@conectiva.com>
- version 0.4
* Wed Aug 30 2000 Alfredo K. Kojima <kojima@conectiva.com>
- version 0.3
* Mon Aug 28 2000 Alfredo K. Kojima <kojima@conectiva.com>
- second try. new release with direct hdlist handling
* Thu Aug 10 2000 Alfredo K. Kojima <kojima@conectiva.com>
- initial package creation. Yeah, it's totally broken for sure.

View File

@ -1,47 +0,0 @@
On Tue, Nov 20, 2001 at 02:28:53PM +0200, Matilainen Panu wrote:
> > I think this is the same bug (if it's a bug of course).
[...]
> The sane-split? I got it working by changing sane-frontends to have
> Provides: sane = %{version}
> and sane-backends
> Conflicts: sane < %{version}
>
> With the additional version information it manages to sort this out
> correctly.
I managed to find a hack permitting this to work without any
package modifications: when package scores are calculated
(based on package priorities and Depends:), I've added some
additionnal code to increment the priority of a package which
obsoletes another. This additionnal 'point' score makes the
right package to be selected for installation.
It works for me in simple cases, but it definately needs more
testing.
Comments ?
Stelian.
--- apt-0.5.4cnc9/apt-pkg/algorithms.cc.orig Wed Nov 21 17:45:34 2001
+++ apt-0.5.4cnc9/apt-pkg/algorithms.cc Wed Nov 21 17:46:12 2001
@@ -566,6 +566,8 @@
{
if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
Scores[D.TargetPkg()->ID]++;
+ if (D->Type == pkgCache::Dep::Obsoletes)
+ Scores[I->ID]++;
}
}
--
Stelian Pop <stelian.pop@fr.alcove.com>
|---------------- Free Software Engineer -----------------|
| Alcôve - http://www.alcove.com - Tel: +33 1 49 22 68 00 |
|------------- Alcôve, liberating software ---------------|
_______________________________________________
Apt-rpm mailing list
Apt-rpm@distro.conectiva.com.br
http://distro.conectiva.com.br/mailman/listinfo/apt-rpm

View File

@ -1,6 +1,7 @@
--- apt-0.5.5cnc1/apt-pkg/deb/debsystem.cc.orig 2002-07-23 21:54:51 +0400
+++ apt-0.5.5cnc1/apt-pkg/deb/debsystem.cc 2003-02-13 16:05:56 +0300
@@ -185,6 +185,8 @@
diff -uprk.orig apt-0.5.15cnc5.orig/apt-pkg/deb/debsystem.cc apt-0.5.15cnc5/apt-pkg/deb/debsystem.cc
--- apt-0.5.15cnc5.orig/apt-pkg/deb/debsystem.cc 2003-12-23 23:18:33 +0300
+++ apt-0.5.15cnc5/apt-pkg/deb/debsystem.cc 2004-01-16 15:12:44 +0300
@@ -185,6 +185,8 @@ bool debSystem::ArchiveSupported(const c
signed debSystem::Score(Configuration const &Cnf)
{
signed Score = 0;

View File

@ -0,0 +1,40 @@
diff -uprk.orig apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmpackagedata.cc apt-0.5.15cnc5/apt-pkg/rpm/rpmpackagedata.cc
--- apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmpackagedata.cc 2003-12-23 23:19:36 +0300
+++ apt-0.5.15cnc5/apt-pkg/rpm/rpmpackagedata.cc 2004-01-16 15:14:46 +0300
@@ -21,7 +21,7 @@ RPMPackageData::RPMPackageData()
#endif
{
// Populate priorities
- string FileName = _config->FindFile("Dir::Etc::rpmpriorities");
+ string FileName = _config->FindFile("Dir::Etc") + "pkgpriorities";
FileFd F(FileName, FileFd::ReadOnly);
if (_error->PendingError())
{
diff -uprk.orig apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmpm.cc apt-0.5.15cnc5/apt-pkg/rpm/rpmpm.cc
--- apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmpm.cc 2003-12-23 23:19:20 +0300
+++ apt-0.5.15cnc5/apt-pkg/rpm/rpmpm.cc 2004-01-16 15:14:33 +0300
@@ -493,7 +493,7 @@ bool pkgRPMExtPM::ExecRPM(Item::RPMOps o
}
}
- if (_config->FindB("RPM::Order",false) == false)
+ if (_config->FindB("RPM::Order",true) == false)
Args[n++] = "--noorder";
bool FilesInArgs = true;
diff -uprk.orig apt-0.5.15cnc5.orig/buildlib/archtable apt-0.5.15cnc5/buildlib/archtable
--- apt-0.5.15cnc5.orig/buildlib/archtable 2003-12-23 23:15:23 +0300
+++ apt-0.5.15cnc5/buildlib/archtable 2004-01-16 15:14:33 +0300
@@ -5,8 +5,10 @@
# The left side is a regex for awk
-i.86 i386
-pentium i386
+i[34]86 i386
+i.86 i586
+pentium.* i586
+athlon i586
sparc sparc
sparc64 sparc
alpha.* alpha

View File

@ -0,0 +1,36 @@
diff -uprk.orig apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmsystem.cc apt-0.5.15cnc5/apt-pkg/rpm/rpmsystem.cc
--- apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmsystem.cc 2003-12-23 23:19:32 +0300
+++ apt-0.5.15cnc5/apt-pkg/rpm/rpmsystem.cc 2004-01-16 15:11:40 +0300
@@ -132,7 +132,7 @@ bool rpmSystem::Initialize(Configuration
Cnf.CndSet("Dir::Etc::translateparts", "translate.list.d");
Cnf.CndSet("Dir::State::prefetch", "prefetch");
Cnf.CndSet("Dir::Locale","/usr/share/locale");
- Cnf.CndSet("Acquire::DistroID","Conectiva"); // hee hee
+ Cnf.CndSet("Acquire::DistroID","ALT Linux"); // hee hee
Cnf.CndSet("Acquire::CDROM::Mount", "/mnt/cdrom");
Cnf.CndSet("Acquire::CDROM::Copy-All", "true");
diff -uprk.orig apt-0.5.15cnc5.orig/cmdline/apt-cdrom.cc apt-0.5.15cnc5/cmdline/apt-cdrom.cc
--- apt-0.5.15cnc5.orig/cmdline/apt-cdrom.cc 2003-12-23 23:31:19 +0300
+++ apt-0.5.15cnc5/cmdline/apt-cdrom.cc 2004-01-16 15:11:40 +0300
@@ -700,7 +700,7 @@ bool DoAdd(CommandLine &)
Name.empty() == true)
{
// CNC:2003-11-25
- cout << _("Please provide a name for this Disc, such as 'Distribution Disk 1'");
+ cout << _("Please provide a name for this Disc, such as 'ALT Linux Disk 1'");
while (1)
{
Name = PromptLine("");
diff -uprk.orig apt-0.5.15cnc5.orig/methods/ftp.cc apt-0.5.15cnc5/methods/ftp.cc
--- apt-0.5.15cnc5.orig/methods/ftp.cc 2003-12-23 23:24:24 +0300
+++ apt-0.5.15cnc5/methods/ftp.cc 2004-01-16 15:11:40 +0300
@@ -190,7 +190,7 @@ bool FTPConn::Login()
// Setup the variables needed for authentication
string User = "anonymous";
// CNC:2003-06-16
- string Pass = "apt_get_ftp_2.1@rpm.linux.user";
+ string Pass = "apt_get_ftp_2.1@alt.linux.user";
// Fill in the user/pass
if (ServerName.User.empty() == false)

View File

@ -0,0 +1,130 @@
diff -uprk.orig apt-0.5.15cnc5.orig/apt-pkg/pkgsystem.h apt-0.5.15cnc5/apt-pkg/pkgsystem.h
--- apt-0.5.15cnc5.orig/apt-pkg/pkgsystem.h 2003-12-23 23:23:22 +0300
+++ apt-0.5.15cnc5/apt-pkg/pkgsystem.h 2004-01-16 14:33:07 +0300
@@ -90,7 +90,7 @@ class pkgSystem
// Return a list of system index files..
virtual bool AddStatusFiles(std::vector<pkgIndexFile *> &List) = 0;
// CNC:2003-11-21
- virtual bool AddSourceFiles(std::vector<pkgIndexFile *> &List) {};
+ virtual void AddSourceFiles(std::vector<pkgIndexFile *> &List) {};
virtual bool FindIndex(pkgCache::PkgFileIterator File,
pkgIndexFile *&Found) const = 0;
diff -uprk.orig apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmhandler.cc apt-0.5.15cnc5/apt-pkg/rpm/rpmhandler.cc
--- apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmhandler.cc 2003-12-23 23:19:22 +0300
+++ apt-0.5.15cnc5/apt-pkg/rpm/rpmhandler.cc 2004-01-16 14:30:11 +0300
@@ -87,7 +87,7 @@ bool RPMFileHandler::Jump(unsigned Offse
{
if (FD == NULL)
return false;
- if (lseek(Fileno(FD),Offset,SEEK_SET) != Offset)
+ if (lseek(Fileno(FD),Offset,SEEK_SET) != (off_t)Offset)
return false;
return Skip();
}
diff -uprk.orig apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmpm.cc apt-0.5.15cnc5/apt-pkg/rpm/rpmpm.cc
--- apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmpm.cc 2003-12-23 23:19:20 +0300
+++ apt-0.5.15cnc5/apt-pkg/rpm/rpmpm.cc 2004-01-16 14:29:19 +0300
@@ -392,7 +392,7 @@ bool pkgRPMExtPM::ExecRPM(Item::RPMOps o
Args[n++] = _config->Find("Dir::Bin::rpm","rpm").c_str();
- bool nodeps;
+ bool nodeps = false;
switch (op)
{
@@ -415,6 +415,8 @@ bool pkgRPMExtPM::ExecRPM(Item::RPMOps o
operation = "-e";
nodeps = true;
break;
+ default:
+ return false;
}
Args[n++] = operation;
@@ -654,8 +656,7 @@ pkgRPMLibPM::~pkgRPMLibPM()
bool pkgRPMLibPM::AddToTransaction(Item::RPMOps op, vector<const char*> &files)
{
- int debug = _config->FindB("Debug::pkgRPMPM", false);
- int n = 0, rc, xx;
+ int rc;
FD_t fd;
rpmHeader hdr;
@@ -735,7 +736,6 @@ bool pkgRPMLibPM::Process(vector<const c
{
int rc = 0;
bool Success = false;
- int debug = _config->FindB("Debug::pkgRPMPM", false);
string Dir = _config->Find("RPM::RootDir");
rpmReadConfigFiles(NULL, NULL);
diff -uprk.orig apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmsystem.cc apt-0.5.15cnc5/apt-pkg/rpm/rpmsystem.cc
--- apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmsystem.cc 2003-12-23 23:19:32 +0300
+++ apt-0.5.15cnc5/apt-pkg/rpm/rpmsystem.cc 2004-01-16 14:33:07 +0300
@@ -249,7 +249,7 @@ bool rpmSystem::AddStatusFiles(vector<pk
// System::AddSourceFiles - Register aditional source files /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool rpmSystem::AddSourceFiles(vector<pkgIndexFile *> &List)
+void rpmSystem::AddSourceFiles(vector<pkgIndexFile *> &List)
{
const Configuration::Item *Top;
Top = _config->Tree("APT::Arguments");
@@ -266,7 +266,6 @@ bool rpmSystem::AddSourceFiles(vector<pk
}
}
}
- return true;
}
/*}}}*/
#ifdef OLD_FILEDEPS
diff -uprk.orig apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmsystem.h apt-0.5.15cnc5/apt-pkg/rpm/rpmsystem.h
--- apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmsystem.h 2003-12-23 23:19:37 +0300
+++ apt-0.5.15cnc5/apt-pkg/rpm/rpmsystem.h 2004-01-16 14:33:07 +0300
@@ -60,7 +60,7 @@ class rpmSystem : public pkgSystem
virtual bool ArchiveSupported(const char *Type);
virtual signed Score(Configuration const &Cnf);
virtual bool AddStatusFiles(vector<pkgIndexFile *> &List);
- virtual bool AddSourceFiles(vector<pkgIndexFile *> &List);
+ virtual void AddSourceFiles(vector<pkgIndexFile *> &List);
virtual bool FindIndex(pkgCache::PkgFileIterator File,
pkgIndexFile *&Found) const;
virtual bool ProcessCache(pkgDepCache &Cache,pkgProblemResolver &Fix);
diff -uprk.orig apt-0.5.15cnc5.orig/cmdline/apt-get.cc apt-0.5.15cnc5/cmdline/apt-get.cc
--- apt-0.5.15cnc5.orig/cmdline/apt-get.cc 2003-12-23 23:30:50 +0300
+++ apt-0.5.15cnc5/cmdline/apt-get.cc 2004-01-16 21:55:48 +0300
@@ -3078,6 +3078,15 @@ int main(int argc,const char *argv[])
return 100;
}
+ // See if the help should be shown
+ if (_config->FindB("help") == true ||
+ _config->FindB("version") == true ||
+ CmdL.FileSize() == 0)
+ {
+ ShowHelp(CmdL);
+ return 0;
+ }
+
// CNC:2003-11-21
if (CmdL.FileSize() != 1)
{
@@ -3102,15 +3111,6 @@ int main(int argc,const char *argv[])
_config->Set("APT::Arguments::", *I);
}
- // See if the help should be shown
- if (_config->FindB("help") == true ||
- _config->FindB("version") == true ||
- CmdL.FileSize() == 0)
- {
- ShowHelp(CmdL);
- return 0;
- }
-
// Deal with stdout not being a tty
if (ttyname(STDOUT_FILENO) == 0 && _config->FindI("quiet",0) < 1)
_config->Set("quiet","1");

View File

@ -27,9 +27,14 @@ which helps to determine which of the branches is really used.)
imz@altlinux.ru, 28 Sep 2002.
--- apt-0.5.4cnc9/apt-pkg/deb/debsrcrecords.h.getsrc 2002-07-25 22:07:18 +0400
+++ apt-0.5.4cnc9/apt-pkg/deb/debsrcrecords.h 2002-10-29 00:45:07 +0300
@@ -34,6 +34,9 @@
Ported to apt-0.5.15cnc4.
avd@altlinux.org 2003-12-09
diff -uprk.orig apt-0.5.15cnc5.orig/apt-pkg/deb/debsrcrecords.h apt-0.5.15cnc5/apt-pkg/deb/debsrcrecords.h
--- apt-0.5.15cnc5.orig/apt-pkg/deb/debsrcrecords.h 2003-12-23 23:19:00 +0300
+++ apt-0.5.15cnc5/apt-pkg/deb/debsrcrecords.h 2004-01-16 15:18:13 +0300
@@ -34,6 +34,9 @@ class debSrcRecordParser : public pkgSrc
virtual bool Step() {iOffset = Tags.Offset(); return Tags.Step(Sect);};
virtual bool Jump(unsigned long Off) {iOffset = Off; return Tags.Jump(Sect,Off);};
@ -39,23 +44,13 @@ imz@altlinux.ru, 28 Sep 2002.
virtual string Package() const {return Sect.FindS("Package");};
virtual string Version() const {return Sect.FindS("Version");};
virtual string Maintainer() const {return Sect.FindS("Maintainer");};
--- apt-0.5.4cnc9/apt-pkg/rpm/rpmsrcrecords.h.getsrc 2002-08-09 00:07:33 +0400
+++ apt-0.5.4cnc9/apt-pkg/rpm/rpmsrcrecords.h 2002-10-29 00:45:07 +0300
@@ -44,6 +44,8 @@
virtual bool Step();
virtual bool Jump(unsigned long Off);
+ virtual string FileName() const;
+
virtual string Package() const;
virtual string Version() const;
virtual string Maintainer() const;
--- apt-0.5.4cnc9/apt-pkg/rpm/rpmrecords.cc.getsrc 2002-08-19 20:37:48 +0400
+++ apt-0.5.4cnc9/apt-pkg/rpm/rpmrecords.cc 2002-10-29 01:02:58 +0300
@@ -174,7 +174,12 @@
/* */
string rpmRecordParser::SourcePkg()
diff -uprk.orig apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmrecords.cc apt-0.5.15cnc5/apt-pkg/rpm/rpmrecords.cc
--- apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmrecords.cc 2003-12-23 23:19:50 +0300
+++ apt-0.5.15cnc5/apt-pkg/rpm/rpmrecords.cc 2004-01-16 15:18:13 +0300
@@ -178,7 +178,12 @@ string rpmRecordParser::SourcePkg()
{
// This must be the *package* name, not the *file* name. We have no
// current way to extract it safely from the file name.
- return "";
+ char *str;
+ int_32 count, type;
@ -66,9 +61,10 @@ imz@altlinux.ru, 28 Sep 2002.
}
/*}}}*/
--- apt-0.5.4cnc9/apt-pkg/rpm/rpmsrcrecords.cc.getsrc 2002-08-09 00:07:33 +0400
+++ apt-0.5.4cnc9/apt-pkg/rpm/rpmsrcrecords.cc 2002-10-29 00:57:41 +0300
@@ -143,6 +143,20 @@
diff -uprk.orig apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmsrcrecords.cc apt-0.5.15cnc5/apt-pkg/rpm/rpmsrcrecords.cc
--- apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmsrcrecords.cc 2003-12-23 23:20:00 +0300
+++ apt-0.5.15cnc5/apt-pkg/rpm/rpmsrcrecords.cc 2004-01-16 15:18:13 +0300
@@ -123,6 +123,20 @@ bool rpmSrcRecordParser::Jump(unsigned l
return true;
}
@ -89,9 +85,22 @@ imz@altlinux.ru, 28 Sep 2002.
string rpmSrcRecordParser::Package() const
{
char *str;
--- apt-0.5.4cnc9/apt-pkg/srcrecords.cc.getsrc 2002-07-23 21:54:50 +0400
+++ apt-0.5.4cnc9/apt-pkg/srcrecords.cc 2002-10-29 00:45:07 +0300
@@ -82,7 +82,7 @@
diff -uprk.orig apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmsrcrecords.h apt-0.5.15cnc5/apt-pkg/rpm/rpmsrcrecords.h
--- apt-0.5.15cnc5.orig/apt-pkg/rpm/rpmsrcrecords.h 2003-12-23 23:20:01 +0300
+++ apt-0.5.15cnc5/apt-pkg/rpm/rpmsrcrecords.h 2004-01-16 15:18:13 +0300
@@ -44,6 +44,8 @@ public:
virtual bool Step();
virtual bool Jump(unsigned long Off);
+ virtual string FileName() const;
+
virtual string Package() const;
virtual string Version() const;
virtual string Maintainer() const;
diff -uprk.orig apt-0.5.15cnc5.orig/apt-pkg/srcrecords.cc apt-0.5.15cnc5/apt-pkg/srcrecords.cc
--- apt-0.5.15cnc5.orig/apt-pkg/srcrecords.cc 2003-12-23 23:19:13 +0300
+++ apt-0.5.15cnc5/apt-pkg/srcrecords.cc 2004-01-16 15:18:13 +0300
@@ -82,7 +82,7 @@ bool pkgSrcRecords::Restart()
/*}}}*/
// SrcRecords::Find - Find the first source package with the given name /*{{{*/
// ---------------------------------------------------------------------
@ -100,7 +109,7 @@ imz@altlinux.ru, 28 Sep 2002.
returns the first found. A 'cursor' like system is used to allow this
function to be called multiple times to get successive entries */
pkgSrcRecords::Parser *pkgSrcRecords::Find(const char *Package,bool SrcOnly)
@@ -92,6 +92,8 @@
@@ -92,6 +92,8 @@ pkgSrcRecords::Parser *pkgSrcRecords::Fi
while (true)
{
@ -109,7 +118,7 @@ imz@altlinux.ru, 28 Sep 2002.
// Step to the next record, possibly switching files
while ((*Current)->Step() == false)
{
@@ -107,7 +109,7 @@
@@ -107,7 +109,7 @@ pkgSrcRecords::Parser *pkgSrcRecords::Fi
return 0;
// Source name hit
@ -117,10 +126,11 @@ imz@altlinux.ru, 28 Sep 2002.
+ if ((*Current)->FileName() == Package)
return *Current;
if (SrcOnly == true)
--- apt-0.5.4cnc9/apt-pkg/srcrecords.h.getsrc 2002-07-25 22:07:18 +0400
+++ apt-0.5.4cnc9/apt-pkg/srcrecords.h 2002-10-29 00:45:07 +0300
@@ -66,6 +66,8 @@
diff -uprk.orig apt-0.5.15cnc5.orig/apt-pkg/srcrecords.h apt-0.5.15cnc5/apt-pkg/srcrecords.h
--- apt-0.5.15cnc5.orig/apt-pkg/srcrecords.h 2003-12-23 23:20:10 +0300
+++ apt-0.5.15cnc5/apt-pkg/srcrecords.h 2004-01-16 15:18:13 +0300
@@ -66,6 +66,8 @@ class pkgSrcRecords
virtual unsigned long Offset() = 0;
virtual string AsStr() = 0;

View File

@ -1,12 +1,12 @@
2003-06-24 Dmitry V. Levin <ldv@altlinux.org>
2004-01-16 Dmitry V. Levin <ldv@altlinux.org>
* cmdline/apt-get.cc (TryToInstall):
Optimize pure virtual packages install.
Add APT::Install::Virtual support.
--- apt-0.5.5cnc4.1.orig/cmdline/apt-get.cc 2003-06-24 21:24:10 +0400
+++ apt-0.5.5cnc4.1/cmdline/apt-get.cc 2003-06-24 21:29:08 +0400
@@ -1042,13 +1042,25 @@ bool TryToInstall(pkgCache::PkgIterator
--- apt-0.5.15cnc5/cmdline/apt-get.cc.orig 2003-12-23 23:30:50 +0300
+++ apt-0.5.15cnc5/cmdline/apt-get.cc 2004-01-16 15:06:11 +0300
@@ -1208,14 +1208,24 @@ bool TryToInstall(pkgCache::PkgIterator
{
/* This is a pure virtual package and there is a single available
provides */
@ -15,25 +15,33 @@
+ if (Cache[Pkg].CandidateVer == 0 && Pkg->ProvidesList != 0)
{
- pkgCache::PkgIterator Tmp = Pkg.ProvidesList().OwnerPkg();
- ioprintf(c1out,_("Note, selecting %s instead of %s\n"),
- // CNC:2003-11-21 - Check if the current candidate is really
- // providing that dependency
- ioprintf(c1out,_("Selecting %s for '%s'\n"),
- Tmp.Name(),Pkg.Name());
- Pkg = Tmp;
+ if (!Remove)
+ for (pkgCache::PrvIterator pv = Pkg.ProvidesList(); pv.end() == false; pv++)
+ {
+ pkgCache::PkgIterator po = pv.OwnerPkg();
+ pkgCache::PkgIterator Tmp = pv.OwnerPkg();
+ // Just marked for install?
+ if (Cache[po].Install() && Cache[po].NewInstall())
+ if (Cache[Tmp].Install() && Cache[Tmp].NewInstall())
+ return true;
+ }
+
+ if ((Pkg.ProvidesList()->NextProvides == 0 ||
+ (!Remove && _config->FindB("APT::Install::Virtual", false))))
+ {
+ pkgCache::PkgIterator po = Pkg.ProvidesList().OwnerPkg();
+ pkgCache::PkgIterator Tmp = Pkg.ProvidesList().OwnerPkg();
+ ioprintf(c1out,_("Note, selecting %s instead of %s\n"),
+ po.Name(),Pkg.Name());
+ Pkg = po;
+ Tmp.Name(),Pkg.Name());
+
pkgCache::VerIterator Ver = Cache[Tmp].CandidateVerIter(Cache);
pkgCache::PrvIterator Prv = Ver.ProvidesList();
bool Found = false;
@@ -1249,6 +1259,7 @@ bool TryToInstall(pkgCache::PkgIterator
}
}
Pkg = Tmp;
+ }
}

View File

@ -0,0 +1,21 @@
diff -uprk.orig apt-0.5.15cnc5.orig/configure.in apt-0.5.15cnc5/configure.in
--- apt-0.5.15cnc5.orig/configure.in 2003-12-23 23:15:40 +0300
+++ apt-0.5.15cnc5/configure.in 2004-01-16 19:50:16 +0300
@@ -11,8 +11,6 @@ AM_MAINTAINER_MODE
AC_CONFIG_HEADER([include/config.h:buildlib/config.h.in])
-AC_PROG_LIBTOOL
-
dnl Check our C compiler
AC_PROG_CC
AM_PROG_CC_C_O
@@ -22,6 +20,8 @@ dnl Check for other programs
AC_PROG_CXX
AC_PROG_CPP
+AC_PROG_LIBTOOL
+
dnl Checks for sockets
SAVE_LIBS="$LIBS"
LIBS=""

View File

@ -1,6 +1,7 @@
--- apt-0.5.4cnc3.orig/apt-pkg/acquire-item.cc Sat Jul 27 13:02:53 2002
+++ apt-0.5.4cnc3/apt-pkg/acquire-item.cc Sat Jul 27 13:34:34 2002
@@ -786,7 +786,10 @@
diff -uprk.orig apt-0.5.15cnc5.orig/apt-pkg/acquire-item.cc apt-0.5.15cnc5/apt-pkg/acquire-item.cc
--- apt-0.5.15cnc5.orig/apt-pkg/acquire-item.cc 2003-12-23 23:20:28 +0300
+++ apt-0.5.15cnc5/apt-pkg/acquire-item.cc 2004-01-16 15:26:05 +0300
@@ -824,7 +824,10 @@ void pkgAcqArchive::Done(string Message,
{
if (Md5Hash != MD5)
{
@ -12,7 +13,7 @@
ErrorText = _("MD5Sum mismatch");
Rename(DestFile,DestFile + ".FAILED");
return;
@@ -916,6 +919,9 @@
@@ -968,6 +971,9 @@ void pkgAcqFile::Done(string Message,uns
{
if (Md5Hash != MD5)
{
@ -22,9 +23,10 @@
Status = StatError;
ErrorText = "MD5Sum mismatch";
Rename(DestFile,DestFile + ".FAILED");
--- apt-0.5.4cnc3.orig/cmdline/apt-get.cc Sat Jul 27 13:02:53 2002
+++ apt-0.5.4cnc3/cmdline/apt-get.cc Sat Jul 27 13:41:35 2002
@@ -1709,6 +1709,9 @@
diff -uprk.orig apt-0.5.15cnc5.orig/cmdline/apt-get.cc apt-0.5.15cnc5/cmdline/apt-get.cc
--- apt-0.5.15cnc5.orig/cmdline/apt-get.cc 2003-12-23 23:30:50 +0300
+++ apt-0.5.15cnc5/cmdline/apt-get.cc 2004-01-16 15:26:05 +0300
@@ -2382,6 +2382,9 @@ bool DoSource(CommandLine &CmdL)
I->Type != "tar")
continue;

View File

@ -1,6 +1,7 @@
--- apt-0.5.5cnc1/methods/gpg.cc.orig 2003-01-31 16:58:32 +0300
+++ apt-0.5.5cnc1/methods/gpg.cc 2003-02-07 19:09:05 +0300
@@ -195,7 +195,7 @@ char *getFileSigner(const char *file, co
diff -uprk.orig apt-0.5.15cnc5.orig/methods/gpg.cc apt-0.5.15cnc5/methods/gpg.cc
--- apt-0.5.15cnc5.orig/methods/gpg.cc 2003-12-23 23:24:04 +0300
+++ apt-0.5.15cnc5/methods/gpg.cc 2004-01-16 15:23:02 +0300
@@ -196,7 +196,7 @@ char *getFileSigner(const char *file, co
else if (pid == 0)
{
string path = _config->Find("Dir::Bin::gpg", "/usr/bin/gpg");
@ -9,7 +10,7 @@
const char *argv[16];
int argc = 0;
@@ -206,17 +206,16 @@ char *getFileSigner(const char *file, co
@@ -207,17 +207,16 @@ char *getFileSigner(const char *file, co
dup2(fd[1], STDERR_FILENO);
unsetenv("LANG");

View File

@ -3,8 +3,9 @@
* apt-pkg/packagemanager.cc (pkgPackageManager::CheckRConflicts):
Ignore versionless reverse dependencies.
--- apt-0.5.4cnc9/apt-pkg/packagemanager.cc.orig 2002-12-26 21:29:50 +0300
+++ apt-0.5.4cnc9/apt-pkg/packagemanager.cc 2002-12-26 21:30:48 +0300
diff -uprk.orig apt-0.5.15cnc5.orig/apt-pkg/packagemanager.cc apt-0.5.15cnc5/apt-pkg/packagemanager.cc
--- apt-0.5.15cnc5.orig/apt-pkg/packagemanager.cc 2003-12-23 23:20:35 +0300
+++ apt-0.5.15cnc5/apt-pkg/packagemanager.cc 2004-01-16 15:27:18 +0300
@@ -216,7 +216,7 @@ bool pkgPackageManager::CheckRConflicts(
if (D.ParentPkg() == Pkg || D.ParentVer() != D.ParentPkg().CurrentVer())
continue;

View File

@ -1,7 +1,7 @@
diff -uprk.orig apt-0.5.5cnc4.1.orig/apt-pkg/init.cc apt-0.5.5cnc4.1/apt-pkg/init.cc
--- apt-0.5.5cnc4.1.orig/apt-pkg/init.cc 2003-09-28 14:11:04 +0400
+++ apt-0.5.5cnc4.1/apt-pkg/init.cc 2003-09-28 14:11:22 +0400
@@ -36,44 +36,44 @@ bool pkgInitConfig(Configuration &Cnf)
diff -uprk.orig apt-0.5.15cnc5.orig/apt-pkg/init.cc apt-0.5.15cnc5/apt-pkg/init.cc
--- apt-0.5.15cnc5.orig/apt-pkg/init.cc 2004-01-16 15:21:38 +0300
+++ apt-0.5.15cnc5/apt-pkg/init.cc 2004-01-16 15:21:01 +0300
@@ -40,44 +40,44 @@ bool pkgInitConfig(Configuration &Cnf)
// General APT things
if (strcmp(COMMON_OS,"linux") == 0 ||
strcmp(COMMON_OS,"unknown") == 0)
@ -55,7 +55,7 @@ diff -uprk.orig apt-0.5.5cnc4.1.orig/apt-pkg/init.cc apt-0.5.5cnc4.1/apt-pkg/ini
- Cnf.Set("Dir::Etc::main","apt.conf");
- Cnf.Set("Dir::Etc::parts","apt.conf.d");
- Cnf.Set("Dir::Etc::preferences","preferences");
- Cnf.Set("Dir::Bin::methods","/usr/lib/apt");
- Cnf.Set("Dir::Bin::methods",LIBDIR "/apt/methods");
- Cnf.Set("Acquire::ComprExtension", ".bz2");
+ Cnf.CndSet("Dir::Etc::sourceparts","sources.list.d");
+ Cnf.CndSet("Dir::Etc::vendorlist","vendors.list");
@ -63,15 +63,15 @@ diff -uprk.orig apt-0.5.5cnc4.1.orig/apt-pkg/init.cc apt-0.5.5cnc4.1/apt-pkg/ini
+ Cnf.CndSet("Dir::Etc::main","apt.conf");
+ Cnf.CndSet("Dir::Etc::parts","apt.conf.d");
+ Cnf.CndSet("Dir::Etc::preferences","preferences");
+ Cnf.CndSet("Dir::Bin::methods","/usr/lib/apt");
+ Cnf.CndSet("Dir::Bin::methods",LIBDIR "/apt/methods");
+ Cnf.CndSet("Acquire::ComprExtension", ".bz2");
bool Res = true;
diff -uprk.orig apt-0.5.5cnc4.1.orig/cmdline/apt-cache.cc apt-0.5.5cnc4.1/cmdline/apt-cache.cc
--- apt-0.5.5cnc4.1.orig/cmdline/apt-cache.cc 2003-03-08 02:10:43 +0300
+++ apt-0.5.5cnc4.1/cmdline/apt-cache.cc 2003-09-28 14:11:22 +0400
@@ -1611,8 +1611,8 @@ int main(int argc,const char *argv[])
diff -uprk.orig apt-0.5.15cnc5.orig/cmdline/apt-cache.cc apt-0.5.15cnc5/cmdline/apt-cache.cc
--- apt-0.5.15cnc5.orig/cmdline/apt-cache.cc 2003-12-23 23:31:15 +0300
+++ apt-0.5.15cnc5/cmdline/apt-cache.cc 2004-01-16 15:21:01 +0300
@@ -1952,8 +1952,8 @@ int main(int argc,const char *argv[])
// Parse the command line and initialize the package library
CommandLine CmdL(Args,_config);
@ -82,10 +82,10 @@ diff -uprk.orig apt-0.5.5cnc4.1.orig/cmdline/apt-cache.cc apt-0.5.5cnc4.1/cmdlin
pkgInitSystem(*_config,_system) == false)
{
_error->DumpErrors();
diff -uprk.orig apt-0.5.5cnc4.1.orig/cmdline/apt-cdrom.cc apt-0.5.5cnc4.1/cmdline/apt-cdrom.cc
--- apt-0.5.5cnc4.1.orig/cmdline/apt-cdrom.cc 2003-09-28 14:11:04 +0400
+++ apt-0.5.5cnc4.1/cmdline/apt-cdrom.cc 2003-09-28 14:11:22 +0400
@@ -904,8 +904,8 @@ int main(int argc,const char *argv[])
diff -uprk.orig apt-0.5.15cnc5.orig/cmdline/apt-cdrom.cc apt-0.5.15cnc5/cmdline/apt-cdrom.cc
--- apt-0.5.15cnc5.orig/cmdline/apt-cdrom.cc 2003-12-23 23:31:19 +0300
+++ apt-0.5.15cnc5/cmdline/apt-cdrom.cc 2004-01-16 15:21:01 +0300
@@ -901,8 +901,8 @@ int main(int argc,const char *argv[])
// Parse the command line and initialize the package library
CommandLine CmdL(Args,_config);
@ -96,9 +96,9 @@ diff -uprk.orig apt-0.5.5cnc4.1.orig/cmdline/apt-cdrom.cc apt-0.5.5cnc4.1/cmdlin
pkgInitSystem(*_config,_system) == false)
{
_error->DumpErrors();
diff -uprk.orig apt-0.5.5cnc4.1.orig/cmdline/apt-config.cc apt-0.5.5cnc4.1/cmdline/apt-config.cc
--- apt-0.5.5cnc4.1.orig/cmdline/apt-config.cc 2003-03-08 02:10:37 +0300
+++ apt-0.5.5cnc4.1/cmdline/apt-config.cc 2003-09-28 14:11:22 +0400
diff -uprk.orig apt-0.5.15cnc5.orig/cmdline/apt-config.cc apt-0.5.15cnc5/cmdline/apt-config.cc
--- apt-0.5.15cnc5.orig/cmdline/apt-config.cc 2003-12-23 23:31:21 +0300
+++ apt-0.5.15cnc5/cmdline/apt-config.cc 2004-01-16 15:21:01 +0300
@@ -109,8 +109,8 @@ int main(int argc,const char *argv[])
// Parse the command line and initialize the package library
@ -110,24 +110,10 @@ diff -uprk.orig apt-0.5.5cnc4.1.orig/cmdline/apt-config.cc apt-0.5.5cnc4.1/cmdli
pkgInitSystem(*_config,_system) == false)
{
_error->DumpErrors();
diff -uprk.orig apt-0.5.5cnc4.1.orig/cmdline/apt-extracttemplates.cc apt-0.5.5cnc4.1/cmdline/apt-extracttemplates.cc
--- apt-0.5.5cnc4.1.orig/cmdline/apt-extracttemplates.cc 2003-03-08 02:10:21 +0300
+++ apt-0.5.5cnc4.1/cmdline/apt-extracttemplates.cc 2003-09-28 14:11:22 +0400
@@ -359,8 +359,8 @@ int main(int argc, const char **argv)
// Parse the command line and initialize the package library
CommandLine CmdL(Args,_config);
- if (pkgInitConfig(*_config) == false ||
- CmdL.Parse(argc,argv) == false ||
+ if (CmdL.Parse(argc,argv) == false ||
+ pkgInitConfig(*_config) == false ||
pkgInitSystem(*_config,_system) == false)
{
_error->DumpErrors();
diff -uprk.orig apt-0.5.5cnc4.1.orig/cmdline/apt-get.cc apt-0.5.5cnc4.1/cmdline/apt-get.cc
--- apt-0.5.5cnc4.1.orig/cmdline/apt-get.cc 2003-09-28 14:11:04 +0400
+++ apt-0.5.5cnc4.1/cmdline/apt-get.cc 2003-09-28 14:11:22 +0400
@@ -2497,8 +2497,8 @@ int main(int argc,const char *argv[])
diff -uprk.orig apt-0.5.15cnc5.orig/cmdline/apt-get.cc apt-0.5.15cnc5/cmdline/apt-get.cc
--- apt-0.5.15cnc5.orig/cmdline/apt-get.cc 2003-12-23 23:30:50 +0300
+++ apt-0.5.15cnc5/cmdline/apt-get.cc 2004-01-16 15:21:01 +0300
@@ -3067,8 +3067,8 @@ int main(int argc,const char *argv[])
// Parse the command line and initialize the package library
CommandLine CmdL(Args,_config);
@ -138,10 +124,10 @@ diff -uprk.orig apt-0.5.5cnc4.1.orig/cmdline/apt-get.cc apt-0.5.5cnc4.1/cmdline/
pkgInitSystem(*_config,_system) == false)
{
if (_config->FindB("version") == true)
diff -uprk.orig apt-0.5.5cnc4.1.orig/cmdline/apt-shell.cc apt-0.5.5cnc4.1/cmdline/apt-shell.cc
--- apt-0.5.5cnc4.1.orig/cmdline/apt-shell.cc 2003-03-08 02:10:37 +0300
+++ apt-0.5.5cnc4.1/cmdline/apt-shell.cc 2003-09-28 14:11:22 +0400
@@ -3738,8 +3738,8 @@ int main(int argc,const char *argv[])
diff -uprk.orig apt-0.5.15cnc5.orig/cmdline/apt-shell.cc apt-0.5.15cnc5/cmdline/apt-shell.cc
--- apt-0.5.15cnc5.orig/cmdline/apt-shell.cc 2003-12-23 23:31:46 +0300
+++ apt-0.5.15cnc5/cmdline/apt-shell.cc 2004-01-16 15:21:01 +0300
@@ -4303,8 +4303,8 @@ int main(int argc,const char *argv[])
// Parse the command line and initialize the package library
CommandLine CmdL(CommandArgs(""),_config);
@ -152,17 +138,3 @@ diff -uprk.orig apt-0.5.5cnc4.1.orig/cmdline/apt-shell.cc apt-0.5.5cnc4.1/cmdlin
pkgInitSystem(*_config,_system) == false)
{
if (_config->FindB("version") == true)
diff -uprk.orig apt-0.5.5cnc4.1.orig/cmdline/apt-sortpkgs.cc apt-0.5.5cnc4.1/cmdline/apt-sortpkgs.cc
--- apt-0.5.5cnc4.1.orig/cmdline/apt-sortpkgs.cc 2003-03-08 02:10:30 +0300
+++ apt-0.5.5cnc4.1/cmdline/apt-sortpkgs.cc 2003-09-28 14:11:22 +0400
@@ -180,8 +180,8 @@ int main(unsigned int argc,const char *a
// Parse the command line and initialize the package library
CommandLine CmdL(Args,_config);
- if (pkgInitConfig(*_config) == false ||
- CmdL.Parse(argc,argv) == false ||
+ if (CmdL.Parse(argc,argv) == false ||
+ pkgInitConfig(*_config) == false ||
pkgInitSystem(*_config,_system) == false)
{
_error->DumpErrors();

View File

@ -0,0 +1,39 @@
diff -uprk.orig apt-0.5.15cnc5.orig/configure.in apt-0.5.15cnc5/configure.in
--- apt-0.5.15cnc5.orig/configure.in 2003-12-23 23:15:40 +0300
+++ apt-0.5.15cnc5/configure.in 2004-01-15 19:08:18 +0300
@@ -72,7 +72,7 @@ else
[AC_MSG_ERROR([Can't find libbz2 library])])
AC_CHECK_LIB(z,gzopen, [],
[AC_MSG_ERROR([Can't find libz library])])
- AC_CHECK_HEADERS(db1/db.h)
+ dnl AC_CHECK_HEADERS(db1/db.h)
CPPFLAGS="$CPPFLAGS -I/usr/include/rpm"
AC_CHECK_HEADER(rpm/rpmlib.h, [],
@@ -80,12 +80,13 @@ else
if test $RPM_VERSION_MAJOR -lt 4; then
RPMLIBS="-lrpm -lz -lbz2 -lpopt"
+ AC_CHECK_HEADERS(db1/db.h)
else
AC_CHECK_LIB(rpmdb,rpmdbOpen,
[RPMDBLIBS="-lrpmdb"],
- [RPMDBLIBS="-ldb-3.1"],
+ [RPMDBLIBS="-ldb"],
[-lrpm -lrpmio -lz -lbz2 -lpopt])
- RPMLIBS="-lrpm $RPMDBLIBS -lrpmio -lz -lbz2 -lpopt"
+ RPMLIBS="-lrpm $RPMDBLIBS"
fi
AC_MSG_CHECKING(for RPM libraries)
AC_MSG_RESULT($RPMLIBS)
diff -uprk.orig apt-0.5.15cnc5.orig/tools/cached_md5.cc apt-0.5.15cnc5/tools/cached_md5.cc
--- apt-0.5.15cnc5.orig/tools/cached_md5.cc 2003-12-23 23:16:37 +0300
+++ apt-0.5.15cnc5/tools/cached_md5.cc 2004-01-15 19:07:44 +0300
@@ -7,6 +7,7 @@
#include <errno.h>
#include <fcntl.h>
#include <rpm/rpmlib.h>
+#include <rpm/misc.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>

View File

@ -0,0 +1,128 @@
2004-01-16 Dmitry V. Levin <ldv@altlinux.org>
* apt-pkg/rpm/rpmpm.cc(pkgRPMPM::ExecRPM,pkgRPMLibPM::Process):
Honor "quiet" config option.
Pass "fancypercent" option.
--- apt-0.5.15cnc5/apt-pkg/rpm/rpmpm.cc.orig 2004-01-16 14:56:02 +0300
+++ apt-0.5.15cnc5/apt-pkg/rpm/rpmpm.cc 2004-01-16 14:58:37 +0300
@@ -389,6 +389,7 @@ bool pkgRPMExtPM::ExecRPM(Item::RPMOps o
const char *operation;
unsigned int n = 0;
bool Interactive = _config->FindB("RPM::Interactive",true);
+ int quiet = _config->FindI("quiet",0);
Args[n++] = _config->Find("Dir::Bin::rpm","rpm").c_str();
@@ -397,18 +398,12 @@ bool pkgRPMExtPM::ExecRPM(Item::RPMOps o
switch (op)
{
case Item::RPMInstall:
- if (Interactive)
- operation = "-ivh";
- else
- operation = "-iv";
+ operation = "-i";
nodeps = true;
break;
case Item::RPMUpgrade:
- if (Interactive)
- operation = "-Uvh";
- else
- operation = "-Uv";
+ operation = "-U";
break;
case Item::RPMErase:
@@ -420,8 +415,22 @@ bool pkgRPMExtPM::ExecRPM(Item::RPMOps o
}
Args[n++] = operation;
- if (Interactive == false && op != Item::RPMErase)
- Args[n++] = "--percent";
+ if (quiet <= 2 && op != Item::RPMErase)
+ {
+ Args[n++] = "-v";
+ if (quiet <= 1)
+ {
+ if (Interactive)
+ {
+ Args[n++] = "-h";
+ if (quiet <= 0)
+ Args[n++] = "--fancypercent";
+ } else
+ {
+ Args[n++] = "--percent";
+ }
+ }
+ }
string rootdir = _config->Find("RPM::RootDir", "");
if (!rootdir.empty())
@@ -550,6 +559,7 @@ bool pkgRPMExtPM::ExecRPM(Item::RPMOps o
return true;
}
+ if (quiet <= 2)
cout << _("Executing RPM (")<<cmd<<")..." << endl;
cout << flush;
@@ -629,6 +639,7 @@ bool pkgRPMExtPM::ExecRPM(Item::RPMOps o
return _error->Error(_("Sub-process %s exited unexpectedly"),Args[0]);
}
+ if (quiet <= 2)
cout << _("Done.") << endl;
return true;
@@ -745,6 +756,7 @@ bool pkgRPMLibPM::Process(vector<const c
int rc = 0;
bool Success = false;
string Dir = _config->Find("RPM::RootDir");
+ int quiet = _config->FindI("quiet",0);
rpmReadConfigFiles(NULL, NULL);
int probFilter = 0;
@@ -791,10 +803,21 @@ bool pkgRPMLibPM::Process(vector<const c
probFilter |= RPMPROB_FILTER_REPLACENEWFILES;
}
- if (_config->FindB("RPM::Interactive", true))
- notifyFlags |= INSTALL_LABEL | INSTALL_HASH;
- else
- notifyFlags |= INSTALL_LABEL | INSTALL_PERCENT;
+ if (quiet <= 2)
+ notifyFlags |= INSTALL_LABEL;
+
+ if (quiet <= 1)
+ {
+ if (_config->FindB("RPM::Interactive", true))
+ {
+ notifyFlags |= INSTALL_HASH;
+ extern int fancyPercents;
+ fancyPercents = (quiet <= 0) ? 1 : 0;
+ } else
+ {
+ notifyFlags |= INSTALL_PERCENT;
+ }
+ }
if (uninstall.empty() == false)
AddToTransaction(Item::RPMErase, uninstall);
@@ -848,6 +871,7 @@ bool pkgRPMLibPM::Process(vector<const c
goto exit;
}
+ if (quiet <= 2)
cout << _("Committing changes...") << endl << flush;
#if RPM_VERSION >= 0x040100
@@ -872,6 +896,7 @@ bool pkgRPMLibPM::Process(vector<const c
if (rc < 0)
_error->Warning(_("Some errors occurred while running transaction"));
else
+ if (quiet <= 2)
cout << _("Done.") << endl;
}
rpmpsFree(probs);

View File

@ -0,0 +1,31 @@
2004-01-16 Dmitry V. Levin <ldv@altlinux.org>
* apt-pkg/rpm/rpmpm.cc(pkgRPMPM::ExecRPM):
Report actual options being passed to rpm.
--- apt-0.5.15cnc5/apt-pkg/rpm/rpmpm.cc.orig 2004-01-16 14:55:17 +0300
+++ apt-0.5.15cnc5/apt-pkg/rpm/rpmpm.cc 2004-01-16 14:56:02 +0300
@@ -497,6 +497,14 @@ bool pkgRPMExtPM::ExecRPM(Item::RPMOps o
if (_config->FindB("RPM::Order",false) == false)
Args[n++] = "--noorder";
+
+ string cmd;
+ for (unsigned i = 0; i < n; ++i)
+ {
+ if (!cmd.empty())
+ cmd += ' ';
+ cmd += Args[i];
+ }
bool FilesInArgs = true;
char *ArgsFileName = NULL;
@@ -542,7 +550,7 @@ bool pkgRPMExtPM::ExecRPM(Item::RPMOps o
return true;
}
- cout << _("Executing RPM (")<<operation<<")..." << endl;
+ cout << _("Executing RPM (")<<cmd<<")..." << endl;
cout << flush;
clog << flush;

View File

@ -0,0 +1,39 @@
diff -uprk.orig apt-0.5.15cnc5.orig/cmdline/Makefile.am apt-0.5.15cnc5/cmdline/Makefile.am
--- apt-0.5.15cnc5.orig/cmdline/Makefile.am 2003-12-23 23:31:00 +0300
+++ apt-0.5.15cnc5/cmdline/Makefile.am 2004-01-16 15:10:00 +0300
@@ -12,6 +12,6 @@ LDADD = ../apt-pkg/libapt-pkg.la $(RPMLI
apt_cache_SOURCES = apt-cache.cc
apt_get_SOURCES = apt-get.cc acqprogress.cc acqprogress.h
apt_shell_SOURCES = apt-shell.cc acqprogress.cc acqprogress.h
-apt_shell_LDADD = $(LDADD) -lreadline -lncurses
+apt_shell_LDADD = $(LDADD) -lreadline -ltinfo
apt_config_SOURCES = apt-config.cc
apt_cdrom_SOURCES = apt-cdrom.cc rpmindexcopy.cc rpmindexcopy.h
diff -uprk.orig apt-0.5.15cnc5.orig/cmdline/Makefile.in apt-0.5.15cnc5/cmdline/Makefile.in
--- apt-0.5.15cnc5.orig/cmdline/Makefile.in 2003-12-23 23:30:26 +0300
+++ apt-0.5.15cnc5/cmdline/Makefile.in 2004-01-16 15:10:00 +0300
@@ -181,7 +181,7 @@ LDADD = ../apt-pkg/libapt-pkg.la $(RPMLI
apt_cache_SOURCES = apt-cache.cc
apt_get_SOURCES = apt-get.cc acqprogress.cc acqprogress.h
apt_shell_SOURCES = apt-shell.cc acqprogress.cc acqprogress.h
-apt_shell_LDADD = $(LDADD) -lreadline -lncurses
+apt_shell_LDADD = $(LDADD) -lreadline -ltinfo
apt_config_SOURCES = apt-config.cc
apt_cdrom_SOURCES = apt-cdrom.cc rpmindexcopy.cc rpmindexcopy.h
subdir = cmdline
diff -uprk.orig apt-0.5.15cnc5.orig/configure.in apt-0.5.15cnc5/configure.in
--- apt-0.5.15cnc5.orig/configure.in 2003-12-23 23:15:40 +0300
+++ apt-0.5.15cnc5/configure.in 2004-01-16 15:10:00 +0300
@@ -121,10 +121,10 @@ fi
AM_CONDITIONAL(WITH_LUA, test "$enable_scripts" != "no")
dnl Check for apt-shell dependencies
-AC_CHECK_LIB(ncurses,tputs,
+AC_CHECK_LIB(tinfo,tputs,
[AC_CHECK_HEADER(readline/readline.h,
[AC_CHECK_LIB(readline,rl_completion_matches,
- [compile_aptshell=yes],,[-lncurses])])])
+ [compile_aptshell=yes],,[-ltinfo])])])
AM_CONDITIONAL(COMPILE_APTSHELL, test "$compile_aptshell" = "yes")
dnl Converts the ARCH to be something singular for this general CPU family

View File

@ -70,14 +70,26 @@ diff -uprk.orig apt-0.5.5cnc4.1.orig/apt-pkg/algorithms.h apt-0.5.5cnc4.1/apt-pk
};
bool pkgDistUpgrade(pkgDepCache &Cache);
diff -uprk.orig apt-0.5.15cnc5/apt-pkg/rpm/rpmpackagedata.h.orig apt-0.5.15cnc5/apt-pkg/rpm/rpmpackagedata.h
--- apt-0.5.15cnc5/apt-pkg/rpm/rpmpackagedata.h.orig 2003-12-23 23:19:39 +0300
+++ apt-0.5.15cnc5/apt-pkg/rpm/rpmpackagedata.h 2004-01-12 18:27:13 +0300
@@ -70,7 +70,7 @@
{
if (Priorities.find(Package) != Priorities.end())
return Priorities[Package];
- return pkgCache::State::Standard;
+ return pkgCache::State::Optional;
};
inline pkgCache::Flag::PkgFlags PkgFlags(string Package)
{return Flags[Package];};
diff -uprk.orig apt-0.5.5cnc4.1.orig/cmdline/apt-get.cc apt-0.5.5cnc4.1/cmdline/apt-get.cc
--- apt-0.5.5cnc4.1.orig/cmdline/apt-get.cc 2003-09-29 17:21:22 +0400
+++ apt-0.5.5cnc4.1/cmdline/apt-get.cc 2003-09-29 17:27:28 +0400
@@ -1056,7 +1056,17 @@ bool TryToInstall(pkgCache::PkgIterator
@@ -1222,7 +1222,17 @@ bool TryToInstall(pkgCache::PkgIterator
if ((Pkg.ProvidesList()->NextProvides == 0 ||
(!Remove && _config->FindB("APT::Install::Virtual", false))))
{
- pkgCache::PkgIterator po = Pkg.ProvidesList().OwnerPkg();
- pkgCache::PkgIterator Tmp = Pkg.ProvidesList().OwnerPkg();
+ unsigned long Size = 0;
+ for (pkgCache::PrvIterator I = Pkg.ProvidesList(); I.end() == false; I++)
+ Size++;
@ -87,8 +99,8 @@ diff -uprk.orig apt-0.5.5cnc4.1.orig/cmdline/apt-get.cc apt-0.5.5cnc4.1/cmdline/
+ *PEnd++ = I.OwnerPkg();
+ Fix.MakeScores();
+ qsort(PList,PEnd - PList,sizeof(*PList),&(Fix.ScoreSort));
+ pkgCache::PkgIterator po = pkgCache::PkgIterator(*Pkg.Cache(), *PList);
+ pkgCache::PkgIterator Tmp = pkgCache::PkgIterator(*Pkg.Cache(), *PList);
+
ioprintf(c1out,_("Note, selecting %s instead of %s\n"),
po.Name(),Pkg.Name());
Pkg = po;
Tmp.Name(),Pkg.Name());

View File

@ -1,36 +0,0 @@
diff -ur apt-0.5.4cnc3.orig/tools/genbasedir apt-0.5.4cnc3/tools/genbasedir
--- apt-0.5.4cnc3.orig/tools/genbasedir Sat Jul 27 13:02:53 2002
+++ apt-0.5.4cnc3/tools/genbasedir Sat Jul 27 14:05:42 2002
@@ -26,6 +26,8 @@
genbasedir /home/ftp/pub/conectiva\n\
genbasedir /home/ftp/pub/conectiva main extra devel\n\
"
+GENPKGLIST=genpkglist-0.5
+GENSRCLIST=gensrclist-0.5
getsize()
{
@@ -178,9 +180,9 @@
fi
if test x$updateinfo = x; then
- (cd $basedir; genpkglist $progress $bloat --index /tmp/srcidx.$comp.$$ $topdir $comp)
+ (cd $basedir; "$GENPKGLIST" $progress $bloat --index /tmp/srcidx.$comp.$$ $topdir $comp)
else
- (cd $basedir; genpkglist $progress $bloat --index /tmp/srcidx.$comp.$$ --info $updateinfo $topdir $comp)
+ (cd $basedir; "$GENPKGLIST" $progress $bloat --index /tmp/srcidx.$comp.$$ --info $updateinfo $topdir $comp)
fi
if [ -f $basedir/pkglist.$comp ]; then
@@ -230,9 +232,9 @@
srctopdir=`cd $topdir; pwd`
fi
if [ $mapi -ne 0 ]; then
- (cd $basedir; gensrclist $progress $flat --mapi $srctopdir $comp /tmp/srcidx.$comp.$$)
+ (cd $basedir; "$GENSRCLIST" $progress $flat --mapi $srctopdir $comp /tmp/srcidx.$comp.$$)
else
- (cd $basedir; gensrclist $progress $flat $srctopdir $comp /tmp/srcidx.$$)
+ (cd $basedir; "$GENSRCLIST" $progress $flat $srctopdir $comp /tmp/srcidx.$$)
fi
if [ -f $basedir/srclist.$comp ]; then

View File

@ -1,41 +0,0 @@
diff -urN -X apt.excludes apt-0.5.4cnc9.orig/apt-pkg/acquire-item.cc apt-0.5.4cnc9.bz2/apt-pkg/acquire-item.cc
--- apt-0.5.4cnc9.orig/apt-pkg/acquire-item.cc 2002-12-17 12:00:20 +0300
+++ apt-0.5.4cnc9.bz2/apt-pkg/acquire-item.cc 2002-12-19 17:17:41 +0300
@@ -188,7 +188,7 @@
// Create the item
// CNC:2002-07-03
- Desc.URI = URI + ".bz2";
+ Desc.URI = URI + _config->Find("Acquire::ComprExtension", ".bz2");
Desc.Description = URIDesc;
Desc.Owner = this;
Desc.ShortDesc = ShortDesc;
diff -urN -X apt.excludes apt-0.5.4cnc9.orig/apt-pkg/init.cc apt-0.5.4cnc9.bz2/apt-pkg/init.cc
--- apt-0.5.4cnc9.orig/apt-pkg/init.cc 2002-12-17 12:00:54 +0300
+++ apt-0.5.4cnc9.bz2/apt-pkg/init.cc 2002-12-19 17:28:15 +0300
@@ -71,6 +71,7 @@
Cnf.Set("Dir::Etc::parts","apt.conf.d");
Cnf.Set("Dir::Etc::preferences","preferences");
Cnf.Set("Dir::Bin::methods","/usr/lib/apt/methods");
+ Cnf.Set("Acquire::ComprExtension", ".bz2");
bool Res = true;
diff -urN -X apt.excludes apt-0.5.4cnc9.orig/methods/file.cc apt-0.5.4cnc9.bz2/methods/file.cc
--- apt-0.5.4cnc9.orig/methods/file.cc 2002-07-23 21:54:53 +0400
+++ apt-0.5.4cnc9.bz2/methods/file.cc 2002-12-19 17:24:32 +0300
@@ -52,9 +52,11 @@
Res.IMSHit = true;
}
- // See if we can compute a file without a .gz exentsion
- string::size_type Pos = File.rfind(".gz");
- if (Pos + 3 == File.length())
+ // See if we can compute a file without a .gz or .bz2 exentsion
+ // Should we check here both .gz and .bz2 extensions?
+ string ComprExtension = _config->Find("Acquire::ComprExtension", ".bz2");
+ string::size_type Pos = File.rfind(ComprExtension);
+ if (Pos + ComprExtension.length() == File.length())
{
File = string(File,0,Pos);
if (stat(File.c_str(),&Buf) == 0)

View File

@ -1,58 +0,0 @@
2003-01-21 Anton Kachalov <mouse@altlinux.org>
* apt-pkg/versionmatch.cc (pkgVersionMatch::Find):
Add APT::Install::VirtualVersion support.
* cmdline/apt-get.cc (TryToChangeVer):
Substitute virtual package with real one.
--- apt-0.5.4cnc9/apt-pkg/versionmatch.cc.orig 2002-07-23 21:54:50 +0400
+++ apt-0.5.4cnc9/apt-pkg/versionmatch.cc 2003-01-21 16:42:55 +0300
@@ -15,6 +15,7 @@
#pragma implementation "apt-pkg/versionmatch.h"
#endif
#include <apt-pkg/versionmatch.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/error.h>
@@ -158,6 +159,19 @@ pkgCache::VerIterator pkgVersionMatch::Find
return Ver;
}
+ if (_config->FindB("APT::Install::VirtualVersion",false) == false)
+ return Ver;
+
+ pkgCache::PrvIterator Prv = Pkg.ProvidesList();
+ for (; Prv.end() == false; Prv++)
+ {
+ if (Type == Version)
+ {
+ if (MatchVer(Prv.ProvideVersion(),VerStr,VerPrefixMatch) == true)
+ return Prv.OwnerVer();
+ continue;
+ }
+ }
// This will be Ended by now.
return Ver;
}
--- apt-0.5.4cnc9/cmdline/apt-get.cc.orig 2002-10-18 22:32:12 +0400
+++ apt-0.5.4cnc9/cmdline/apt-get.cc 2003-01-23 15:33:45 +0300
@@ -1119,7 +1119,7 @@
// TryToChangeVer - Try to change a candidate version /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool TryToChangeVer(pkgCache::PkgIterator Pkg,pkgDepCache &Cache,
+bool TryToChangeVer(pkgCache::PkgIterator &Pkg,pkgDepCache &Cache,
const char *VerTag,bool IsRel)
{
pkgVersionMatch Match(VerTag,(IsRel == true?pkgVersionMatch::Release :
@@ -1143,6 +1143,9 @@
}
Cache.SetCandidateVersion(Ver);
+ if (Ver.ParentPkg() != Pkg) {
+ Pkg = Ver.ParentPkg();
+ }
return true;
}
/*}}}*/

View File

@ -1,11 +0,0 @@
--- apt-0.5.5cnc1/apt-pkg/rpm/rpmpackagedata.cc.orig 2003-01-29 16:52:32 +0300
+++ apt-0.5.5cnc1/apt-pkg/rpm/rpmpackagedata.cc 2003-02-07 18:31:11 +0300
@@ -16,7 +16,7 @@
RPMPackageData::RPMPackageData()
{
// Populate priorities
- string FileName = _config->FindFile("Dir::Etc::rpmpriorities");
+ string FileName = _config->FindFile("Dir::Etc") + "pkgpriorities";
FileFd F(FileName, FileFd::ReadOnly);
if (_error->PendingError())
{

View File

@ -1,33 +0,0 @@
--- apt-0.5.5cnc1/apt-pkg/rpm/rpmsystem.cc.orig 2002-11-25 21:25:28 +0300
+++ apt-0.5.5cnc1/apt-pkg/rpm/rpmsystem.cc 2003-02-07 18:13:09 +0300
@@ -125,7 +125,7 @@
Cnf.CndSet("Dir::Etc::translateparts", "translate.list.d");
Cnf.CndSet("Dir::State::prefetch", "prefetch");
Cnf.CndSet("Dir::Locale","/usr/share/locale");
- Cnf.CndSet("Acquire::DistroID","Conectiva"); // hee hee
+ Cnf.CndSet("Acquire::DistroID","ALT Linux"); // hee hee
Cnf.CndSet("Acquire::CDROM::Mount", "/mnt/cdrom");
Cnf.CndSet("Acquire::CDROM::Copy-All", "true");
--- apt-0.5.5cnc2/cmdline/apt-cdrom.cc.orig 2003-02-21 17:09:14 +0300
+++ apt-0.5.5cnc2/cmdline/apt-cdrom.cc 2003-02-25 15:33:02 +0300
@@ -700,7 +700,7 @@ bool DoAdd(CommandLine &)
{
// CNC:2002-07-11
#ifdef HAVE_RPM
- cout << "Please provide a name for this Disc, such as 'Conectiva Disk 1'";
+ cout << "Please provide a name for this Disc, such as 'ALT Linux Disk 1'";
#else
cout << "Please provide a name for this Disc, such as 'Debian 2.1r1 Disk 1'";
#endif
--- apt-0.5.5cnc2/methods/ftp.cc.orig 2003-02-21 17:12:17 +0300
+++ apt-0.5.5cnc2/methods/ftp.cc 2003-02-25 16:02:07 +0300
@@ -189,7 +189,7 @@ bool FTPConn::Login()
// Setup the variables needed for authentication
string User = "anonymous";
- string Pass = "apt_get_ftp_2.1@debian.linux.user";
+ string Pass = "apt_get_ftp_2.1@alt.linux.user";
// Fill in the user/pass
if (ServerName.User.empty() == false)

View File

@ -1,66 +0,0 @@
diff -uprk.orig apt-0.5.5cnc2.orig/configure.in apt-0.5.5cnc2/configure.in
--- apt-0.5.5cnc2.orig/configure.in 2003-02-21 17:06:40 +0300
+++ apt-0.5.5cnc2/configure.in 2003-02-25 16:04:31 +0300
@@ -56,10 +56,12 @@ dnl if test "$PTHREADLIB" != "-lpthread"
dnl AC_MSG_ERROR(failed: I need posix threads, pthread)
dnl fi
+DB2LIB=
+dnl ALT: uncomment this to build apt-ftparchive
dnl Check for DB2
-AC_CHECK_HEADER(db2/db.h,
- [AC_CHECK_LIB(db2,db_open,
- [AC_DEFINE(HAVE_DB2) DB2LIB="-ldb2"])])
+dnl AC_CHECK_HEADER(db2/db.h,
+dnl [AC_CHECK_LIB(db2,db_open,
+dnl [AC_DEFINE(HAVE_DB2) DB2LIB="-ldb2"])])
AC_SUBST(DB2LIB)
dnl CNC:2002-07-03
@@ -69,7 +71,6 @@ SAVE_LIBS="$LIBS"
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$SAVE_CPPFLAGS -I/usr/include/rpm"
-AC_CHECK_HEADERS(db1/db.h)
AC_CHECK_HEADER(rpm/rpmlib.h, rpm_header_ok=1, rpm_header_ok=0)
if test $rpm_header_ok = 1; then
@@ -77,7 +78,7 @@ if test $rpm_header_ok = 1; then
LIBS="$SAVE_LIBS -lrpm -lrpmio -lz -lbz2 -lpopt"
AC_CHECK_LIB(rpmdb,rpmdbOpen,
[RPMDBLIBS="-lrpmdb"],
- [RPMDBLIBS="-ldb-3.1"])
+ [RPMDBLIBS="-ldb"])
LIBS="$SAVE_LIBS $RPMDBLIBS -lrpmio -lz -lbz2 -lpopt"
AC_CHECK_LIB(rpm,rpmdbGetIteratorOffset,
@@ -96,6 +97,7 @@ if test $rpm_header_ok = 1; then
[AC_DEFINE_UNQUOTED(HAVE_RPM, 1)
RPMLIBS="-lrpm -ldb1 -lz -lbz2 -lpopt"
SAVE_CPPFLAGS="$SAVE_CPPFLAGS -I/usr/include/rpm"
+ AC_CHECK_HEADERS(db1/db.h)
rpm_version="3"])
fi
fi
diff -uprk.orig apt-0.5.5cnc2.orig/tools/cached_md5.cc apt-0.5.5cnc2/tools/cached_md5.cc
--- apt-0.5.5cnc2.orig/tools/cached_md5.cc 2003-02-21 17:12:36 +0300
+++ apt-0.5.5cnc2/tools/cached_md5.cc 2003-02-25 16:03:17 +0300
@@ -7,6 +7,7 @@
#include <errno.h>
#include <fcntl.h>
#include <rpm/rpmlib.h>
+#include <rpm/misc.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
diff -uprk.orig apt-0.5.5cnc2.orig/tools/hdlist2pkglist.cc apt-0.5.5cnc2/tools/hdlist2pkglist.cc
--- apt-0.5.5cnc2.orig/tools/hdlist2pkglist.cc 2003-02-21 17:12:30 +0300
+++ apt-0.5.5cnc2/tools/hdlist2pkglist.cc 2003-02-25 16:03:17 +0300
@@ -7,6 +7,7 @@
#include <errno.h>
#include <fcntl.h>
#include <rpmlib.h>
+#include <rpm/misc.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>

View File

@ -1,20 +0,0 @@
--- apt-0.5.5cnc3.orig/cmdline/apt-cdrom.cc 2003-02-28 04:19:12 +1200
+++ apt-0.5.5cnc3/cmdline/apt-cdrom.cc 2003-03-04 11:34:11 +1200
@@ -853,7 +853,7 @@ int ShowHelp()
return 0;
cout <<
- "Usage: apt-cdrom [options] command\n"
+ _("Usage: apt-cdrom [options] command\n"
"\n"
"apt-cdrom is a tool to add CDROM's to APT's source list. The\n"
"CDROM mount point and device information is taken from apt.conf\n"
@@ -872,7 +872,7 @@ int ShowHelp()
" -a Thorough scan mode\n"
" -c=? Read this configuration file\n"
" -o=? Set an arbitary configuration option, eg -o dir::cache=/tmp\n"
- "See fstab(5)\n";
+ "See fstab(5)\n");
return 0;
}
/*}}}*/

View File

@ -1,40 +0,0 @@
diff -uprk.orig apt-0.5.5cnc4.1.orig/apt-pkg/init.cc apt-0.5.5cnc4.1/apt-pkg/init.cc
--- apt-0.5.5cnc4.1.orig/apt-pkg/init.cc 2003-06-25 18:35:05 +0400
+++ apt-0.5.5cnc4.1/apt-pkg/init.cc 2003-06-25 18:35:45 +0400
@@ -72,7 +72,7 @@ bool pkgInitConfig(Configuration &Cnf)
Cnf.Set("Dir::Etc::main","apt.conf");
Cnf.Set("Dir::Etc::parts","apt.conf.d");
Cnf.Set("Dir::Etc::preferences","preferences");
- Cnf.Set("Dir::Bin::methods","/usr/lib/apt/methods");
+ Cnf.Set("Dir::Bin::methods","/usr/lib/apt");
Cnf.Set("Acquire::ComprExtension", ".bz2");
bool Res = true;
diff -uprk.orig apt-0.5.5cnc4.1.orig/apt-pkg/rpm/rpmpm.cc apt-0.5.5cnc4.1/apt-pkg/rpm/rpmpm.cc
--- apt-0.5.5cnc4.1.orig/apt-pkg/rpm/rpmpm.cc 2003-06-25 18:35:05 +0400
+++ apt-0.5.5cnc4.1/apt-pkg/rpm/rpmpm.cc 2003-06-25 18:43:01 +0400
@@ -332,7 +332,7 @@ bool pkgRPMPM::ExecRPM(Item::RPMOps op,
}
}
- if (_config->FindB("RPM::Order",false) == false)
+ if (_config->FindB("RPM::Order",true) == false)
Args[n++] = "--noorder";
string cmd;
diff -uprk.orig apt-0.5.5cnc4.1.orig/buildlib/archtable apt-0.5.5cnc4.1/buildlib/archtable
--- apt-0.5.5cnc4.1.orig/buildlib/archtable 2003-03-08 02:14:52 +0300
+++ apt-0.5.5cnc4.1/buildlib/archtable 2003-06-25 18:37:36 +0400
@@ -5,8 +5,10 @@
# The left side is a regex for awk
-i.86 i386
-pentium i386
+i[34]86 i386
+i.86 i586
+pentium.* i586
+athlon i586
sparc sparc
sparc64 sparc
alpha.* alpha

View File

@ -1,31 +0,0 @@
2002-10-23 Dmitry V. Levin <ldv@altlinux.org>
* apt-pkg/rpm/rpmpm.cc(pkgRPMPM::ExecRPM):
Report actual options being passed to rpm.
--- apt-0.5.5cnc4/apt-pkg/rpm/rpmpm.cc.orig 2003-03-07 17:40:44 +0300
+++ apt-0.5.5cnc4/apt-pkg/rpm/rpmpm.cc 2003-03-07 19:24:07 +0300
@@ -333,6 +333,14 @@ bool pkgRPMPM::ExecRPM(Item::RPMOps op,
if (_config->FindB("RPM::Order",false) == false)
Args[n++] = "--noorder";
+ string cmd;
+ for (unsigned i = 0; i < n; ++i)
+ {
+ if (!cmd.empty())
+ cmd += ' ';
+ cmd += Args[i];
+ }
+
for (vector<const char*>::iterator I = files.begin(); I != files.end(); I++)
Args[n++] = *I;
@@ -346,7 +354,7 @@ bool pkgRPMPM::ExecRPM(Item::RPMOps op,
return true;
}
- cout << _("Executing RPM (")<<operation<<")..." << endl;
+ cout << _("Executing RPM (")<<cmd<<")..." << endl;
cout << flush;
clog << flush;

View File

@ -1,26 +0,0 @@
--- apt-0.5.5cnc4.1/configure.in.orig 2003-03-08 03:07:11 +0300
+++ apt-0.5.5cnc4.1/configure.in 2003-03-11 13:08:10 +0300
@@ -125,10 +125,10 @@
[AC_MSG_RESULT(no)])
dnl Check for apt-shell dependencies
-AC_CHECK_LIB(ncurses,tputs,
+AC_CHECK_LIB(tinfo,tputs,
[AC_CHECK_HEADER(readline/readline.h,
[AC_CHECK_LIB(readline,readline,
- [COMPILE_APTSHELL=yes],,[-lncurses])])])
+ [COMPILE_APTSHELL=yes],,[-ltinfo])])])
AC_SUBST(COMPILE_APTSHELL)
dnl Converts the ARCH to be something singular for this general CPU family
--- apt-0.5.5cnc4.1/cmdline/makefile.orig 2003-03-08 02:10:32 +0300
+++ apt-0.5.5cnc4.1/cmdline/makefile 2003-03-11 13:08:19 +0300
@@ -27,7 +27,7 @@
ifdef COMPILE_APTSHELL
# The apt-shell program
PROGRAM=apt-shell
-SLIBS = -lapt-pkg -lreadline -lncurses $(RPMLIBS)
+SLIBS = -lapt-pkg -lreadline -ltinfo $(RPMLIBS)
LIB_MAKES = apt-pkg/makefile
SOURCE = apt-shell.cc acqprogress.cc
include $(PROGRAM_H)

View File

@ -1,55 +0,0 @@
2003-04-28 Anton Kachalov <mouse@altlinux.org>
* apt-pkg/versionmatch.cc (pkgVersionMatch::MatchVer):
Ignore serial while matching version string.
Check both for version and version-release while matching version string.
--- apt-0.5.5cnc4.1/apt-pkg/versionmatch.cc.orig 2003-03-25 19:40:45 +0300
+++ apt-0.5.5cnc4.1/apt-pkg/versionmatch.cc 2003-04-28 19:35:30 +0400
@@ -124,18 +124,36 @@ pkgVersionMatch::pkgVersionMatch(string
/* */
bool pkgVersionMatch::MatchVer(const char *A,string B,bool Prefix)
{
- const char *Ab = A;
- const char *Ae = Ab + strlen(A);
+ string s(A), sc(A);
+ const char *Ab = s.c_str(), *Ac = sc.c_str();
+
+ for (string::iterator i = s.begin(), k = sc.begin(); i != s.end(); ++i,++k)
+ {
+ if (*i == ':')
+ {
+ Ab = &(*i) + 1;
+ Ac = &(*k) + 1;
+ }
+ else if (*i == '-')
+ {
+ *i = 0;
+ break;
+ }
+ }
+
+ const char *Ae = Ab + strlen(Ab);
+ const char *Af = Ac + strlen(Ac);
// Strings are not a compatible size.
- if ((unsigned)(Ae - Ab) != B.length() && Prefix == false ||
- (unsigned)(Ae - Ab) < B.length())
- return false;
-
- // Match (leading?)
- if (stringcasecmp(B,Ab,Ab + B.length()) == 0)
- return true;
-
+ if (((unsigned)(Ae - Ab) == B.length() || Prefix == true) &&
+ (unsigned)(Ae - Ab) >= B.length() &&
+ stringcasecmp(B,Ab,Ab + B.length()) == 0)
+ return true;
+ else if (((unsigned)(Af - Ac) == B.length() || Prefix == true) &&
+ (unsigned)(Af - Ac) >= B.length() &&
+ stringcasecmp(B,Ac,Ac + B.length()) == 0)
+ return true;
+
return false;
}
/*}}}*/

View File

@ -1,231 +0,0 @@
2003-06-24 Dmitry V. Levin <ldv@altlinux.org>
* apt-pkg/versionmatch.cc (pkgVersionMatch::MatchVer):
Use pkgVersioningSystem's CheckDep for normal (non-prefix) match.
* apt-pkg/versionmatch.h (class pkgVersionMatch):
Added "int VerOp" private member.
Added argument to constructor.
* apt-pkg/versionmatch.cc (pkgVersionMatch::pkgVersionMatch):
Initialize VerOp.
* cmdline/apt-get.cc (DoInstall):
Changed parser to initialize VerOp.
* cmdline/apt-get.cc (TryToChangeVer): Use it.
* cmdline/apt-get.cc (op2str): New function.
* cmdline/apt-get.cc (TryToChangeVer): Use it.
diff -uprk.orig apt-0.5.5cnc4.1.orig/apt-pkg/versionmatch.cc apt-0.5.5cnc4.1/apt-pkg/versionmatch.cc
--- apt-0.5.5cnc4.1.orig/apt-pkg/versionmatch.cc 2003-06-24 15:43:54 +0400
+++ apt-0.5.5cnc4.1/apt-pkg/versionmatch.cc 2003-06-24 15:18:19 +0400
@@ -15,6 +15,7 @@
#pragma implementation "apt-pkg/versionmatch.h"
#endif
#include <apt-pkg/versionmatch.h>
+#include <apt-pkg/version.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/strutl.h>
@@ -27,7 +28,7 @@
// VersionMatch::pkgVersionMatch - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* Break up the data string according to the selected type */
-pkgVersionMatch::pkgVersionMatch(string Data,MatchType Type) : Type(Type)
+pkgVersionMatch::pkgVersionMatch(string Data,MatchType Type,int Op) : VerOp(Op), Type(Type)
{
MatchAll = false;
VerPrefixMatch = false;
@@ -162,13 +163,22 @@ bool pkgVersionMatch::MatchVer(const cha
/* */
pkgCache::VerIterator pkgVersionMatch::Find(pkgCache::PkgIterator Pkg)
{
+ pkgVersioningSystem *VS = Pkg.Cache()->VS;
pkgCache::VerIterator Ver = Pkg.VersionList();
+
for (; Ver.end() == false; Ver++)
{
if (Type == Version)
{
- if (MatchVer(Ver.VerStr(),VerStr,VerPrefixMatch) == true)
- return Ver;
+ if (VerPrefixMatch)
+ {
+ if (MatchVer(Ver.VerStr(),VerStr,VerPrefixMatch) == true)
+ return Ver;
+ } else {
+ if (VS->CheckDep(Ver.VerStr(),VerOp,VerStr.c_str()) == true)
+ return Ver;
+ }
+
continue;
}
@@ -185,9 +195,14 @@ pkgCache::VerIterator pkgVersionMatch::F
{
if (Type == Version)
{
- if (MatchVer(Prv.ProvideVersion(),VerStr,VerPrefixMatch) == true)
- return Prv.OwnerVer();
- continue;
+ if (VerPrefixMatch)
+ {
+ if (MatchVer(Prv.ProvideVersion(),VerStr,VerPrefixMatch) == true)
+ return Prv.OwnerVer();
+ } else {
+ if (VS->CheckDep(Prv.ProvideVersion(),VerOp,VerStr.c_str()) == true)
+ return Prv.OwnerVer();
+ }
}
}
// This will be Ended by now.
diff -uprk.orig apt-0.5.5cnc4.1.orig/apt-pkg/versionmatch.h apt-0.5.5cnc4.1/apt-pkg/versionmatch.h
--- apt-0.5.5cnc4.1.orig/apt-pkg/versionmatch.h 2003-03-08 02:12:11 +0300
+++ apt-0.5.5cnc4.1/apt-pkg/versionmatch.h 2003-06-24 14:22:28 +0400
@@ -45,6 +45,7 @@ class pkgVersionMatch
// Version Matching
string VerStr;
bool VerPrefixMatch;
+ int VerOp;
// Release Matching
string RelVerStr;
@@ -66,7 +67,7 @@ class pkgVersionMatch
bool FileMatch(pkgCache::PkgFileIterator File);
pkgCache::VerIterator Find(pkgCache::PkgIterator Pkg);
- pkgVersionMatch(string Data,MatchType Type);
+ pkgVersionMatch(string Data,MatchType Type,int Op = 0);
};
#endif
diff -uprk.orig apt-0.5.5cnc4.1.orig/cmdline/apt-get.cc apt-0.5.5cnc4.1/cmdline/apt-get.cc
--- apt-0.5.5cnc4.1.orig/cmdline/apt-get.cc 2003-06-24 15:43:54 +0400
+++ apt-0.5.5cnc4.1/cmdline/apt-get.cc 2003-06-24 15:39:37 +0400
@@ -1172,29 +1172,40 @@ bool TryToInstall(pkgCache::PkgIterator
return true;
}
/*}}}*/
+static const char *op2str(int op)
+{
+ switch (op & 0x0f)
+ {
+ case pkgCache::Dep::LessEq: return "<=";
+ case pkgCache::Dep::GreaterEq: return ">=";
+ case pkgCache::Dep::Less: return "<";
+ case pkgCache::Dep::Greater: return ">";
+ case pkgCache::Dep::Equals: return "=";
+ case pkgCache::Dep::NotEquals: return "!";
+ default: return "";
+ }
+};
+
// TryToChangeVer - Try to change a candidate version /*{{{*/
// ---------------------------------------------------------------------
/* */
bool TryToChangeVer(pkgCache::PkgIterator &Pkg,pkgDepCache &Cache,
- const char *VerTag,bool IsRel)
+ int VerOp,const char *VerTag,bool IsRel)
{
pkgVersionMatch Match(VerTag,(IsRel == true?pkgVersionMatch::Release :
- pkgVersionMatch::Version));
+ pkgVersionMatch::Version),VerOp);
pkgCache::VerIterator Ver = Match.Find(Pkg);
if (Ver.end() == true)
- {
- if (IsRel == true)
- return _error->Error(_("Release '%s' for '%s' was not found"),
- VerTag,Pkg.Name());
- return _error->Error(_("Version '%s' for '%s' was not found"),
- VerTag,Pkg.Name());
- }
+ return _error->Error(_("%s %s'%s' for '%s' was not found"),
+ IsRel ? _("Release") : _("Version"),
+ op2str(VerOp), VerTag,Pkg.Name());
if (strcmp(VerTag,Ver.VerStr()) != 0)
{
- ioprintf(c1out,_("Selected version %s (%s) for %s\n"),
+ ioprintf(c1out,_("Selected %s %s (%s) for %s\n"),
+ IsRel ? _("release") : _("version"),
Ver.VerStr(),Ver.RelStr().c_str(),Pkg.Name());
}
@@ -1455,6 +1466,7 @@ bool DoInstall(CommandLine &CmdL)
bool Remove = DefRemove;
char *VerTag = 0;
bool VerIsRel = false;
+ int VerOp = 0;
while (Cache->FindPkg(S).end() == true)
{
// Handle an optional end tag indicating what to do
@@ -1472,15 +1484,47 @@ bool DoInstall(CommandLine &CmdL)
continue;
}
- char *Slash = strchr(S,'=');
- if (Slash != 0)
+ char *sep = strpbrk(S,"=><");
+ if (sep)
{
+ char *p;
+ int eq = 0, gt = 0, lt = 0;
+
VerIsRel = false;
- *Slash = 0;
- VerTag = Slash + 1;
+ for (p = sep; *p && strchr("=><",*p); ++p)
+ switch (*p)
+ {
+ case '=': eq = 1; break;
+ case '>': gt = 1; break;
+ case '<': lt = 1; break;
+ }
+ if (eq)
+ {
+ if (lt && gt)
+ return _error->Error(_("Couldn't parse name: %s"),S);
+ else if (lt)
+ VerOp = pkgCache::Dep::LessEq;
+ else if (gt)
+ VerOp = pkgCache::Dep::GreaterEq;
+ else
+ VerOp = pkgCache::Dep::Equals;
+ }
+ else
+ {
+ if (lt && gt)
+ VerOp = pkgCache::Dep::NotEquals;
+ else if (lt)
+ VerOp = pkgCache::Dep::Less;
+ else if (gt)
+ VerOp = pkgCache::Dep::Greater;
+ else
+ return _error->Error(_("Couldn't parse name: %s"),S);
+ }
+ *sep = '\0';
+ VerTag = p;
}
- Slash = strchr(S,'/');
+ char *Slash = strchr(S,'/');
if (Slash != 0)
{
VerIsRel = true;
@@ -1530,7 +1574,7 @@ bool DoInstall(CommandLine &CmdL)
Pkg.Name(),S);
if (VerTag != 0)
- if (TryToChangeVer(Pkg,Cache,VerTag,VerIsRel) == false)
+ if (TryToChangeVer(Pkg,Cache,VerOp,VerTag,VerIsRel) == false)
return false;
Hit |= TryToInstall(Pkg,Cache,Fix,Remove,BrokenFix,
@@ -1544,7 +1588,7 @@ bool DoInstall(CommandLine &CmdL)
else
{
if (VerTag != 0)
- if (TryToChangeVer(Pkg,Cache,VerTag,VerIsRel) == false)
+ if (TryToChangeVer(Pkg,Cache,VerOp,VerTag,VerIsRel) == false)
return false;
if (TryToInstall(Pkg,Cache,Fix,Remove,BrokenFix,ExpectedInst) == false)
return false;

View File

@ -1,46 +0,0 @@
2003-09-28 Dmitry V. Levin <ldv@altlinux.org>
* apt-pkg/rpm/rpmpm.cc(pkgRPMPM::ExecRPM):
Honor "quiet" config option.
Pass "fancypercent" option.
--- apt-0.5.5cnc4.1/apt-pkg/rpm/rpmpm.cc.orig 2003-09-28 14:18:22 +0400
+++ apt-0.5.5cnc4.1/apt-pkg/rpm/rpmpm.cc 2003-09-28 14:22:42 +0400
@@ -227,6 +227,7 @@ bool pkgRPMPM::ExecRPM(Item::RPMOps op,
const char *operation;
unsigned int n = 0;
bool Interactive = _config->FindB("RPM::Interactive",true);
+ int quiet = _config->FindI("quiet",0);
Args[n++] = _config->Find("Dir::Bin::rpm","rpm").c_str();
@@ -235,7 +236,7 @@ bool pkgRPMPM::ExecRPM(Item::RPMOps op,
switch (op)
{
case Item::RPMInstall:
- if (Interactive)
+ if (Interactive && quiet < 2)
operation = "-ivh";
else
operation = "-iv";
@@ -243,7 +244,7 @@ bool pkgRPMPM::ExecRPM(Item::RPMOps op,
break;
case Item::RPMUpgrade:
- if (Interactive)
+ if (Interactive && quiet < 2)
operation = "-Uvh";
else
operation = "-Uv";
@@ -256,8 +257,10 @@ bool pkgRPMPM::ExecRPM(Item::RPMOps op,
}
Args[n++] = operation;
- if (Interactive == false && op != Item::RPMErase)
+ if (Interactive == false && quiet == 0 && op != Item::RPMErase)
Args[n++] = "--percent";
+ if (Interactive && quiet == 0)
+ Args[n++] = "--fancypercent";
string rootdir = _config->Find("RPM::RootDir", "");
if (!rootdir.empty())

View File

@ -1,7 +1,8 @@
diff -urN -X apt.excludes apt-0.5.4cnc9.orig/apt-pkg/acquire-item.h apt-0.5.4cnc9.rsync/apt-pkg/acquire-item.h
--- apt-0.5.4cnc9.orig/apt-pkg/acquire-item.h 2002-07-23 21:54:50 +0400
+++ apt-0.5.4cnc9.rsync/apt-pkg/acquire-item.h 2002-12-17 11:34:33 +0300
@@ -59,6 +59,9 @@
Index: apt-rpm.rsync/apt-pkg/acquire-item.h
===================================================================
--- apt-rpm.rsync/apt-pkg/acquire-item.h (revision 137)
+++ apt-rpm.rsync/apt-pkg/acquire-item.h (working copy)
@@ -61,6 +61,9 @@
// File to write the fetch into
string DestFile;
@ -11,43 +12,10 @@ diff -urN -X apt.excludes apt-0.5.4cnc9.orig/apt-pkg/acquire-item.h apt-0.5.4cnc
// Action members invoked by the worker
virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf);
diff -urN -X apt.excludes apt-0.5.4cnc9.orig/apt-pkg/acquire-method.cc apt-0.5.4cnc9.rsync/apt-pkg/acquire-method.cc
--- apt-0.5.4cnc9.orig/apt-pkg/acquire-method.cc 2002-07-23 21:54:50 +0400
+++ apt-0.5.4cnc9.rsync/apt-pkg/acquire-method.cc 2002-12-17 11:34:33 +0300
@@ -135,7 +135,7 @@
if (Queue == 0)
abort();
- char S[1024] = "";
+ char S[2048] = "";
char *End = S;
End += snprintf(S,sizeof(S),"200 URI Start\nURI: %s\n",Queue->Uri.c_str());
@@ -150,6 +150,10 @@
End += snprintf(End,sizeof(S)-4 - (End - S),"Resume-Point: %lu\n",
Res.ResumePoint);
+ if (!Res.TmpFilename.empty())
+ End += snprintf(End,sizeof(S)-4 - (End - S),"Tmp-Filename: %s\n",
+ Res.TmpFilename.c_str());
+
strcat(End,"\n");
if (write(STDOUT_FILENO,S,strlen(S)) != (signed)strlen(S))
exit(100);
diff -urN -X apt.excludes apt-0.5.4cnc9.orig/apt-pkg/acquire-method.h apt-0.5.4cnc9.rsync/apt-pkg/acquire-method.h
--- apt-0.5.4cnc9.orig/apt-pkg/acquire-method.h 2002-07-23 21:54:50 +0400
+++ apt-0.5.4cnc9.rsync/apt-pkg/acquire-method.h 2002-12-17 11:34:33 +0300
@@ -47,6 +47,7 @@
time_t LastModified;
bool IMSHit;
string Filename;
+ string TmpFilename;
unsigned long Size;
unsigned long ResumePoint;
diff -urN -X apt.excludes apt-0.5.4cnc9.orig/apt-pkg/acquire-worker.cc apt-0.5.4cnc9.rsync/apt-pkg/acquire-worker.cc
--- apt-0.5.4cnc9.orig/apt-pkg/acquire-worker.cc 2002-07-23 21:54:50 +0400
+++ apt-0.5.4cnc9.rsync/apt-pkg/acquire-worker.cc 2002-12-17 11:34:33 +0300
Index: apt-rpm.rsync/apt-pkg/acquire-worker.cc
===================================================================
--- apt-rpm.rsync/apt-pkg/acquire-worker.cc (revision 137)
+++ apt-rpm.rsync/apt-pkg/acquire-worker.cc (working copy)
@@ -235,6 +235,7 @@
CurrentSize = 0;
TotalSize = atoi(LookupTag(Message,"Size","0").c_str());
@ -69,27 +37,47 @@ diff -urN -X apt.excludes apt-0.5.4cnc9.orig/apt-pkg/acquire-worker.cc apt-0.5.4
return;
CurrentSize = Buf.st_size;
diff -urN -X apt.excludes apt-0.5.4cnc9.orig/methods/makefile apt-0.5.4cnc9.rsync/methods/makefile
--- apt-0.5.4cnc9.orig/methods/makefile 2002-07-25 22:07:19 +0400
+++ apt-0.5.4cnc9.rsync/methods/makefile 2002-12-17 11:34:33 +0300
@@ -63,6 +63,13 @@
SOURCE = gpg.cc
include $(PROGRAM_H)
Index: apt-rpm.rsync/apt-pkg/acquire-method.cc
===================================================================
--- apt-rpm.rsync/apt-pkg/acquire-method.cc (revision 137)
+++ apt-rpm.rsync/apt-pkg/acquire-method.cc (working copy)
@@ -135,7 +135,7 @@
if (Queue == 0)
abort();
+# The rsync method
+PROGRAM=rsync
+SLIBS = -lapt-pkg $(SOCKETLIBS) $(RPMLIBS)
+LIB_MAKES = apt-pkg/makefile
+SOURCE = rsync.cc
+include $(PROGRAM_H)
- char S[1024] = "";
+ char S[2048] = "";
char *End = S;
End += snprintf(S,sizeof(S),"200 URI Start\nURI: %s\n",Queue->Uri.c_str());
@@ -150,6 +150,10 @@
End += snprintf(End,sizeof(S)-4 - (End - S),"Resume-Point: %lu\n",
Res.ResumePoint);
+ if (!Res.TmpFilename.empty())
+ End += snprintf(End,sizeof(S)-4 - (End - S),"Tmp-Filename: %s\n",
+ Res.TmpFilename.c_str());
+
# SSH and vzip2 method symlink
all: $(BIN)/ssh $(BIN)/bzip2
veryclean: clean-$(BIN)/ssh clean-$(BIN)/bzip2
diff -urN -X apt.excludes apt-0.5.4cnc9.orig/methods/rsync.cc apt-0.5.4cnc9.rsync/methods/rsync.cc
--- apt-0.5.4cnc9.orig/methods/rsync.cc 1970-01-01 03:00:00 +0300
+++ apt-0.5.4cnc9.rsync/methods/rsync.cc 2002-12-17 13:25:56 +0300
@@ -0,0 +1,468 @@
strcat(End,"\n");
if (write(STDOUT_FILENO,S,strlen(S)) != (signed)strlen(S))
exit(100);
Index: apt-rpm.rsync/apt-pkg/acquire-method.h
===================================================================
--- apt-rpm.rsync/apt-pkg/acquire-method.h (revision 137)
+++ apt-rpm.rsync/apt-pkg/acquire-method.h (working copy)
@@ -47,6 +47,7 @@
time_t LastModified;
bool IMSHit;
string Filename;
+ string TmpFilename;
unsigned long Size;
unsigned long ResumePoint;
Index: apt-rpm.rsync/methods/rsync.cc
===================================================================
--- apt-rpm.rsync/methods/rsync.cc (working copy)
+++ apt-rpm.rsync/methods/rsync.cc (working copy)
@@ -0,0 +1,570 @@
+// -*- mode: cpp; mode: fold -*-
+// Description /*{{{*/
+// $Id$
@ -124,6 +112,7 @@ diff -urN -X apt.excludes apt-0.5.4cnc9.orig/methods/rsync.cc apt-0.5.4cnc9.rsyn
+#include <arpa/inet.h>
+#include <netdb.h>
+
+#include "apti18n.h"
+#include "rfc2553emu.h"
+#include "connect.h"
+#include "rsync-method.h"
@ -319,17 +308,45 @@ diff -urN -X apt.excludes apt-0.5.4cnc9.orig/methods/rsync.cc apt-0.5.4cnc9.rsyn
+ return false;
+}
+
+/* Parse rysnc output
+ * Need to parse lines like:
+ *
+ * ^opening tcp connection to rsync.altlinux.ru port 873
+ * ^[11948] i=0 <NULL> FILENAME mode=0100664 len=171935
+ * ^FILENAME
+ * ^renaming .FILENAME.bWM2bW to FILENAME
+ * ^set modtime of FILENAME to (1048860997) Fri Mar 28 17:16:37 2003
+ * ^recv_files finished
+ *
+ */
+void RsyncMethod::RsyncConnExec::ParseOutput(pkgAcqMethod *Owner, FetchResult &FRes, const char *buf)
+{
+ static const char * TMPFN = "Tmp-Filename: ";
+ static const char * SIZE = "Size: ";
+ static const char * START = "Start: ";
+ static const char * DONE = "Done: ";
+ static const char * DONE = "recv_files finished";
+ static const char * FAILED= "Failed: ";
+ const char * ptr;
+
+ //if ( RsyncMethod::Debug )
+ // cerr << "ParseOutput: " << buf << endl;
+ if ( RsyncMethod::Debug )
+ cerr << "ParseOutput: " << buf << endl;
+
+ ptr = strstr(buf,"opening tcp connection");
+ if (ptr) {
+ if ( RsyncMethod::Debug )
+ cerr << endl << "Status: Connecting" << endl;
+ State = Connecting;
+ Owner->Status(_("Connecting"));
+ return;
+ }
+
+ // [PID] i=0 DIRNAME FILENAME mode=XXXXXXX len=YYYYYY
+ if (buf[0]=='[') {
+ ptr = strstr(buf,"i=0 ");
+ if (ptr == 0) return;
+ ptr += 4; // skip "i=0 "
+ ptr = strchr(ptr,' '); // skip DIRNAME
+ }
+
+ ptr = strstr(buf,TMPFN);
+ if (ptr) {
@ -401,7 +418,7 @@ diff -urN -X apt.excludes apt-0.5.4cnc9.orig/methods/rsync.cc apt-0.5.4cnc9.rsyn
+ argv.add(program.c_str());
+ argv.add("-Lpt");
+ argv.add("--partial");
+ argv.add("--apt-support");
+ AddOptions(argv);
+ if (RsyncMethod::Timeout>0) {
+ argv.add("--timeout");
+ char S[10];
@ -471,6 +488,76 @@ diff -urN -X apt.excludes apt-0.5.4cnc9.orig/methods/rsync.cc apt-0.5.4cnc9.rsyn
+ return false;
+}
+
+// Parse output of rsync process with --apt-support option
+void RsyncMethod::RsyncConnExecExt::ParseOutput(pkgAcqMethod *Owner, FetchResult &FRes, const char *buf)
+{
+ static const char * TMPFN = "Tmp-Filename: ";
+ static const char * SIZE = "Size: ";
+ static const char * START = "Start: ";
+ static const char * DONE = "Done: ";
+ static const char * FAILED= "Failed: ";
+ const char * ptr;
+
+ //if ( RsyncMethod::Debug )
+ // cerr << "ParseOutput: " << buf << endl;
+
+ ptr = strstr(buf,TMPFN);
+ if (ptr) {
+ ptr += strlen(TMPFN);
+ const char *ptr2 = ptr;
+ while (*ptr2!=0 && !isspace(*ptr2))
+ ++ptr2;
+ if (ptr!=ptr2) {
+ char *tmpfn = new char[ptr2-ptr+1];
+ bzero(tmpfn, ptr2-ptr+1);
+ strncpy(tmpfn, ptr, ptr2-ptr);
+ if (RsyncMethod::Debug)
+ cerr << endl << "RSYNC: " << TMPFN << tmpfn << endl;
+ FRes.TmpFilename = string(tmpfn);
+ delete tmpfn;
+ }
+ }
+
+ ptr = strstr(buf,SIZE);
+ if (ptr) {
+ ptr += strlen(SIZE);
+ unsigned long size = atol(ptr);
+ if (RsyncMethod::Debug)
+ cerr << "RSYNC: " << SIZE << size << endl;
+ FRes.Size = size;
+ }
+
+ ptr = strstr(buf,START);
+ if (ptr) {
+ State = Fetching;
+ dynamic_cast<RsyncMethod*>(Owner)->Start(FRes);
+ }
+
+ ptr = strstr(buf,DONE);
+ if (ptr)
+ State = Done;
+
+ ptr = strstr(buf,FAILED);
+ if (ptr) {
+ State = Failed;
+ ptr += strlen(FAILED);
+ const char *ptr2 = ptr;
+ while (*ptr2!=0 && *ptr2!='\n')
+ ++ptr2;
+ if (ptr!=ptr2) {
+ char *tmp = new char[ptr2-ptr+1];
+ bzero(tmp, ptr2-ptr+1);
+ strncpy(tmp, ptr, ptr2-ptr);
+ _error->Error("%s",tmp);
+ if (RsyncMethod::Debug)
+ cerr << endl << FAILED << tmp << endl;
+ delete tmp;
+ } else {
+ _error->Error("Child process failed (no description)");
+ }
+ }
+}
+
+// RsyncMethod::RsyncMethod - Constructor /*{{{*/
+// ---------------------------------------------------------------------
+/* */
@ -529,6 +616,9 @@ diff -urN -X apt.excludes apt-0.5.4cnc9.orig/methods/rsync.cc apt-0.5.4cnc9.rsyn
+
+ // Don't compare now for the same server uri
+ delete server;
+ if ( _config->FindB("Acquire::rsync::apt-support",true) )
+ server = new RsyncConnExecExt(Get,proxy,RsyncProg);
+ else
+ server = new RsyncConnExec(Get,proxy,RsyncProg);
+
+ if ( server->Get(this,Res,File,Itm->DestFile.c_str()) ) {
@ -558,10 +648,11 @@ diff -urN -X apt.excludes apt-0.5.4cnc9.orig/methods/rsync.cc apt-0.5.4cnc9.rsyn
+
+ return Mth.Run();
+}
diff -urN -X apt.excludes apt-0.5.4cnc9.orig/methods/rsync-method.h apt-0.5.4cnc9.rsync/methods/rsync-method.h
--- apt-0.5.4cnc9.orig/methods/rsync-method.h 1970-01-01 03:00:00 +0300
+++ apt-0.5.4cnc9.rsync/methods/rsync-method.h 2002-12-17 11:34:33 +0300
@@ -0,0 +1,102 @@
Index: apt-rpm.rsync/methods/rsync-method.h
===================================================================
--- apt-rpm.rsync/methods/rsync-method.h (working copy)
+++ apt-rpm.rsync/methods/rsync-method.h (working copy)
@@ -0,0 +1,116 @@
+// -*- mode: cpp; mode: fold -*-
+// Description /*{{{*/
+// $Id$
@ -600,7 +691,7 @@ diff -urN -X apt.excludes apt-0.5.4cnc9.orig/methods/rsync-method.h apt-0.5.4cnc
+class RsyncMethod : public pkgAcqMethod
+{
+ protected:
+ enum ConnType {ConnTypeExec, ConnTypeProto};
+ enum ConnType {ConnTypeExec, ConnTypeExecExt, ConnTypeProto};
+
+ class RsyncConn
+ {
@ -633,7 +724,9 @@ diff -urN -X apt.excludes apt-0.5.4cnc9.orig/methods/rsync-method.h apt-0.5.4cnc
+
+ protected:
+ bool WaitChild(pkgAcqMethod *Owner, FetchResult &FRes, const char *To);
+ void ParseOutput(pkgAcqMethod *Owner, FetchResult &FRes, const char *buf);
+ virtual void ParseOutput(pkgAcqMethod *Owner, FetchResult &FRes, const char *buf);
+ virtual void AddOptions(Argv &argv)
+ { argv.add("-vvvv"); };
+
+ public:
+ RsyncConnExec(URI u, const string &_proxy, const string &prog);
@ -642,6 +735,18 @@ diff -urN -X apt.excludes apt-0.5.4cnc9.orig/methods/rsync-method.h apt-0.5.4cnc
+ virtual bool Get(pkgAcqMethod *Owner, FetchResult &FRes, const char *From, const char *To);
+ };
+
+ class RsyncConnExecExt: public RsyncConnExec
+ {
+ protected:
+ virtual void ParseOutput(pkgAcqMethod *Owner, FetchResult &FRes, const char *buf);
+ virtual void AddOptions(Argv &argv)
+ { argv.add("--apt-support"); };
+
+ public:
+ RsyncConnExecExt(URI u, const string &_proxy, const string &prog):
+ RsyncConnExec(u, _proxy, prog) {};
+ };
+
+ static RsyncConn *server;
+ static ConnType connType;
+ static bool Debug;
@ -664,3 +769,23 @@ diff -urN -X apt.excludes apt-0.5.4cnc9.orig/methods/rsync-method.h apt-0.5.4cnc
+};
+
+#endif
Index: apt-rpm.rsync/methods/Makefile.am
===================================================================
--- apt-rpm.rsync/methods/Makefile.am (revision 137)
+++ apt-rpm.rsync/methods/Makefile.am (working copy)
@@ -1,6 +1,6 @@
methodsdir=${libdir}/apt/methods
-methods_PROGRAMS = cdrom copy file ftp gpg gzip bzip2 http rsh ssh
+methods_PROGRAMS = cdrom copy file ftp gpg gzip bzip2 http rsh ssh rsync
LDADD = ../apt-pkg/libapt-pkg.la
@@ -12,6 +12,7 @@
bzip2_SOURCES = $(gzip_SOURCES)
rsh_SOURCES = rsh.cc rsh.h
ssh_SOURCES = $(rsh_SOURCES)
+rsync_SOURCES = rsync.cc rsync-method.h
http_SOURCES = \
http.cc \

View File

@ -1,61 +0,0 @@
diff -ur apt-0.5.5cnc4.1/apt-pkg/algorithms.cc apt-0.5.5cnc4.1_20030324a/apt-pkg/algorithms.cc
--- apt-0.5.5cnc4.1/apt-pkg/algorithms.cc 2003-03-08 02:12:08 +0300
+++ apt-0.5.5cnc4.1_20030324a/apt-pkg/algorithms.cc 2003-03-24 20:27:31 +0300
@@ -419,7 +419,8 @@
if (_config->FindB("APT::Remove-Depends",false) == true)
Fix.RemoveDepends();
- return Fix.Resolve();
+ // CNC:2003-03-22
+ return Fix.Resolve(true);
}
/*}}}*/
// AllUpgrade - Upgrade as many packages as possible /*{{{*/
@@ -1029,6 +1030,22 @@
if ((Flags[Pkg->ID] & Protected) != 0)
continue;
+ // CNC:2003-03-22
+ pkgDepCache::State State(&Cache);
+ if (BrokenFix == true && DoUpgrade(Pkg) == true)
+ {
+ if (Cache[I].InstBroken() == false &&
+ State.BrokenCount() >= Cache.BrokenCount())
+ {
+ if (Debug == true)
+ clog << " Installing " << Pkg.Name() << endl;
+ Change = true;
+ break;
+ }
+ else
+ State.Restore();
+ }
+
if (Debug == true)
clog << " Added " << Pkg.Name() << " to the remove list" << endl;
@@ -1405,7 +1422,7 @@
return -1;
if (L->Priority != R->Priority)
- return R->Priority - L->Priority;
+ return L->Priority - R->Priority;
return strcmp(L.ParentPkg().Name(),R.ParentPkg().Name());
}
void pkgPrioSortList(pkgCache &Cache,pkgCache::Version **List)
diff -ur apt-0.5.5cnc4.1/apt-pkg/rpm/rpmpackagedata.h apt-0.5.5cnc4.1_20030324a/apt-pkg/rpm/rpmpackagedata.h
--- apt-0.5.5cnc4.1/apt-pkg/rpm/rpmpackagedata.h 2003-03-08 02:12:32 +0300
+++ apt-0.5.5cnc4.1_20030324a/apt-pkg/rpm/rpmpackagedata.h 2003-03-21 02:30:15 +0300
@@ -67,7 +67,11 @@
public:
inline pkgCache::State::VerPriority VerPriority(string Package)
- {return Priorities[Package];};
+ {
+ if (Priorities.find(Package) != Priorities.end())
+ return Priorities[Package];
+ return pkgCache::State::Optional;
+ };
inline pkgCache::Flag::PkgFlags PkgFlags(string Package)
{return Flags[Package];};

50
apt.8
View File

@ -1,50 +0,0 @@
.\" This manpage is copyright (C) 1998 Branden Robinson <branden@debian.org>.
.\"
.\" This is free software; you may redistribute it and/or modify
.\" it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2,
.\" or (at your option) any later version.
.\"
.\" This is distributed in the hope that it will be useful, but
.\" WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with APT; if not, write to the Free Software
.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
.\" 02111-1307 USA
.TH apt 8 "16 June 1998" "Debian GNU/Linux"
.SH NAME
apt \- Advanced Package Tool
.SH SYNOPSIS
.B apt
.SH DESCRIPTION
APT is a management system for software packages. It is still
under development; the snazzy front ends are not yet available. In the
meantime, please see
.BR apt-get (8).
.SH OPTIONS
None.
.SH FILES
None.
.SH SEE ALSO
.BR apt-cache (8),
.BR apt-get (8),
.BR apt.conf (5),
.BR sources.list (5)
.SH DIAGNOSTICS
apt returns zero on normal operation, decimal 100 on error.
.SH BUGS
This manpage isn't even started.
.PP
See <http://bugs.debian.org/apt>. If you wish to report a
bug in
.BR apt ,
please see
.I /usr/share/doc/debian/bug-reporting.txt
or the
.BR bug (1)
command.
.SH AUTHOR
apt was written by the APT team <apt@packages.debian.org>.

2689
apt.ru.po

File diff suppressed because it is too large Load Diff

802
apt.spec
View File

@ -1,65 +1,63 @@
# hey Emacs, its -*- mode: rpm-spec; coding: cyrillic-cp1251; -*-
Name: apt
Version: 0.5.5cnc4.1
Release: alt7
Version: 0.5.15cnc5
Release: alt1
Summary: Debian's Advanced Packaging Tool with RPM support
Summary(ru_RU.CP1251): Debian APT - Óñîâåðøåíñòâîâàííîå ñðåäñòâî óïðàâëåíèÿ ïàêåòàìè ñ ïîääåðæêîé RPM
License: GPL
Group: System/Configuration/Packaging
Url: https://moin.conectiva.com.br/AptRpm
Packager: APT Development Team <apt@packages.altlinux.org>
%def_without static
Source0: http://moin.conectiva.com.br/files/AptRpm/attachments/%name-%version.tar.bz2
Source1: apt.conf
Source2: genbasedir
Source3: README.rsync
Source4: apt.8
Source5: apt.ru.po
Source4: apt.ru.po
Source5: ChangeLog-rpm.old
Patch1: apt-0.5.5cnc2-alt-distro.patch
Patch2: apt-0.5.5cnc2-alt-rpm.patch
Patch3: apt-0.5.4cnc9-alt-getsrc.patch
Patch4: apt-0.5.4cnc3-alt-md5hash-debug.patch
Patch5: apt-0.5.4cnc9-alt-rsync.patch
Patch6: apt-0.5.5cnc4-alt-rpm_cmd.patch
Patch7: apt-0.5.5cnc4.1-alt-rpm-fancypercent.patch
Patch8: apt-0.5.5cnc1-alt-pkgpriorities.patch
Patch9: apt-0.5.4cnc9-alt-bz2.patch
Patch10: apt-0.5.4cnc9-alt-packagemanager-CheckRConflicts.patch
Patch11: apt-0.5.5cnc4-alt-install_virtual.patch
Patch12: apt-0.5.4cnc9-alt-install_virtual_version.patch
Patch13: apt-0.5.5cnc1-alt-methods_gpg_homedir.patch
Patch14: apt-0.5.4cnc9-alt-pkgorderlist_score.patch
Patch15: apt-0.5.5cnc1-alt-debsystem.patch
Patch16: apt-0.5.5cnc3-alt-i18n-apt-cdrom.patch
Patch17: apt-0.5.5cnc4-alt-tinfo.patch
Patch18: apt-cnc-20030322-algo.patch
Patch19: apt-0.5.5cnc4-alt-versionmatch.patch
Patch20: apt-0.5.5cnc4-alt-versionmatch2.patch
Patch21: apt-0.5.5cnc4-alt-defaults.patch
Patch22: apt-0.5.5cnc4.1-alt-fixpriorsort.patch
Patch23: apt-0.5.5cnc4.1-alt-parseargs.patch
Patch24: apt-0.5.5cnc4.1-alt-virtual_scores.patch
Patch1: apt-0.5.15cnc5-alt-libtool.patch
Patch11: apt-0.5.15cnc5-alt-fixes.patch
Patch12: apt-0.5.15cnc5-alt-tinfo.patch
Patch13: apt-0.5.15cnc5-alt-rpm-build.patch
Patch14: apt-0.5.15cnc5-alt-distro.patch
Patch15: apt-0.5.15cnc5-alt-debsystem.patch
Patch16: apt-0.5.15cnc5-alt-defaults.patch
Patch17: apt-0.5.5cnc5-alt-rsync.patch
Patch18: apt-0.5.15cnc5-alt-getsrc.patch
Patch19: apt-0.5.15cnc5-alt-parseargs.patch
Patch20: apt-0.5.15cnc5-alt-rpm_cmd.patch
Patch21: apt-0.5.15cnc5-alt-rpm-fancypercent.patch
Patch22: apt-0.5.15cnc5-alt-methods_gpg_homedir.patch
Patch23: apt-0.5.15cnc5-alt-md5hash-debug.patch
Patch24: apt-0.5.15cnc5-alt-packagemanager-CheckRConflicts.patch
Patch25: apt-0.5.5cnc4.1-alt-fixpriorsort.patch
Patch26: apt-0.5.4cnc9-alt-pkgorderlist_score.patch
Patch27: apt-0.5.15cnc5-alt-install_virtual.patch
Patch28: apt-0.5.15cnc5-alt-virtual_scores.patch
# Need to be adopted. Or not?
Patch31: apt-0.3.19cnc53-stelian-apt-pkg-algorithms-scores.patch
# Normally not applied, but useful.
Patch32: apt-0.5.4cnc9-alt-getsrc-debug.patch
# Obsolete.
Patch33: apt-0.5.4cnc3-alt-select-genlist.patch
Patch101: apt-0.5.4cnc9-alt-getsrc-debug.patch
PreReq: %__subst
Requires: libapt = %version-%release
Requires: %{get_dep rpm}, /etc/apt/pkgpriorities, apt-conf, gnupg, alt-gpgkeys
Requires: rpm >= 4.0.4-alt28, /etc/apt/pkgpriorities, apt-conf, gnupg, alt-gpgkeys
Obsoletes: apt-0.5
BuildPreReq: librpm-devel >= 4.0.4, rpm-build >= 4.0.4
# new rpmlib.
BuildPreReq: librpm-devel >= 4.0.4-alt28
# Automatically added by buildreq on Tue Mar 11 2003
BuildRequires: docbook-dtds docbook-utils gcc-c++ libreadline-devel librpm-devel libstdc++-devel libtinfo-devel openjade perl-SGMLSpm sgml-common xml-common
# for docs.
BuildPreReq: docbook-utils
%def_disable static
%{?_enable_static:BuildPreReq: glibc-devel-static}
# all the rest.
BuildPreReq: gcc-c++ libreadline-devel libstdc++-devel libtinfo-devel
%define risk_usage_en This package is still under development.
@ -88,19 +86,20 @@ capability and several other unique features.
Summary: APT's core libraries
Group: System/Libraries
Obsoletes: libapt-0.5
PreReq: librpm >= 4.0.4-alt28
%package -n libapt-devel
Summary: Development files and documentation for APT's core libs
Summary(ru_RU.CP1251): Ôàéëû è äîêóìåíòàöèÿ äëÿ ðàçðàáîò÷èêîâ, èñïîëüçóþùèõ áèáëèîòåêè APT
Group: Development/C
Requires: libapt = %version-%release
Requires: libapt = %version-%release, librpm-devel >= 4.0.4-alt28
Obsoletes: libapt-0.5-devel
%package -n libapt-devel-static
Summary: Development static library for APT's libs
Summary(ru_RU.CP1251): Ñòàòè÷åñêàÿ áèáëèîòåêà APT äëÿ ðàçðàáîò÷èêîâ, èñïîëüçóþùèõ áèáëèîòåêè APT
Group: Development/C
Requires: libapt-devel = %version-%release
Requires: libapt-devel = %version-%release, librpm-devel-static >= 4.0.4-alt28
Obsoletes: libapt-0.5-devel-static
%package utils
@ -109,7 +108,7 @@ Summary: Utilities to create APT repositaries (the indices)
Summary(ru_RU.CP1251): Óòèëèòû äëÿ ïîñòðîåíèÿ APT-ðåïîçèòàðèåâ (èíäåêñîâ)
Group: Development/Other
Requires: %name = %version-%release, mktemp >= 1:1.3.1, getopt
Requires: %{get_dep rpm}, gnupg, sed
Requires: gnupg, sed
Obsoletes: apt-0.5-utils
%package rsync
@ -189,17 +188,8 @@ This package contains method 'rsync' for APT.
%risk_usage
%prep
%setup -q -n apt-%version
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
@ -214,85 +204,57 @@ This package contains method 'rsync' for APT.
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
# Need to be adopted. Or not?
#%patch31 -p1
# Turn it on only if you want to see the debugging messages:
#%patch32 -p1 -b .getsrc-debug
# Obsolete.
#%patch33 -p1
#%patch101 -p1 -b .getsrc-debug
%__install -p -m644 %SOURCE3 %SOURCE4 .
%__install -p -m644 %SOURCE5 po/ru.po
find -type f -name \*.orig -print -delete
%__install -p -m644 %SOURCE3 %SOURCE5 .
%__install -p -m644 %SOURCE4 po/ru.po
%build
%add_optflags -fno-exceptions -D_GNU_SOURCE
pushd doc
[ -f apt.8 ] || %__install -p -m644 %SOURCE4 .
popd
# Fix gettextization.
if [ ! -s po/LINGUAS ]; then
%__sed -ne 's/^ALL_LINGUAS="\([^"]*\)"$/\1/p' configure.in >>po/LINGUAS
%__subst 's/^\(ALL_LINGUAS=\)/#\1/g' configure.in
fi
# Fix url.
%__subst -p 's,/usr/share/common-licenses/GPL,/usr/share/license/GPL,' COPYING
libtoolize --copy --force
aclocal -I buildlib
autoconf
%__aclocal -I buildlib
# rsync patch update only methods/Makefile.am so need to run automake
%__automake
%__autoconf
%configure --with-proc-multiply=1 --with-procs=%__nprocs
# --disable-dependency-tracking Speeds up one-time builds
%configure --includedir=%_includedir/apt-pkg %{subst_enable static}
# Probably this obsolete now?
find -type f -print0 |
xargs -r0 %__grep -EZl '/var(/lib)?/state/apt' -- |
xargs -r0 %__subst 's,/var\(/lib\)\?/state/apt,%_localstatedir/apt,g' --
%make clean
%make_build %{?_enable_static:STATICLIBS=1} NOISY=1
xargs -r0 %__subst -p 's,/var\(/lib\)\?/state/apt,%_localstatedir/%name,g' --
%make_build
%install
%__mkdir_p $RPM_BUILD_ROOT{%_bindir,%_libdir/apt,%_mandir/man{1,5,8},%_includedir/apt-pkg,%_includedir/apt-inst,%_sysconfdir/apt/{apt.conf,sources.list,vendors.list}.d}
%__mkdir_p $RPM_BUILD_ROOT%_localstatedir/apt/{lists/partial,prefetch}
%__mkdir_p $RPM_BUILD_ROOT/var/cache/apt/{archives/partial,gen{pkg,src}list}
%__mkdir_p %buildroot%_sysconfdir/%name/{%name.conf,sources.list,vendors.list}.d
%__mkdir_p %buildroot%_libdir/%name/scripts
%__mkdir_p %buildroot%_localstatedir/%name/{lists/partial,prefetch}
%__mkdir_p %buildroot%_cachedir/%name/{archives/partial,gen{pkg,src}list}
%__cp -a bin/lib*.so* $RPM_BUILD_ROOT%_libdir/
%if_enabled static
%__cp -a bin/lib*.a* $RPM_BUILD_ROOT%_libdir/
%endif
%makeinstall includedir=%buildroot%_includedir/apt-pkg
%__install -p -m755 bin/methods/* $RPM_BUILD_ROOT%_libdir/apt/
%__install -p -m755 bin/apt-* $RPM_BUILD_ROOT%_bindir/
%__install -p -m755 bin/{%name-*,*list} %SOURCE2 $RPM_BUILD_ROOT%_bindir/
%__install -p -m755 %SOURCE2 %buildroot%_bindir/
%__install -p -m644 %SOURCE1 %buildroot%_sysconfdir/%name/
%__install -p -m644 apt-pkg/{,*/}*.h $RPM_BUILD_ROOT%_includedir/apt-pkg/
%__install -p -m644 apt-inst/{,*/}*.h $RPM_BUILD_ROOT%_includedir/apt-inst/
# This is still needed.
%__ln_s -f rsh %buildroot%_libdir/%name/methods/ssh
%__ln_s -f gzip %buildroot%_libdir/%name/methods/bzip2
%__install -p -m644 doc/*.1 $RPM_BUILD_ROOT%_man1dir/
%__install -p -m644 doc/*.5 $RPM_BUILD_ROOT%_man5dir/
%__install -p -m644 doc/*.8 $RPM_BUILD_ROOT%_man8dir/
# Cleanup
find %buildroot%_includedir -type f -name rpmshowprogress.h -print -delete
%__rm -f %buildroot%_libdir/*.la
%__install -p -m644 %SOURCE1 $RPM_BUILD_ROOT%_sysconfdir/apt/
%__bzip2 -9fk ChangeLog-rpm.old
%__ln_s -f rsh $RPM_BUILD_ROOT%_libdir/apt/ssh
%__ln_s -f gzip $RPM_BUILD_ROOT%_libdir/apt/bzip2
%__mkdir_p $RPM_BUILD_ROOT%_datadir
%__rm -rf $RPM_BUILD_ROOT%_datadir/locale
%__cp -a locale $RPM_BUILD_ROOT%_datadir/
%define docdir %_docdir/%name-%version
%__mkdir_p $RPM_BUILD_ROOT%docdir
%__cp -a README* TODO COPYING AUTHORS* doc/examples \
$RPM_BUILD_ROOT%docdir/
%find_lang --output=%name.lang \
apt libapt-pkg3.3
%find_lang %name
%triggerun -- apt < 0.5.4
CONF=/etc/apt/apt.conf
@ -305,30 +267,30 @@ fi
%files -f %name.lang
%_bindir/apt-*
%_libdir/apt
%exclude %_libdir/apt/rsync
%dir %_sysconfdir/apt
%config(noreplace) %_sysconfdir/apt/apt.conf
%dir %_sysconfdir/apt/*.d
%_libdir/%name
%exclude %_libdir/%name/methods/rsync
%dir %_sysconfdir/%name
%config(noreplace) %_sysconfdir/%name/%name.conf
%dir %_sysconfdir/%name/*.d
%_mandir/man?/*
%docdir
%_localstatedir/apt
%_localstatedir/%name
%doc README* TODO COPYING AUTHORS* doc/examples ChangeLog-rpm.old.bz2
%defattr(2770,root,rpm,2770)
%_cachedir/apt/archives
%_cachedir/%name/archives
%files utils
%_bindir/*
%exclude %_bindir/apt-*
%defattr(2770,root,rpm,2770)
%_cachedir/apt/gen*list
%_cachedir/%name/gen*list
%files -n libapt
%_libdir/*.so.*
%defattr(2770,root,rpm,2770)
%dir %_cachedir/apt
%dir %_cachedir/%name
%files -n libapt-devel
%_libdir/*.so
@ -340,25 +302,185 @@ fi
%endif
%files rsync
%dir %_libdir/apt
%_libdir/apt/rsync
%dir %_libdir/%name
%dir %_libdir/%name/methods
%_libdir/%name/methods/rsync
# Probably %%doc with README.rsync?
%changelog
* Sun Sep 28 2003 Dmitry V. Levin <ldv@altlinux.org> 0.5.5cnc4.1-alt7
- apt-pkg/rpm/rpmpm.cc(pkgRPMPM::ExecRPM): honor "quiet" option.
- Additional sorting hacks for virtual packages (mouse).
* Fri Jan 16 2004 Dmitry V. Levin <ldv@altlinux.org> 0.5.15cnc5-alt1
- Specfile cleanup.
- Rediffed patches.
- Fixed --help/--version segfault.
- Fixed some compilation warnings.
- Relocated methods to %_libdir/%name/methods/.
* Wed Sep 03 2003 Rider <rider@altlinux.ru> 0.5.5cnc4.1-alt6
- Fixed sorting of equal packages names with different versions (Mouse).
- Fixed parsing command line arguments (Mouse).
* Thu Jan 15 2004 Dmitry V. Levin <ldv@altlinux.org> 0.5.15cnc5-alt0.3
- Updated:
+ apt-0.5.15cnc5-alt-rpm
+ apt-0.5.15cnc5-alt-rpm-fancypercent
* Tue Jun 24 2003 Dmitry V. Levin <ldv@altlinux.org> 0.5.5cnc4.1-alt5
- apt-get: Optimize pure virtual packages install.
- libapt,apt-get: Use pkgVersioningSystem's CheckDep algorithm
for normal version match.
- Changed some defaults in code rather then in /etc/apt.conf;
cleaned up /etc/apt.conf file.
- Do not build static libraries by default.
* Tue Jan 13 2004 Anton Kachalov <mouse@altlinux.ru> 0.5.15cnc5-alt0.2
- Updated and applied:
+ apt-0.5.15cnc5-alt-install_virtual
+ apt-0.5.15cnc5-alt-virtual_scores
- Removed:
+ apt-0.5.4cnc9-alt-install_virtual_version (merged upstream).
* Fri Dec 26 2003 Anton V. Denisov <avd@altlinux.org> 0.5.15cnc5-alt0.1
- Updated to 0.5.15cnc4.
- Updated alt-rpm.patch.
* Tue Dec 09 2003 Anton V. Denisov <avd@altlinux.org> 0.5.15cnc4-alt0.2
- Updated and applied alt-getsrc.patch.
- Following patches still stay unapplied:
+ alt-install_virtual.patch
+ alt-install_virtual_version.patch
+ alt-virtual_scores.patch
* Mon Dec 08 2003 Anton V. Denisov <avd@altlinux.org> 0.5.15cnc4-alt0.1
- Updated to 0.5.15cnc4.
- Updated alt-distro.patch.
- Updated russian translation.
- Get rid of %_libdir/*.la files.
- Still have disabled patches.
* Tue Nov 25 2003 Anton V. Denisov <avd@altlinux.org> 0.5.15cnc3-alt0.1
- Updated to 0.5.15cnc3
- Temporary disabled patches:
+ apt-0.5.4cnc9-alt-getsrc.patch
+ apt-0.5.5cnc4-alt-install_virtual.patch
+ apt-0.5.5cnc4.1-alt-virtual_scores.patch
- Merged upstream patches:
+ apt-0.5.15cnc1-upstream-pinning-fix.patch
- NOTE:
+ this release can not be used with hasher (until we 'll
update temporary disabled patches);
+ all packages which uses libapt need to be rebuilt (library version
changed).
- TODO:
+ check and update our patches (most important);
+ update russian translation.
* Tue Nov 11 2003 Anton V. Denisov <avd@altlinux.org> 0.5.15cnc1-alt0.2
- added apt-0.5.15cnc1-upstream-pinning-fix.patch.
- Updated russian translation.
* Sat Nov 08 2003 Anton V. Denisov <avd@altlinux.org> 0.5.15cnc1-alt0.1
- Updated to 0.5.15cnc1, renumbered patches.
- Removed patches:
+ apt-0.5.5cnc5-panu-nodigest.patch
- Updated patches:
+ alt-distro.patch
+ alt-rpm_cmd.patch
+ alt-defaults.patch
- Merged upstream patches:
+ alt-bz2.patch
+ alt-versionmatch.patch
+ alt-versionmatch2.patch
+ alt-cleanups.patch
+ apt-0.5.12_apt-get_backports.patch
+ apt-0.5.12_apt-cache_backports.patch
+ apt-0.5.12_doc_backports.patch
+ apt-0.5.12_methods_backports.patch
+ apt-0.5.12_apt-pkg_backports.patch
+ apt-0.5.12_acqprogress_backports.patch
+ apt-0.5.12_tests_backports.patch
+ apt-0.5.14_apt_get_and_docs.patch
- Temporary disabled patches:
+ alt-install_virtual_version.patch (need to be updated by author)
- Following patches wasn't accepted by upstream (what to do with it?):
+ alt-packagemanager-CheckRConflicts.patch
+ alt-debsystem.patch
+ alt-install_virtual.patch
+ alt-fixpriorsort.patch
+ alt-rpm-fancypercent.patch
+ alt-virtual_scores.patch
+ alt-parseargs.patch
* Thu Oct 09 2003 Anton V. Denisov <avd@altlinux.org> 0.5.5cnc6-alt0.8
- added BuildRequires: python (fix build in hasher).
- partial merge with upstream APT (0.5.14):
+ apt-0.5.14_apt_get_and_docs.patch
* Wed Oct 08 2003 Anton V. Denisov <avd@altlinux.org> 0.5.5cnc6-alt0.7
- added apt-0.5.5cnc6-alt-cleanups.patch (fixed some compiler warnings)
- sync with apt-0.5.5cnc4.1-alt7:
+ updated alt-fixpriorsort.patch
+ updated alt-rpm-fancypercent.patch
+ updated alt-parseargs.patch (and update it for cnc6)
+ added alt-virtual_scores.patch
+ renamed spec file.
* Tue Oct 07 2003 Anton V. Denisov <avd@altlinux.org> 0.5.5cnc6-alt0.5
- partial merge with upstream APT (0.5.12):
+ apt-0.5.12_apt-cache_backports.patch
+ apt-0.5.12_apt-get_backports.patch
+ apt-0.5.12_doc_backports.patch
+ apt-0.5.12_methods_backports.patch
+ apt-0.5.12_apt-pkg_backports.patch
+ apt-0.5.12_acqprogress_backports.patch
+ apt-0.5.12_tests_backports.patch
* Mon Oct 06 2003 Anton V. Denisov <avd@altlinux.org> 0.5.5cnc6-alt0.4
- sync with apt-0.5.5cnc4.1-alt6:
+ added apt-0.5.5cnc4.1-alt-parseargs.patch
+ added apt-0.5.5cnc6-alt-fixpriorsort.patch
* Fri Sep 05 2003 Anton V. Denisov <avd@altlinux.org> 0.5.5cnc6-alt0.3
- s/$RPM_BUILD_ROOT/%%buildroot/g in spec file.
- Updated BuildRequires in Sisyphus (20030704) env.
- Updated russian translation.
- sync with apt-0.5.5cnc4.1-alt5:
+ added apt-0.5.5cnc4-alt-defaults.patch
+ cleaned up /etc/apt.conf file.
+ updated alt-install_virtual.patch
+ added apt-0.5.5cnc4-alt-versionmatch2.patch
+ do not build static libraries by default.
* Mon Jun 16 2003 Anton V. Denisov <avd@altlinux.org> 0.5.5cnc6-alt0.1
- Updated to 0.5.5cnc6.
- Re-added patches due to upstream changes:
+ alt-debsystem.patch (apt-pkg/deb/debsystem.cc was added again).
- Downgraded patches due to upstream changes:
+ alt-getsrc.patch (apt-pkg/deb/debsrcrecords.h was added again).
- Packaged directories:
+ Dir::Bin::scripts (/usr/lib/apt/scripts);
- Updated %%doc (contrib dir added).
* Fri Jun 06 2003 Anton V. Denisov <avd@altlinux.org> 0.5.5cnc5-alt0.5
- old changelog entries come back as rpm_old_changelog.
- updated %%find_lang call.
- added -I m4 for %%__aclocal call.
- more macroszification.
- My Mother birthday edition.
* Tue Jun 03 2003 Anton V. Denisov <avd@altlinux.org> 0.5.5cnc5-alt0.4
- %%install section reworked (%%makeinstall use).
- %%build section cleaned up.
- %%_libdir/*.la moved to libapt-devel subpackage.
- %name.8 removed from sources.
- Dropped obsolete old patches.
- Dropped old changelog entries.
* Tue Jun 03 2003 Anton V. Denisov <avd@altlinux.org> 0.5.5cnc5-alt0.3
- Updated to 0.5.5cnc5, renumbered patches.
- Added patches:
+ apt-0.5.5cnc5-panu-nodigest.patch
- Updated patches:
+ alt-getsrc
+ alt-rsync
+ alt-tinfo
+ alt-rpm (check this one)
- Removed patches due to upstream changes:
+ alt-debsystem
- Merged upstream patches:
+ alt-i18n-apt-cdrom
+ apt-cnc-20030322-algo
- Updated russian translation.
- Explicitly use autoconf-2.5 and automake-1.7 for build.
- Major changes in spec file (need more changes).
- Updated buildrequires (libbeecrypt-devel and glibc-devel-static added).
* Mon Apr 28 2003 Dmitry V. Levin <ldv@altlinux.org> 0.5.5cnc4.1-alt4
- apt-get: substitute virtual package with real one (mouse).
@ -589,414 +711,6 @@ fi
- It's a just build for Deadalus - not for actual use.
- I just built it but not test yet.
* Wed Jun 10 2002 Ivan Zakharyaschev <imz@altlinux.ru> 0.3.19cnc55-alt6
- fixes in genbasedir from apt-utils:
+ srclist generation: now it correctly includes the information on produced
binaries (the list was empty before), and also correctly treats --mapi
(the fixed bug caused misbehaviour of 'apt-get source', in the "2nd branch
of DoSource()" as referenced by me in previous changelogs);
+ --flat option.
* Mon Jun 09 2002 Ivan Zakharyaschev <imz@altlinux.ru> 0.3.19cnc55-alt5
- renamed the 'build' subpackage to 'utils' (because there is already
an 'apt-build' project at freshmeat.net).
* Mon Jun 09 2002 Ivan Zakharyaschev <imz@altlinux.ru> 0.3.19cnc55-alt4
- separate subpkg 'build': analoguous to rpm-build, contains teh utilities to
generate indices (as a consequence less dependencies of 'apt' pkg,
little size);
- fix the work of 'apt-get source' for source packages with multiple binaries
with help of feedback and debugging patches from Anton Denisov
<fire@kgpu.kamchatka.ru> (only the first branch of control flow in DoSource()
is fixed, but that should be enough for normal use).
* Tue Mar 26 2002 Dmitry V. Levin <ldv@alt-linux.org> 0.3.19cnc55-alt3
- Added librpm-4.0.4 build support.
- Built with librpm-4.0.4, updated buildrequires.
* Thu Mar 21 2002 Dmitry V. Levin <ldv@alt-linux.org> 0.3.19cnc55-alt2
- Added kernel-aureal and NVIDIA_kernel to default AllowedDupPkgs.
- Updated patch for pkgRPMPM::ExecRPM.
- Reenabled rsh method.
- Updated rpmpriorities.
- fixed genbasedir patch.
- Set explicit Packager tag.
- Dropped obsolete trigger.
- lib%name: Conflicts: %name < %%version-%%release.
- Renamed patches.
* Wed Mar 13 2002 Alexander Bokovoy <ab@altlinux.ru> 0.3.19cnc55-alt1
- apt-0.3.19cnc55 integrated
- Fixed:
+ rpmpm-exec_rpm patch
+ genbasedir
- Removed:
+ rpmpm-nodeps patch (already upstream)
+ rsh method (already upstream)
* Mon Dec 10 2001 Dmitry V. Levin <ldv@alt-linux.org> 0.3.19cnc53-alt6
- Fixed rpm --nodeps option usage in pkgRPMPM::ExecRPM (#0000215).
* Fri Nov 23 2001 Dmitry V. Levin <ldv@alt-linux.org> 0.3.19cnc53-alt5
- Applied scoring algorithm patch (Stelian Pop <stelian.pop@fr.alcove.com>)
- Updated package requires.
* Mon Nov 19 2001 Dmitry V. Levin <ldv@alt-linux.org> 0.3.19cnc53-alt4
- Dropped outdated pofile (already upstream).
- Corrected "Executing RPM" message generation.
* Fri Nov 16 2001 Dmitry V. Levin <ldv@alt-linux.org> 0.3.19cnc53-alt3
- Updated patches: genbasedir, configure-db3, i18n.
* Wed Nov 15 2001 Alexander Bokovoy <ab@altlinux.ru> 0.3.19cnc53-alt2
+ apt-0.3.19cnc53-2cl integrated. Most of our patches moved to upstream
- Fixed (from Conectiva's changelog):
+ fixed bug in mirror patch
+ cleaned up gen{pkg,src}list (Alexander Bokovoy <ab@altlinux.ru
+ fixed crash bug in genpkglist
+ configure.in patch to detect rpmdb (Stelian Pop <stelian.pop@fr.alcove.com>)
+ * Skips correctly over empty package directories
+ * Adds the --bz2only argument which makes genbasedir
+ to generate only the .bz2 compressed versions of pkglist
+ and srclist (space gain...)
+ * Doesn't change the timestamps on pkglists/srclists if
+ the contents are not modified (making possible for example
+ to make several consecutive runs of genbasedir without
+ having the apt clients download the indexes again and again).
+ * Some minor cleanups (remove the temporary files in /tmp
+ at the end of the script etc).
+ (Stelian Pop <stelian.pop@fr.alcove.com>)
+ cleanup patch for gensrclist (Stelian Pop <stelian.pop@fr.alcove.com>)
+ fixed multi-arch pkg handling (Stelian Pop <stelian.pop@fr.alcove.com>)
+ updated russian translation (Alexander Bokovoy <ab@altlinux.ru>
+ updated i18n (Dmitry Levin <ldv@alt-linux.org>)
+ replaced Apt::GPG::Pubring with Apt::GPG::PubringPath
also uses --homedir instead of --keyring in gpg
(Alexander Bokovoy <ab@altlinux.ru>)
+ patch to detect replaced (instead of just removed) packages
Dmitry Levin <ldv@alt-linux.org>
+ updated mirrors patch
+ Fixed mirrors infinite loop bug (closes: #4420).
+ Fixed error handling.
- Added:
+ added kernel-tape to default AllowedDupPkgs
+ added patch to fix bug in genbasedir with empty dirs
(Stelian Pop <stelian.pop@fr.alcove.com>)
+ added -K (RPM::Check-Signatures) option to verify rpm sigs
+ Added mirrors patch.
* Fri Nov 02 2001 Dmitry V. Levin <ldv@alt-linux.org> 0.3.19cnc52-alt6
- Initial build with rpm4.
* Thu Oct 04 2001 Dmitry V. Levin <ldv@altlinux.ru> 0.3.19cnc52-alt5
- Fixed i18n support and probably smth else
(configure.in, config.h.in and i18n.h were broken, kojima sux).
- Implemented 18n for apt-pkg/rpm, updated POTFILES.in and russian translation.
* Mon Oct 01 2001 Dmitry V. Levin <ldv@altlinux.ru> 0.3.19cnc52-alt4
- Removed "^(kernel|alsa)[0-9]*-headers" from RPM::HoldPkgs list.
- Added (experimental) replaced packages support.
* Fri Sep 07 2001 Ivan Zakharyaschev <imz@altlinux.ru> 0.3.19cnc52-alt3.1
- apt-cdrom fix (patch 6) reworked: apt-cdrom used to not detect a second
list file (srclist) if both (pkglist and srclist) were present in one
directory on the disk (in non-thorough mode); hopefully now it works how
we expect it to do.
* Thu Aug 09 2001 Dmitry V. Levin <ldv@altlinux.ru> 0.3.19cnc52-alt3
- Libification.
- Reworked compilation options again: we add only '-fno-exceptions' now.
* Tue Aug 07 2001 Dmitry V. Levin <ldv@altlinux.ru> 0.3.19cnc52-alt2
- More code cleanup in tools/gen{pkg,src}list.cc.
- Added %%optflags_nocpp to compilation options.
* Mon Aug 06 2001 Alexander Bokovoy <ab@altlinux.ru> 0.3.19cnc52-alt1
- cnc52, gcc 3 and Solaris fixes
- RPM4 check is disabled for the moment
- File method fix has been integrated into mainstream
- RPM::RemoveOptions, RPM::UpdateOptions have been added
- Generation of Package list fixed
* Thu Aug 02 2001 Dmitry V. Levin <ldv@altlinux.ru> 0.3.19cnc51-alt4
- Added trigger for better apt-conf-* migration.
* Tue Jul 31 2001 Dmitry V. Levin <ldv@altlinux.ru> 0.3.19cnc51-alt3
- Updated:
+ rpmpriorities,
+ AllowedDupPkgs,
+ HoldPkgs.
- Moved *.list to apt-conf-* packages.
* Fri Jul 20 2001 Alexander Bokovoy <ab@altlinux.ru> 0.3.19cnc51-alt2
- Fixed:
+ Bug in file method which prevented authentication from working correctly
* Fri Jul 20 2001 Alexander Bokovoy <ab@altlinux.ru> 0.3.19cnc51-alt1
- cnc51
* Wed Jun 27 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc46-alt2
- cnc46
- kernel(|24)-{headers,source} added to HoldPkgs
- REPOSITORIO-APT-HOWTO added (Portugal)
- AllowedDupPackages -> AllowedDupPkgs
* Thu Jun 07 2001 Dmitry V. Levin <ldv@altlinux.ru> 0.3.19cnc38-alt4
- Various fixes in %_bindir/genbasedir.
* Thu May 17 2001 Dmitry V. Levin <ldv@altlinux.ru> 0.3.19cnc38-alt3
- Fixed build.
- Updated rpmpriorities.
* Mon Apr 16 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc38-alt2
- More duplicate packages from kernel series allowed.
* Sun Apr 15 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc38-alt1
- cnc38
- Updated:
+ apt-cdrom now works correctly
+ default architecture has been changed to i586
+ ssh method as wrapper to rsh one
* Mon Mar 19 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc37-ipl3mdk
- Updated:
+ New patch for genbasedir to allow pass default key to GnuPG
* Sun Mar 18 2001 Dmitry V. Levin <ldv@altlinux.ru> 0.3.19cnc37-ipl2mdk
- Fixed:
+ Build/installation of manpages without yodl sources;
+ Uncompressed small patches.
- Updated:
+ AllowedDupPackages list according to new kernel naming scheme;
+ URLs to use new domain name.
* Sat Mar 17 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc37-ipl1mdk
- Fixed:
+ APT::GPG::Pubring renamed to APT::GPG::PubringPath
+ Pubring support patch changed to use --homedir instead of --keyring
- Updated:
+ APT cnc37
+ Fingerprint and repository sources changed to reflect ALT Linux
new public key ring
* Mon Feb 19 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc36-ipl4mdk
- Sisyphus source repository added to sources.list
* Mon Feb 19 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc36-ipl3mdk
- New version
* Fri Feb 16 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc35-ipl2mdk
- Static library compilation added
- Static library goes to apt-devel-static due sizes of library
* Thu Feb 15 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc35-ipl1mdk
- New version
- Rsh method from upstream apt-get ported
- Spec file follows libification of rpm now
* Mon Jan 22 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc32-ipl4mdk
- New upstream version
- Russian translation updated
- Rebuild with new RPM library
* Mon Jan 22 2001 Alexander Bokovoy <ab@avilink.net> 0.3.19cnc28-ipl1mdk
- New upstream version
- cnc28 still lacks correct GNUPG checking code, our patch is neccessary.
- Genbasedir slightly patched again.
* Sun Jan 21 2001 Alexander Bokovoy <ab@avilink.net> ipl11mdk
- Typo in methods/gpg.cc fixed.
* Sun Jan 21 2001 Alexander Bokovoy <ab@avilink.net> ipl10mdk
- APT::GPG::Pubring option to specify default gnupg public ring added to check
distributors' signs automatically via default pubring in RPM package
- ftp user password changed to IPL one.
* Tue Jan 09 2001 Dmitry V. Levin <ldv@fandra.org> 0.3.19cnc27-ipl7mdk
- Specfile cleanup.
* Mon Jan 08 2001 Alexander Bokovoy <ab@avilink.net> ipl5mdk
- genbasedir help message fixed
* Mon Jan 08 2001 Alexander Bokovoy <ab@avilink.net> ipl4mdk
- Integration with main IPL package:
- Russian translation for command line messages added
- Russian translation of package summary/description
* Thu Jan 04 2001 AEN <aen@logic.ru>
- Real Sisyphus URL & IPLabs Fingerptint added
- changed rpmpriorities
* Thu Jan 04 2001 AEN <aen@logic.ru>
- build for RE
* Tue Dec 12 2000 Frederic Lepied <flepied@mandrakesoft.com> 0.3.19cnc27-1mdk
- first mandrake version.
* Thu Dec 07 2000 Andreas Hasenack <andreas@conectiva.com>
- damn! Wrong URL in sources.list, atualizacoes.conectiva.com
doesn't exist, of course...
* Thu Dec 07 2000 Andreas Hasenack <andreas@conectiva.com>
- updated sources.list with new mirrors and new download tree
- removed (noreplace) for the sources.list file for this
upgrade. It will be easier for the user. The (noreplace)
should be back in place after this update as we expect no
further big modifications for that file, only new mirrors.
* Wed Dec 06 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- fixed prob in vendors.list
* Tue Dec 05 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc27
* Wed Nov 08 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc26
* Mon Nov 06 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc25
* Thu Nov 02 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc24
* Thu Nov 02 2000 Rud<E1> Moura <ruda@conectiva.com>
- updated source.list (again)
* Thu Nov 02 2000 Rud<E1> Moura <ruda@conectiva.com>
- updated source.list
* Wed Nov 01 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc23
- added cache directories for gen{pkg,src}list
- pt_BR manpages
* Tue Oct 31 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc22
- Requires -> PreReq in apt-devel
* Mon Oct 30 2000 Alfredo Kojima <kojima@conectiva.com>
- collapsed libapt-pkg-devel and -doc to apt-devel
* Mon Oct 30 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc21
* Sun Oct 29 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc20
* Sun Oct 29 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc19
- added gensrclist
- support for apt-get source
* Fri Oct 27 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc18
* Thu Oct 26 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc17
- new manpages
* Wed Oct 25 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc16
* Sun Oct 22 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc15
* Sat Oct 21 2000 Alfredo K. Kojima <kojima@conectiva.com.br>
- released version 0.3.19cnc14
* Thu Oct 19 2000 Claudio Matsuoka <claudio@conectiva.com>
- new upstream release: 0.3.9cnc13
* Tue Oct 17 2000 Eliphas Levy Theodoro <eliphas@conectiva.com>
- added rpmpriorities to filelist and install
* Tue Oct 17 2000 Claudio Matsuoka <claudio@conectiva.com>
- updated to 0.3.19cnc12
- fresh CVS snapshot including: support to Acquire::ComprExtension,
debug messages removed, fixed apt-cdrom, RPM DB path, rpmlib call
in pkgRpmLock::Close(), package priority kludge removed, i18n
improvements, and genbasedir/genpkglist updates.
- handling language setting in genpkglist to make aptitude happy
* Wed Oct 11 2000 Alfredo K. Kojima <kojima@conectiva.com>
- released version 0.3.19cnc11
- fixed problem with shard lib symlinks
* Tue Oct 10 2000 Alfredo K. Kojima <kojima@conectiva.com>
- released version 0.3.19cnc10
* Mon Oct 2 2000 Claudio Matsuoka <claudio@conectiva.com>
- fixed brown paper bag bug with method permissions
- added parameter --sign to genbasedir
- added html/text doc files
* Sat Sep 30 2000 Claudio Matsuoka <claudio@conectiva.com>
- bumped to 0.3.19cnc9
- added vendors.list
- added gpg method
- fixed minor stuff to make Aptitude work
- added missing manpages
- fixed shared libs
- split in apt, libapt-pkg, libapt-pkg-devel, libapt-pkg-doc
- rewrote genbasedir in shell script (original was in TCL)
- misc cosmetic changes
* Tue Sep 26 2000 Alfredo K. Kojima <kojima@conectiva.com>
- released version 0.3.19cnc8
* Wed Sep 20 2000 Alfredo K. Kojima <kojima@conectiva.com>
- released version 0.3.19cnc7
* Mon Sep 18 2000 Alfredo K. Kojima <kojima@conectiva.com>
- released version 0.3.19cnc6
* Sat Sep 16 2000 Alfredo K. Kojima <kojima@conectiva.com>
- released version 0.3.19cnc5
* Fri Sep 15 2000 Alfredo K. Kojima <kojima@conectiva.com>
- released version 0.3.19cnc4
* Mon Sep 12 2000 Alfredo K. Kojima <kojima@conectiva.com>
- released version 0.3.19cnc3
* Mon Sep 5 2000 Alfredo K. Kojima <kojima@conectiva.com>
- renamed package to apt, with version 0.3.19cncV
* Mon Sep 5 2000 Alfredo K. Kojima <kojima@conectiva.com>
- 0.10
- added genpkglist and rapt-config
- program names changed back to apt-*
* Mon Sep 4 2000 Alfredo K. Kojima <kojima@conectiva.com>
- 0.9
* Mon Sep 4 2000 Alfredo K. Kojima <kojima@conectiva.com>
- 0.8
* Mon Sep 4 2000 Alfredo K. Kojima <kojima@conectiva.com>
- 0.7
* Fri Sep 1 2000 Alfredo K. Kojima <kojima@conectiva.com>
- fixed typo in sources.list
* Tue Aug 31 2000 Alfredo K. Kojima <kojima@conectiva.com>
- version 0.6
* Tue Aug 31 2000 Alfredo K. Kojima <kojima@conectiva.com>
- version 0.5
* Tue Aug 31 2000 Alfredo K. Kojima <kojima@conectiva.com>
- version 0.4
* Wed Aug 30 2000 Alfredo K. Kojima <kojima@conectiva.com>
- version 0.3
* Thu Aug 28 2000 Alfredo K. Kojima <kojima@conectiva.com>
- second try. new release with direct hdlist handling
* Thu Aug 10 2000 Alfredo K. Kojima <kojima@conectiva.com>
- initial package creation. Yeah, it's totally broken for sure.
# Local Variables:
# compile-command: "rpmbuild -ba --target=i586 apt.spec"
# End:

435
apt/ABOUT-NLS Normal file
View File

@ -0,0 +1,435 @@
Notes on the Free Translation Project
*************************************
Free software is going international! The Free Translation Project
is a way to get maintainers of free software, translators, and users all
together, so that will gradually become able to speak many languages.
A few packages already provide translations for their messages.
If you found this `ABOUT-NLS' file inside a distribution, you may
assume that the distributed package does use GNU `gettext' internally,
itself available at your nearest GNU archive site. But you do _not_
need to install GNU `gettext' prior to configuring, installing or using
this package with messages translated.
Installers will find here some useful hints. These notes also
explain how users should proceed for getting the programs to use the
available translations. They tell how people wanting to contribute and
work at translations should contact the appropriate team.
When reporting bugs in the `intl/' directory or bugs which may be
related to internationalization, you should tell about the version of
`gettext' which is used. The information can be found in the
`intl/VERSION' file, in internationalized packages.
Quick configuration advice
==========================
If you want to exploit the full power of internationalization, you
should configure it using
./configure --with-included-gettext
to force usage of internationalizing routines provided within this
package, despite the existence of internationalizing capabilities in the
operating system where this package is being installed. So far, only
the `gettext' implementation in the GNU C library version 2 provides as
many features (such as locale alias, message inheritance, automatic
charset conversion or plural form handling) as the implementation here.
It is also not possible to offer this additional functionality on top
of a `catgets' implementation. Future versions of GNU `gettext' will
very likely convey even more functionality. So it might be a good idea
to change to GNU `gettext' as soon as possible.
So you need _not_ provide this option if you are using GNU libc 2 or
you have installed a recent copy of the GNU gettext package with the
included `libintl'.
INSTALL Matters
===============
Some packages are "localizable" when properly installed; the
programs they contain can be made to speak your own native language.
Most such packages use GNU `gettext'. Other packages have their own
ways to internationalization, predating GNU `gettext'.
By default, this package will be installed to allow translation of
messages. It will automatically detect whether the system already
provides the GNU `gettext' functions. If not, the GNU `gettext' own
library will be used. This library is wholly contained within this
package, usually in the `intl/' subdirectory, so prior installation of
the GNU `gettext' package is _not_ required. Installers may use
special options at configuration time for changing the default
behaviour. The commands:
./configure --with-included-gettext
./configure --disable-nls
will respectively bypass any pre-existing `gettext' to use the
internationalizing routines provided within this package, or else,
_totally_ disable translation of messages.
When you already have GNU `gettext' installed on your system and run
configure without an option for your new package, `configure' will
probably detect the previously built and installed `libintl.a' file and
will decide to use this. This might be not what is desirable. You
should use the more recent version of the GNU `gettext' library. I.e.
if the file `intl/VERSION' shows that the library which comes with this
package is more recent, you should use
./configure --with-included-gettext
to prevent auto-detection.
The configuration process will not test for the `catgets' function
and therefore it will not be used. The reason is that even an
emulation of `gettext' on top of `catgets' could not provide all the
extensions of the GNU `gettext' library.
Internationalized packages have usually many `po/LL.po' files, where
LL gives an ISO 639 two-letter code identifying the language. Unless
translations have been forbidden at `configure' time by using the
`--disable-nls' switch, all available translations are installed
together with the package. However, the environment variable `LINGUAS'
may be set, prior to configuration, to limit the installed set.
`LINGUAS' should then contain a space separated list of two-letter
codes, stating which languages are allowed.
Using This Package
==================
As a user, if your language has been installed for this package, you
only have to set the `LANG' environment variable to the appropriate
`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code,
and `CC' is an ISO 3166 two-letter country code. For example, let's
suppose that you speak German and live in Germany. At the shell
prompt, merely execute `setenv LANG de_DE' (in `csh'),
`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
This can be done from your `.login' or `.profile' file, once and for
all.
You might think that the country code specification is redundant.
But in fact, some languages have dialects in different countries. For
example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
country code serves to distinguish the dialects.
The locale naming convention of `LL_CC', with `LL' denoting the
language and `CC' denoting the country, is the one use on systems based
on GNU libc. On other systems, some variations of this scheme are
used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
locales supported by your system for your country by running the command
`locale -a | grep '^LL''.
Not all programs have translations for all languages. By default, an
English message is shown in place of a nonexistent translation. If you
understand other languages, you can set up a priority list of languages.
This is done through a different environment variable, called
`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
for the purpose of message handling, but you still need to have `LANG'
set to the primary language; this is required by other parts of the
system libraries. For example, some Swedish users who would rather
read translations in German than English for when Swedish is not
available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
In the `LANGUAGE' environment variable, but not in the `LANG'
environment variable, `LL_CC' combinations can be abbreviated as `LL'
to denote the language's main dialect. For example, `de' is equivalent
to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
(Portuguese as spoken in Portugal) in this context.
Translating Teams
=================
For the Free Translation Project to be a success, we need interested
people who like their own language and write it well, and who are also
able to synergize with other translators speaking the same language.
Each translation team has its own mailing list. The up-to-date list of
teams can be found at the Free Translation Project's homepage,
`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
area.
If you'd like to volunteer to _work_ at translating messages, you
should become a member of the translating team for your own language.
The subscribing address is _not_ the same as the list itself, it has
`-request' appended. For example, speakers of Swedish can send a
message to `sv-request@li.org', having this message body:
subscribe
Keep in mind that team members are expected to participate
_actively_ in translations, or at solving translational difficulties,
rather than merely lurking around. If your team does not exist yet and
you want to start one, or if you are unsure about what to do or how to
get started, please write to `translation@iro.umontreal.ca' to reach the
coordinator for all translator teams.
The English team is special. It works at improving and uniformizing
the terminology in use. Proven linguistic skill are praised more than
programming skill, here.
Available Packages
==================
Languages are not equally supported in all packages. The following
matrix shows the current state of internationalization, as of August
2002. The matrix shows, in regard of each package, for which languages
PO files have been submitted to translation coordination, with a
translation percentage of at least 50%.
Ready PO files be bg ca cs da de el en eo es et fi fr
+----------------------------------------+
a2ps | [] [] [] [] |
ap-utils | |
bash | [] [] [] [] |
bfd | [] [] |
binutils | [] [] |
bison | [] [] [] [] |
clisp | |
clisp | [] [] [] [] |
clisplow | |
cpio | [] [] [] [] |
darkstat | () |
diffutils | [] [] [] [] [] [] |
enscript | [] [] |
error | [] [] [] |
fetchmail | [] () [] [] [] () |
fileutils | [] [] [] [] [] |
findutils | [] [] [] [] [] [] |
flex | [] [] [] [] [] |
gas | [] [] |
gawk | [] [] [] |
gcal | [] [] |
gcc | [] [] |
gettext | [] [] [] [] [] |
gnupg | [] [] [] [] [] [] [] |
gprof | [] [] |
gpsdrive | () () () () () |
grep | [] [] [] [] [] [] [] [] |
gretl | [] |
gthumb | () () () |
hello | [] [] [] [] [] [] [] [] [] |
id-utils | [] [] [] |
indent | [] [] [] [] [] |
jpilot | () [] [] [] |
jwhois | [] [] |
kbd | [] [] [] |
ld | [] [] |
libc | [] [] [] [] [] [] [] [] |
libiconv | [] [] [] [] |
lifelines | () () |
lilypond | [] [] |
lingoteach | [] [] |
lingoteach_lessons| () () |
lynx | [] [] [] [] [] |
m4 | [] [] [] [] [] |
make | [] [] [] [] |
man-db | [] () () [] () () |
mysecretdiary | [] [] [] |
nano | [] () [] [] [] [] |
nano_1_0 | [] () [] [] [] [] |
opcodes | [] [] [] |
parted | [] [] [] [] [] |
ptx | [] [] [] [] [] [] [] |
python | |
recode | [] [] [] [] [] [] |
sed | [] [] [] [] [] [] [] [] [] [] |
sh-utils | [] [] [] [] |
sharutils | [] [] [] [] [] [] [] |
sketch | () [] () |
soundtracker | [] [] [] |
sp | [] |
tar | [] [] [] [] [] [] |
texinfo | [] [] [] [] [] |
textutils | [] [] [] [] [] |
util-linux | [] [] [] [] [] [] |
vorbis-tools | [] |
wastesedge | |
wdiff | [] [] [] [] [] [] |
wget | [] [] [] [] [] [] [] [] [] [] |
+----------------------------------------+
be bg ca cs da de el en eo es et fi fr
0 2 19 10 30 44 9 1 12 44 17 6 53
gl he hr hu id it ja ko lv nb nl nn
+-------------------------------------+
a2ps | () () [] |
ap-utils | |
bash | [] |
bfd | [] |
binutils | [] |
bison | [] [] [] [] |
clisp | |
clisp | [] |
clisplow | |
cpio | [] [] [] [] |
darkstat | |
diffutils | [] [] [] [] [] |
enscript | [] [] |
error | [] |
fetchmail | [] |
fileutils | [] [] [] |
findutils | [] [] [] [] [] [] [] [] |
flex | [] |
gas | |
gawk | [] |
gcal | |
gcc | [] |
gettext | [] [] |
gnupg | [] [] [] [] |
gprof | [] |
gpsdrive | [] () () |
grep | [] [] [] [] [] [] [] |
gretl | |
gthumb | () () |
hello | [] [] [] [] [] [] [] [] [] [] [] [] |
id-utils | [] [] |
indent | [] [] [] [] |
jpilot | () () |
jwhois | [] [] |
kbd | |
ld | |
libc | [] [] [] [] |
libiconv | [] [] [] |
lifelines | |
lilypond | [] |
lingoteach | [] |
lingoteach_lessons| |
lynx | [] [] [] [] |
m4 | [] [] [] [] |
make | [] [] [] [] [] [] |
man-db | () () |
mysecretdiary | [] |
nano | [] [] [] [] |
nano_1_0 | [] [] [] [] [] |
opcodes | [] [] |
parted | [] [] [] |
ptx | [] [] [] [] [] |
python | |
recode | [] [] [] |
sed | [] [] [] [] [] [] [] [] |
sh-utils | [] [] [] |
sharutils | [] [] [] |
sketch | () |
soundtracker | [] [] |
sp | |
tar | [] [] [] [] [] [] |
texinfo | [] [] [] |
textutils | [] [] [] [] |
util-linux | () [] |
vorbis-tools | [] |
wastesedge | |
wdiff | [] [] [] |
wget | [] [] [] [] [] [] |
+-------------------------------------+
gl he hr hu id it ja ko lv nb nl nn
23 9 12 19 16 13 26 9 1 7 19 3
no pl pt pt_BR ru sk sl sv tr uk zh_CN zh_TW
+----------------------------------------------+
a2ps | () () () [] [] [] [] [] | 10
ap-utils | () | 0
bash | [] | 6
bfd | [] [] | 5
binutils | [] [] | 5
bison | [] [] [] [] | 12
clisp | | 0
clisp | | 5
clisplow | | 0
cpio | [] [] [] [] | 12
darkstat | [] [] () () | 2
diffutils | [] [] [] [] [] [] | 17
enscript | [] [] [] [] | 8
error | [] [] [] | 7
fetchmail | () () [] | 6
fileutils | [] [] [] [] [] [] | 14
findutils | [] [] [] [] [] [] [] | 21
flex | [] [] [] | 9
gas | [] | 3
gawk | [] [] | 6
gcal | [] [] | 4
gcc | [] | 4
gettext | [] [] [] [] [] [] | 13
gnupg | [] [] [] | 14
gprof | [] [] | 5
gpsdrive | [] [] | 3
grep | [] [] [] [] [] | 20
gretl | | 1
gthumb | () () [] | 1
hello | [] [] [] [] [] [] [] | 28
id-utils | [] [] [] [] | 9
indent | [] [] [] [] [] | 14
jpilot | () () [] [] | 5
jwhois | [] () () [] [] | 7
kbd | [] [] | 5
ld | [] [] | 4
libc | [] [] [] [] [] [] | 18
libiconv | [] [] [] [] [] | 12
lifelines | [] | 1
lilypond | [] | 4
lingoteach | [] [] | 5
lingoteach_lessons| () | 0
lynx | [] [] [] [] | 13
m4 | [] [] [] [] | 13
make | [] [] [] [] [] | 15
man-db | | 3
mysecretdiary | [] [] [] | 7
nano | [] [] [] [] | 13
nano_1_0 | [] [] [] [] | 14
opcodes | [] [] [] | 8
parted | [] [] [] [] | 12
ptx | [] [] [] [] [] [] [] | 19
python | | 0
recode | [] [] [] [] [] [] | 15
sed | [] [] [] [] [] [] | 24
sh-utils | [] [] | 9
sharutils | [] [] [] [] | 14
sketch | [] () [] | 4
soundtracker | [] | 6
sp | | 1
tar | [] [] [] [] [] [] [] | 19
texinfo | [] [] | 10
textutils | [] [] [] [] [] | 14
util-linux | [] [] [] | 10
vorbis-tools | [] | 3
wastesedge | | 0
wdiff | [] [] [] [] [] | 14
wget | [] [] [] [] [] [] [] [] | 24
+----------------------------------------------+
37 teams no pl pt pt_BR ru sk sl sv tr uk zh_CN zh_TW
68 domains 4 15 2 28 28 12 10 49 43 4 1 9 609
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
used for implementing regional variants of languages, or language
dialects.
For a PO file in the matrix above to be effective, the package to
which it applies should also have been internationalized and
distributed as such by its maintainer. There might be an observable
lag between the mere existence a PO file and its wide availability in a
distribution.
If August 2002 seems to be old, you may fetch a more recent copy of
this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
matrix with full percentage details can be found at
`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
Using `gettext' in new packages
===============================
If you are writing a freely available program and want to
internationalize it you are welcome to use GNU `gettext' in your
package. Of course you have to respect the GNU Library General Public
License which covers the use of the GNU `gettext' library. This means
in particular that even non-free programs can use `libintl' as a shared
library, whereas only free software can use `libintl' as a static
library or use modified versions of `libintl'.
Once the sources are changed appropriately and the setup can handle
to use of `gettext' the only thing missing are the translations. The
Free Translation Project is also available for packages which are not
developed inside the GNU project. Therefore the information given above
applies also for every other Free Software Project. Contact
`translation@iro.umontreal.ca' to make the `.pot' files available to
the translation teams.

View File

@ -1,83 +0,0 @@
General Information
~~~~~~~~~~~~~~~~~~~
To compile this you need a couple things
- A working POSIX system with working POSIX gcc, g++, make (GNU),
ar, sh, awk and sed in the path
- GNU Make 3.74 or so, -- normal UNIX make will NOT work
* Note 3.77 is broken.
- A working ANSI C++ compiler, this is not g++ 2.7.*
g++ 2.8 works OK and newer egcs work well also. Nobody has tried it
on other compilers :< You will need a properly working STL as well.
- A C library with the usual POSIX functions and a BSD socket layer.
If you OS conforms to the Single Unix Spec then you are fine:
http://www.opengroup.org/onlinepubs/7908799/index.html
** NOTICE **
The C++ global constructors do not link correctly when using non-shared
libaries. This is probably the correct behavior of the linker, but I have
not yet had time to devise a work around for it. The correct thing to
do is add a reference to debSystem in apt-pkg/init.cc,
assert(&debSystem == 0) would be fine for instance.
Guidelines
~~~~~~~~~~
I am not interested in making 'ultra portable code'. I will accept patches
to make the code that already exists conform more to SUS or POSIX, but
I don't really care if your not-SUS OS doesn't work. It is simply too
much work to maintain patches for dysfunctional OSs. I highly suggest you
contact your vendor and express intrest in a conforming C library.
That said, there are lots of finniky problems that must be delt with even
between the supported OS's. Primarily the path I choose to take is to put
a shim header file in build/include that transparently adds the required
functionality. Patches to make autoconf detect these cases and generate the
required shims are OK.
Current shims:
* C99 integer types 'inttypes.h'
* sys/statvfs.h to convert from BSD/old-glibc statfs to SUS statvfs
* rfc2553 hostname resolution (methods/rfc*), shims to normal gethostbyname.
The more adventerous could steal the KAME IPv6 enabled resolvers for those
OS's with IPv6 support but no rfc2553 (why?)
* define _XOPEN_EXTENDED_SOURCE to bring in h_errno on HP-UX
* socklen_t shim in netdb.h if the OS does not have socklen_t
The only completely non-shimed OS is Linux with glibc2.1, glibc2.0 requires
the first three shims.
Platform Notes
~~~~~~~~~~~~~~
Debian GNU Linux 2.1 'slink'
Debian GNU Linux 'potato'
Debian GNU Linux 'woody'
* All Archs
- Works flawlessly
- You will want to have debiandoc-sgml and docbook2man installed to get
best results.
- No IPv6 Support in glibc's < 2.1.
Sun Solaris
SunOS cab101 5.7 Generic_106541-04 sun4u sparc
SunOS csu201 5.8 Generic_108528-04 sun4u sparc
- Works fine
- Note, no IPv6 Support, OS lacks RFC 2553 hostname resolution
OpenBSD
OpenBSD gsb086 2.5 CMPUT#0 i386 unknown
OpenBSD csu101 2.7 CMPUT#1 i386 unknown
- OS needs 'ranlib' to generate the symbol table after 'ar'.. (not using
GNU ar with the gnu tool chain :<)
- '2.5' does not have RFC 2553 hostname resolution, but '2.7' does
- Testing on '2.7' suggests the OS has a bug in its handling of
ftruncate on files that have been written via mmap. It fills the page
that crosses the truncation boundary with 0's.
HP-UX
HP-UX nyquist B.10.20 C 9000/780 2016574337 32-user license
- Evil OS, does not conform very well to SUS
1) snprintf exists but is not prototyped, ignore spurios warnings
2) No socklen_t
3) Requires -D_XOPEN_SOURCE_EXTENDED for h_errno
configure should fix the last two (see above)
- Note, no IPv6 Support, OS lacks RFC 2553 hostname resolution

View File

@ -1,36 +0,0 @@
# -*- make -*-
# This is the top level make file for APT, it recurses to each lower
# level make file and runs it with the proper target
ifndef NOISY
.SILENT:
endif
.PHONY: default
default: startup all
.PHONY: headers library clean veryclean all binary program doc
all headers library clean veryclean binary program doc dirs:
# CNC:2003-02-15
$(MAKE) -C apt-pkg $@
#$(MAKE) -C apt-inst $@
$(MAKE) -C methods $@
$(MAKE) -C cmdline $@
#$(MAKE) -C ftparchive $@
#$(MAKE) -C dselect $@
$(MAKE) -C doc $@
$(MAKE) -C tools $@
$(MAKE) -C po $@
# Some very common aliases
.PHONY: maintainer-clean dist-clean distclean pristine sanity
maintainer-clean dist-clean distclean pristine sanity: veryclean
# The startup target builds the necessary configure scripts. It should
# be used after a CVS checkout.
CONVERTED=environment.mak include/config.h include/apti18n.h makefile
include buildlib/configure.mak
$(BUILDDIR)/include/config.h: buildlib/config.h.in
$(BUILDDIR)/include/apti18n.h: buildlib/apti18n.h.in
$(BUILDDIR)/environment.mak: buildlib/environment.mak.in
$(BUILDDIR)/makefile: buildlib/makefile.in

43
apt/Makefile.am Normal file
View File

@ -0,0 +1,43 @@
SUBDIRS = buildlib intl lua apt-pkg methods cmdline tools doc m4 po
ACLOCAL_AMFLAGS = -I m4 -I buildlib
EXTRA_DIST = \
AUTHORS.RPM \
COPYING.GPL \
rpmpriorities \
test/conf.cc \
test/extract-control.cc \
test/hash.cc \
test/makefile \
test/mthdcat.cc \
test/rpmver.cc \
test/scratch.cc \
test/testdeb.cc \
test/testextract.cc \
test/uri.cc \
test/versions.lst \
test/versiontest.cc \
python/apt.i \
python/apt.py \
python/apt_wrap.cxx \
python/Makefile \
python/swig-1.3.16-cxx.patch \
contrib/apt-rpm/apt-rpm \
contrib/apt-rpm/apt-rpm.1 \
contrib/apt-files/README \
contrib/apt-files/apt-files.lua \
contrib/apt-files/apt-files.conf \
contrib/apt-files/convert.py \
contrib/install-devel/README \
contrib/install-devel/install-devel.lua \
contrib/apt-groupinstall/README \
contrib/apt-groupinstall/apt-groupinstall.lua \
contrib/apt-groupinstall/apt-groupinstall.py \
contrib/apt-groupinstall/apt-groupinstall.conf \
contrib/proxypasswd/README \
contrib/proxypasswd/proxypasswd.lua
contrib/guess/README \
contrib/guess/guess.lua \
contrib/guess/guess.conf

637
apt/Makefile.in Normal file
View File

@ -0,0 +1,637 @@
# Makefile.in generated by automake 1.7.9 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_triplet = @host@
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COMPILE_APTSHELL_FALSE = @COMPILE_APTSHELL_FALSE@
COMPILE_APTSHELL_TRUE = @COMPILE_APTSHELL_TRUE@
COMPILE_MANPAGES_FALSE = @COMPILE_MANPAGES_FALSE@
COMPILE_MANPAGES_TRUE = @COMPILE_MANPAGES_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DATADIRNAME = @DATADIRNAME@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DOCBOOK2MAN = @DOCBOOK2MAN@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GENCAT = @GENCAT@
GLIBC21 = @GLIBC21@
GLIBC_VER = @GLIBC_VER@
GMSGFMT = @GMSGFMT@
HAVE_TIMEGM = @HAVE_TIMEGM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBSTDCPP_VER = @LIBSTDCPP_VER@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MSGMERGE = @MSGMERGE@
NEED_INTTYPES_H_FALSE = @NEED_INTTYPES_H_FALSE@
NEED_INTTYPES_H_TRUE = @NEED_INTTYPES_H_TRUE@
NEED_NETDB_H_FALSE = @NEED_NETDB_H_FALSE@
NEED_NETDB_H_TRUE = @NEED_NETDB_H_TRUE@
NEED_SOCKLEN_T_DEFINE = @NEED_SOCKLEN_T_DEFINE@
NEED_STATVFS_H_FALSE = @NEED_STATVFS_H_FALSE@
NEED_STATVFS_H_TRUE = @NEED_STATVFS_H_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POSUB = @POSUB@
PTHREADLIB = @PTHREADLIB@
RANLIB = @RANLIB@
RPMLIBS = @RPMLIBS@
RPM_PATH = @RPM_PATH@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOCKETLIBS = @SOCKETLIBS@
STRIP = @STRIP@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WITH_LUA_FALSE = @WITH_LUA_FALSE@
WITH_LUA_TRUE = @WITH_LUA_TRUE@
XGETTEXT = @XGETTEXT@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
SUBDIRS = buildlib intl lua apt-pkg methods cmdline tools doc m4 po
ACLOCAL_AMFLAGS = -I m4 -I buildlib
EXTRA_DIST = \
AUTHORS.RPM \
COPYING.GPL \
rpmpriorities \
test/conf.cc \
test/extract-control.cc \
test/hash.cc \
test/makefile \
test/mthdcat.cc \
test/rpmver.cc \
test/scratch.cc \
test/testdeb.cc \
test/testextract.cc \
test/uri.cc \
test/versions.lst \
test/versiontest.cc \
python/apt.i \
python/apt.py \
python/apt_wrap.cxx \
python/Makefile \
python/swig-1.3.16-cxx.patch \
contrib/apt-rpm/apt-rpm \
contrib/apt-rpm/apt-rpm.1 \
contrib/apt-files/README \
contrib/apt-files/apt-files.lua \
contrib/apt-files/apt-files.conf \
contrib/apt-files/convert.py \
contrib/install-devel/README \
contrib/install-devel/install-devel.lua \
contrib/apt-groupinstall/README \
contrib/apt-groupinstall/apt-groupinstall.lua \
contrib/apt-groupinstall/apt-groupinstall.py \
contrib/apt-groupinstall/apt-groupinstall.conf \
contrib/proxypasswd/README \
contrib/proxypasswd/proxypasswd.lua
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/buildlib/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/include/config.h
CONFIG_CLEAN_FILES = intl/Makefile
DIST_SOURCES =
RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
ps-recursive install-info-recursive uninstall-info-recursive \
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/configure \
./buildlib/config.h.in ABOUT-NLS AUTHORS COPYING Makefile.am \
TODO aclocal.m4 configure configure.in
DIST_SUBDIRS = $(SUBDIRS)
all: all-recursive
.SUFFIXES:
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in m4/codeset.m4 m4/gettext.m4 m4/glibc21.m4 m4/iconv.m4 m4/intdiv0.m4 m4/inttypes-pri.m4 m4/inttypes.m4 m4/inttypes_h.m4 m4/isc-posix.m4 m4/lcmessage.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 m4/progtest.m4 m4/stdint_h.m4 m4/uintmax_t.m4 m4/ulonglong.m4 buildlib/tools.m4
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
include/config.h: include/stamp-h1
@if test ! -f $@; then \
rm -f include/stamp-h1; \
$(MAKE) include/stamp-h1; \
else :; fi
include/stamp-h1: $(srcdir)/./buildlib/config.h.in $(top_builddir)/config.status
@rm -f include/stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status include/config.h
$(srcdir)/./buildlib/config.h.in: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOHEADER)
touch $(srcdir)/./buildlib/config.h.in
distclean-hdr:
-rm -f include/config.h include/stamp-h1
intl/Makefile: $(top_builddir)/config.status $(top_srcdir)/intl/Makefile.in
cd $(top_builddir) && $(SHELL) ./config.status $@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ETAGS = etags
ETAGSFLAGS =
CTAGS = ctags
CTAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if (etags --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
else \
include_option=--include; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = .
distdir = $(PACKAGE)-$(VERSION)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
distdir: $(DISTFILES)
$(am__remove_distdir)
mkdir $(distdir)
$(mkinstalldirs) $(distdir)/./buildlib $(distdir)/contrib/apt-files $(distdir)/contrib/apt-groupinstall $(distdir)/contrib/apt-rpm $(distdir)/contrib/install-devel $(distdir)/contrib/proxypasswd $(distdir)/intl $(distdir)/po $(distdir)/python $(distdir)/test
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" \
distdir=../$(distdir)/$$subdir \
distdir) \
|| exit 1; \
fi; \
done
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
$(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist dist-all: distdir
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
$(am__remove_distdir)
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
--with-included-gettext \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
&& rm -f $(distdir).tar.gz \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@echo "$(distdir).tar.gz is ready for distribution" | \
sed 'h;s/./=/g;p;x;p;x'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr distclean-libtool \
distclean-tags
dvi: dvi-recursive
dvi-am:
info: info-recursive
info-am:
install-data-am:
install-exec-am:
install-info: install-info-recursive
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-info-am
uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
clean-generic clean-libtool clean-recursive ctags \
ctags-recursive dist dist-all dist-bzip2 dist-gzip distcheck \
distclean distclean-generic distclean-hdr distclean-libtool \
distclean-recursive distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am dvi-recursive info info-am \
info-recursive install install-am install-data install-data-am \
install-data-recursive install-exec install-exec-am \
install-exec-recursive install-info install-info-am \
install-info-recursive install-man install-recursive \
install-strip installcheck installcheck-am installdirs \
installdirs-am installdirs-recursive maintainer-clean \
maintainer-clean-generic maintainer-clean-recursive mostlyclean \
mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
pdf pdf-am pdf-recursive ps ps-am ps-recursive tags \
tags-recursive uninstall uninstall-am uninstall-info-am \
uninstall-info-recursive uninstall-recursive
contrib/guess/README \
contrib/guess/guess.lua \
contrib/guess/guess.conf
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -1,112 +0,0 @@
The Make System
~~~ ~~~~ ~~~~~~
To compile this program you require GNU Make. In fact you probably need
GNU Make 3.76.1 or newer. The makefiles contained make use of many
GNU Make specific features and will not run on other makes.
The make system has a number of interesting properties that are not found
in other systems such as automake or the GNU makefile standards. In
general some semblance of expectedness is kept so as not to be too
surprising. Basically the following will work as expected:
./configure
make
or
cd build
../configure
make
There are a number of other things that are possible that may make software
development and software packaging simpler. The first of these is the
environment.mak file. When configure is run it creates an environment.mak
file in the build directory. This contains -all- configurable parameters
for all of the make files in all of the subdirectories. Changing one
of these parameters will have an immediate effect. The use of makefile.in
and configure substitutions across build makefiles is not used at all.
Furthermore, the make system runs with a current directory equal to the
source directory irregardless of the destination directory. This means
#include "" and #include <> work as expected and more importantly
running 'make' in the source directory will work as expected. The
environment variable or make parameter 'BUILD' sets the build directory.
It may be an absolute path or a path relative to the top level directory.
By default build-arch/ then build/ will be used with a fall back to ./ This
means you can get all the advantages of a build directory without having to
cd into it to edit your source code!
The make system also performs dependency generation on the fly as the
compiler runs. This is extremely fast and accurate. There is however
one failure condition that occures when a header file is erased. In
this case you should run make clean to purge the .o and .d files to
rebuild.
The final significant deviation from normal make practicies is
in how the build directory is managed. It is not mearly a mirror of
the source directory but is logically divided in the following manner
bin/
methods/
doc/
examples/
include/
apt-pkg/
obj/
apt-pkg/
cmndline/
[...]
Only .o and .d files are placed in the obj/ subdirectory. The final compiled
binaries are placed in bin, published headers for inter-component linking
are placed in include/ and documentation is generated into doc/. This means
all runnable programs are within the bin/ directory, a huge benifit for
debugging inter-program relationships. The .so files are also placed in
bin/ for simplicity.
By default make is put into silent mode. During operation there should be
no shell or compiler messages only status messages from the makefiles,
if any pop up that indicates there may be a problem with your environment.
For debugging you can disable this by setting NOISY=1, ala
make NOISY=1
Using the makefiles
~~~~~ ~~~ ~~~~~~~~~
The makefiles for the components are really simple. The complexity is hidden
within the buildlib/ directory. Each makefile defines a set of make variables
for the bit it is going to make then includes a makefile fragment from
the buildlib/. This fragment generates the necessary rules based on the
originally defined variables. This process can be repeated as many times as
necessary for as many programs or libraries as are in the directory.
Many of the make fragments have some useful properties involving sub
directories and other interesting features. They are more completely
described in the fragment code in buildlib. Some tips on writing fragments
are included in buildlib/defaults.mak
The fragments are NEVER processed by configure, so if you make changes to
them they will have an immediate effect.
Autoconf
~~~~~~~~
Straight out of CVS you have to initialize autoconf. This requires
automake (I really don't know why) and autoconf and requires doing
aclocal -I buidlib
autoconf
[Altertatively you can run make startup in the top level build dir]
Autoconf is configured to do some basic system probes for optional and
required functionality and generate an environment.mak and include/config.h
from it's findings. It will then write a 'makefile' and run make dirs to
create the output directory tree.
It is not my belief that autoconf should be used to generate substantial
source code markup to escape OS problems. If an OS problem does crop up
it can likely be corrected by installing the correct files into the
build include/ dir and perhaps writing some replacement code and
linking it in. To the fullest extent possible the source code should conform
to standards and not cater to broken systems.
Autoconf will also wite a makefile into the top level of the build dir,
this simply acts as a wrapper to the main top level make in the source tree.
There is one big warning, you can't use both this make file and the
ones in the top level tree. Make is not able to resolve rules that
go to the same file through different paths and this will confuse the
depends mechanism. I recommend always using the makefiles in the
source directory and exporting BUILD.

View File

@ -1,3 +1,6 @@
- Implement hashing in file method.
- Build program to check for dependencies between repositories.
- Implement apt-cache provides/whatprovides
- Implement Minimize
- Implement depends/provides support in Lua API.
- Implement build options for source -b command.

4144
apt/aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,155 +0,0 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: arfile.cc,v 1.5 2003/02/10 00:36:12 doogie Exp $
/* ######################################################################
AR File - Handle an 'AR' archive
AR Archives have plain text headers at the start of each file
section. The headers are aligned on a 2 byte boundry.
Information about the structure of AR files can be found in ar(5)
on a BSD system, or in the binutils source.
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
#ifdef __GNUG__
#pragma implementation "apt-pkg/arfile.h"
#endif
#include <apti18n.h>
#include <apt-pkg/arfile.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/error.h>
#include <stdlib.h>
/*}}}*/
struct ARArchive::MemberHeader
{
char Name[16];
char MTime[12];
char UID[6];
char GID[6];
char Mode[8];
char Size[10];
char Magic[2];
};
// ARArchive::ARArchive - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
ARArchive::ARArchive(FileFd &File) : List(0), File(File)
{
LoadHeaders();
}
/*}}}*/
// ARArchive::~ARArchive - Destructor /*{{{*/
// ---------------------------------------------------------------------
/* */
ARArchive::~ARArchive()
{
while (List != 0)
{
Member *Tmp = List;
List = List->Next;
delete Tmp;
}
}
/*}}}*/
// ARArchive::LoadHeaders - Load the headers from each file /*{{{*/
// ---------------------------------------------------------------------
/* AR files are structured with a 8 byte magic string followed by a 60
byte plain text header then the file data, another header, data, etc */
bool ARArchive::LoadHeaders()
{
signed long Left = File.Size();
// Check the magic byte
char Magic[8];
if (File.Read(Magic,sizeof(Magic)) == false)
return false;
if (memcmp(Magic,"!<arch>\012",sizeof(Magic)) != 0)
return _error->Error(_("Invalid archive signature"));
Left -= sizeof(Magic);
// Read the member list
while (Left > 0)
{
MemberHeader Head;
if (File.Read(&Head,sizeof(Head)) == false)
return _error->Error(_("Error reading archive member header"));
Left -= sizeof(Head);
// Convert all of the integer members
Member *Memb = new Member();
if (StrToNum(Head.MTime,Memb->MTime,sizeof(Head.MTime)) == false ||
StrToNum(Head.UID,Memb->UID,sizeof(Head.UID)) == false ||
StrToNum(Head.GID,Memb->GID,sizeof(Head.GID)) == false ||
StrToNum(Head.Mode,Memb->Mode,sizeof(Head.Mode),8) == false ||
StrToNum(Head.Size,Memb->Size,sizeof(Head.Size)) == false)
{
delete Memb;
return _error->Error(_("Invalid archive member header"));
}
// Check for an extra long name string
if (memcmp(Head.Name,"#1/",3) == 0)
{
char S[300];
unsigned long Len;
if (StrToNum(Head.Name+3,Len,sizeof(Head.Size)-3) == false ||
Len >= strlen(S))
{
delete Memb;
return _error->Error(_("Invalid archive member header"));
}
if (File.Read(S,Len) == false)
return false;
S[Len] = 0;
Memb->Name = S;
Memb->Size -= Len;
Left -= Len;
}
else
{
unsigned int I = sizeof(Head.Name) - 1;
for (; Head.Name[I] == ' '; I--);
Memb->Name = string(Head.Name,0,I+1);
}
// Account for the AR header alignment
unsigned Skip = Memb->Size % 2;
// Add it to the list
Memb->Next = List;
List = Memb;
Memb->Start = File.Tell();
if (File.Skip(Memb->Size + Skip) == false)
return false;
if (Left < (signed)(Memb->Size + Skip))
return _error->Error(_("Archive is too short"));
Left -= Memb->Size + Skip;
}
if (Left != 0)
return _error->Error(_("Failed to read the archive headers"));
return true;
}
/*}}}*/
// ARArchive::FindMember - Find a name in the member list /*{{{*/
// ---------------------------------------------------------------------
/* Find a member with the given name */
const ARArchive::Member *ARArchive::FindMember(const char *Name) const
{
const Member *Res = List;
while (Res != 0)
{
if (Res->Name == Name)
return Res;
Res = Res->Next;
}
return 0;
}
/*}}}*/

View File

@ -1,68 +0,0 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: arfile.h,v 1.2 2002/07/25 18:07:17 niemeyer Exp $
/* ######################################################################
AR File - Handle an 'AR' archive
This is a reader for the usual 4.4 BSD AR format. It allows raw
stream access to a single member at a time. Basically all this class
provides is header parsing and verification. It is up to the client
to correctly make use of the stream start/stop points.
##################################################################### */
/*}}}*/
#ifndef PKGLIB_ARFILE_H
#define PKGLIB_ARFILE_H
#ifdef __GNUG__
#pragma interface "apt-pkg/arfile.h"
#endif
#include <string>
#include <apt-pkg/fileutl.h>
class ARArchive
{
struct MemberHeader;
public:
struct Member;
protected:
// Linked list of members
Member *List;
bool LoadHeaders();
public:
// The stream file
FileFd &File;
// Locate a member by name
const Member *FindMember(const char *Name) const;
ARArchive(FileFd &File);
~ARArchive();
};
// A member of the archive
struct ARArchive::Member
{
// Fields from the header
string Name;
unsigned long MTime;
unsigned long UID;
unsigned long GID;
unsigned long Mode;
unsigned long Size;
// Location of the data.
unsigned long Start;
Member *Next;
Member() : Start(0), Next(0) {};
};
#endif

View File

@ -1,344 +0,0 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: extracttar.cc,v 1.7 2003/02/10 00:36:12 doogie Exp $
/* ######################################################################
Extract a Tar - Tar Extractor
Some performance measurements showed that zlib performed quite poorly
in comparision to a forked gzip process. This tar extractor makes use
of the fact that dup'd file descriptors have the same seek pointer
and that gzip will not read past the end of a compressed stream,
even if there is more data. We use the dup property to track extraction
progress and the gzip feature to just feed gzip a fd in the middle
of an AR file.
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
#ifdef __GNUG__
#pragma implementation "apt-pkg/extracttar.h"
#endif
#include <apti18n.h>
#include <apt-pkg/extracttar.h>
#include <apt-pkg/error.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/configuration.h>
#include <system.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
#include <iostream>
/*}}}*/
using namespace std;
// The on disk header for a tar file.
struct ExtractTar::TarHeader
{
char Name[100];
char Mode[8];
char UserID[8];
char GroupID[8];
char Size[12];
char MTime[12];
char Checksum[8];
char LinkFlag;
char LinkName[100];
char MagicNumber[8];
char UserName[32];
char GroupName[32];
char Major[8];
char Minor[8];
};
// ExtractTar::ExtractTar - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
ExtractTar::ExtractTar(FileFd &Fd,unsigned long Max) : File(Fd),
MaxInSize(Max)
{
GZPid = -1;
InFd = -1;
Eof = false;
}
/*}}}*/
// ExtractTar::ExtractTar - Destructor /*{{{*/
// ---------------------------------------------------------------------
/* */
ExtractTar::~ExtractTar()
{
// Error close
Done(true);
}
/*}}}*/
// ExtractTar::Done - Reap the gzip sub process /*{{{*/
// ---------------------------------------------------------------------
/* If the force flag is given then error messages are suppressed - this
means we hit the end of the tar file but there was still gzip data. */
bool ExtractTar::Done(bool Force)
{
InFd.Close();
if (GZPid <= 0)
return true;
/* If there is a pending error then we are cleaning up gzip and are
not interested in it's failures */
if (_error->PendingError() == true)
Force = true;
// Make sure we clean it up!
kill(GZPid,SIGINT);
if (ExecWait(GZPid,_config->Find("dir::bin::gzip","/bin/gzip").c_str(),
Force) == false)
{
GZPid = -1;
return Force;
}
GZPid = -1;
return true;
}
/*}}}*/
// ExtractTar::StartGzip - Startup gzip /*{{{*/
// ---------------------------------------------------------------------
/* This creates a gzip sub process that has its input as the file itself.
If this tar file is embedded into something like an ar file then
gzip will efficiently ignore the extra bits. */
bool ExtractTar::StartGzip()
{
int Pipes[2];
if (pipe(Pipes) != 0)
return _error->Errno("pipe",_("Failed to create pipes"));
// Fork off the process
GZPid = ExecFork();
// Spawn the subprocess
if (GZPid == 0)
{
// Setup the FDs
dup2(Pipes[1],STDOUT_FILENO);
dup2(File.Fd(),STDIN_FILENO);
int Fd = open("/dev/null",O_RDWR);
if (Fd == -1)
_exit(101);
dup2(Fd,STDERR_FILENO);
close(Fd);
SetCloseExec(STDOUT_FILENO,false);
SetCloseExec(STDIN_FILENO,false);
SetCloseExec(STDERR_FILENO,false);
const char *Args[3];
Args[0] = _config->Find("dir::bin::gzip","/bin/gzip").c_str();
Args[1] = "-d";
Args[2] = 0;
execv(Args[0],(char **)Args);
cerr << _("Failed to exec gzip ") << Args[0] << endl;
_exit(100);
}
// Fix up our FDs
InFd.Fd(Pipes[0]);
close(Pipes[1]);
return true;
}
/*}}}*/
// ExtractTar::Go - Perform extraction /*{{{*/
// ---------------------------------------------------------------------
/* This reads each 512 byte block from the archive and extracts the header
information into the Item structure. Then it resolves the UID/GID and
invokes the correct processing function. */
bool ExtractTar::Go(pkgDirStream &Stream)
{
if (StartGzip() == false)
return false;
// Loop over all blocks
string LastLongLink;
string LastLongName;
while (1)
{
bool BadRecord = false;
unsigned char Block[512];
if (InFd.Read(Block,sizeof(Block),true) == false)
return false;
if (InFd.Eof() == true)
break;
// Get the checksum
TarHeader *Tar = (TarHeader *)Block;
unsigned long CheckSum;
if (StrToNum(Tar->Checksum,CheckSum,sizeof(Tar->Checksum),8) == false)
return _error->Error(_("Corrupted archive"));
/* Compute the checksum field. The actual checksum is blanked out
with spaces so it is not included in the computation */
unsigned long NewSum = 0;
memset(Tar->Checksum,' ',sizeof(Tar->Checksum));
for (int I = 0; I != sizeof(Block); I++)
NewSum += Block[I];
/* Check for a block of nulls - in this case we kill gzip, GNU tar
does this.. */
if (NewSum == ' '*sizeof(Tar->Checksum))
return Done(true);
if (NewSum != CheckSum)
return _error->Error(_("Tar Checksum failed, archive corrupted"));
// Decode all of the fields
pkgDirStream::Item Itm;
if (StrToNum(Tar->Mode,Itm.Mode,sizeof(Tar->Mode),8) == false ||
StrToNum(Tar->UserID,Itm.UID,sizeof(Tar->UserID),8) == false ||
StrToNum(Tar->GroupID,Itm.GID,sizeof(Tar->GroupID),8) == false ||
StrToNum(Tar->Size,Itm.Size,sizeof(Tar->Size),8) == false ||
StrToNum(Tar->MTime,Itm.MTime,sizeof(Tar->MTime),8) == false ||
StrToNum(Tar->Major,Itm.Major,sizeof(Tar->Major),8) == false ||
StrToNum(Tar->Minor,Itm.Minor,sizeof(Tar->Minor),8) == false)
return _error->Error(_("Corrupted archive"));
// Grab the filename
if (LastLongName.empty() == false)
Itm.Name = (char *)LastLongName.c_str();
else
{
Tar->Name[sizeof(Tar->Name)] = 0;
Itm.Name = Tar->Name;
}
if (Itm.Name[0] == '.' && Itm.Name[1] == '/' && Itm.Name[2] != 0)
Itm.Name += 2;
// Grab the link target
Tar->Name[sizeof(Tar->LinkName)] = 0;
Itm.LinkTarget = Tar->LinkName;
if (LastLongLink.empty() == false)
Itm.LinkTarget = (char *)LastLongLink.c_str();
// Convert the type over
switch (Tar->LinkFlag)
{
case NormalFile0:
case NormalFile:
Itm.Type = pkgDirStream::Item::File;
break;
case HardLink:
Itm.Type = pkgDirStream::Item::HardLink;
break;
case SymbolicLink:
Itm.Type = pkgDirStream::Item::SymbolicLink;
break;
case CharacterDevice:
Itm.Type = pkgDirStream::Item::CharDevice;
break;
case BlockDevice:
Itm.Type = pkgDirStream::Item::BlockDevice;
break;
case Directory:
Itm.Type = pkgDirStream::Item::Directory;
break;
case FIFO:
Itm.Type = pkgDirStream::Item::FIFO;
break;
case GNU_LongLink:
{
unsigned long Length = Itm.Size;
unsigned char Block[512];
while (Length > 0)
{
if (InFd.Read(Block,sizeof(Block),true) == false)
return false;
if (Length <= sizeof(Block))
{
LastLongLink.append(Block,Block+sizeof(Block));
break;
}
LastLongLink.append(Block,Block+sizeof(Block));
Length -= sizeof(Block);
}
continue;
}
case GNU_LongName:
{
unsigned long Length = Itm.Size;
unsigned char Block[512];
while (Length > 0)
{
if (InFd.Read(Block,sizeof(Block),true) == false)
return false;
if (Length < sizeof(Block))
{
LastLongName.append(Block,Block+sizeof(Block));
break;
}
LastLongName.append(Block,Block+sizeof(Block));
Length -= sizeof(Block);
}
continue;
}
default:
BadRecord = true;
_error->Warning(_("Unkown TAR header type %u, member %s"),(unsigned)Tar->LinkFlag,Tar->Name);
break;
}
int Fd = -1;
if (BadRecord == false)
if (Stream.DoItem(Itm,Fd) == false)
return false;
// Copy the file over the FD
unsigned long Size = Itm.Size;
while (Size != 0)
{
unsigned char Junk[32*1024];
unsigned long Read = MIN(Size,sizeof(Junk));
if (InFd.Read(Junk,((Read+511)/512)*512) == false)
return false;
if (BadRecord == false)
{
if (Fd > 0)
{
if (write(Fd,Junk,Read) != (signed)Read)
return Stream.Fail(Itm,Fd);
}
else
{
/* An Fd of -2 means to send to a special processing
function */
if (Fd == -2)
if (Stream.Process(Itm,Junk,Read,Itm.Size - Size) == false)
return Stream.Fail(Itm,Fd);
}
}
Size -= Read;
}
// And finish up
if (Itm.Size != 0 && BadRecord == false)
if (Stream.FinishedFile(Itm,Fd) == false)
return false;
LastLongName.erase();
LastLongLink.erase();
}
return Done(false);
}
/*}}}*/

View File

@ -1,54 +0,0 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: extracttar.h,v 1.2 2002/07/25 18:07:17 niemeyer Exp $
/* ######################################################################
Extract a Tar - Tar Extractor
The tar extractor takes an ordinary gzip compressed tar stream from
the given file and explodes it, passing the individual items to the
given Directory Stream for processing.
##################################################################### */
/*}}}*/
#ifndef PKGLIB_EXTRACTTAR_H
#define PKGLIB_EXTRACTTAR_H
#ifdef __GNUG__
#pragma interface "apt-pkg/extracttar.h"
#endif
#include <apt-pkg/fileutl.h>
#include <apt-pkg/dirstream.h>
class ExtractTar
{
protected:
struct TarHeader;
// The varios types items can be
enum ItemType {NormalFile0 = '\0',NormalFile = '0',HardLink = '1',
SymbolicLink = '2',CharacterDevice = '3',
BlockDevice = '4',Directory = '5',FIFO = '6',
GNU_LongLink = 'K',GNU_LongName = 'L'};
FileFd &File;
unsigned long MaxInSize;
int GZPid;
FileFd InFd;
bool Eof;
// Fork and reap gzip
bool StartGzip();
bool Done(bool Force);
public:
bool Go(pkgDirStream &Stream);
ExtractTar(FileFd &Fd,unsigned long Max);
virtual ~ExtractTar();
};
#endif

View File

@ -1,30 +0,0 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: database.cc,v 1.2 2002/07/25 18:07:17 niemeyer Exp $
/* ######################################################################
Data Base Abstraction
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
#ifdef __GNUG__
#pragma implementation "apt-pkg/database.h"
#endif
#include <apt-pkg/database.h>
/*}}}*/
// DataBase::GetMetaTmp - Get the temp dir /*{{{*/
// ---------------------------------------------------------------------
/* This re-initializes the meta temporary directory if it hasn't yet
been inited for this cycle. The flag is the emptyness of MetaDir */
bool pkgDataBase::GetMetaTmp(string &Dir)
{
if (MetaDir.empty() == true)
if (InitMetaTmp(MetaDir) == false)
return false;
Dir = MetaDir;
return true;
}
/*}}}*/

View File

@ -1,56 +0,0 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: database.h,v 1.2 2002/07/25 18:07:17 niemeyer Exp $
/* ######################################################################
Data Base Abstraction
This class provides a simple interface to an abstract notion of a
database directory for storing state information about the system.
The 'Meta' information for a package is the control information and
setup scripts stored inside the archive. GetMetaTmp returns the name of
a directory that is used to store named files containing the control
information.
The File Listing is the database of installed files. It is loaded
into the memory/persistent cache structure by the ReadFileList method.
##################################################################### */
/*}}}*/
#ifndef PKGLIB_DATABASE_H
#define PKGLIB_DATABASE_H
#ifdef __GNUG__
#pragma interface "apt-pkg/database.h"
#endif
#include <apt-pkg/filelist.h>
#include <apt-pkg/pkgcachegen.h>
class pkgDataBase
{
protected:
pkgCacheGenerator *Cache;
pkgFLCache *FList;
string MetaDir;
virtual bool InitMetaTmp(string &Dir) = 0;
public:
// Some manipulators for the cache and generator
inline pkgCache &GetCache() {return Cache->GetCache();};
inline pkgFLCache &GetFLCache() {return *FList;};
inline pkgCacheGenerator &GetGenerator() {return *Cache;};
bool GetMetaTmp(string &Dir);
virtual bool ReadyFileList(OpProgress &Progress) = 0;
virtual bool ReadyPkgCache(OpProgress &Progress) = 0;
virtual bool LoadChanges() = 0;
pkgDataBase() : Cache(0), FList(0) {};
virtual ~pkgDataBase() {delete Cache; delete FList;};
};
#endif

View File

@ -1,263 +0,0 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: debfile.cc,v 1.3 2003/02/10 00:36:12 doogie Exp $
/* ######################################################################
Debian Archive File (.deb)
.DEB archives are AR files containing two tars and an empty marker
member called 'debian-binary'. The two tars contain the meta data and
the actual archive contents. Thus this class is a very simple wrapper
around ar/tar to simply extract the right tar files.
It also uses the deb package list parser to parse the control file
into the cache.
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
#ifdef __GNUG__
#pragma implementation "apt-pkg/debfile.h"
#endif
#include <apti18n.h>
#include <apt-pkg/debfile.h>
#include <apt-pkg/extracttar.h>
#include <apt-pkg/error.h>
#include <apt-pkg/deblistparser.h>
#include <sys/stat.h>
#include <unistd.h>
/*}}}*/
// DebFile::debDebFile - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* Open the AR file and check for consistency */
debDebFile::debDebFile(FileFd &File) : File(File), AR(File)
{
if (_error->PendingError() == true)
return;
// Check the members for validity
if (CheckMember("debian-binary") == false ||
CheckMember("control.tar.gz") == false ||
CheckMember("data.tar.gz") == false)
return;
}
/*}}}*/
// DebFile::CheckMember - Check if a named member is in the archive /*{{{*/
// ---------------------------------------------------------------------
/* This is used to check for a correct deb and to give nicer error messages
for people playing around. */
bool debDebFile::CheckMember(const char *Name)
{
if (AR.FindMember(Name) == 0)
return _error->Error(_("This is not a valid DEB archive, missing '%s' member"),Name);
return true;
}
/*}}}*/
// DebFile::GotoMember - Jump to a Member /*{{{*/
// ---------------------------------------------------------------------
/* Jump in the file to the start of a named member and return the information
about that member. The caller can then read from the file up to the
returned size. Note, since this relies on the file position this is
a destructive operation, it also changes the last returned Member
structure - so don't nest them! */
const ARArchive::Member *debDebFile::GotoMember(const char *Name)
{
// Get the archive member and positition the file
const ARArchive::Member *Member = AR.FindMember(Name);
if (Member == 0)
{
_error->Error(_("Internal Error, could not locate member %s"),Name);
return 0;
}
if (File.Seek(Member->Start) == false)
return 0;
return Member;
}
/*}}}*/
// DebFile::ExtractControl - Extract Control information /*{{{*/
// ---------------------------------------------------------------------
/* Extract the control information into the Database's temporary
directory. */
bool debDebFile::ExtractControl(pkgDataBase &DB)
{
// Get the archive member and positition the file
const ARArchive::Member *Member = GotoMember("control.tar.gz");
if (Member == 0)
return false;
// Prepare Tar
ControlExtract Extract;
ExtractTar Tar(File,Member->Size);
if (_error->PendingError() == true)
return false;
// Get into the temporary directory
string Cwd = SafeGetCWD();
string Tmp;
if (DB.GetMetaTmp(Tmp) == false)
return false;
if (chdir(Tmp.c_str()) != 0)
return _error->Errno("chdir",_("Couldn't change to %s"),Tmp.c_str());
// Do extraction
if (Tar.Go(Extract) == false)
return false;
// Switch out of the tmp directory.
if (chdir(Cwd.c_str()) != 0)
chdir("/");
return true;
}
/*}}}*/
// DebFile::ExtractArchive - Extract the archive data itself /*{{{*/
// ---------------------------------------------------------------------
/* Simple wrapper around tar.. */
bool debDebFile::ExtractArchive(pkgDirStream &Stream)
{
// Get the archive member and positition the file
const ARArchive::Member *Member = AR.FindMember("data.tar.gz");
if (Member == 0)
return _error->Error(_("Internal Error, could not locate member"));
if (File.Seek(Member->Start) == false)
return false;
// Prepare Tar
ExtractTar Tar(File,Member->Size);
if (_error->PendingError() == true)
return false;
return Tar.Go(Stream);
}
/*}}}*/
// DebFile::MergeControl - Merge the control information /*{{{*/
// ---------------------------------------------------------------------
/* This reads the extracted control file into the cache and returns the
version that was parsed. All this really does is select the correct
parser and correct file to parse. */
pkgCache::VerIterator debDebFile::MergeControl(pkgDataBase &DB)
{
// Open the control file
string Tmp;
if (DB.GetMetaTmp(Tmp) == false)
return pkgCache::VerIterator(DB.GetCache());
FileFd Fd(Tmp + "control",FileFd::ReadOnly);
if (_error->PendingError() == true)
return pkgCache::VerIterator(DB.GetCache());
// Parse it
debListParser Parse(&Fd);
pkgCache::VerIterator Ver(DB.GetCache());
if (DB.GetGenerator().MergeList(Parse,&Ver) == false)
return pkgCache::VerIterator(DB.GetCache());
if (Ver.end() == true)
_error->Error(_("Failed to locate a valid control file"));
return Ver;
}
/*}}}*/
// DebFile::ControlExtract::DoItem - Control Tar Extraction /*{{{*/
// ---------------------------------------------------------------------
/* This directory stream handler for the control tar handles extracting
it into the temporary meta directory. It only extracts files, it does
not create directories, links or anything else. */
bool debDebFile::ControlExtract::DoItem(Item &Itm,int &Fd)
{
if (Itm.Type != Item::File)
return true;
/* Cleanse the file name, prevent people from trying to unpack into
absolute paths, .., etc */
for (char *I = Itm.Name; *I != 0; I++)
if (*I == '/')
*I = '_';
/* Force the ownership to be root and ensure correct permissions,
go-w, the rest are left untouched */
Itm.UID = 0;
Itm.GID = 0;
Itm.Mode &= ~(S_IWGRP | S_IWOTH);
return pkgDirStream::DoItem(Itm,Fd);
}
/*}}}*/
// MemControlExtract::DoItem - Check if it is the control file /*{{{*/
// ---------------------------------------------------------------------
/* This sets up to extract the control block member file into a memory
block of just the right size. All other files go into the bit bucket. */
bool debDebFile::MemControlExtract::DoItem(Item &Itm,int &Fd)
{
// At the control file, allocate buffer memory.
if (Member == Itm.Name)
{
delete [] Control;
Control = new char[Itm.Size+2];
IsControl = true;
Fd = -2; // Signal to pass to Process
Length = Itm.Size;
}
else
IsControl = false;
return true;
}
/*}}}*/
// MemControlExtract::Process - Process extracting the control file /*{{{*/
// ---------------------------------------------------------------------
/* Just memcopy the block from the tar extractor and put it in the right
place in the pre-allocated memory block. */
bool debDebFile::MemControlExtract::Process(Item &Itm,const unsigned char *Data,
unsigned long Size,unsigned long Pos)
{
memcpy(Control + Pos, Data,Size);
return true;
}
/*}}}*/
// MemControlExtract::Read - Read the control information from the deb /*{{{*/
// ---------------------------------------------------------------------
/* This uses the internal tar extractor to fetch the control file, and then
it parses it into a tag section parser. */
bool debDebFile::MemControlExtract::Read(debDebFile &Deb)
{
// Get the archive member and positition the file
const ARArchive::Member *Member = Deb.GotoMember("control.tar.gz");
if (Member == 0)
return false;
// Extract it.
ExtractTar Tar(Deb.GetFile(),Member->Size);
if (Tar.Go(*this) == false)
return false;
if (Control == 0)
return true;
Control[Length] = '\n';
Control[Length+1] = '\n';
if (Section.Scan(Control,Length+2) == false)
return _error->Error(_("Unparsible control file"));
return true;
}
/*}}}*/
// MemControlExtract::TakeControl - Parse a memory block /*{{{*/
// ---------------------------------------------------------------------
/* The given memory block is loaded into the parser and parsed as a control
record. */
bool debDebFile::MemControlExtract::TakeControl(const void *Data,unsigned long Size)
{
delete [] Control;
Control = new char[Size+2];
Length = Size;
memcpy(Control,Data,Size);
Control[Length] = '\n';
Control[Length+1] = '\n';
return Section.Scan(Control,Length+2);
}
/*}}}*/

View File

@ -1,92 +0,0 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: debfile.h,v 1.2 2002/07/25 18:07:17 niemeyer Exp $
/* ######################################################################
Debian Archive File (.deb)
This Class handles all the operations performed directly on .deb
files. It makes use of the AR and TAR classes to give the necessary
external interface.
There are only two things that can be done with a raw package,
extract it's control information and extract the contents itself.
This should probably subclass an as-yet unwritten super class to
produce a generic archive mechanism.
The memory control file extractor is useful to extract a single file
into memory from the control.tar.gz
##################################################################### */
/*}}}*/
#ifndef PKGLIB_DEBFILE_H
#define PKGLIB_DEBFILE_H
#ifdef __GNUG__
#pragma interface "apt-pkg/debfile.h"
#endif
#include <apt-pkg/arfile.h>
#include <apt-pkg/database.h>
#include <apt-pkg/dirstream.h>
#include <apt-pkg/tagfile.h>
class debDebFile
{
protected:
FileFd &File;
ARArchive AR;
bool CheckMember(const char *Name);
public:
class ControlExtract;
class MemControlExtract;
bool ExtractControl(pkgDataBase &DB);
bool ExtractArchive(pkgDirStream &Stream);
pkgCache::VerIterator MergeControl(pkgDataBase &DB);
const ARArchive::Member *GotoMember(const char *Name);
inline FileFd &GetFile() {return File;};
debDebFile(FileFd &File);
};
class debDebFile::ControlExtract : public pkgDirStream
{
public:
virtual bool DoItem(Item &Itm,int &Fd);
};
class debDebFile::MemControlExtract : public pkgDirStream
{
bool IsControl;
public:
char *Control;
pkgTagSection Section;
unsigned long Length;
string Member;
// Members from DirStream
virtual bool DoItem(Item &Itm,int &Fd);
virtual bool Process(Item &Itm,const unsigned char *Data,
unsigned long Size,unsigned long Pos);
// Helpers
bool Read(debDebFile &Deb);
bool TakeControl(const void *Data,unsigned long Size);
MemControlExtract() : IsControl(false), Control(0), Length(0), Member("control") {};
MemControlExtract(string Member) : IsControl(false), Control(0), Length(0), Member(Member) {};
~MemControlExtract() {delete [] Control;};
};
/*}}}*/
#endif

View File

@ -1,494 +0,0 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: dpkgdb.cc,v 1.7 2003/02/10 00:36:12 doogie Exp $
/* ######################################################################
DPKGv1 Database Implemenation
This class provides parsers and other implementations for the DPKGv1
database. It reads the diversion file, the list files and the status
file to build both the list of currently installed files and the
currently installed package list.
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
#ifdef __GNUG__
#pragma implementation "apt-pkg/dpkgdb.h"
#endif
#include <apti18n.h>
#include <apt-pkg/dpkgdb.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/progress.h>
#include <apt-pkg/tagfile.h>
#include <apt-pkg/strutl.h>
#include <stdio.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <ctype.h>
#include <iostream>
/*}}}*/
using namespace std;
// EraseDir - Erase A Directory /*{{{*/
// ---------------------------------------------------------------------
/* This is necessary to create a new empty sub directory. The caller should
invoke mkdir after this with the proper permissions and check for
error. Maybe stick this in fileutils */
static bool EraseDir(const char *Dir)
{
// First we try a simple RM
if (rmdir(Dir) == 0 ||
errno == ENOENT)
return true;
// A file? Easy enough..
if (errno == ENOTDIR)
{
if (unlink(Dir) != 0)
return _error->Errno("unlink",_("Failed to remove %s"),Dir);
return true;
}
// Should not happen
if (errno != ENOTEMPTY)
return _error->Errno("rmdir",_("Failed to remove %s"),Dir);
// Purge it using rm
int Pid = ExecFork();
// Spawn the subprocess
if (Pid == 0)
{
execlp(_config->Find("Dir::Bin::rm","/bin/rm").c_str(),
"rm","-rf","--",Dir,0);
_exit(100);
}
return ExecWait(Pid,_config->Find("dir::bin::rm","/bin/rm").c_str());
}
/*}}}*/
// DpkgDB::debDpkgDB - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
debDpkgDB::debDpkgDB() : CacheMap(0), FileMap(0)
{
AdminDir = flNotFile(_config->Find("Dir::State::status"));
DiverInode = 0;
DiverTime = 0;
}
/*}}}*/
// DpkgDB::~debDpkgDB - Destructor /*{{{*/
// ---------------------------------------------------------------------
/* */
debDpkgDB::~debDpkgDB()
{
delete Cache;
Cache = 0;
delete CacheMap;
CacheMap = 0;
delete FList;
FList = 0;
delete FileMap;
FileMap = 0;
}
/*}}}*/
// DpkgDB::InitMetaTmp - Get the temp dir for meta information /*{{{*/
// ---------------------------------------------------------------------
/* This creats+empties the meta temporary directory /var/lib/dpkg/tmp.ci
Only one package at a time can be using the returned meta directory. */
bool debDpkgDB::InitMetaTmp(string &Dir)
{
string Tmp = AdminDir + "tmp.ci/";
if (EraseDir(Tmp.c_str()) == false)
return _error->Error(_("Unable to create %s"),Tmp.c_str());
if (mkdir(Tmp.c_str(),0755) != 0)
return _error->Errno("mkdir",_("Unable to create %s"),Tmp.c_str());
// Verify it is on the same filesystem as the main info directory
dev_t Dev;
struct stat St;
if (stat((AdminDir + "info").c_str(),&St) != 0)
return _error->Errno("stat",_("Failed to stat %sinfo"),AdminDir.c_str());
Dev = St.st_dev;
if (stat(Tmp.c_str(),&St) != 0)
return _error->Errno("stat",_("Failed to stat %s"),Tmp.c_str());
if (Dev != St.st_dev)
return _error->Error(_("The info and temp directories need to be on the same filesystem"));
// Done
Dir = Tmp;
return true;
}
/*}}}*/
// DpkgDB::ReadyPkgCache - Prepare the cache with the current status /*{{{*/
// ---------------------------------------------------------------------
/* This reads in the status file into an empty cache. This really needs
to be somehow unified with the high level APT notion of the Database
directory, but there is no clear way on how to do that yet. */
bool debDpkgDB::ReadyPkgCache(OpProgress &Progress)
{
if (Cache != 0)
{
Progress.OverallProgress(1,1,1,_("Reading Package Lists"));
return true;
}
if (CacheMap != 0)
{
delete CacheMap;
CacheMap = 0;
}
if (pkgMakeOnlyStatusCache(Progress,&CacheMap) == false)
return false;
Cache->DropProgress();
return true;
}
/*}}}*/
// DpkgDB::ReadFList - Read the File Listings in /*{{{*/
// ---------------------------------------------------------------------
/* This reads the file listing in from the state directory. This is a
performance critical routine, as it needs to parse about 50k lines of
text spread over a hundred or more files. For an initial cold start
most of the time is spent in reading file inodes and so on, not
actually parsing. */
bool debDpkgDB::ReadFList(OpProgress &Progress)
{
// Count the number of packages we need to read information for
unsigned long Total = 0;
pkgCache &Cache = this->Cache->GetCache();
for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
{
// Only not installed packages have no files.
if (I->CurrentState == pkgCache::State::NotInstalled)
continue;
Total++;
}
/* Switch into the admin dir, this prevents useless lookups for the
path components */
string Cwd = SafeGetCWD();
if (chdir((AdminDir + "info/").c_str()) != 0)
return _error->Errno("chdir",_("Failed to change to the admin dir %sinfo"),AdminDir.c_str());
// Allocate a buffer. Anything larger than this buffer will be mmaped
unsigned long BufSize = 32*1024;
char *Buffer = new char[BufSize];
// Begin Loading them
unsigned long Count = 0;
char Name[300];
for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
{
/* Only not installed packages have no files. ConfFile packages have
file lists but we don't want to read them in */
if (I->CurrentState == pkgCache::State::NotInstalled ||
I->CurrentState == pkgCache::State::ConfigFiles)
continue;
// Fetch a package handle to associate with the file
pkgFLCache::PkgIterator FlPkg = FList->GetPkg(I.Name(),0,true);
if (FlPkg.end() == true)
{
_error->Error(_("Internal Error getting a Package Name"));
break;
}
Progress.OverallProgress(Count,Total,1,_("Reading File Listing"));
// Open the list file
snprintf(Name,sizeof(Name),"%s.list",I.Name());
int Fd = open(Name,O_RDONLY);
/* Okay this is very strange and bad.. Best thing is to bail and
instruct the user to look into it. */
struct stat Stat;
if (Fd == -1 || fstat(Fd,&Stat) != 0)
{
_error->Errno("open",_("Failed to open the list file '%sinfo/%s'. If you "
"cannot restore this file then make it empty "
"and immediately re-install the same version of the package!"),
AdminDir.c_str(),Name);
break;
}
// Set File to be a memory buffer containing the whole file
char *File;
if ((unsigned)Stat.st_size < BufSize)
{
if (read(Fd,Buffer,Stat.st_size) != Stat.st_size)
{
_error->Errno("read",_("Failed reading the list file %sinfo/%s"),
AdminDir.c_str(),Name);
close(Fd);
break;
}
File = Buffer;
}
else
{
// Use mmap
File = (char *)mmap(0,Stat.st_size,PROT_READ,MAP_PRIVATE,Fd,0);
if (File == (char *)(-1))
{
_error->Errno("mmap",_("Failed reading the list file %sinfo/%s"),
AdminDir.c_str(),Name);
close(Fd);
break;
}
}
// Parse it
const char *Start = File;
const char *End = File;
const char *Finish = File + Stat.st_size;
for (; End < Finish; End++)
{
// Not an end of line
if (*End != '\n' && End + 1 < Finish)
continue;
// Skip blank lines
if (End - Start > 1)
{
pkgFLCache::NodeIterator Node = FList->GetNode(Start,End,
FlPkg.Offset(),true,false);
if (Node.end() == true)
{
_error->Error(_("Internal Error getting a Node"));
break;
}
}
// Skip past the end of line
for (; *End == '\n' && End < Finish; End++);
Start = End;
}
close(Fd);
if ((unsigned)Stat.st_size >= BufSize)
munmap((caddr_t)File,Stat.st_size);
// Failed
if (End < Finish)
break;
Count++;
}
delete [] Buffer;
if (chdir(Cwd.c_str()) != 0)
chdir("/");
return !_error->PendingError();
}
/*}}}*/
// DpkgDB::ReadDiversions - Load the diversions file /*{{{*/
// ---------------------------------------------------------------------
/* Read the diversion file in from disk. This is usually invoked by
LoadChanges before performing an operation that uses the FLCache. */
bool debDpkgDB::ReadDiversions()
{
struct stat Stat;
if (stat((AdminDir + "diversions").c_str(),&Stat) != 0)
return true;
if (_error->PendingError() == true)
return false;
FILE *Fd = fopen((AdminDir + "diversions").c_str(),"r");
if (Fd == 0)
return _error->Errno("fopen",_("Failed to open the diversions file %sdiversions"),AdminDir.c_str());
FList->BeginDiverLoad();
while (1)
{
char From[300];
char To[300];
char Package[100];
// Read the three lines in
if (fgets(From,sizeof(From),Fd) == 0)
break;
if (fgets(To,sizeof(To),Fd) == 0 ||
fgets(Package,sizeof(Package),Fd) == 0)
{
_error->Error(_("The diversion file is corrupted"));
break;
}
// Strip the \ns
unsigned long Len = strlen(From);
if (Len < 2 || From[Len-1] != '\n')
_error->Error(_("Invalid line in the diversion file: %s"),From);
else
From[Len-1] = 0;
Len = strlen(To);
if (Len < 2 || To[Len-1] != '\n')
_error->Error(_("Invalid line in the diversion file: %s"),To);
else
To[Len-1] = 0;
Len = strlen(Package);
if (Len < 2 || Package[Len-1] != '\n')
_error->Error(_("Invalid line in the diversion file: %s"),Package);
else
Package[Len-1] = 0;
// Make sure the lines were parsed OK
if (_error->PendingError() == true)
break;
// Fetch a package
if (strcmp(Package,":") == 0)
Package[0] = 0;
pkgFLCache::PkgIterator FlPkg = FList->GetPkg(Package,0,true);
if (FlPkg.end() == true)
{
_error->Error(_("Internal Error getting a Package Name"));
break;
}
// Install the diversion
if (FList->AddDiversion(FlPkg,From,To) == false)
{
_error->Error(_("Internal Error adding a diversion"));
break;
}
}
if (_error->PendingError() == false)
FList->FinishDiverLoad();
DiverInode = Stat.st_ino;
DiverTime = Stat.st_mtime;
fclose(Fd);
return !_error->PendingError();
}
/*}}}*/
// DpkgDB::ReadFileList - Read the file listing /*{{{*/
// ---------------------------------------------------------------------
/* Read in the file listing. The file listing is created from three
sources, *.list, Conffile sections and the Diversion table. */
bool debDpkgDB::ReadyFileList(OpProgress &Progress)
{
if (Cache == 0)
return _error->Error(_("The pkg cache must be initialize first"));
if (FList != 0)
{
Progress.OverallProgress(1,1,1,_("Reading File List"));
return true;
}
// Create the cache and read in the file listing
FileMap = new DynamicMMap(MMap::Public);
FList = new pkgFLCache(*FileMap);
if (_error->PendingError() == true ||
ReadFList(Progress) == false ||
ReadConfFiles() == false ||
ReadDiversions() == false)
{
delete FList;
delete FileMap;
FileMap = 0;
FList = 0;
return false;
}
cout << "Node: " << FList->HeaderP->NodeCount << ',' << FList->HeaderP->UniqNodes << endl;
cout << "Dir: " << FList->HeaderP->DirCount << endl;
cout << "Package: " << FList->HeaderP->PackageCount << endl;
cout << "HashSize: " << FList->HeaderP->HashSize << endl;
cout << "Size: " << FileMap->Size() << endl;
cout << endl;
return true;
}
/*}}}*/
// DpkgDB::ReadConfFiles - Read the conf file sections from the s-file /*{{{*/
// ---------------------------------------------------------------------
/* Reading the conf files is done by reparsing the status file. This is
actually rather fast so it is no big deal. */
bool debDpkgDB::ReadConfFiles()
{
FileFd File(_config->FindFile("Dir::State::status"),FileFd::ReadOnly);
pkgTagFile Tags(&File);
if (_error->PendingError() == true)
return false;
pkgTagSection Section;
while (1)
{
// Skip to the next section
unsigned long Offset = Tags.Offset();
if (Tags.Step(Section) == false)
break;
// Parse the line
const char *Start;
const char *Stop;
if (Section.Find("Conffiles",Start,Stop) == false)
continue;
const char *PkgStart;
const char *PkgEnd;
if (Section.Find("Package",PkgStart,PkgEnd) == false)
return _error->Error(_("Failed to find a Package: Header, offset %lu"),Offset);
// Snag a package record for it
pkgFLCache::PkgIterator FlPkg = FList->GetPkg(PkgStart,PkgEnd,true);
if (FlPkg.end() == true)
return _error->Error(_("Internal Error getting a Package Name"));
// Parse the conf file lines
while (1)
{
for (; isspace(*Start) != 0 && Start < Stop; Start++);
if (Start == Stop)
break;
// Split it into words
const char *End = Start;
for (; isspace(*End) == 0 && End < Stop; End++);
const char *StartMd5 = End;
for (; isspace(*StartMd5) != 0 && StartMd5 < Stop; StartMd5++);
const char *EndMd5 = StartMd5;
for (; isspace(*EndMd5) == 0 && EndMd5 < Stop; EndMd5++);
if (StartMd5 == EndMd5 || Start == End)
return _error->Error(_("Bad ConfFile section in the status file. Offset %lu"),Offset);
// Insert a new entry
unsigned char MD5[16];
if (Hex2Num(string(StartMd5,EndMd5-StartMd5),MD5,16) == false)
return _error->Error(_("Error parsing MD5. Offset %lu"),Offset);
if (FList->AddConfFile(Start,End,FlPkg,MD5) == false)
return false;
Start = EndMd5;
}
}
return true;
}
/*}}}*/
// DpkgDB::LoadChanges - Read in any changed state files /*{{{*/
// ---------------------------------------------------------------------
/* The only file in the dpkg system that can change while packages are
unpacking is the diversions file. */
bool debDpkgDB::LoadChanges()
{
struct stat Stat;
if (stat((AdminDir + "diversions").c_str(),&Stat) != 0)
return true;
if (DiverInode == Stat.st_ino && DiverTime == Stat.st_mtime)
return true;
return ReadDiversions();
}
/*}}}*/

View File

@ -1,53 +0,0 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: dpkgdb.h,v 1.2 2002/07/25 18:07:17 niemeyer Exp $
/* ######################################################################
DPKGv1 Data Base Implemenation
The DPKGv1 database is typically stored in /var/lib/dpkg/. For
DPKGv1 the 'meta' information is the contents of the .deb control.tar.gz
member prepended by the package name. The meta information is unpacked
in its temporary directory and then migrated into the main list dir
at a checkpoint.
Journaling is providing by syncronized file writes to the updates sub
directory.
##################################################################### */
/*}}}*/
#ifndef PKGLIB_DPKGDB_H
#define PKGLIB_DPKGDB_H
#ifdef __GNUG__
#pragma interface "apt-pkg/dpkgdb.h"
#endif
#include <apt-pkg/database.h>
class debDpkgDB : public pkgDataBase
{
protected:
string AdminDir;
DynamicMMap *CacheMap;
DynamicMMap *FileMap;
unsigned long DiverInode;
signed long DiverTime;
virtual bool InitMetaTmp(string &Dir);
bool ReadFList(OpProgress &Progress);
bool ReadDiversions();
bool ReadConfFiles();
public:
virtual bool ReadyFileList(OpProgress &Progress);
virtual bool ReadyPkgCache(OpProgress &Progress);
virtual bool LoadChanges();
debDpkgDB();
virtual ~debDpkgDB();
};
#endif

View File

@ -1,104 +0,0 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: dirstream.cc,v 1.3 2003/02/10 00:36:12 doogie Exp $
/* ######################################################################
Directory Stream
This class provides a simple basic extractor that can be used for
a number of purposes.
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
#ifdef __GNUG__
#pragma implementation "apt-pkg/dirstream.h"
#endif
#include <apti18n.h>
#include <apt-pkg/dirstream.h>
#include <apt-pkg/error.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
#include <utime.h>
#include <unistd.h>
/*}}}*/
// DirStream::DoItem - Process an item /*{{{*/
// ---------------------------------------------------------------------
/* This is a very simple extractor, it does not deal with things like
overwriting directories with files and so on. */
bool pkgDirStream::DoItem(Item &Itm,int &Fd)
{
switch (Itm.Type)
{
case Item::File:
{
/* Open the output file, NDELAY is used to prevent this from
blowing up on device special files.. */
int iFd = open(Itm.Name,O_NDELAY|O_WRONLY|O_CREAT|O_TRUNC|O_APPEND,
Itm.Mode);
if (iFd < 0)
return _error->Errno("open",_("Failed write file %s"),
Itm.Name);
// fchmod deals with umask and fchown sets the ownership
if (fchmod(iFd,Itm.Mode) != 0)
return _error->Errno("fchmod",_("Failed write file %s"),
Itm.Name);
if (fchown(iFd,Itm.UID,Itm.GID) != 0 && errno != EPERM)
return _error->Errno("fchown",_("Failed write file %s"),
Itm.Name);
Fd = iFd;
return true;
}
case Item::HardLink:
case Item::SymbolicLink:
case Item::CharDevice:
case Item::BlockDevice:
case Item::Directory:
case Item::FIFO:
break;
}
return true;
}
/*}}}*/
// DirStream::FinishedFile - Finished processing a file /*{{{*/
// ---------------------------------------------------------------------
/* */
bool pkgDirStream::FinishedFile(Item &Itm,int Fd)
{
if (Fd < 0)
return true;
if (close(Fd) != 0)
return _error->Errno("close",_("Failed to close file %s"),Itm.Name);
/* Set the modification times. The only way it can fail is if someone
has futzed with our file, which is intolerable :> */
struct utimbuf Time;
Time.actime = Itm.MTime;
Time.modtime = Itm.MTime;
if (utime(Itm.Name,&Time) != 0)
_error->Errno("utime",_("Failed to close file %s"),Itm.Name);
return true;
}
/*}}}*/
// DirStream::Fail - Failed processing a file /*{{{*/
// ---------------------------------------------------------------------
/* */
bool pkgDirStream::Fail(Item &Itm,int Fd)
{
if (Fd < 0)
return true;
close(Fd);
return false;
}
/*}}}*/

View File

@ -1,61 +0,0 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: dirstream.h,v 1.2 2002/07/25 18:07:17 niemeyer Exp $
/* ######################################################################
Directory Stream
When unpacking the contents of the archive are passed into a directory
stream class for analysis and processing. The class controls all aspects
of actually writing the directory stream from disk. The low level
archive handlers are only responsible for decoding the archive format
and sending events (via method calls) to the specified directory
stream.
When unpacking a real file the archive handler is passed back a file
handle to write the data to, this is to support strange
archives+unpacking methods. If that fd is -1 then the file data is
simply ignored.
The provided defaults do the 'Right Thing' for a normal unpacking
process (ie 'tar')
##################################################################### */
/*}}}*/
#ifndef PKGLIB_DIRSTREAM_H
#define PKGLIB_DIRSTREAM_H
#ifdef __GNUG__
#pragma interface "apt-pkg/dirstream.h"
#endif
class pkgDirStream
{
public:
// All possible information about a component
struct Item
{
enum Type_t {File, HardLink, SymbolicLink, CharDevice, BlockDevice,
Directory, FIFO} Type;
char *Name;
char *LinkTarget;
unsigned long Mode;
unsigned long UID;
unsigned long GID;
unsigned long Size;
unsigned long MTime;
unsigned long Major;
unsigned long Minor;
};
virtual bool DoItem(Item &Itm,int &Fd);
virtual bool Fail(Item &Itm,int Fd);
virtual bool FinishedFile(Item &Itm,int Fd);
virtual bool Process(Item &Itm,const unsigned char *Data,
unsigned long Size,unsigned long Pos) {return true;};
virtual ~pkgDirStream() {};
};
#endif

View File

@ -1,5 +0,0 @@
- Replacing directories with files
dpkg permits this with the weak condition that the directory is owned only
by the package. APT requires that the directory have no files that are not
owned by the package. Replaces are specifically not checked to prevent
file list corruption.

View File

@ -1,512 +0,0 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: extract.cc,v 1.6 2003/02/10 00:36:12 doogie Exp $
/* ######################################################################
Archive Extraction Directory Stream
Extraction for each file is a bit of an involved process. Each object
undergoes an atomic backup, overwrite, erase sequence. First the
object is unpacked to '.dpkg.new' then the original is hardlinked to
'.dpkg.tmp' and finally the new object is renamed to overwrite the old
one. From an external perspective the file never ceased to exist.
After the archive has been sucessfully unpacked the .dpkg.tmp files
are erased. A failure causes all the .dpkg.tmp files to be restored.
Decisions about unpacking go like this:
- Store the original filename in the file listing
- Resolve any diversions that would effect this file, all checks
below apply to the diverted name, not the real one.
- Resolve any symlinked configuration files.
- If the existing file does not exist then .dpkg-tmp is checked for.
[Note, this is reduced to only check if a file was expected to be
there]
- If the existing link/file is not a directory then it is replaced
irregardless
- If the existing link/directory is being replaced by a directory then
absolutely nothing happens.
- If the existing link/directory is being replaced by a link then
absolutely nothing happens.
- If the existing link/directory is being replaced by a non-directory
then this will abort if the package is not the sole owner of the
directory. [Note, this is changed to not happen if the directory
non-empty - that is, it only includes files that are part of this
package - prevents removing user files accidentally.]
- If the non-directory exists in the listing database and it
does not belong to the current package then an overwrite condition
is invoked.
As we unpack we record the file list differences in the FL cache. If
we need to unroll the the FL cache knows which files have been unpacked
and can undo. When we need to erase then it knows which files have not
been unpacked.
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
#ifdef __GNUG__
#pragma implementation "apt-pkg/extract.h"
#endif
#include <apti18n.h>
#include <apt-pkg/extract.h>
#include <apt-pkg/error.h>
#include <apt-pkg/debversion.h>
#include <sys/stat.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <dirent.h>
#include <iostream>
/*}}}*/
using namespace std;
static const char *TempExt = "dpkg-tmp";
//static const char *NewExt = "dpkg-new";
// Extract::pkgExtract - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
pkgExtract::pkgExtract(pkgFLCache &FLCache,pkgCache::VerIterator Ver) :
FLCache(FLCache), Ver(Ver)
{
FLPkg = FLCache.GetPkg(Ver.ParentPkg().Name(),true);
if (FLPkg.end() == true)
return;
Debug = true;
}
/*}}}*/
// Extract::DoItem - Handle a single item from the stream /*{{{*/
// ---------------------------------------------------------------------
/* This performs the setup for the extraction.. */
bool pkgExtract::DoItem(Item &Itm,int &Fd)
{
char Temp[sizeof(FileName)];
/* Strip any leading/trailing /s from the filename, then copy it to the
temp buffer and re-apply the leading / We use a class variable
to store the new filename for use by the three extraction funcs */
char *End = FileName+1;
const char *I = Itm.Name;
for (; *I != 0 && *I == '/'; I++);
*FileName = '/';
for (; *I != 0 && End < FileName + sizeof(FileName); I++, End++)
*End = *I;
if (End + 20 >= FileName + sizeof(FileName))
return _error->Error(_("The path %s is too long"),Itm.Name);
for (; End > FileName && End[-1] == '/'; End--);
*End = 0;
Itm.Name = FileName;
/* Lookup the file. Nde is the file [group] we are going to write to and
RealNde is the actual node we are manipulating. Due to diversions
they may be entirely different. */
pkgFLCache::NodeIterator Nde = FLCache.GetNode(Itm.Name,End,0,false,false);
pkgFLCache::NodeIterator RealNde = Nde;
// See if the file is already in the file listing
unsigned long FileGroup = RealNde->File;
for (; RealNde.end() == false && FileGroup == RealNde->File; RealNde++)
if (RealNde.RealPackage() == FLPkg)
break;
// Nope, create an entry
if (RealNde.end() == true)
{
RealNde = FLCache.GetNode(Itm.Name,End,FLPkg.Offset(),true,false);
if (RealNde.end() == true)
return false;
RealNde->Flags |= pkgFLCache::Node::NewFile;
}
/* Check if this entry already was unpacked. The only time this should
ever happen is if someone has hacked tar to support capabilities, in
which case this needs to be modified anyhow.. */
if ((RealNde->Flags & pkgFLCache::Node::Unpacked) ==
pkgFLCache::Node::Unpacked)
return _error->Error(_("Unpacking %s more than once"),Itm.Name);
if (Nde.end() == true)
Nde = RealNde;
/* Consider a diverted file - We are not permitted to divert directories,
but everything else is fair game (including conf files!) */
if ((Nde->Flags & pkgFLCache::Node::Diversion) != 0)
{
if (Itm.Type == Item::Directory)
return _error->Error(_("The directory %s is diverted"),Itm.Name);
/* A package overwriting a diversion target is just the same as
overwriting a normally owned file and is checked for below in
the overwrites mechanism */
/* If this package is trying to overwrite the target of a diversion,
that is never, ever permitted */
pkgFLCache::DiverIterator Div = Nde.Diversion();
if (Div.DivertTo() == Nde)
return _error->Error(_("The package is trying to write to the "
"diversion target %s/%s"),Nde.DirN(),Nde.File());
// See if it is us and we are following it in the right direction
if (Div->OwnerPkg != FLPkg.Offset() && Div.DivertFrom() == Nde)
{
Nde = Div.DivertTo();
End = FileName + snprintf(FileName,sizeof(FileName)-20,"%s/%s",
Nde.DirN(),Nde.File());
if (End <= FileName)
return _error->Error(_("The diversion path is too long"));
}
}
// Deal with symlinks and conf files
if ((RealNde->Flags & pkgFLCache::Node::NewConfFile) ==
pkgFLCache::Node::NewConfFile)
{
string Res = flNoLink(Itm.Name);
if (Res.length() > sizeof(FileName))
return _error->Error(_("The path %s is too long"),Res.c_str());
if (Debug == true)
clog << "Followed conf file from " << FileName << " to " << Res << endl;
Itm.Name = strcpy(FileName,Res.c_str());
}
/* Get information about the existing file, and attempt to restore
a backup if it does not exist */
struct stat LExisting;
bool EValid = false;
if (lstat(Itm.Name,&LExisting) != 0)
{
// This is bad news.
if (errno != ENOENT)
return _error->Errno("stat",_("Failed to stat %s"),Itm.Name);
// See if we can recover the backup file
if (Nde.end() == false)
{
snprintf(Temp,sizeof(Temp),"%s.%s",Itm.Name,TempExt);
if (rename(Temp,Itm.Name) != 0 && errno != ENOENT)
return _error->Errno("rename",_("Failed to rename %s to %s"),
Temp,Itm.Name);
if (stat(Itm.Name,&LExisting) != 0)
{
if (errno != ENOENT)
return _error->Errno("stat",_("Failed to stat %s"),Itm.Name);
}
else
EValid = true;
}
}
else
EValid = true;
/* If the file is a link we need to stat its destination, get the
existing file modes */
struct stat Existing = LExisting;
if (EValid == true && S_ISLNK(Existing.st_mode))
{
if (stat(Itm.Name,&Existing) != 0)
{
if (errno != ENOENT)
return _error->Errno("stat",_("Failed to stat %s"),Itm.Name);
Existing = LExisting;
}
}
// We pretend a non-existing file looks like it is a normal file
if (EValid == false)
Existing.st_mode = S_IFREG;
/* Okay, at this point 'Existing' is the stat information for the
real non-link file */
/* The only way this can be a no-op is if a directory is being
replaced by a directory or by a link */
if (S_ISDIR(Existing.st_mode) != 0 &&
(Itm.Type == Item::Directory || Itm.Type == Item::SymbolicLink))
return true;
/* Non-Directory being replaced by non-directory. We check for over
writes here. */
if (Nde.end() == false)
{
if (HandleOverwrites(Nde) == false)
return false;
}
/* Directory being replaced by a non-directory - this needs to see if
the package is the owner and then see if the directory would be
empty after the package is removed [ie no user files will be
erased] */
if (S_ISDIR(Existing.st_mode) != 0)
{
if (CheckDirReplace(Itm.Name) == false)
return _error->Error(_("The directory %s is being replaced by a non-directory"),Itm.Name);
}
if (Debug == true)
clog << "Extract " << string(Itm.Name,End) << endl;
/* if (Count != 0)
return _error->Error(_("Done"));*/
return true;
}
/*}}}*/
// Extract::Finished - Sequence finished, erase the temp files /*{{{*/
// ---------------------------------------------------------------------
/* */
bool pkgExtract::Finished()
{
return true;
}
/*}}}*/
// Extract::Aborted - Sequence aborted, undo all our unpacking /*{{{*/
// ---------------------------------------------------------------------
/* This undoes everything that was done by all calls to the DoItem method
and restores the File Listing cache to its original form. It bases its
actions on the flags value for each node in the cache. */
bool pkgExtract::Aborted()
{
if (Debug == true)
clog << "Aborted, backing out" << endl;
pkgFLCache::NodeIterator Files = FLPkg.Files();
map_ptrloc *Last = &FLPkg->Files;
/* Loop over all files, restore those that have been unpacked from their
dpkg-tmp entires */
while (Files.end() == false)
{
// Locate the hash bucket for the node and locate its group head
pkgFLCache::NodeIterator Nde(FLCache,FLCache.HashNode(Files));
for (; Nde.end() == false && Files->File != Nde->File; Nde++);
if (Nde.end() == true)
return _error->Error(_("Failed to locate node in its hash bucket"));
if (snprintf(FileName,sizeof(FileName)-20,"%s/%s",
Nde.DirN(),Nde.File()) <= 0)
return _error->Error(_("The path is too long"));
// Deal with diversions
if ((Nde->Flags & pkgFLCache::Node::Diversion) != 0)
{
pkgFLCache::DiverIterator Div = Nde.Diversion();
// See if it is us and we are following it in the right direction
if (Div->OwnerPkg != FLPkg.Offset() && Div.DivertFrom() == Nde)
{
Nde = Div.DivertTo();
if (snprintf(FileName,sizeof(FileName)-20,"%s/%s",
Nde.DirN(),Nde.File()) <= 0)
return _error->Error(_("The diversion path is too long"));
}
}
// Deal with overwrites+replaces
for (; Nde.end() == false && Files->File == Nde->File; Nde++)
{
if ((Nde->Flags & pkgFLCache::Node::Replaced) ==
pkgFLCache::Node::Replaced)
{
if (Debug == true)
clog << "De-replaced " << FileName << " from " << Nde.RealPackage()->Name << endl;
Nde->Flags &= ~pkgFLCache::Node::Replaced;
}
}
// Undo the change in the filesystem
if (Debug == true)
clog << "Backing out " << FileName;
// Remove a new node
if ((Files->Flags & pkgFLCache::Node::NewFile) ==
pkgFLCache::Node::NewFile)
{
if (Debug == true)
clog << " [new node]" << endl;
pkgFLCache::Node *Tmp = Files;
Files++;
*Last = Tmp->NextPkg;
Tmp->NextPkg = 0;
FLCache.DropNode(Tmp - FLCache.NodeP);
}
else
{
if (Debug == true)
clog << endl;
Last = &Files->NextPkg;
Files++;
}
}
return true;
}
/*}}}*/
// Extract::Fail - Extraction of a file Failed /*{{{*/
// ---------------------------------------------------------------------
/* */
bool pkgExtract::Fail(Item &Itm,int Fd)
{
return pkgDirStream::Fail(Itm,Fd);
}
/*}}}*/
// Extract::FinishedFile - Finished a file /*{{{*/
// ---------------------------------------------------------------------
/* */
bool pkgExtract::FinishedFile(Item &Itm,int Fd)
{
return pkgDirStream::FinishedFile(Itm,Fd);
}
/*}}}*/
// Extract::HandleOverwrites - See if a replaces covers this overwrite /*{{{*/
// ---------------------------------------------------------------------
/* Check if the file is in a package that is being replaced by this
package or if the file is being overwritten. Note that if the file
is really a directory but it has been erased from the filesystem
this will fail with an overwrite message. This is a limitation of the
dpkg file information format.
XX If a new package installs and another package replaces files in this
package what should we do? */
bool pkgExtract::HandleOverwrites(pkgFLCache::NodeIterator Nde,
bool DiverCheck)
{
pkgFLCache::NodeIterator TmpNde = Nde;
unsigned long DiverOwner = 0;
unsigned long FileGroup = Nde->File;
const char *FirstOwner = 0;
for (; Nde.end() == false && FileGroup == Nde->File; Nde++)
{
if ((Nde->Flags & pkgFLCache::Node::Diversion) != 0)
{
/* Store the diversion owner if this is the forward direction
of the diversion */
if (DiverCheck == true)
DiverOwner = Nde.Diversion()->OwnerPkg;
continue;
}
pkgFLCache::PkgIterator FPkg(FLCache,Nde.RealPackage());
if (FPkg.end() == true || FPkg == FLPkg)
continue;
/* This tests trips when we are checking a diversion to see
if something has already been diverted by this diversion */
if (FPkg.Offset() == DiverOwner)
continue;
FirstOwner = FPkg.Name();
// Now see if this package matches one in a replace depends
pkgCache::DepIterator Dep = Ver.DependsList();
bool Ok = false;
for (; Dep.end() == false; Dep++)
{
if (Dep->Type != pkgCache::Dep::Replaces)
continue;
// Does the replaces apply to this package?
if (strcmp(Dep.TargetPkg().Name(),FPkg.Name()) != 0)
continue;
/* Check the version for match. I do not think CurrentVer can be
0 if we are here.. */
pkgCache::PkgIterator Pkg = Dep.TargetPkg();
if (Pkg->CurrentVer == 0)
{
_error->Warning(_("Overwrite package match with no version for %s"),Pkg.Name());
continue;
}
// Replaces is met
if (debVS.CheckDep(Pkg.CurrentVer().VerStr(),Dep->CompareOp,Dep.TargetVer()) == true)
{
if (Debug == true)
clog << "Replaced file " << Nde.DirN() << '/' << Nde.File() << " from " << Pkg.Name() << endl;
Nde->Flags |= pkgFLCache::Node::Replaced;
Ok = true;
break;
}
}
// Negative Hit
if (Ok == false)
return _error->Error(_("File %s/%s overwrites the one in the package %s"),
Nde.DirN(),Nde.File(),FPkg.Name());
}
/* If this is a diversion we might have to recurse to process
the other side of it */
if ((TmpNde->Flags & pkgFLCache::Node::Diversion) != 0)
{
pkgFLCache::DiverIterator Div = TmpNde.Diversion();
if (Div.DivertTo() == TmpNde)
return HandleOverwrites(Div.DivertFrom(),true);
}
return true;
}
/*}}}*/
// Extract::CheckDirReplace - See if this directory can be erased /*{{{*/
// ---------------------------------------------------------------------
/* If this directory is owned by a single package and that package is
replacing it with something non-directoryish then dpkg allows this.
We increase the requirement to be that the directory is non-empty after
the package is removed */
bool pkgExtract::CheckDirReplace(string Dir,unsigned int Depth)
{
// Looping?
if (Depth > 40)
return false;
if (Dir[Dir.size() - 1] != '/')
Dir += '/';
DIR *D = opendir(Dir.c_str());
if (D == 0)
return _error->Errno("opendir",_("Unable to read %s"),Dir.c_str());
string File;
for (struct dirent *Dent = readdir(D); Dent != 0; Dent = readdir(D))
{
// Skip some files
if (strcmp(Dent->d_name,".") == 0 ||
strcmp(Dent->d_name,"..") == 0)
continue;
// Look up the node
File = Dir + Dent->d_name;
pkgFLCache::NodeIterator Nde = FLCache.GetNode(File.c_str(),
File.c_str() + File.length(),0,false,false);
// The file is not owned by this package
if (Nde.end() != false || Nde.RealPackage() != FLPkg)
{
closedir(D);
return false;
}
// See if it is a directory
struct stat St;
if (lstat(File.c_str(),&St) != 0)
{
closedir(D);
return _error->Errno("lstat",_("Unable to stat %s"),File.c_str());
}
// Recurse down directories
if (S_ISDIR(St.st_mode) != 0)
{
if (CheckDirReplace(File,Depth + 1) == false)
{
closedir(D);
return false;
}
}
}
// No conflicts
closedir(D);
return true;
}
/*}}}*/

View File

@ -1,52 +0,0 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: extract.h,v 1.2 2002/07/25 18:07:17 niemeyer Exp $
/* ######################################################################
Archive Extraction Directory Stream
This Directory Stream implements extraction of an archive into the
filesystem. It makes the choices on what files should be unpacked and
replaces as well as guiding the actual unpacking.
When the unpacking sequence is completed one of the two functions,
Finished or Aborted must be called.
##################################################################### */
/*}}}*/
#ifndef PKGLIB_EXTRACT_H
#define PKGLIB_EXTRACT_H
#ifdef __GNUG__
#pragma interface "apt-pkg/extract.h"
#endif
#include <apt-pkg/dirstream.h>
#include <apt-pkg/filelist.h>
#include <apt-pkg/pkgcache.h>
class pkgExtract : public pkgDirStream
{
pkgFLCache &FLCache;
pkgCache::VerIterator Ver;
pkgFLCache::PkgIterator FLPkg;
char FileName[1024];
bool Debug;
bool HandleOverwrites(pkgFLCache::NodeIterator Nde,
bool DiverCheck = false);
bool CheckDirReplace(string Dir,unsigned int Depth = 0);
public:
virtual bool DoItem(Item &Itm,int &Fd);
virtual bool Fail(Item &Itm,int Fd);
virtual bool FinishedFile(Item &Itm,int Fd);
bool Finished();
bool Aborted();
pkgExtract(pkgFLCache &FLCache,pkgCache::VerIterator Ver);
};
#endif

View File

@ -1,591 +0,0 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: filelist.cc,v 1.4 2003/02/10 00:36:12 doogie Exp $
/* ######################################################################
File Listing - Manages a Cache of File -> Package names.
Diversions add some signficant complexity to the system. To keep
storage space down in the very special case of a diverted file no
extra bytes are allocated in the Node structure. Instead a diversion
is inserted directly into the hash table and its flag bit set. Every
lookup for that filename will always return the diversion.
The hash buckets are stored in sorted form, with diversions having
the higest sort order. Identical files are assigned the same file
pointer, thus after a search all of the nodes owning that file can be
found by iterating down the bucket.
Re-updates of diversions (another extremely special case) are done by
marking all diversions as untouched, then loading the entire diversion
list again, touching each diversion and then finally going back and
releasing all untouched diversions. It is assumed that the diversion
table will always be quite small and be a very irregular case.
Diversions that are user-installed are represented by a package with
an empty name string.
Conf files are handled like diversions by changing the meaning of the
Pointer field to point to a conf file entry - again to reduce over
head for a special case.
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
#ifdef __GNUG__
#pragma implementation "apt-pkg/filelist.h"
#endif
#include <apti18n.h>
#include <apt-pkg/filelist.h>
#include <apt-pkg/mmap.h>
#include <apt-pkg/error.h>
#include <apt-pkg/strutl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
/*}}}*/
using namespace std;
// FlCache::Header::Header - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* Initialize the header variables. These are the defaults used when
creating new caches */
pkgFLCache::Header::Header()
{
Signature = 0xEA3F1295;
/* Whenever the structures change the major version should be bumped,
whenever the generator changes the minor version should be bumped. */
MajorVersion = 1;
MinorVersion = 0;
Dirty = true;
HeaderSz = sizeof(pkgFLCache::Header);
NodeSz = sizeof(pkgFLCache::Node);
DirSz = sizeof(pkgFLCache::Directory);
PackageSz = sizeof(pkgFLCache::Package);
DiversionSz = sizeof(pkgFLCache::Diversion);
ConfFileSz = sizeof(pkgFLCache::ConfFile);
NodeCount = 0;
DirCount = 0;
PackageCount = 0;
DiversionCount = 0;
ConfFileCount = 0;
HashSize = 1 << 14;
FileHash = 0;
DirTree = 0;
Packages = 0;
Diversions = 0;
UniqNodes = 0;
memset(Pools,0,sizeof(Pools));
}
/*}}}*/
// FLCache::Header::CheckSizes - Check if the two headers have same *sz /*{{{*/
// ---------------------------------------------------------------------
/* Compare to make sure we are matching versions */
bool pkgFLCache::Header::CheckSizes(Header &Against) const
{
if (HeaderSz == Against.HeaderSz &&
NodeSz == Against.NodeSz &&
DirSz == Against.DirSz &&
DiversionSz == Against.DiversionSz &&
PackageSz == Against.PackageSz &&
ConfFileSz == Against.ConfFileSz)
return true;
return false;
}
/*}}}*/
// FLCache::pkgFLCache - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* If this is a new cache then a new header and hash table are instantaited
otherwise the existing ones are mearly attached */
pkgFLCache::pkgFLCache(DynamicMMap &Map) : Map(Map)
{
if (_error->PendingError() == true)
return;
LastTreeLookup = 0;
LastLookupSize = 0;
// Apply the typecasts
HeaderP = (Header *)Map.Data();
NodeP = (Node *)Map.Data();
DirP = (Directory *)Map.Data();
DiverP = (Diversion *)Map.Data();
PkgP = (Package *)Map.Data();
ConfP = (ConfFile *)Map.Data();
StrP = (char *)Map.Data();
AnyP = (unsigned char *)Map.Data();
// New mapping, create the basic cache structures
if (Map.Size() == 0)
{
Map.RawAllocate(sizeof(pkgFLCache::Header));
*HeaderP = pkgFLCache::Header();
HeaderP->FileHash = Map.RawAllocate(sizeof(pkgFLCache::Node)*HeaderP->HashSize,
sizeof(pkgFLCache::Node))/sizeof(pkgFLCache::Node);
}
FileHash = NodeP + HeaderP->FileHash;
// Setup the dynamic map manager
HeaderP->Dirty = true;
Map.Sync(0,sizeof(pkgFLCache::Header));
Map.UsePools(*HeaderP->Pools,sizeof(HeaderP->Pools)/sizeof(HeaderP->Pools[0]));
}
/*}}}*/
// FLCache::TreeLookup - Perform a lookup in a generic tree /*{{{*/
// ---------------------------------------------------------------------
/* This is a simple generic tree lookup. The first three entries of
the Directory structure are used as a template, but any other similar
structure could be used in it's place. */
map_ptrloc pkgFLCache::TreeLookup(map_ptrloc *Base,const char *Text,
const char *TextEnd,unsigned long Size,
unsigned int *Count,bool Insert)
{
pkgFLCache::Directory *Dir;
// Check our last entry cache
if (LastTreeLookup != 0 && LastLookupSize == Size)
{
Dir = (pkgFLCache::Directory *)(AnyP + LastTreeLookup*Size);
if (stringcmp(Text,TextEnd,StrP + Dir->Name) == 0)
return LastTreeLookup;
}
while (1)
{
// Allocate a new one
if (*Base == 0)
{
if (Insert == false)
return 0;
*Base = Map.Allocate(Size);
if (*Base == 0)
return 0;
(*Count)++;
Dir = (pkgFLCache::Directory *)(AnyP + *Base*Size);
Dir->Name = Map.WriteString(Text,TextEnd - Text);
LastTreeLookup = *Base;
LastLookupSize = Size;
return *Base;
}
// Compare this node
Dir = (pkgFLCache::Directory *)(AnyP + *Base*Size);
int Res = stringcmp(Text,TextEnd,StrP + Dir->Name);
if (Res == 0)
{
LastTreeLookup = *Base;
LastLookupSize = Size;
return *Base;
}
if (Res > 0)
Base = &Dir->Left;
if (Res < 0)
Base = &Dir->Right;
}
}
/*}}}*/
// FLCache::PrintTree - Print out a tree /*{{{*/
// ---------------------------------------------------------------------
/* This is a simple generic tree dumper, ment for debugging. */
void pkgFLCache::PrintTree(map_ptrloc Base,unsigned long Size)
{
if (Base == 0)
return;
pkgFLCache::Directory *Dir = (pkgFLCache::Directory *)(AnyP + Base*Size);
PrintTree(Dir->Left,Size);
cout << (StrP + Dir->Name) << endl;
PrintTree(Dir->Right,Size);
}
/*}}}*/
// FLCache::GetPkg - Get a package pointer /*{{{*/
// ---------------------------------------------------------------------
/* Locate a package by name in it's tree, this is just a wrapper for
TreeLookup */
pkgFLCache::PkgIterator pkgFLCache::GetPkg(const char *Name,const char *NameEnd,
bool Insert)
{
if (NameEnd == 0)
NameEnd = Name + strlen(Name);
map_ptrloc Pos = TreeLookup(&HeaderP->Packages,Name,NameEnd,
sizeof(pkgFLCache::Package),
&HeaderP->PackageCount,Insert);
if (Pos == 0)
return pkgFLCache::PkgIterator();
return pkgFLCache::PkgIterator(*this,PkgP + Pos);
}
/*}}}*/
// FLCache::GetNode - Get the node associated with the filename /*{{{*/
// ---------------------------------------------------------------------
/* Lookup a node in the hash table. If Insert is true then a new node is
always inserted. The hash table can have multiple instances of a
single name available. A search returns the first. It is important
that additions for the same name insert after the first entry of
the name group. */
pkgFLCache::NodeIterator pkgFLCache::GetNode(const char *Name,
const char *NameEnd,
map_ptrloc Loc,
bool Insert,bool Divert)
{
// Split the name into file and directory, hashing as it is copied
const char *File = Name;
unsigned long HashPos = 0;
for (const char *I = Name; I < NameEnd; I++)
{
HashPos = 1637*HashPos + *I;
if (*I == '/')
File = I;
}
// Search for it
Node *Hash = NodeP + HeaderP->FileHash + (HashPos % HeaderP->HashSize);
int Res = 0;
map_ptrloc FilePtr = 0;
while (Hash->Pointer != 0)
{
// Compare
Res = stringcmp(File+1,NameEnd,StrP + Hash->File);
if (Res == 0)
Res = stringcmp(Name,File,StrP + DirP[Hash->Dir].Name);
// Diversion?
if (Res == 0 && Insert == true)
{
/* Dir and File match exactly, we need to reuse the file name
when we link it in */
FilePtr = Hash->File;
Res = Divert - ((Hash->Flags & Node::Diversion) == Node::Diversion);
}
// Is a match
if (Res == 0)
{
if (Insert == false)
return NodeIterator(*this,Hash);
// Only one diversion per name!
if (Divert == true)
return NodeIterator(*this,Hash);
break;
}
// Out of sort order
if (Res > 0)
break;
if (Hash->Next != 0)
Hash = NodeP + Hash->Next;
else
break;
}
// Fail, not found
if (Insert == false)
return NodeIterator(*this);
// Find a directory node
map_ptrloc Dir = TreeLookup(&HeaderP->DirTree,Name,File,
sizeof(pkgFLCache::Directory),
&HeaderP->DirCount,true);
if (Dir == 0)
return NodeIterator(*this);
// Allocate a new node
if (Hash->Pointer != 0)
{
// Overwrite or append
if (Res > 0)
{
Node *Next = NodeP + Map.Allocate(sizeof(*Hash));
if (Next == NodeP)
return NodeIterator(*this);
*Next = *Hash;
Hash->Next = Next - NodeP;
}
else
{
unsigned long NewNext = Map.Allocate(sizeof(*Hash));
if (NewNext == 0)
return NodeIterator(*this);
NodeP[NewNext].Next = Hash->Next;
Hash->Next = NewNext;
Hash = NodeP + Hash->Next;
}
}
// Insert into the new item
Hash->Dir = Dir;
Hash->Pointer = Loc;
Hash->Flags = 0;
if (Divert == true)
Hash->Flags |= Node::Diversion;
if (FilePtr != 0)
Hash->File = FilePtr;
else
{
HeaderP->UniqNodes++;
Hash->File = Map.WriteString(File+1,NameEnd - File-1);
}
// Link the node to the package list
if (Divert == false && Loc == 0)
{
Hash->Next = PkgP[Loc].Files;
PkgP[Loc].Files = Hash - NodeP;
}
HeaderP->NodeCount++;
return NodeIterator(*this,Hash);
}
/*}}}*/
// FLCache::HashNode - Return the hash bucket for the node /*{{{*/
// ---------------------------------------------------------------------
/* This is one of two hashing functions. The other is inlined into the
GetNode routine. */
pkgFLCache::Node *pkgFLCache::HashNode(NodeIterator const &Nde)
{
// Hash the node
unsigned long HashPos = 0;
for (const char *I = Nde.DirN(); *I != 0; I++)
HashPos = 1637*HashPos + *I;
HashPos = 1637*HashPos + '/';
for (const char *I = Nde.File(); *I != 0; I++)
HashPos = 1637*HashPos + *I;
return NodeP + HeaderP->FileHash + (HashPos % HeaderP->HashSize);
}
/*}}}*/
// FLCache::DropNode - Drop a node from the hash table /*{{{*/
// ---------------------------------------------------------------------
/* This erases a node from the hash table. Note that this does not unlink
the node from the package linked list. */
void pkgFLCache::DropNode(map_ptrloc N)
{
if (N == 0)
return;
NodeIterator Nde(*this,NodeP + N);
if (Nde->NextPkg != 0)
_error->Warning(_("DropNode called on still linked node"));
// Locate it in the hash table
Node *Last = 0;
Node *Hash = HashNode(Nde);
while (Hash->Pointer != 0)
{
// Got it
if (Hash == Nde)
{
// Top of the bucket..
if (Last == 0)
{
Hash->Pointer = 0;
if (Hash->Next == 0)
return;
*Hash = NodeP[Hash->Next];
// Release Hash->Next
return;
}
Last->Next = Hash->Next;
// Release Hash
return;
}
Last = Hash;
if (Hash->Next != 0)
Hash = NodeP + Hash->Next;
else
break;
}
_error->Error(_("Failed to locate the hash element!"));
}
/*}}}*/
// FLCache::BeginDiverLoad - Start reading new diversions /*{{{*/
// ---------------------------------------------------------------------
/* Tag all the diversions as untouched */
void pkgFLCache::BeginDiverLoad()
{
for (DiverIterator I = DiverBegin(); I.end() == false; I++)
I->Flags = 0;
}
/*}}}*/
// FLCache::FinishDiverLoad - Finish up a new diversion load /*{{{*/
// ---------------------------------------------------------------------
/* This drops any untouched diversions. In effect removing any diversions
that where not loaded (ie missing from the diversion file) */
void pkgFLCache::FinishDiverLoad()
{
map_ptrloc *Cur = &HeaderP->Diversions;
while (*Cur != 0)
{
Diversion *Div = DiverP + *Cur;
if ((Div->Flags & Diversion::Touched) == Diversion::Touched)
{
Cur = &Div->Next;
continue;
}
// Purge!
DropNode(Div->DivertTo);
DropNode(Div->DivertFrom);
*Cur = Div->Next;
}
}
/*}}}*/
// FLCache::AddDiversion - Add a new diversion /*{{{*/
// ---------------------------------------------------------------------
/* Add a new diversion to the diverion tables and make sure that it is
unique and non-chaining. */
bool pkgFLCache::AddDiversion(PkgIterator const &Owner,
const char *From,const char *To)
{
/* Locate the two hash nodes we are going to manipulate. If there
are pre-existing diversions then they will be returned */
NodeIterator FromN = GetNode(From,From+strlen(From),0,true,true);
NodeIterator ToN = GetNode(To,To+strlen(To),0,true,true);
if (FromN.end() == true || ToN.end() == true)
return _error->Error(_("Failed to allocate diversion"));
// Should never happen
if ((FromN->Flags & Node::Diversion) != Node::Diversion ||
(ToN->Flags & Node::Diversion) != Node::Diversion)
return _error->Error(_("Internal Error in AddDiversion"));
// Now, try to reclaim an existing diversion..
map_ptrloc Diver = 0;
if (FromN->Pointer != 0)
Diver = FromN->Pointer;
/* Make sure from and to point to the same diversion, if they dont
then we are trying to intermix diversions - very bad */
if (ToN->Pointer != 0 && ToN->Pointer != Diver)
{
// It could be that the other diversion is no longer in use
if ((DiverP[ToN->Pointer].Flags & Diversion::Touched) == Diversion::Touched)
return _error->Error(_("Trying to overwrite a diversion, %s -> %s and %s/%s"),
From,To,ToN.File(),ToN.Dir().Name());
// We can erase it.
Diversion *Div = DiverP + ToN->Pointer;
ToN->Pointer = 0;
if (Div->DivertTo == ToN.Offset())
Div->DivertTo = 0;
if (Div->DivertFrom == ToN.Offset())
Div->DivertFrom = 0;
// This diversion will be cleaned up by FinishDiverLoad
}
// Allocate a new diversion
if (Diver == 0)
{
Diver = Map.Allocate(sizeof(Diversion));
if (Diver == 0)
return false;
DiverP[Diver].Next = HeaderP->Diversions;
HeaderP->Diversions = Diver;
HeaderP->DiversionCount++;
}
// Can only have one diversion of the same files
Diversion *Div = DiverP + Diver;
if ((Div->Flags & Diversion::Touched) == Diversion::Touched)
return _error->Error(_("Double add of diversion %s -> %s"),From,To);
// Setup the From/To links
if (Div->DivertFrom != FromN.Offset() && Div->DivertFrom != ToN.Offset())
DropNode(Div->DivertFrom);
Div->DivertFrom = FromN.Offset();
if (Div->DivertTo != FromN.Offset() && Div->DivertTo != ToN.Offset())
DropNode(Div->DivertTo);
Div->DivertTo = ToN.Offset();
// Link it to the two nodes
FromN->Pointer = Diver;
ToN->Pointer = Diver;
// And the package
Div->OwnerPkg = Owner.Offset();
Div->Flags |= Diversion::Touched;
return true;
}
/*}}}*/
// FLCache::AddConfFile - Add a new configuration file /*{{{*/
// ---------------------------------------------------------------------
/* This simply adds a new conf file node to the hash table. This is only
used by the status file reader. It associates a hash with each conf
file entry that exists in the status file and the list file for
the proper package. Duplicate conf files (across packages) are left
up to other routines to deal with. */
bool pkgFLCache::AddConfFile(const char *Name,const char *NameEnd,
PkgIterator const &Owner,
const unsigned char *Sum)
{
NodeIterator Nde = GetNode(Name,NameEnd,0,false,false);
if (Nde.end() == true)
return true;
unsigned long File = Nde->File;
for (; Nde->File == File && Nde.end() == false; Nde++)
{
if (Nde.RealPackage() != Owner)
continue;
if ((Nde->Flags & Node::ConfFile) == Node::ConfFile)
return _error->Error(_("Duplicate conf file %s/%s"),Nde.DirN(),Nde.File());
// Allocate a new conf file structure
map_ptrloc Conf = Map.Allocate(sizeof(ConfFile));
if (Conf == 0)
return false;
ConfP[Conf].OwnerPkg = Owner.Offset();
memcpy(ConfP[Conf].MD5,Sum,sizeof(ConfP[Conf].MD5));
Nde->Pointer = Conf;
Nde->Flags |= Node::ConfFile;
return true;
}
/* This means the conf file has been replaced, but the entry in the
status file was not updated */
return true;
}
/*}}}*/
// NodeIterator::RealPackage - Return the package for this node /*{{{*/
// ---------------------------------------------------------------------
/* Since the package pointer is indirected in all sorts of interesting ways
this is used to get a pointer to the owning package */
pkgFLCache::Package *pkgFLCache::NodeIterator::RealPackage() const
{
if (Nde->Pointer == 0)
return 0;
if ((Nde->Flags & Node::ConfFile) == Node::ConfFile)
return Owner->PkgP + Owner->ConfP[Nde->Pointer].OwnerPkg;
// Diversions are ignored
if ((Nde->Flags & Node::Diversion) == Node::Diversion)
return 0;
return Owner->PkgP + Nde->Pointer;
}
/*}}}*/

View File

@ -1,314 +0,0 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: filelist.h,v 1.2 2002/07/25 18:07:17 niemeyer Exp $
/* ######################################################################
File Listing - Manages a Cache of File -> Package names.
This is identical to the Package cache, except that the generator
(which is much simpler) is integrated directly into the main class,
and it has been designed to handle live updates.
The storage content of the class is maintained in a memory map and is
written directly to the file system. Performance is traded against
space to give something that performs well and remains small.
The average per file usage is 32 bytes which yeilds about a meg every
36k files. Directory paths are collected into a binary tree and stored
only once, this offsets the cost of the hash nodes enough to keep
memory usage slightly less than the sum of the filenames.
The file names are stored into a fixed size chained hash table that is
linked to the package name and to the directory component.
Each file node has a set of associated flags that indicate the current
state of the file.
##################################################################### */
/*}}}*/
#ifndef PKGLIB_FILELIST_H
#define PKGLIB_FILELIST_H
#ifdef __GNUG__
#pragma interface "apt-pkg/filelist.h"
#endif
#include <apt-pkg/mmap.h>
class pkgFLCache
{
public:
struct Header;
struct Node;
struct Directory;
struct Package;
struct Diversion;
struct ConfFile;
class NodeIterator;
class DirIterator;
class PkgIterator;
class DiverIterator;
protected:
string CacheFile;
DynamicMMap &Map;
map_ptrloc LastTreeLookup;
unsigned long LastLookupSize;
// Helpers for the addition algorithms
map_ptrloc TreeLookup(map_ptrloc *Base,const char *Text,const char *TextEnd,
unsigned long Size,unsigned int *Count = 0,
bool Insert = false);
public:
// Pointers to the arrays of items
Header *HeaderP;
Node *NodeP;
Directory *DirP;
Package *PkgP;
Diversion *DiverP;
ConfFile *ConfP;
char *StrP;
unsigned char *AnyP;
// Quick accessors
Node *FileHash;
// Accessors
Header &Head() {return *HeaderP;};
void PrintTree(map_ptrloc Base,unsigned long Size);
// Add/Find things
PkgIterator GetPkg(const char *Name,const char *End,bool Insert);
inline PkgIterator GetPkg(const char *Name,bool Insert);
NodeIterator GetNode(const char *Name,
const char *NameEnd,
map_ptrloc Loc,
bool Insert,bool Divert);
Node *HashNode(NodeIterator const &N);
void DropNode(map_ptrloc Node);
inline DiverIterator DiverBegin();
// Diversion control
void BeginDiverLoad();
void FinishDiverLoad();
bool AddDiversion(PkgIterator const &Owner,const char *From,
const char *To);
bool AddConfFile(const char *Name,const char *NameEnd,
PkgIterator const &Owner,const unsigned char *Sum);
pkgFLCache(DynamicMMap &Map);
// ~pkgFLCache();
};
struct pkgFLCache::Header
{
// Signature information
unsigned long Signature;
short MajorVersion;
short MinorVersion;
bool Dirty;
// Size of structure values
unsigned HeaderSz;
unsigned NodeSz;
unsigned DirSz;
unsigned PackageSz;
unsigned DiversionSz;
unsigned ConfFileSz;
// Structure Counts;
unsigned int NodeCount;
unsigned int DirCount;
unsigned int PackageCount;
unsigned int DiversionCount;
unsigned int ConfFileCount;
unsigned int HashSize;
unsigned long UniqNodes;
// Offsets
map_ptrloc FileHash;
map_ptrloc DirTree;
map_ptrloc Packages;
map_ptrloc Diversions;
/* Allocation pools, there should be one of these for each structure
excluding the header */
DynamicMMap::Pool Pools[5];
bool CheckSizes(Header &Against) const;
Header();
};
/* The bit field is used to advoid incurring an extra 4 bytes x 40000,
Pointer is the most infrequently used member of the structure */
struct pkgFLCache::Node
{
map_ptrloc Dir; // Dir
map_ptrloc File; // String
unsigned Pointer:24; // Package/Diversion/ConfFile
unsigned Flags:8; // Package
map_ptrloc Next; // Node
map_ptrloc NextPkg; // Node
enum Flags {Diversion = (1<<0),ConfFile = (1<<1),
NewConfFile = (1<<2),NewFile = (1<<3),
Unpacked = (1<<4),Replaced = (1<<5)};
};
struct pkgFLCache::Directory
{
map_ptrloc Left; // Directory
map_ptrloc Right; // Directory
map_ptrloc Name; // String
};
struct pkgFLCache::Package
{
map_ptrloc Left; // Package
map_ptrloc Right; // Package
map_ptrloc Name; // String
map_ptrloc Files; // Node
};
struct pkgFLCache::Diversion
{
map_ptrloc OwnerPkg; // Package
map_ptrloc DivertFrom; // Node
map_ptrloc DivertTo; // String
map_ptrloc Next; // Diversion
unsigned long Flags;
enum Flags {Touched = (1<<0)};
};
struct pkgFLCache::ConfFile
{
map_ptrloc OwnerPkg; // Package
unsigned char MD5[16];
};
class pkgFLCache::PkgIterator
{
Package *Pkg;
pkgFLCache *Owner;
public:
inline bool end() const {return Owner == 0 || Pkg == Owner->PkgP?true:false;}
// Accessors
inline Package *operator ->() {return Pkg;};
inline Package const *operator ->() const {return Pkg;};
inline Package const &operator *() const {return *Pkg;};
inline operator Package *() {return Pkg == Owner->PkgP?0:Pkg;};
inline operator Package const *() const {return Pkg == Owner->PkgP?0:Pkg;};
inline unsigned long Offset() const {return Pkg - Owner->PkgP;};
inline const char *Name() const {return Pkg->Name == 0?0:Owner->StrP + Pkg->Name;};
inline pkgFLCache::NodeIterator Files() const;
PkgIterator() : Pkg(0), Owner(0) {};
PkgIterator(pkgFLCache &Owner,Package *Trg) : Pkg(Trg), Owner(&Owner) {};
};
class pkgFLCache::DirIterator
{
Directory *Dir;
pkgFLCache *Owner;
public:
// Accessors
inline Directory *operator ->() {return Dir;};
inline Directory const *operator ->() const {return Dir;};
inline Directory const &operator *() const {return *Dir;};
inline operator Directory *() {return Dir == Owner->DirP?0:Dir;};
inline operator Directory const *() const {return Dir == Owner->DirP?0:Dir;};
inline const char *Name() const {return Dir->Name == 0?0:Owner->StrP + Dir->Name;};
DirIterator() : Dir(0), Owner(0) {};
DirIterator(pkgFLCache &Owner,Directory *Trg) : Dir(Trg), Owner(&Owner) {};
};
class pkgFLCache::DiverIterator
{
Diversion *Diver;
pkgFLCache *Owner;
public:
// Iteration
void operator ++(int) {if (Diver != Owner->DiverP) Diver = Owner->DiverP + Diver->Next;};
inline void operator ++() {operator ++(0);};
inline bool end() const {return Owner == 0 || Diver == Owner->DiverP;};
// Accessors
inline Diversion *operator ->() {return Diver;};
inline Diversion const *operator ->() const {return Diver;};
inline Diversion const &operator *() const {return *Diver;};
inline operator Diversion *() {return Diver == Owner->DiverP?0:Diver;};
inline operator Diversion const *() const {return Diver == Owner->DiverP?0:Diver;};
inline PkgIterator OwnerPkg() const {return PkgIterator(*Owner,Owner->PkgP + Diver->OwnerPkg);};
inline NodeIterator DivertFrom() const;
inline NodeIterator DivertTo() const;
DiverIterator() : Diver(0), Owner(0) {};
DiverIterator(pkgFLCache &Owner,Diversion *Trg) : Diver(Trg), Owner(&Owner) {};
};
class pkgFLCache::NodeIterator
{
Node *Nde;
enum {NdePkg, NdeHash} Type;
pkgFLCache *Owner;
public:
// Iteration
void operator ++(int) {if (Nde != Owner->NodeP) Nde = Owner->NodeP +
(Type == NdePkg?Nde->NextPkg:Nde->Next);};
inline void operator ++() {operator ++(0);};
inline bool end() const {return Owner == 0 || Nde == Owner->NodeP;};
// Accessors
inline Node *operator ->() {return Nde;};
inline Node const *operator ->() const {return Nde;};
inline Node const &operator *() const {return *Nde;};
inline operator Node *() {return Nde == Owner->NodeP?0:Nde;};
inline operator Node const *() const {return Nde == Owner->NodeP?0:Nde;};
inline unsigned long Offset() const {return Nde - Owner->NodeP;};
inline DirIterator Dir() const {return DirIterator(*Owner,Owner->DirP + Nde->Dir);};
inline DiverIterator Diversion() const {return DiverIterator(*Owner,Owner->DiverP + Nde->Pointer);};
inline const char *File() const {return Nde->File == 0?0:Owner->StrP + Nde->File;};
inline const char *DirN() const {return Owner->StrP + Owner->DirP[Nde->Dir].Name;};
Package *RealPackage() const;
NodeIterator() : Nde(0), Type(NdeHash), Owner(0) {};
NodeIterator(pkgFLCache &Owner) : Nde(Owner.NodeP), Type(NdeHash), Owner(&Owner) {};
NodeIterator(pkgFLCache &Owner,Node *Trg) : Nde(Trg), Type(NdeHash), Owner(&Owner) {};
NodeIterator(pkgFLCache &Owner,Node *Trg,Package *) : Nde(Trg), Type(NdePkg), Owner(&Owner) {};
};
/* Inlines with forward references that cannot be included directly in their
respsective classes */
inline pkgFLCache::NodeIterator pkgFLCache::DiverIterator::DivertFrom() const
{return NodeIterator(*Owner,Owner->NodeP + Diver->DivertFrom);};
inline pkgFLCache::NodeIterator pkgFLCache::DiverIterator::DivertTo() const
{return NodeIterator(*Owner,Owner->NodeP + Diver->DivertTo);};
inline pkgFLCache::NodeIterator pkgFLCache::PkgIterator::Files() const
{return NodeIterator(*Owner,Owner->NodeP + Pkg->Files,Pkg);};
inline pkgFLCache::DiverIterator pkgFLCache::DiverBegin()
{return DiverIterator(*this,DiverP + HeaderP->Diversions);};
inline pkgFLCache::PkgIterator pkgFLCache::GetPkg(const char *Name,bool Insert)
{return GetPkg(Name,Name+strlen(Name),Insert);};
#endif

View File

@ -1,32 +0,0 @@
# -*- make -*-
BASE=..
SUBDIR=apt-inst
# Header location
SUBDIRS = contrib deb
HEADER_TARGETDIRS = apt-pkg
# Bring in the default rules
include ../buildlib/defaults.mak
# The library name
LIBRARY=apt-inst
LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
MAJOR=1.0
MINOR=0
SLIBS=$(PTHREADLIB) -lapt-pkg
APT_DOMAIN:=libapt-inst$(MAJOR)
# Source code for the contributed non-core things
SOURCE = contrib/extracttar.cc contrib/arfile.cc
# Source code for the main library
SOURCE+= filelist.cc database.cc dirstream.cc extract.cc \
deb/dpkgdb.cc deb/debfile.cc
# Public header files
HEADERS = extracttar.h arfile.h filelist.h database.h extract.h \
dpkgdb.h dirstream.h debfile.h
HEADERS := $(addprefix apt-pkg/,$(HEADERS))
include $(LIBRARY_H)

157
apt/apt-pkg/Makefile.am Normal file
View File

@ -0,0 +1,157 @@
lib_LTLIBRARIES = libapt-pkg.la
libapt_pkg_la_LIBADD = @RPMLIBS@
libapt_pkg_la_LDFLAGS = -version-info 1:1:1 -release @GLIBC_VER@-@LIBSTDCPP_VER@
AM_CPPFLAGS = -DLIBDIR=\"$(libdir)\"
INCLUDES = -I$(top_srcdir)/lua/include -I$(top_srcdir)/lua/local
if WITH_LUA
libapt_pkg_la_LIBADD += $(top_builddir)/lua/liblua.la
endif
libapt_pkg_la_SOURCES = \
contrib/cdromutl.cc \
contrib/cdromutl.h \
contrib/cmndline.cc \
contrib/cmndline.h \
contrib/configuration.cc \
contrib/configuration.h \
contrib/crc-16.cc \
contrib/crc-16.h \
contrib/error.cc \
contrib/error.h \
contrib/fileutl.cc \
contrib/fileutl.h \
contrib/hashes.cc \
contrib/hashes.h \
contrib/md5.cc \
contrib/md5.h \
contrib/mmap.cc \
contrib/mmap.h \
contrib/progress.cc \
contrib/progress.h \
contrib/sha1.cc \
contrib/sha1.h \
contrib/sptr.h \
contrib/strutl.cc \
contrib/strutl.h \
contrib/system.h \
rpm/rpmhandler.cc \
rpm/rpmhandler.h \
rpm/rpmindexfile.cc \
rpm/rpmindexfile.h \
rpm/rpmlistparser.cc \
rpm/rpmlistparser.h \
rpm/rpmmisc.h \
rpm/rpmpackagedata.cc \
rpm/rpmpackagedata.h \
rpm/rpmpm.cc \
rpm/rpmpm.h \
rpm/rpmshowprogress.h \
rpm/rpmrecords.cc \
rpm/rpmrecords.h \
rpm/rpmsrcrecords.cc \
rpm/rpmsrcrecords.h \
rpm/rpmsystem.cc \
rpm/rpmsystem.h \
rpm/rpmversion.cc \
rpm/rpmversion.h \
acquire.cc \
acquire.h \
acquire-item.cc \
acquire-item.h \
acquire-method.cc \
acquire-method.h \
acquire-worker.cc \
acquire-worker.h \
algorithms.cc \
algorithms.h \
cachefile.cc \
cachefile.h \
cacheiterators.h \
clean.cc \
clean.h \
depcache.cc \
depcache.h \
indexfile.cc \
indexfile.h \
init.cc \
init.h \
luaiface.cc \
luaiface.h \
orderlist.cc \
orderlist.h \
packagemanager.cc \
packagemanager.h \
pkgcache.cc \
pkgcachegen.cc \
pkgcachegen.h \
pkgcache.h \
pkgrecords.cc \
pkgrecords.h \
pkgsystem.cc \
pkgsystem.h \
policy.cc \
policy.h \
repository.cc \
repository.h \
sourcelist.cc \
sourcelist.h \
srcrecords.cc \
srcrecords.h \
tagfile.cc \
tagfile.h \
version.cc \
version.h \
versionmatch.cc \
versionmatch.h
PRIVATEHEADERS = contrib/system.h
includedir=${prefix}/include/apt-pkg
include_HEADERS = $(filter-out \
$(PRIVATEHEADERS), \
$(filter %.h,$(libapt_pkg_la_SOURCES)))
# This is a hack to allow us to maintain the original
# APT system of a a flat apt-pkg/ header directory.
PRIVREALHEADERS = $(PRIVATEHEADERS)
PRIVCOPYHEADERS = $(patsubst %.h, \
$(top_builddir)/include/%.h, \
$(notdir $(PRIVREALHEADERS)))
REALHEADERS = $(filter-out \
$(PRIVREALHEADERS), \
$(filter %.h,$(libapt_pkg_la_SOURCES)))
COPYHEADERS = $(patsubst %.h, \
$(top_builddir)/include/apt-pkg/%.h, \
$(notdir $(REALHEADERS)))
REALOBJECTS = $(patsubst %.cc,%.lo,\
$(filter %.cc,$(libapt_pkg_la_SOURCES)))
$(REALOBJECTS): $(COPYHEADERS) $(PRIVCOPYHEADERS)
$(top_builddir)/include/apt-pkg/%: %
@$(mkinstalldirs) $(top_builddir)/include/apt-pkg
cp -f -p $< $@
$(top_builddir)/include/apt-pkg/%: contrib/%
@$(mkinstalldirs) $(top_builddir)/include/apt-pkg
cp -f -p $< $@
$(top_builddir)/include/apt-pkg/%: rpm/%
@$(mkinstalldirs) $(top_builddir)/include/apt-pkg
cp -f -p $< $@
$(top_builddir)/include/%: %
@$(mkinstalldirs) $(top_builddir)/include/apt-pkg
cp -f -p $< $@
$(top_builddir)/include/%: contrib/%
@$(mkinstalldirs) $(top_builddir)/include/apt-pkg
cp -f -p $< $@
$(top_builddir)/include/%: rpm/%
@$(mkinstalldirs) $(top_builddir)/include/apt-pkg
cp -f -p $< $@
clean-local:
rm -f $(PRIVCOPYHEADERS)
rm -rf $(top_builddir)/include/apt-pkg

1540
apt/apt-pkg/Makefile.in Normal file

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,10 @@
// CNC:2002-07-03
#include <apt-pkg/repository.h>
#include <apt-pkg/md5.h>
#include <config.h>
#include <apt-pkg/luaiface.h>
#include <iostream>
#include <assert.h>
using namespace std;
#include <apti18n.h>
@ -188,7 +191,7 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner,pkgRepository *Repository,
// Create the item
// CNC:2002-07-03
Desc.URI = URI + ".bz2";
Desc.URI = URI + _config->Find("Acquire::ComprExtension", ".bz2");
Desc.Description = URIDesc;
Desc.Owner = this;
Desc.ShortDesc = ShortDesc;
@ -773,6 +776,33 @@ bool pkgAcqArchive::QueueNext()
return false;
}
/*}}}*/
// CNC:2003-03-19
#ifdef WITH_LUA
// ScriptsAcquireDone - Script trigger. /*{{{*/
// ---------------------------------------------------------------------
/* */
template<class T>
static void ScriptsAcquireDone(const char *ConfKey,
string &StoreFilename,
string &ErrorText,
T &Status)
{
if (_lua->HasScripts(ConfKey) == true) {
_lua->SetGlobal("acquire_filename", StoreFilename.c_str());
_lua->SetGlobal("acquire_error", (const char *)NULL);
_lua->RunScripts(ConfKey, true);
const char *Error = _lua->GetGlobal("acquire_error");
if (Error != NULL && *Error != 0) {
Status = pkgAcquire::Item::StatError;
ErrorText = Error;
}
_lua->ResetGlobals();
}
}
/*}}}*/
#endif
// AcqArchive::Done - Finished fetching /*{{{*/
// ---------------------------------------------------------------------
/* */
@ -817,6 +847,13 @@ void pkgAcqArchive::Done(string Message,unsigned long Size,string Md5Hash,
{
StoreFilename = DestFile = FileName;
Local = true;
// CNC:2003-03-19
#ifdef WITH_LUA
ScriptsAcquireDone("Scripts::Acquire::Archive::Done",
StoreFilename, ErrorText, Status);
#endif
return;
}
@ -827,6 +864,13 @@ void pkgAcqArchive::Done(string Message,unsigned long Size,string Md5Hash,
StoreFilename = DestFile = FinalFile;
Complete = true;
// CNC:2003-03-19
#ifdef WITH_LUA
ScriptsAcquireDone("Scripts::Acquire::Archive::Done",
StoreFilename, ErrorText, Status);
#endif
}
/*}}}*/
// AcqArchive::Failed - Failure handler /*{{{*/
@ -965,6 +1009,13 @@ void pkgAcqFile::Done(string Message,unsigned long Size,string MD5,
{
if (S_ISLNK(St.st_mode) != 0)
unlink(DestFile.c_str());
// CNC:2003-12-11 - Check if FileName == DestFile
else {
struct stat St2;
if (stat(FileName.c_str(), &St2) == 0
&& St.st_ino == St2.st_ino)
return;
}
}
// Symlink the file

View File

@ -46,7 +46,7 @@ class pkgAcquire::Item
// State of the item
/* CNC:2002-11-22
* Do not use anonyomus enums, as this breaks swig in some cases */
* Do not use anonyomus enums, as this breaks SWIG in some cases */
enum StatusFlags {StatIdle, StatFetching, StatDone, StatError} Status;
string ErrorText;
unsigned long FileSize;

View File

@ -419,7 +419,8 @@ bool pkgDistUpgrade(pkgDepCache &Cache)
if (_config->FindB("APT::Remove-Depends",false) == true)
Fix.RemoveDepends();
return Fix.Resolve();
// CNC:2003-03-22
return Fix.Resolve(true);
}
/*}}}*/
// AllUpgrade - Upgrade as many packages as possible /*{{{*/
@ -1029,6 +1030,22 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
if ((Flags[Pkg->ID] & Protected) != 0)
continue;
// CNC:2003-03-22
pkgDepCache::State State(&Cache);
if (BrokenFix == true && DoUpgrade(Pkg) == true)
{
if (Cache[I].InstBroken() == false &&
State.BrokenCount() >= Cache.BrokenCount())
{
if (Debug == true)
clog << " Installing " << Pkg.Name() << endl;
Change = true;
break;
}
else
State.Restore();
}
if (Debug == true)
clog << " Added " << Pkg.Name() << " to the remove list" << endl;
@ -1405,7 +1422,7 @@ static int PrioComp(const void *A,const void *B)
return -1;
if (L->Priority != R->Priority)
return R->Priority - L->Priority;
return L->Priority - R->Priority;
return strcmp(L.ParentPkg().Name(),R.ParentPkg().Name());
}
void pkgPrioSortList(pkgCache &Cache,pkgCache::Version **List)

View File

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: cacheiterators.h,v 1.1 2002/07/23 17:54:50 niemeyer Exp $
// $Id: cacheiterators.h,v 1.18 2003/10/09 23:15:25 mdz Exp $
/* ######################################################################
Cache Iterators - Iterators for navigating the cache structure
@ -302,7 +302,7 @@ class pkgCache::PkgFileIterator
inline const char *Component() const {return File->Component == 0?0:Owner->StrP + File->Component;};
inline const char *Version() const {return File->Version == 0?0:Owner->StrP + File->Version;};
inline const char *Origin() const {return File->Origin == 0?0:Owner->StrP + File->Origin;};
inline const char *Label() const {return File->Origin == 0?0:Owner->StrP + File->Label;};
inline const char *Label() const {return File->Label == 0?0:Owner->StrP + File->Label;};
inline const char *Site() const {return File->Site == 0?0:Owner->StrP + File->Site;};
inline const char *Architecture() const {return File->Architecture == 0?0:Owner->StrP + File->Architecture;};
inline const char *IndexType() const {return File->IndexType == 0?0:Owner->StrP + File->IndexType;};

View File

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: configuration.cc,v 1.4 2003/01/29 18:43:48 niemeyer Exp $
// $Id: configuration.cc,v 1.27 2003/07/26 00:27:36 mdz Exp $
/* ######################################################################
Configuration Class
@ -305,7 +305,8 @@ string Configuration::FindAny(const char *Name,const char *Default) const
// bool
case 'b':
return FindB(key, Default) ? "true" : "false";
// CNC:2003-11-23
return FindB(key, StringToBool(Default)) ? "true" : "false";
// int
case 'i':
@ -412,13 +413,17 @@ bool Configuration::ExistsAny(const char *Name) const
{
string key = Name;
if (key.size() > 2 && key.end()[-2] == '/' &&
key.find_first_of("fdbi",key.size()-1) < key.size())
if (key.size() > 2 && key.end()[-2] == '/')
if (key.find_first_of("fdbi",key.size()-1) < key.size())
{
key.resize(key.size() - 2);
if (Exists(key.c_str()))
return true;
}
else
{
_error->Warning(_("Unrecognized type abbreviation: '%c'"), key.end()[-3]);
}
return Exists(Name);
}
@ -736,6 +741,11 @@ bool ReadConfigDir(Configuration &Conf,string Dir,bool AsSectional,
if (Ent->d_name[0] == '.')
continue;
// CNC:2003-12-02 Only accept .list & .conf files as valid config parts
if ((flExtension(Ent->d_name) != "list") &&
(flExtension(Ent->d_name) != "conf"))
continue;
// Skip bad file names ala run-parts
const char *C = Ent->d_name;
for (; *C != 0; C++)

View File

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: strutl.cc,v 1.47 2003/02/02 22:20:27 jgg Exp $
// $Id: strutl.cc,v 1.48 2003/07/18 14:15:11 mdz Exp $
/* ######################################################################
String Util - Some useful string functions.
@ -652,7 +652,7 @@ bool ReadMessages(int Fd, vector<string> &List)
continue;
// Pull the message out
string Message(Buffer,0,I-Buffer);
string Message(Buffer,I-Buffer);
// Fix up the buffer
for (; I < End && *I == '\n'; I++);
@ -1045,7 +1045,7 @@ void URI::CopyFrom(string U)
Path = "/";
// Now we attempt to locate a user:pass@host fragment
if (FirstColon[1] == '/' && FirstColon[2] == '/')
if (FirstColon + 2 <= U.end() && FirstColon[1] == '/' && FirstColon[2] == '/')
FirstColon += 3;
else
FirstColon += 1;

View File

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: deblistparser.cc,v 1.2 2002/07/25 18:07:18 niemeyer Exp $
// $Id: deblistparser.cc,v 1.29 2003/09/22 04:16:26 mdz Exp $
/* ######################################################################
Package Cache Generator - Generator for the cache structure.
@ -268,11 +268,7 @@ bool debListParser::ParseStatus(pkgCache::PkgIterator Pkg,
return true;
}
/*}}}*/
// ListParser::ParseDepends - Parse a dependency element /*{{{*/
// ---------------------------------------------------------------------
/* This parses the dependency elements out of a standard string in place,
bit by bit. */
const char *debListParser::ConvertRelation(const char *I,unsigned int &Op)
{
// Determine the operator
@ -331,6 +327,11 @@ const char *debListParser::ConvertRelation(const char *I,unsigned int &Op)
return I;
}
/*}}}*/
// ListParser::ParseDepends - Parse a dependency element /*{{{*/
// ---------------------------------------------------------------------
/* This parses the dependency elements out of a standard string in place,
bit by bit. */
const char *debListParser::ParseDepends(const char *Start,const char *Stop,
string &Package,string &Ver,
unsigned int &Op, bool ParseArchFlags)

View File

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: debversion.cc,v 1.2 2003/01/29 18:43:48 niemeyer Exp $
// $Id: debversion.cc,v 1.8 2003/09/10 23:39:49 mdz Exp $
/* ######################################################################
Debian Version - Versioning system for Debian
@ -48,9 +48,15 @@ int debVersioningSystem::CmpFragment(const char *A,const char *AEnd,
if (A >= AEnd && B >= BEnd)
return 0;
if (A >= AEnd)
{
if (*B == '~') return 1;
return -1;
}
if (B >= BEnd)
{
if (*A == '~') return -1;
return 1;
}
/* Iterate over the whole string
What this does is to spilt the whole string into groups of
@ -65,8 +71,8 @@ int debVersioningSystem::CmpFragment(const char *A,const char *AEnd,
{
int first_diff = 0;
while ((lhs != AEnd && !isdigit(*lhs)) ||
(rhs != BEnd && !isdigit(*rhs)) )
while (lhs != AEnd && rhs != BEnd &&
(!isdigit(*lhs) || !isdigit(*rhs)))
{
int vc = order(*lhs);
int rc = order(*rhs);
@ -101,11 +107,17 @@ int debVersioningSystem::CmpFragment(const char *A,const char *AEnd,
// lhs is shorter
if (lhs == AEnd)
{
if (*rhs == '~') return 1;
return -1;
}
// rhs is shorter
if (rhs == BEnd)
{
if (*lhs == '~') return -1;
return 1;
}
// Shouldnt happen
return 1;

View File

@ -1,5 +1,5 @@
// Description /*{{{*/
// $Id: dpkgpm.cc,v 1.2 2002/07/25 18:07:18 niemeyer Exp $
// $Id: dpkgpm.cc,v 1.27 2003/07/26 00:25:44 mdz Exp $
/* ######################################################################
DPKG Package Manager - Provide an interface to dpkg
@ -328,7 +328,7 @@ bool pkgDPkgPM::RunScriptsWithPkgs(const char *Cnf)
bool pkgDPkgPM::Go()
{
unsigned int MaxArgs = _config->FindI("Dpkg::MaxArgs",350);
unsigned int MaxArgBytes = _config->FindI("Dpkg::MaxArgBytes",1024);
unsigned int MaxArgBytes = _config->FindI("Dpkg::MaxArgBytes",8192);
if (RunScripts("DPkg::Pre-Invoke") == false)
return false;
@ -447,7 +447,7 @@ bool pkgDPkgPM::Go()
if (chdir(_config->FindDir("DPkg::Run-Directory","/").c_str()) != 0)
_exit(100);
if (_config->FindB("DPkg::FlushSTDIN",true) == true)
if (_config->FindB("DPkg::FlushSTDIN",true) == true && isatty(STDIN_FILENO))
{
int Flags,dummy;
if ((Flags = fcntl(STDIN_FILENO,F_GETFL,dummy)) < 0)

View File

@ -20,6 +20,10 @@
// CNC:2002-07-05
#include <apt-pkg/pkgsystem.h>
// CNC:2003-03-17
#include <config.h>
#include <apt-pkg/luaiface.h>
#include <apti18n.h>
/*}}}*/
@ -95,6 +99,13 @@ bool pkgDepCache::Init(OpProgress *Prog)
Update(Prog);
// CNC:2003-03-17
#ifdef WITH_LUA
_lua->SetDepCache(this);
_lua->RunScripts("Scripts::Cache::Init", true);
_lua->ResetCaches();
#endif
return true;
}
/*}}}*/
@ -1015,19 +1026,33 @@ bool pkgDepCache::Policy::IsImportantDep(DepIterator Dep)
// pkgDepCache::State::* - Routines to work on the state of a DepCache. /*{{{*/
// ---------------------------------------------------------------------
/* */
void pkgDepCache::State::Copy(pkgDepCache::State const &Other)
{
memcpy(this, &Other, sizeof(*this));
int Size = Dep->Head().PackageCount;
int DepSize = Dep->Head().DependsCount;
PkgState = new StateCache[Size];
PkgIgnore = new bool[Size];
DepState = new unsigned char[DepSize];
memcpy(PkgState, Other.PkgState, Size*sizeof(*PkgState));
memcpy(PkgIgnore, Other.PkgIgnore, Size*sizeof(*PkgIgnore));
memcpy(DepState, Other.DepState, DepSize*sizeof(*DepState));
}
void pkgDepCache::State::Save(pkgDepCache *dep)
{
Dep = dep;
delete [] PkgState;
delete [] DepState;
delete [] PkgIgnore;
delete[] PkgState;
delete[] DepState;
delete[] PkgIgnore;
int Size = Dep->Head().PackageCount;
int DepSize = Dep->Head().DependsCount;
PkgState = new StateCache[Size];
PkgIgnore = new bool[Size];
DepState = new unsigned char[Dep->Head().DependsCount];
DepState = new unsigned char[DepSize];
memcpy(PkgState, Dep->PkgState, Size*sizeof(*PkgState));
memset(PkgIgnore, 0, Size*sizeof(*PkgIgnore));
memcpy(DepState, Dep->DepState, Dep->Head().DependsCount*sizeof(*DepState));
memcpy(DepState, Dep->DepState, DepSize*sizeof(*DepState));
iUsrSize = Dep->iUsrSize;
iDownloadSize= Dep->iDownloadSize;
iInstCount = Dep->iInstCount;
@ -1039,8 +1064,7 @@ void pkgDepCache::State::Save(pkgDepCache *dep)
void pkgDepCache::State::Restore()
{
int Size = Dep->Head().PackageCount;
memcpy(Dep->PkgState, PkgState, Size*sizeof(*PkgState));
memcpy(Dep->PkgState, PkgState, Dep->Head().PackageCount*sizeof(*PkgState));
memcpy(Dep->DepState, DepState, Dep->Head().DependsCount*sizeof(*DepState));
Dep->iUsrSize = iUsrSize;
Dep->iDownloadSize= iDownloadSize;
@ -1063,6 +1087,12 @@ bool pkgDepCache::State::Changed()
}
return false;
}
void pkgDepCache::State::UnIgnoreAll()
{
memset(PkgIgnore, 0, Dep->Head().PackageCount*sizeof(*PkgIgnore));
}
/*}}}*/
// vim:sts=3:sw=3

View File

@ -244,6 +244,9 @@ class pkgDepCache::State
bool Changed();
void Ignore(PkgIterator const &I) {PkgIgnore[I->ID] = true;};
void UnIgnore(PkgIterator const &I) {PkgIgnore[I->ID] = false;};
bool Ignored(PkgIterator const &I) {return PkgIgnore[I->ID];};
void UnIgnoreAll();
StateCache &operator [](pkgCache::PkgIterator const &I) {return PkgState[I->ID];};
@ -256,11 +259,25 @@ class pkgDepCache::State
inline unsigned long BrokenCount() {return iBrokenCount;};
inline unsigned long BadCount() {return iBadCount;};
void Copy(State const &Other);
void operator =(State const &Other)
{
delete[] PkgState;
delete[] DepState;
delete[] PkgIgnore;
Copy(Other);
};
State(const State &Other)
{ Copy(Other); };
State(pkgDepCache *Dep=NULL)
: Dep(0), PkgState(0), DepState(0), PkgIgnore(0)
{ if (Dep != NULL) Save(Dep); };
~State()
{ delete[] PkgState; delete[] DepState; delete[] PkgIgnore; };
{
delete[] PkgState;
delete[] DepState;
delete[] PkgIgnore;
};
};

View File

@ -15,6 +15,10 @@
#include <apti18n.h>
#include <config.h>
#include <sys/stat.h>
// CNC:2003-03-17
#include <apt-pkg/luaiface.h>
/*}}}*/
#define Stringfy_(x) # x
@ -72,7 +76,8 @@ bool pkgInitConfig(Configuration &Cnf)
Cnf.Set("Dir::Etc::main","apt.conf");
Cnf.Set("Dir::Etc::parts","apt.conf.d");
Cnf.Set("Dir::Etc::preferences","preferences");
Cnf.Set("Dir::Bin::methods","/usr/lib/apt/methods");
Cnf.Set("Dir::Bin::methods",LIBDIR "/apt/methods");
Cnf.Set("Acquire::ComprExtension", ".bz2");
bool Res = true;
@ -153,6 +158,11 @@ bool pkgInitSystem(Configuration &Cnf,pkgSystem *&Sys)
return _error->Error(_("Unable to determine a suitable system type"));
}
return Sys->Initialize(Cnf);
// CNC:2003-03-15
bool Ret = Sys->Initialize(Cnf);
#ifdef WITH_LUA
_lua->RunScripts("Scripts::Init", false);
#endif
return Ret;
}
/*}}}*/

1072
apt/apt-pkg/luaiface.cc Normal file

File diff suppressed because it is too large Load Diff

109
apt/apt-pkg/luaiface.h Normal file
View File

@ -0,0 +1,109 @@
#ifndef LUAIFACE_H
#define LUAIFACE_H
#ifdef __GNUG__
#pragma interface "apt-pkg/luaiface.h"
#endif
#ifdef WITH_LUA
#include <map>
#include <vector>
using namespace std;
class pkgCache;
class pkgDepCache;
class pkgProblemResolver;
class lua_State;
typedef int (*lua_CFunction)(struct lua_State*);
class LuaCacheControl {
public:
virtual pkgDepCache *Open();
virtual pkgDepCache *Open(bool Write) = 0;
virtual void Close() = 0;
virtual ~LuaCacheControl() {};
};
class Lua {
protected:
struct CacheData {
int Begin;
int End;
};
lua_State *L;
map<string,CacheData> ChunkCache;
vector<string> Globals;
pkgDepCache *DepCache;
pkgCache *Cache;
LuaCacheControl *CacheControl;
pkgProblemResolver *Fix;
bool DontFix;
public:
bool RunScripts(const char *ConfListKey, bool CacheChunks);
bool HasScripts(const char *ConfListKey);
void SetGlobal(const char *Name, const char *Value);
void SetGlobal(const char *Name, double Value);
void SetGlobal(const char *Name, void *Value);
void SetGlobal(const char *Name, string Value)
{ SetGlobal(Name, Value.c_str()); };
void SetGlobal(const char *Name, int Value)
{ SetGlobal(Name, (double)Value); };
void SetGlobal(const char *Name, lua_CFunction Value);
void SetGlobal(const char *Name, const char **Value, int Total=-1);
void SetGlobal(const char *Name, vector<const char *> &Value,
int Total=-1);
void SetGlobal(const char *Name, vector<string> &Value,
int Total=-1);
void SetGlobal(const char *Name, vector<pkgCache::Package*> &Value,
int Total=-1);
void ResetGlobals();
const char *GetGlobal(const char *Name);
double GetGlobalI(const char *Name);
void *GetGlobalP(const char *Name);
void GetGlobalVS(const char *Name, vector<string> &VS);
static const double NoGlobalI;
void SetDepCache(pkgDepCache *DepCache_);
void SetCache(pkgCache *Cache_) { Cache = Cache_; };
void SetCacheControl(LuaCacheControl *CacheControl_);
void SetProblemResolver(pkgProblemResolver *Fix_) { Fix = Fix_; };
void SetDontFix() { DontFix = true; };
void ResetCaches()
{ DepCache = NULL; Cache = NULL; Fix = NULL; DontFix = false; };
// For API functions
pkgDepCache *GetDepCache(lua_State *L=NULL);
pkgCache *GetCache(lua_State *L=NULL);
LuaCacheControl *GetCacheControl() { return CacheControl; };
pkgProblemResolver *GetProblemResolver() { return Fix; };
bool GetDontFix() { return DontFix; };
Lua();
~Lua();
};
// The same system used with _error
Lua *_GetLuaObj();
#define _lua _GetLuaObj()
#endif // WITH_LUA
#endif
// vim:sts=3:sw=3

View File

@ -1,74 +0,0 @@
# -*- make -*-
BASE=..
SUBDIR=apt-pkg
# Header location
# CNC:2002-07-03
SUBDIRS = rpm deb contrib
HEADER_TARGETDIRS = apt-pkg
# Bring in the default rules
include ../buildlib/defaults.mak
# The library name, don't forget to update init.h and the copy in
# methods/makefile - FIXME
LIBRARY=apt-pkg
LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
MAJOR=3.3
MINOR=0
# CNC:2002-07-03
SLIBS=$(PTHREADLIB) $(INTLLIBS) $(RPMLIBS)
APT_DOMAIN:=libapt-pkg$(MAJOR)
# Source code for the contributed non-core things
SOURCE = contrib/mmap.cc contrib/error.cc contrib/strutl.cc \
contrib/configuration.cc contrib/progress.cc contrib/cmndline.cc \
contrib/md5.cc contrib/sha1.cc contrib/hashes.cc \
contrib/cdromutl.cc contrib/crc-16.cc \
contrib/fileutl.cc
HEADERS = mmap.h error.h configuration.h fileutl.h cmndline.h \
md5.h crc-16.h cdromutl.h strutl.h sptr.h sha1.h hashes.h
# Source code for the core main library
# CNC:2002-07-03
SOURCE+= pkgcache.cc version.cc depcache.cc \
orderlist.cc tagfile.cc sourcelist.cc packagemanager.cc \
pkgrecords.cc algorithms.cc acquire.cc\
acquire-worker.cc acquire-method.cc init.cc clean.cc \
srcrecords.cc cachefile.cc versionmatch.cc policy.cc \
pkgsystem.cc indexfile.cc pkgcachegen.cc acquire-item.cc \
repository.cc
HEADERS+= algorithms.h depcache.h pkgcachegen.h cacheiterators.h \
orderlist.h sourcelist.h packagemanager.h tagfile.h \
init.h pkgcache.h version.h progress.h pkgrecords.h \
acquire.h acquire-worker.h acquire-item.h acquire-method.h \
clean.h srcrecords.h cachefile.h versionmatch.h policy.h \
pkgsystem.h indexfile.h repository.h
# CNC:2003-02-15
WITH_DEB=no
ifeq ($(WITH_DEB),yes)
# Source code for the debian specific components
# In theory the deb headers do not need to be exported..
SOURCE+= deb/deblistparser.cc deb/debrecords.cc deb/dpkgpm.cc \
deb/debsrcrecords.cc deb/debversion.cc deb/debsystem.cc \
deb/debindexfile.cc deb/debindexfile.cc
HEADERS+= debversion.h debsrcrecords.h dpkgpm.h debrecords.h \
deblistparser.h debsystem.h debindexfile.h
endif
# CNC:2002-07-03
# Source code for the rpm specific components
SOURCE+= rpm/rpmhandler.cc rpm/rpmindexfile.cc rpm/rpmlistparser.cc \
rpm/rpmpackagedata.cc rpm/rpmpm.cc rpm/rpmrecords.cc \
rpm/rpmsrcrecords.cc rpm/rpmsystem.cc rpm/rpmversion.cc
HEADERS+= rpmhandler.h rpmindexfile.h rpmlistparser.h rpmpackagedata.h \
rpmpm.h rpmrecords.h rpmsrcrecords.h rpmsystem.h rpmversion.h \
rpmmisc.h
HEADERS := $(addprefix apt-pkg/,$(HEADERS))
# Private header files
HEADERS+= system.h
include $(LIBRARY_H)

View File

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: packagemanager.cc,v 1.8 2003/01/31 16:32:30 niemeyer Exp $
// $Id: packagemanager.cc,v 1.30 2003/04/27 03:04:15 doogie Exp $
/* ######################################################################
Package Manager - Abstacts the package manager
@ -133,7 +133,7 @@ bool pkgPackageManager::CreateOrderList()
delete List;
List = new pkgOrderList(&Cache);
bool NoImmConfigure = _config->FindB("APT::Immediate-Configure",false);
bool NoImmConfigure = !_config->FindB("APT::Immediate-Configure",true);
// Generate the list of affected packages and sort it
for (PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
@ -542,7 +542,6 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg)
}
}
}
#endif
// Check for reverse conflicts.
if (CheckRConflicts(Pkg,Pkg.RevDependsList(),
@ -552,6 +551,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg)
for (PrvIterator P = Cache[Pkg].InstVerIter(Cache).ProvidesList();
P.end() == false; P++)
CheckRConflicts(Pkg,P.ParentPkg().RevDependsList(),P.ProvideVersion());
#endif
if (Install(Pkg,FileNames[Pkg->ID]) == false)
return false;

View File

@ -52,10 +52,17 @@ pkgCache::Header::Header()
/* Whenever the structures change the major version should be bumped,
whenever the generator changes the minor version should be bumped. */
MajorVersion = 4;
// CNC:2003-11-24
MajorVersion = 6;
MinorVersion = 0;
Dirty = false;
// CNC:2003-03-18
HasFileDeps = false;
// CNC:2003-11-24
OptionsHash = 0;
HeaderSz = sizeof(pkgCache::Header);
PackageSz = sizeof(pkgCache::Package);
PackageFileSz = sizeof(pkgCache::PackageFile);

View File

@ -168,6 +168,12 @@ struct pkgCache::Header
short MinorVersion;
bool Dirty;
// CNC:2003-03-18
bool HasFileDeps;
// CNC:2003-11-24
unsigned long OptionsHash;
// Size of structure values
unsigned short HeaderSz;
unsigned short PackageSz;

View File

@ -626,6 +626,10 @@ static bool CheckValidity(string CacheFile, FileIterator Start,
return false;
}
// CNC:2003-11-24
if (_system->OptionsHash() != Cache.HeaderP->OptionsHash)
return false;
/* Now we check every index file, see if it is in the cache,
verify the IMS data and check that it is on the disk too.. */
SPtrArray<bool> Visited = new bool[Cache.HeaderP->PackageFileCount];
@ -725,27 +729,21 @@ static bool BuildCache(pkgCacheGenerator &Gen,
/* */
static bool CollectFileProvides(pkgCacheGenerator &Gen,
OpProgress &Progress,
unsigned long &CurrentSize,unsigned long TotalSize,
FileIterator Start, FileIterator End)
{
FileIterator I;
if (Gen.HasFileDeps() == true)
{
Progress.Done();
unsigned long TotalSize = ComputeSize(Start, End);
unsigned long CurrentSize = 0;
for (I = Start; I != End; I++)
for (FileIterator I = Start; I != End; I++)
{
if ((*I)->HasPackages() == false || (*I)->Exists() == false)
continue;
unsigned long Size = (*I)->Size();
Progress.OverallProgress(CurrentSize,TotalSize,Size,_("Collecting File Provides"));
Progress.OverallProgress(CurrentSize,TotalSize,Size,_("Reading Package Lists"));
CurrentSize += Size;
if ((*I)->MergeFileProvides(Gen,Progress) == false)
return false;
}
Progress.Done();
}
return true;
}
/*}}}*/
@ -832,6 +830,12 @@ bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress,
TotalSize = ComputeSize(Files.begin()+EndOfSource,Files.end());
// CNC:2003-03-18
// For the file provides collection phase.
unsigned long SrcSize = ComputeSize(Files.begin(),
Files.begin()+EndOfSource);
TotalSize = TotalSize+(TotalSize+SrcSize);
// Build the status cache
pkgCacheGenerator Gen(Map.Get(),&Progress);
if (_error->PendingError() == true)
@ -840,17 +844,32 @@ bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress,
Files.begin()+EndOfSource,Files.end()) == false)
return false;
// CNC:2003-03-03
// Collect file provides over *all* files (sources + database), since
// the cache is saved without them.
if (CollectFileProvides(Gen,Progress,
// CNC:2003-03-18
if (Gen.HasFileDeps() == true) {
// There are new file dependencies. Collect over all packages.
Gen.GetCache().HeaderP->HasFileDeps = true;
if (CollectFileProvides(Gen,Progress,CurrentSize,TotalSize,
Files.begin(),Files.end()) == false)
return false;
} else if (Gen.GetCache().HeaderP->HasFileDeps == true) {
// Jump entries which are not going to be parsed.
CurrentSize += SrcSize;
// No new file dependencies. Collect over the new packages.
if (CollectFileProvides(Gen,Progress,CurrentSize,TotalSize,
Files.begin()+EndOfSource,Files.end()) == false)
return false;
}
}
else
{
TotalSize = ComputeSize(Files.begin(),Files.end());
// CNC:2003-03-18
// For the file provides collection phase.
unsigned long SrcSize = ComputeSize(Files.begin(),
Files.begin()+EndOfSource);
TotalSize = (TotalSize*2)+SrcSize;
// Build the source cache
pkgCacheGenerator Gen(Map.Get(),&Progress);
if (_error->PendingError() == true)
@ -859,6 +878,23 @@ bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress,
Files.begin(),Files.begin()+EndOfSource) == false)
return false;
// CNC:2003-11-24
Gen.GetCache().HeaderP->OptionsHash = _system->OptionsHash();
// CNC:2003-03-18
if (Gen.HasFileDeps() == true) {
// There are file dependencies. Collect over source packages.
Gen.GetCache().HeaderP->HasFileDeps = true;
if (CollectFileProvides(Gen,Progress,CurrentSize,TotalSize,
Files.begin(),Files.begin()+EndOfSource) == false)
return false;
// Reset to check for new file dependencies in the status cache.
Gen.ResetFileDeps();
} else {
// Jump entries which are not going to be parsed.
CurrentSize += SrcSize;
}
// Write it back
// CNC:2003-03-03 - Notice that it is without the file provides. This
// is on purpose, since file requires introduced later on the status
@ -891,12 +927,21 @@ bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress,
Files.begin()+EndOfSource,Files.end()) == false)
return false;
// CNC:2003-03-03
// Collect file provides over *all* files (sources + database), since
// the cache is saved without them.
if (CollectFileProvides(Gen,Progress,
// CNC:2003-03-18
if (Gen.HasFileDeps() == true) {
// There are new file dependencies. Collect over all packages.
Gen.GetCache().HeaderP->HasFileDeps = true;
if (CollectFileProvides(Gen,Progress,CurrentSize,TotalSize,
Files.begin(),Files.end()) == false)
return false;
} else if (Gen.GetCache().HeaderP->HasFileDeps == true) {
// Jump entries which are not going to be parsed.
CurrentSize += SrcSize;
// No new file dependencies. Collect over the new packages.
if (CollectFileProvides(Gen,Progress,CurrentSize,TotalSize,
Files.begin()+EndOfSource,Files.end()) == false)
return false;
}
}
if (_error->PendingError() == true)
@ -939,6 +984,10 @@ bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap)
TotalSize = ComputeSize(Files.begin()+EndOfSource,Files.end());
// CNC:2003-03-18
// For the file provides collection phase.
TotalSize *= 2;
// Build the status cache
Progress.OverallProgress(0,1,1,_("Reading Package Lists"));
pkgCacheGenerator Gen(Map.Get(),&Progress);
@ -948,12 +997,12 @@ bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap)
Files.begin()+EndOfSource,Files.end()) == false)
return false;
// CNC:2003-03-03
// Collect file provides over *all* files (sources + database), since
// the cache is saved without them.
if (CollectFileProvides(Gen,Progress,
Files.begin(),Files.end()) == false)
// CNC:2003-03-18
if (Gen.HasFileDeps() == true) {
if (CollectFileProvides(Gen,Progress,CurrentSize,TotalSize,
Files.begin()+EndOfSource,Files.end()) == false)
return false;
}
if (_error->PendingError() == true)
return false;

View File

@ -75,6 +75,9 @@ class pkgCacheGenerator
bool HasFileDeps() {return FoundFileDeps;};
bool MergeFileProvides(ListParser &List);
// CNC:2003-03-18
inline void ResetFileDeps() {FoundFileDeps = false;};
pkgCacheGenerator(DynamicMMap *Map,OpProgress *Progress);
~pkgCacheGenerator();
};

View File

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: pkgrecords.cc,v 1.2 2002/11/28 18:54:15 niemeyer Exp $
// $Id: pkgrecords.cc,v 1.8 2003/09/02 04:52:16 mdz Exp $
/* ######################################################################
Package Records - Allows access to complete package description records

View File

@ -71,6 +71,9 @@ class pkgRecords::Parser
// The record in binary form
virtual void GetRec(const char *&Start,const char *&Stop) {Start = Stop = 0;};
// CNC:2003-11-21
virtual bool HasFile(const char *File) {return false;};
virtual ~Parser() {};
};

View File

@ -89,6 +89,8 @@ class pkgSystem
// Return a list of system index files..
virtual bool AddStatusFiles(std::vector<pkgIndexFile *> &List) = 0;
// CNC:2003-11-21
virtual bool AddSourceFiles(std::vector<pkgIndexFile *> &List) {};
virtual bool FindIndex(pkgCache::PkgFileIterator File,
pkgIndexFile *&Found) const = 0;
@ -105,6 +107,9 @@ class pkgSystem
virtual bool IgnoreDep(pkgVersioningSystem &VS, pkgCache::DepIterator &Dep)
{return false;};
// CNC:2003-11-24
virtual unsigned long OptionsHash() const {return 0;};
pkgSystem();
virtual ~pkgSystem() {};
};

View File

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: policy.cc,v 1.2 2003/01/29 18:43:48 niemeyer Exp $
// $Id: policy.cc,v 1.10 2003/08/12 00:17:37 mdz Exp $
/* ######################################################################
Package Version Policy implementation
@ -336,8 +336,14 @@ bool ReadPinFile(pkgPolicy &Plcy,string File)
}
for (; Word != End && isspace(*Word) != 0; Word++);
Plcy.CreatePin(Type,Name,string(Word,End),
Tags.FindI("Pin-Priority"));
short int priority = Tags.FindI("Pin-Priority", 0);
if (priority == 0)
{
_error->Warning(_("No priority (or zero) specified for pin"));
continue;
}
Plcy.CreatePin(Type,Name,string(Word,End),priority);
}
Plcy.InitDefaults();

View File

@ -16,6 +16,7 @@
#include <sys/stat.h>
#include <utime.h>
#include <unistd.h>
#include <assert.h>
#include <apt-pkg/error.h>
#include <apt-pkg/configuration.h>
@ -26,7 +27,7 @@
#include <apti18n.h>
#ifdef HAVE_RPM41
#if RPM_VERSION >= 0x040100
#include <rpm/rpmts.h>
#include <rpm/rpmdb.h>
#define rpmxxInitIterator(a,b,c,d) rpmtsInitIterator(a,(rpmTag)b,c,d)
@ -142,6 +143,68 @@ string RPMFileHandler::MD5Sum()
return str;
}
bool RPMSingleFileHandler::Skip()
{
if (FD == NULL)
return false;
if (HeaderP != NULL) {
headerFree(HeaderP);
HeaderP = NULL;
return false;
}
#if RPM_VERSION >= 0x040100
rpmts TS = rpmtsCreate();
rpmtsSetVSFlags(TS, (rpmVSFlags_e)-1);
int rc = rpmReadPackageFile(TS, FD, sFilePath.c_str(), &HeaderP);
if (rc != RPMRC_OK && rc != RPMRC_NOTTRUSTED && rc != RPMRC_NOKEY) {
_error->Error(_("Failed reading file %s"), sFilePath.c_str());
HeaderP = NULL;
}
rpmtsFree(TS);
#else
int rc = rpmReadPackageHeader(FD, &HeaderP, 0, NULL, NULL);
if (rc) {
_error->Error(_("Failed reading file %s"), sFilePath.c_str());
HeaderP = NULL;
}
#endif
return (HeaderP != NULL);
}
bool RPMSingleFileHandler::Jump(unsigned Offset)
{
assert(Offset == 0);
Rewind();
return RPMFileHandler::Jump(Offset);
}
void RPMSingleFileHandler::Rewind()
{
if (FD == NULL)
return;
if (HeaderP != NULL) {
HeaderP = NULL;
headerFree(HeaderP);
}
lseek(Fileno(FD),0,SEEK_SET);
}
unsigned long RPMSingleFileHandler::FileSize()
{
struct stat S;
if (stat(sFilePath.c_str(),&S) != 0)
return 0;
return S.st_size;
}
string RPMSingleFileHandler::MD5Sum()
{
MD5Summation MD5;
FileFd File(sFilePath, FileFd::ReadOnly);
MD5.AddFD(File.Fd(), File.Size());
File.Close();
return MD5.Result().Value();
}
RPMDirHandler::RPMDirHandler(string DirName)
: sDirName(DirName)
@ -154,8 +217,9 @@ RPMDirHandler::RPMDirHandler(string DirName)
while (nextFileName() != NULL)
iSize += 1;
rewinddir(Dir);
#ifdef HAVE_RPM41
#if RPM_VERSION >= 0x040100
TS = rpmtsCreate();
rpmtsSetVSFlags(TS, (rpmVSFlags_e)-1);
#endif
}
@ -188,7 +252,7 @@ RPMDirHandler::~RPMDirHandler()
{
if (HeaderP != NULL)
headerFree(HeaderP);
#ifdef HAVE_RPM41
#if RPM_VERSION >= 0x040100
rpmtsFree(TS);
#endif
if (Dir != NULL)
@ -212,7 +276,7 @@ bool RPMDirHandler::Skip()
FD_t FD = Fopen(sFilePath.c_str(), "r");
if (FD == NULL)
continue;
#ifdef HAVE_RPM41
#if RPM_VERSION >= 0x040100
int rc = rpmReadPackageFile(TS, FD, fname, &HeaderP);
Fclose(FD);
if (rc != RPMRC_OK
@ -260,7 +324,7 @@ unsigned long RPMDirHandler::FileSize()
return 0;
struct stat St;
if (stat(sFilePath.c_str(),&St) != 0) {
_error->Errno("stat","Unable to determine the file size");
_error->Errno("stat",_("Unable to determine the file size"));
return 0;
}
return St.st_size;
@ -295,11 +359,12 @@ RPMDBHandler::RPMDBHandler(bool WriteLock)
stat(DataPath(false).c_str(), &St);
DbFileMtime = St.st_mtime;
#ifdef HAVE_RPM4
#if RPM_VERSION >= 0x040000
RpmIter = NULL;
#endif
#ifdef HAVE_RPM41
#if RPM_VERSION >= 0x040100
Handler = rpmtsCreate();
rpmtsSetVSFlags(Handler, (rpmVSFlags_e)-1);
if (!Dir.empty())
rpmtsSetRootDir(Handler, Dir.c_str());
if (rpmtsOpenDB(Handler, WriteLock?O_RDWR:O_RDONLY) != 0)
@ -317,7 +382,7 @@ RPMDBHandler::RPMDBHandler(bool WriteLock)
return;
}
#endif
#ifdef HAVE_RPM4
#if RPM_VERSION >= 0x040000
RpmIter = rpmxxInitIterator(Handler, RPMDBI_PACKAGES, NULL, 0);
if (RpmIter == NULL) {
_error->Error(_("could not create RPM database iterator"));
@ -349,7 +414,7 @@ RPMDBHandler::RPMDBHandler(bool WriteLock)
RPMDBHandler::~RPMDBHandler()
{
#ifdef HAVE_RPM4
#if RPM_VERSION >= 0x040000
if (RpmIter == NULL)
return;
rpmdbFreeIterator(RpmIter);
@ -359,7 +424,7 @@ RPMDBHandler::~RPMDBHandler()
headerFree(HeaderP);
#endif
#ifdef HAVE_RPM41
#if RPM_VERSION >= 0x040100
rpmtsFree(Handler);
#else
rpmdbClose(Handler);
@ -377,19 +442,23 @@ RPMDBHandler::~RPMDBHandler()
string RPMDBHandler::DataPath(bool DirectoryOnly)
{
string File = "packages.rpm";
#ifdef HAVE_RPM4
char *tmp = (char *) rpmExpand("%{_dbpath}", NULL);
string DBPath(_config->Find("RPM::RootDir")+tmp);
free(tmp);
#if RPM_VERSION >= 0x040000
if (rpmExpandNumeric("%{_dbapi}") >= 3)
File = "Packages";
#endif
if (DirectoryOnly == true)
return _config->Find("RPM::RootDir")+"/var/lib/rpm";
return DBPath;
else
return _config->Find("RPM::RootDir")+"/var/lib/rpm/"+File;
return DBPath+"/"+File;
}
bool RPMDBHandler::Skip()
{
#ifdef HAVE_RPM4
#if RPM_VERSION >= 0x040000
if (RpmIter == NULL)
return false;
HeaderP = rpmdbNextIterator(RpmIter);
@ -416,7 +485,7 @@ bool RPMDBHandler::Skip()
bool RPMDBHandler::Jump(unsigned int Offset)
{
iOffset = Offset;
#ifdef HAVE_RPM4
#if RPM_VERSION >= 0x040000
if (RpmIter == NULL)
return false;
rpmdbFreeIterator(RpmIter);
@ -434,7 +503,7 @@ bool RPMDBHandler::Jump(unsigned int Offset)
void RPMDBHandler::Rewind()
{
#ifdef HAVE_RPM4
#if RPM_VERSION >= 0x040000
if (RpmIter == NULL)
return;
rpmdbFreeIterator(RpmIter);

View File

@ -45,6 +45,7 @@ class RPMHandler
virtual string Directory() {return "";};
virtual unsigned long FileSize() {return 1;};
virtual string MD5Sum() {return "";};
virtual bool ProvideFileName() {return false;};
RPMHandler() : iOffset(0), iSize(0), HeaderP(0) {};
virtual ~RPMHandler() {};
@ -53,6 +54,8 @@ class RPMHandler
class RPMFileHandler : public RPMHandler
{
protected:
FD_t FD;
public:
@ -72,15 +75,40 @@ class RPMFileHandler : public RPMHandler
virtual ~RPMFileHandler();
};
class RPMSingleFileHandler : public RPMFileHandler
{
protected:
string sFilePath;
public:
virtual bool Skip();
virtual bool Jump(unsigned int Offset);
virtual void Rewind();
virtual string FileName() {return sFilePath;};
virtual string Directory() {return "";};
virtual unsigned long FileSize();
virtual string MD5Sum();
virtual bool ProvideFileName() {return true;};
RPMSingleFileHandler(string File) : RPMFileHandler(File), sFilePath(File) {};
virtual ~RPMSingleFileHandler() {};
};
class RPMDBHandler : public RPMHandler
{
#ifdef HAVE_RPM41
protected:
#if RPM_VERSION >= 0x040100
rpmts Handler;
#else
rpmdb Handler;
#endif
#ifdef HAVE_RPM4
#if RPM_VERSION >= 0x040000
rpmdbMatchIterator RpmIter;
#endif
bool WriteLock;
@ -104,13 +132,14 @@ class RPMDBHandler : public RPMHandler
class RPMDirHandler : public RPMHandler
{
protected:
DIR *Dir;
string sDirName;
string sFileName;
string sFilePath;
#ifdef HAVE_RPM41
#if RPM_VERSION >= 0x040100
rpmts TS;
#endif

View File

@ -170,7 +170,7 @@ bool rpmListIndex::Exists() const
return FileExists(IndexPath());
}
/*}}}*/
// SrcListIndex::Size - Return the size of the index /*{{{*/
// rpmListIndex::Size - Return the size of the index /*{{{*/
// ---------------------------------------------------------------------
/* */
unsigned long rpmListIndex::Size() const
@ -237,7 +237,10 @@ string rpmSrcListIndex::ArchiveURI(string File) const
else
Res = URI + Dist;
Res += "/" + File;
if (File.find("/") != string::npos)
Res += '/' + File;
else
Res += "/SRPMS."+Section + '/' + File;
if (rpmdata->HasSourceTranslation() == true)
{
@ -320,7 +323,7 @@ string rpmPkgListIndex::ArchiveURI(string File) const
if (File.find("/") != string::npos)
Res += '/' + File;
else
Res += "/RPMS."+Section + '/' + File;
Res += "/RPMS." + Section + '/' + File;
if (rpmdata->HasBinaryTranslation() == true)
{
@ -328,6 +331,10 @@ string rpmPkgListIndex::ArchiveURI(string File) const
Dict["uri"] = URI;
Dict["dist"] = Dist;
Dict["sect"] = Section;
string::size_type pos = File.rfind("/");
if (pos != string::npos)
Dict["file"] = string(File, pos+1);
else
Dict["file"] = File;
rpmdata->TranslateBinary(Res, Dict);
}
@ -373,7 +380,7 @@ bool rpmPkgListIndex::Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const
if (stat(PackageFile.c_str(),&St) != 0)
{
delete Handler;
return _error->Errno("stat","Failed to stat");
return _error->Errno("stat",_("Failed to stat %s"), PackageFile.c_str());
}
File->Size = St.st_size;
File->mtime = St.st_mtime;
@ -475,6 +482,51 @@ unsigned long rpmPkgDirIndex::Size() const
}
/*}}}*/
// SrcDirIndex::Index* - Return the URI to the index files /*{{{*/
// ---------------------------------------------------------------------
/* */
inline string rpmSrcDirIndex::IndexPath() const
{
return ::URI(ArchiveURI("")).Path;
}
/*}}}*/
// SrcDirIndex::Size - Return the size of the index /*{{{*/
// ---------------------------------------------------------------------
/* This is really only used for progress reporting. */
unsigned long rpmSrcDirIndex::Size() const
{
// XXX: Must optimize this somehow.
RPMHandler *Handler = CreateHandler();
unsigned long Res = Handler->Size();
delete Handler;
return Res;
}
// SinglePkgIndex::ArchiveURI - URI for the archive /*{{{*/
// ---------------------------------------------------------------------
string rpmSinglePkgIndex::ArchiveURI(string File) const
{
char *cwd = getcwd(NULL,0);
if (File[0] == '.' && File[1] == '/')
File = string(File, 2);
string URI = "file://"+flCombine(cwd, File);
free(cwd);
return URI;
}
/*}}}*/
// SinglePkgIndex::ArchiveURI - URI for the archive /*{{{*/
// ---------------------------------------------------------------------
string rpmSingleSrcIndex::ArchiveURI(string File) const
{
char *cwd = getcwd(NULL,0);
if (File[0] == '.' && File[1] == '/')
File = string(File, 2);
string URI = "file://"+flCombine(cwd, File);
free(cwd);
return URI;
}
/*}}}*/
// DatabaseIndex::rpmDatabaseIndex - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
@ -515,7 +567,7 @@ bool rpmDatabaseIndex::Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const
pkgCache::PkgFileIterator CFile = Gen.GetCurFile();
struct stat St;
if (stat(Handler->DataPath(false).c_str(),&St) != 0)
return _error->Errno("fstat","Failed to stat");
return _error->Errno("fstat",_("Failed to stat %s"), Handler->DataPath(false).c_str());
CFile->Size = St.st_size;
CFile->mtime = Handler->Mtime();
@ -679,9 +731,30 @@ class rpmSLTypeRpmDir : public rpmSLTypeGen
}
};
class rpmSLTypeSrpmDir : public rpmSLTypeGen
{
public:
bool CreateItem(vector<pkgIndexFile *> &List,
string URI, string Dist, string Section,
pkgSourceList::Vendor const *Vendor) const
{
pkgRepository *Rep = GetRepository(URI,Dist,Vendor);
List.push_back(new rpmSrcDirIndex(URI,Dist,Section,Rep));
return true;
};
rpmSLTypeSrpmDir()
{
Name = "rpm-src-dir";
Label = "Local SRPM directory tree";
}
};
rpmSLTypeRpm _apt_rpmType;
rpmSLTypeSrpm _apt_rpmSrcType;
rpmSLTypeRpmDir _apt_rpmDirType;
rpmSLTypeSrpmDir _apt_rpmSrcDirType;
/*}}}*/
// Index File types for rpm /*{{{*/
class rpmIFTypeSrc : public pkgIndexFile::Type
@ -722,10 +795,22 @@ const pkgIndexFile::Type *rpmPkgListIndex::GetType() const
{
return &_apt_Pkg;
}
const pkgIndexFile::Type *rpmSrcDirIndex::GetType() const
{
return &_apt_Src;
}
const pkgIndexFile::Type *rpmPkgDirIndex::GetType() const
{
return &_apt_Pkg;
}
const pkgIndexFile::Type *rpmSinglePkgIndex::GetType() const
{
return &_apt_Pkg;
}
const pkgIndexFile::Type *rpmSingleSrcIndex::GetType() const
{
return &_apt_Src;
}
const pkgIndexFile::Type *rpmDatabaseIndex::GetType() const
{
return &_apt_DB;

View File

@ -195,5 +195,83 @@ class rpmPkgDirIndex : public rpmPkgListIndex
{};
};
class rpmSrcDirIndex : public rpmSrcListIndex
{
protected:
virtual string MainType() const {return "srcdir";}
virtual string IndexPath() const;
public:
virtual bool GetReleases(pkgAcquire *Owner) const { return true; }
virtual bool GetIndexes(pkgAcquire *Owner) const { return true; }
// Creates a RPMHandler suitable for usage with this object
virtual RPMHandler *CreateHandler() const
{ return new RPMDirHandler(IndexPath()); };
virtual const Type *GetType() const;
// Interface for the Cache Generator
virtual unsigned long Size() const;
rpmSrcDirIndex(string URI,string Dist,string Section,
pkgRepository *Repository) :
rpmSrcListIndex(URI,Dist,Section,Repository)
{};
};
class rpmSinglePkgIndex : public rpmPkgListIndex
{
protected:
string FilePath;
virtual string MainType() const {return "pkg";}
virtual string IndexPath() const {return FilePath;}
public:
virtual bool GetReleases(pkgAcquire *Owner) const { return true; }
virtual bool GetIndexes(pkgAcquire *Owner) const { return true; }
// Creates a RPMHandler suitable for usage with this object
virtual RPMHandler *CreateHandler() const
{ return new RPMSingleFileHandler(IndexPath()); };
virtual string ArchiveURI(string File) const;
virtual const Type *GetType() const;
rpmSinglePkgIndex(string File) :
rpmPkgListIndex("", "", "", NULL), FilePath(File) {};
};
class rpmSingleSrcIndex : public rpmSrcListIndex
{
protected:
string FilePath;
virtual string MainType() const {return "src";}
virtual string IndexPath() const {return FilePath;}
public:
virtual bool GetReleases(pkgAcquire *Owner) const { return true; }
virtual bool GetIndexes(pkgAcquire *Owner) const { return true; }
// Creates a RPMHandler suitable for usage with this object
virtual RPMHandler *CreateHandler() const
{ return new RPMSingleFileHandler(IndexPath()); };
virtual string ArchiveURI(string File) const;
virtual const Type *GetType() const;
rpmSingleSrcIndex(string File) :
rpmSrcListIndex("", "", "", NULL), FilePath(File) {};
};
#endif

View File

@ -29,7 +29,7 @@
#include <rpm/rpmlib.h>
#ifdef HAVE_RPM41
#if RPM_VERSION >= 0x040100
#include <rpm/rpmds.h>
#endif
@ -108,7 +108,7 @@ string rpmListParser::Package()
if (headerGetEntry(header, RPMTAG_NAME, &type, (void**)&str, &count) != 1)
{
_error->Error("Corrupt pkglist: no RPMTAG_NAME in header entry");
_error->Error(_("Corrupt pkglist: no RPMTAG_NAME in header entry"));
return "";
}
@ -251,6 +251,10 @@ bool rpmListParser::NewVersion(pkgCache::VerIterator Ver)
if (ParseProvides(Ver) == false)
return false;
if (Handler->ProvideFileName() &&
NewProvides(Ver, Handler->FileName(), "") == false)
return false;
return true;
}
/*}}}*/
@ -278,11 +282,12 @@ bool rpmListParser::UsePackage(pkgCache::PkgIterator Pkg,
// ---------------------------------------------------------------------
/* */
/*
static int compare(const void *a, const void *b)
{
return strcmp(*(char**)a, *(char**)b);
}
*/
unsigned short rpmListParser::VersionHash()
{
@ -384,7 +389,7 @@ bool rpmListParser::ParseDepends(pkgCache::VerIterator Ver,
if (namel[i][0] == 'r' && strncmp(namel[i], "rpmlib", 6) == 0)
{
#ifdef HAVE_RPM41
#if RPM_VERSION >= 0x040100
rpmds ds = rpmdsSingle(RPMTAG_PROVIDENAME,
namel[i], verl?verl[i]:NULL, flagl[i]);
int res = rpmCheckRpmlibProvides(ds);
@ -519,10 +524,22 @@ bool rpmListParser::CollectFileProvides(pkgCache &Cache,
NULL, (void **) &names, &count);
while (count--)
{
pkgCache::Package *P = Cache.FindPackage(names[count]);
if (P != NULL && !NewProvides(Ver, names[count], ""))
const char *FileName = names[count];
pkgCache::Package *P = Cache.FindPackage(FileName);
if (P != NULL) {
// Check if this is already provided.
bool Found = false;
for (pkgCache::PrvIterator Prv = Ver.ProvidesList();
Prv.end() == false; Prv++) {
if (strcmp(Prv.Name(), FileName) == 0) {
Found = true;
break;
}
}
if (Found == false && NewProvides(Ver, FileName, "") == false)
return false;
}
}
return true;
}
@ -646,7 +663,7 @@ bool rpmListParser::LoadReleaseInfo(pkgCache::PkgFileIterator FileI,
if (Section.FindFlag("NotAutomatic",FileI->Flags,
pkgCache::Flag::NotAutomatic) == false)
_error->Warning("Bad NotAutomatic flag");
_error->Warning(_("Bad NotAutomatic flag"));
return !_error->PendingError();
}
@ -702,8 +719,8 @@ void rpmListParser::VirtualizePackage(string Name)
// read the comment above).
map_ptrloc *ToVerLast = &ToPkgI->VersionList;
for (pkgCache::VerIterator ToVerLastI = ToPkgI.VersionList();
ToVerLastI.end() == false;
ToVerLast = &ToVerLastI->NextVer, ToVerLast++);
ToVerLastI.end() == false; ToVerLastI++)
ToVerLast = &ToVerLastI->NextVer;
*ToVerLast = FromVerI.Index();

View File

@ -1,7 +1,7 @@
#ifndef RPMMISC_H
#define RPMMISC_H
#ifdef WITH_HASH_MAP
#ifdef WITH_GNU_HASH_MAP
#include <ext/hash_map>
@ -23,7 +23,7 @@ struct cstr_eq_pred
size_t operator()(const char *s1, const char *s2) const
{ return strcmp(s1, s2) == 0; };
};
#endif /* WITH_HASH_MAP */
#endif /* WITH_GNU_HASH_MAP */
struct cstr_lt_pred
{

View File

@ -67,7 +67,11 @@ class RPMPackageData
public:
inline pkgCache::State::VerPriority VerPriority(string Package)
{return Priorities[Package];};
{
if (Priorities.find(Package) != Priorities.end())
return Priorities[Package];
return pkgCache::State::Standard;
};
inline pkgCache::Flag::PkgFlags PkgFlags(string Package)
{return Flags[Package];};

View File

@ -19,6 +19,8 @@
#include <apt-pkg/rpmpm.h>
#include <apt-pkg/error.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/luaiface.h>
#include <apt-pkg/depcache.h>
#include <apti18n.h>
@ -32,9 +34,19 @@
#include <stdio.h>
#include <iostream>
#include <rpm/rpmlib.h>
/*}}}*/
#if RPM_VERSION >= 0x040100
#include <rpm/rpmdb.h>
#define packagesTotal rpmcliPackagesTotal
#else
#define rpmpsPrint(a,b) rpmProblemSetPrint(a,b)
#define rpmpsFree(a) rpmProblemSetFree(a)
#define rpmReadPackageFile(a,b,c,d) rpmReadPackageHeader(b,d,0,NULL,NULL)
#if RPM_VERSION < 0x040000
#define rpmtransFlags int
#define rpmprobFilterFlags int
#include "rpmshowprogress.h"
#endif
#endif
// RPMPM::pkgRPMPM - Constructor /*{{{*/
// ---------------------------------------------------------------------
@ -162,7 +174,7 @@ bool pkgRPMPM::RunScriptsWithPkgs(const char *Cnf)
// Create the pipes
int Pipes[2];
if (pipe(Pipes) != 0)
return _error->Errno("pipe","Failed to create IPC pipe to subprocess");
return _error->Errno("pipe",_("Failed to create IPC pipe to subprocess"));
SetCloseExec(Pipes[0],true);
SetCloseExec(Pipes[1],true);
@ -221,7 +233,157 @@ bool pkgRPMPM::RunScriptsWithPkgs(const char *Cnf)
/*}}}*/
bool pkgRPMPM::ExecRPM(Item::RPMOps op, vector<const char*> &files)
// RPMPM::Go - Run the sequence /*{{{*/
// ---------------------------------------------------------------------
/* This globs the operations and calls rpm */
bool pkgRPMPM::Go()
{
if (RunScripts("RPM::Pre-Invoke") == false)
return false;
if (RunScriptsWithPkgs("RPM::Pre-Install-Pkgs") == false)
return false;
vector<const char*> install_or_upgrade;
vector<const char*> install;
vector<const char*> upgrade;
vector<const char*> uninstall;
vector<pkgCache::Package*> pkgs_install;
vector<pkgCache::Package*> pkgs_uninstall;
vector<char*> unalloc;
for (vector<Item>::iterator I = List.begin(); I != List.end(); I++)
{
switch (I->Op)
{
case Item::Purge:
case Item::Remove:
if (strchr(I->Pkg.Name(), '#') != NULL)
{
char *name = strdup(I->Pkg.Name());
char *p = strchr(name, '#');
*(p++) = '-';
const char *epoch = strchr(p, ':');
if (epoch != NULL)
memmove(p, epoch+1, strlen(epoch+1)+1);
unalloc.push_back(name);
uninstall.push_back(name);
}
else
uninstall.push_back(I->Pkg.Name());
pkgs_uninstall.push_back(I->Pkg);
break;
case Item::Configure:
break;
case Item::Install:
if (strchr(I->Pkg.Name(), '#') != NULL) {
char *name = strdup(I->Pkg.Name());
char *p = strchr(name, '#');
*p = 0;
PkgIterator Pkg = Cache.FindPkg(name);
free(name);
PrvIterator Prv = Pkg.ProvidesList();
bool Installed = false;
for (; Prv.end() == false; Prv++) {
if (Prv.OwnerPkg().CurrentVer().end() == false) {
Installed = true;
break;
}
}
if (Installed)
install.push_back(I->File.c_str());
else
upgrade.push_back(I->File.c_str());
} else {
upgrade.push_back(I->File.c_str());
}
install_or_upgrade.push_back(I->File.c_str());
pkgs_install.push_back(I->Pkg);
break;
default:
return _error->Error(_("Unknown pkgRPMPM operation."));
}
}
bool Ret = true;
#ifdef WITH_LUA
if (_lua->HasScripts("Scripts::PM::Pre") == true) {
_lua->SetGlobal("files_install", install_or_upgrade);
_lua->SetGlobal("names_remove", uninstall);
_lua->SetGlobal("pkgs_install", pkgs_install);
_lua->SetGlobal("pkgs_remove", pkgs_uninstall);
_lua->SetDepCache(&Cache);
_lua->RunScripts("Scripts::PM::Pre", false);
_lua->ResetCaches();
_lua->ResetGlobals();
if (_error->PendingError() == true) {
Ret = false;
goto exit;
}
}
#endif
if (Process(install, upgrade, uninstall) == false)
Ret = false;
#ifdef WITH_LUA
if (_lua->HasScripts("Scripts::PM::Post") == true) {
_lua->SetGlobal("files_install", install_or_upgrade);
_lua->SetGlobal("names_remove", uninstall);
_lua->SetGlobal("pkgs_install", pkgs_install);
_lua->SetGlobal("pkgs_remove", pkgs_uninstall);
_lua->SetDepCache(&Cache);
_lua->RunScripts("Scripts::PM::Post", false);
_lua->ResetCaches();
_lua->ResetGlobals();
if (_error->PendingError() == true) {
Ret = false;
goto exit;
}
}
#endif
if (Ret == true)
Ret = RunScripts("RPM::Post-Invoke");
exit:
for (vector<char *>::iterator I = unalloc.begin(); I != unalloc.end(); I++)
free(*I);
return Ret;
}
/*}}}*/
// pkgRPMPM::Reset - Dump the contents of the command list /*{{{*/
// ---------------------------------------------------------------------
/* */
void pkgRPMPM::Reset()
{
List.erase(List.begin(),List.end());
}
/*}}}*/
// RPMExtPM::pkgRPMExtPM - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
pkgRPMExtPM::pkgRPMExtPM(pkgDepCache *Cache) : pkgRPMPM(Cache)
{
}
/*}}}*/
// RPMExtPM::pkgRPMExtPM - Destructor /*{{{*/
// ---------------------------------------------------------------------
/* */
pkgRPMExtPM::~pkgRPMExtPM()
{
}
/*}}}*/
bool pkgRPMExtPM::ExecRPM(Item::RPMOps op, vector<const char*> &files)
{
const char *Args[10000];
const char *operation;
@ -285,7 +447,8 @@ bool pkgRPMPM::ExecRPM(Item::RPMOps op, vector<const char*> &files)
}
else
{
bool oldpackage = _config->FindB("RPM::OldPackage",true);
bool oldpackage = _config->FindB("RPM::OldPackage",
(op == Item::RPMUpgrade));
bool replacepkgs = _config->FindB("APT::Get::ReInstall",false);
bool replacefiles = _config->FindB("APT::Get::ReInstall",false);
Opts = _config->Tree("RPM::Install-Options");
@ -333,8 +496,35 @@ bool pkgRPMPM::ExecRPM(Item::RPMOps op, vector<const char*> &files)
if (_config->FindB("RPM::Order",false) == false)
Args[n++] = "--noorder";
for (vector<const char*>::iterator I = files.begin(); I != files.end(); I++)
bool FilesInArgs = true;
char *ArgsFileName = NULL;
#if RPM_VERSION >= 0x040000
if (op != Item::RPMErase && files.size() > 50) {
string FileName = _config->FindDir("Dir::Cache", "/tmp/") +
"filelist.XXXXXX";
ArgsFileName = strdup(FileName.c_str());
if (ArgsFileName) {
int fd = mkstemp(ArgsFileName);
if (fd != -1) {
FileFd File(fd);
for (vector<const char*>::iterator I = files.begin();
I != files.end(); I++) {
File.Write(*I, strlen(*I));
File.Write("\n", 1);
}
File.Close();
FilesInArgs = false;
Args[n++] = ArgsFileName;
}
}
}
#endif
if (FilesInArgs == true) {
for (vector<const char*>::iterator I = files.begin();
I != files.end(); I++)
Args[n++] = *I;
}
Args[n++] = 0;
@ -343,6 +533,10 @@ bool pkgRPMPM::ExecRPM(Item::RPMOps op, vector<const char*> &files)
for (unsigned int k = 0; k < n; k++)
clog << Args[k] << ' ';
clog << endl;
if (ArgsFileName) {
unlink(ArgsFileName);
free(ArgsFileName);
}
return true;
}
@ -386,7 +580,7 @@ bool pkgRPMPM::ExecRPM(Item::RPMOps op, vector<const char*> &files)
}
execvp(Args[0],(char **)Args);
cerr << "Could not exec " << Args[0] << endl;
cerr << _("Could not exec ") << Args[0] << endl;
_exit(100);
}
@ -397,7 +591,15 @@ bool pkgRPMPM::ExecRPM(Item::RPMOps op, vector<const char*> &files)
if (errno == EINTR)
continue;
RunScripts("RPM::Post-Invoke");
return _error->Errno("waitpid","Couldn't wait for subprocess");
if (ArgsFileName) {
unlink(ArgsFileName);
free(ArgsFileName);
}
return _error->Errno("waitpid",_("Couldn't wait for subprocess"));
}
if (ArgsFileName) {
unlink(ArgsFileName);
free(ArgsFileName);
}
// Restore sig int/quit
@ -417,12 +619,12 @@ bool pkgRPMPM::ExecRPM(Item::RPMOps op, vector<const char*> &files)
return _error->Error(_("Sub-process %s exited unexpectedly"),Args[0]);
}
cout << _("Done.") << endl;
return true;
}
bool pkgRPMPM::Process(vector<const char*> &install,
bool pkgRPMExtPM::Process(vector<const char*> &install,
vector<const char*> &upgrade,
vector<const char*> &uninstall)
{
@ -435,83 +637,316 @@ bool pkgRPMPM::Process(vector<const char*> &install,
return true;
}
// RPMPM::Go - Run the sequence /*{{{*/
// ---------------------------------------------------------------------
/* This globs the operations and calls rpm */
bool pkgRPMPM::Go()
{
if (RunScripts("RPM::Pre-Invoke") == false)
return false;
if (RunScriptsWithPkgs("RPM::Pre-Install-Pkgs") == false)
return false;
vector<const char*> install;
vector<const char*> upgrade;
vector<const char*> uninstall;
vector<char*> unalloc;
for (vector<Item>::iterator I = List.begin(); I != List.end(); I++)
{
switch (I->Op)
{
case Item::Purge:
case Item::Remove:
if (strchr(I->Pkg.Name(), '#') != NULL)
{
char *name = strdup(I->Pkg.Name());
char *p = strchr(name, '#');
*(p++) = '-';
const char *epoch = strchr(p, ':');
if (epoch != NULL)
memmove(p, epoch+1, strlen(epoch+1)+1);
unalloc.push_back(name);
uninstall.push_back(name);
}
else
uninstall.push_back(I->Pkg.Name());
break;
case Item::Configure:
break;
case Item::Install:
if (strchr(I->Pkg.Name(), '#') != NULL)
install.push_back(I->File.c_str());
else
upgrade.push_back(I->File.c_str());
break;
default:
return _error->Error("Unknown pkgRPMPM operation.");
}
}
bool Ret = true;
if (Process(install, upgrade, uninstall) == false)
Ret = false;
for (vector<char *>::iterator I = unalloc.begin(); I != unalloc.end(); I++)
free(*I);
if (Ret == true)
Ret = RunScripts("RPM::Post-Invoke");
return Ret;
}
/*}}}*/
// pkgRPMPM::Reset - Dump the contents of the command list /*{{{*/
// RPMLibPM::pkgRPMLibPM - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
void pkgRPMPM::Reset()
pkgRPMLibPM::pkgRPMLibPM(pkgDepCache *Cache) : pkgRPMPM(Cache)
{
}
/*}}}*/
// RPMLibPM::pkgRPMLibPM - Destructor /*{{{*/
// ---------------------------------------------------------------------
/* */
pkgRPMLibPM::~pkgRPMLibPM()
{
List.erase(List.begin(),List.end());
}
/*}}}*/
bool pkgRPMLibPM::AddToTransaction(Item::RPMOps op, vector<const char*> &files)
{
int debug = _config->FindB("Debug::pkgRPMPM", false);
int n = 0, rc, xx;
FD_t fd;
rpmHeader hdr;
for (vector<const char*>::iterator I = files.begin(); I != files.end(); I++)
{
int upgrade = 0;
switch (op)
{
case Item::RPMUpgrade:
upgrade = 1;
case Item::RPMInstall:
fd = Fopen(*I, "r.ufdio");
if (fd == NULL)
_error->Error(_("Failed opening %s"), *I);
#if RPM_VERSION >= 0x040100
rc = rpmReadPackageFile(TS, fd, *I, &hdr);
if (rc != RPMRC_OK && rc != RPMRC_NOTTRUSTED && rc != RPMRC_NOKEY)
_error->Error(_("Failed reading file %s"), *I);
rc = rpmtsAddInstallElement(TS, hdr, *I, upgrade, 0);
#else
rc = rpmReadPackageHeader(fd, &hdr, 0, NULL, NULL);
if (rc)
_error->Error(_("Failed reading file %s"), *I);
rc = rpmtransAddPackage(TS, hdr, NULL, *I, upgrade, 0);
#endif
if (rc)
_error->Error(_("Failed adding %s to transaction %s"),
*I, "(install)");
headerFree(hdr);
Fclose(fd);
break;
case Item::RPMErase:
#if RPM_VERSION >= 0x040000
rpmdbMatchIterator MI;
#if RPM_VERSION >= 0x040100
MI = rpmtsInitIterator(TS, (rpmTag)RPMDBI_LABEL, *I, 0);
#else
MI = rpmdbInitIterator(DB, RPMDBI_LABEL, *I, 0);
#endif
while ((hdr = rpmdbNextIterator(MI)) != NULL)
{
unsigned int recOffset = rpmdbGetIteratorOffset(MI);
if (recOffset) {
#if RPM_VERSION >= 0x040100
rc = rpmtsAddEraseElement(TS, hdr, recOffset);
#else
rc = rpmtransRemovePackage(TS, recOffset);
#endif
if (rc)
_error->Error(_("Failed adding %s to transaction %s"),
*I, "(erase)");
}
}
MI = rpmdbFreeIterator(MI);
#else // RPM 3.X
dbiIndexSet matches;
rc = rpmdbFindByLabel(DB, *I, &matches);
if (rc == 0) {
for (int i = 0; i < dbiIndexSetCount(matches); i++) {
unsigned int recOffset = dbiIndexRecordOffset(matches, i);
if (recOffset)
rpmtransRemovePackage(TS, recOffset);
}
}
#endif
break;
}
}
return true;
}
bool pkgRPMLibPM::Process(vector<const char*> &install,
vector<const char*> &upgrade,
vector<const char*> &uninstall)
{
int rc = 0;
bool Success = false;
int debug = _config->FindB("Debug::pkgRPMPM", false);
string Dir = _config->Find("RPM::RootDir");
rpmReadConfigFiles(NULL, NULL);
int probFilter = 0;
int notifyFlags = 0;
int tsFlags = 0;
if (uninstall.empty() == false)
ParseRpmOpts("RPM::Erase-Options", &tsFlags, &probFilter);
if (install.empty() == false || upgrade.empty() == false)
ParseRpmOpts("RPM::Install-Options", &tsFlags, &probFilter);
ParseRpmOpts("RPM::Options", &tsFlags, &probFilter);
#if RPM_VERSION >= 0x040100
rpmps probs;
TS = rpmtsCreate();
rpmtsSetVSFlags(TS, (rpmVSFlags_e)-1);
// 4.1 needs this always set even if NULL,
// otherwise all scriptlets fail
rpmtsSetRootDir(TS, Dir.c_str());
if (rpmtsOpenDB(TS, O_RDWR) != 0)
{
_error->Error(_("Could not open RPM database"));
goto exit;
}
#else
rpmProblemSet probs;
const char *RootDir = NULL;
if (!Dir.empty())
RootDir = Dir.c_str();
if (rpmdbOpen(RootDir, &DB, O_RDWR, 0644) != 0)
{
_error->Error(_("Could not open RPM database"));
goto exit;
}
TS = rpmtransCreateSet(DB, Dir.c_str());
#endif
if (_config->FindB("RPM::OldPackage", true) || !upgrade.empty()) {
probFilter |= RPMPROB_FILTER_OLDPACKAGE;
}
if (_config->FindB("APT::Get::ReInstall", false)) {
probFilter |= RPMPROB_FILTER_REPLACEPKG;
probFilter |= RPMPROB_FILTER_REPLACEOLDFILES;
probFilter |= RPMPROB_FILTER_REPLACENEWFILES;
}
if (_config->FindB("RPM::Interactive", true))
notifyFlags |= INSTALL_LABEL | INSTALL_HASH;
else
notifyFlags |= INSTALL_LABEL | INSTALL_PERCENT;
if (uninstall.empty() == false)
AddToTransaction(Item::RPMErase, uninstall);
if (install.empty() == false)
AddToTransaction(Item::RPMInstall, install);
if (upgrade.empty() == false)
AddToTransaction(Item::RPMUpgrade, upgrade);
// Setup the gauge used by rpmShowProgress.
packagesTotal = install.size()+upgrade.size();
#if RPM_VERSION >= 0x040100
rc = rpmtsCheck(TS);
probs = rpmtsProblems(TS);
if (rc || probs->numProblems > 0) {
rpmpsPrint(NULL, probs);
rpmpsFree(probs);
_error->Error(_("Transaction set check failed"));
goto exit;
}
#else
#if RPM_VERSION < 0x040000
rpmDependencyConflict *conflicts;
#else
rpmDependencyConflict conflicts;
#endif
int numConflicts;
if (_config->FindB("RPM::NoDeps", false) == false &&
rpmdepCheck(TS, &conflicts, &numConflicts))
{
_error->Error(_("Transaction set check failed"));
if (conflicts) {
printDepProblems(stderr, conflicts, numConflicts);
rpmdepFreeConflicts(conflicts, numConflicts);
}
goto exit;
}
#endif
rc = 0;
#if RPM_VERSION >= 0x040100
if (_config->FindB("RPM::Order", true) == true)
rc = rpmtsOrder(TS);
#else
if (_config->FindB("RPM::Order", true) == true)
rc = rpmdepOrder(TS);
#endif
if (rc > 0) {
_error->Error(_("Ordering failed for %d packages"), rc);
goto exit;
}
cout << _("Committing changes...") << endl << flush;
#if RPM_VERSION >= 0x040100
probFilter |= rpmtsFilterFlags(TS);
rpmtsSetFlags(TS, (rpmtransFlags)(rpmtsFlags(TS) | tsFlags));
rpmtsClean(TS);
rc = rpmtsSetNotifyCallback(TS, rpmShowProgress, (void *)notifyFlags);
rc = rpmtsRun(TS, NULL, (rpmprobFilterFlags)probFilter);
probs = rpmtsProblems(TS);
#else
rc = rpmRunTransactions(TS, rpmShowProgress, (void *)notifyFlags, NULL,
&probs, (rpmtransFlags)tsFlags,
(rpmprobFilterFlags)probFilter);
#endif
if (rc > 0) {
_error->Error(_("Error while running transaction"));
if (probs->numProblems > 0)
rpmpsPrint(stderr, probs);
} else {
Success = true;
if (rc < 0)
_error->Warning(_("Some errors occurred while running transaction"));
else
cout << _("Done.") << endl;
}
rpmpsFree(probs);
exit:
#if RPM_VERSION >= 0x040100
rpmtsFree(TS);
#else
rpmdbClose(DB);
#endif
return Success;
}
bool pkgRPMLibPM::ParseRpmOpts(const char *Cnf, int *tsFlags, int *probFilter)
{
Configuration::Item const *Opts = _config->Tree(Cnf);
if (Opts != 0)
{
Opts = Opts->Child;
for (; Opts != 0; Opts = Opts->Next)
{
if (Opts->Value.empty() == true)
continue;
// Transaction set flags
if (Opts->Value == "--noscripts")
*tsFlags |= RPMTRANS_FLAG_NOSCRIPTS;
else if (Opts->Value == "--notriggers")
*tsFlags |= RPMTRANS_FLAG_NOTRIGGERS;
else if (Opts->Value == "--nodocs" ||
Opts->Value == "--excludedocs")
*tsFlags |= RPMTRANS_FLAG_NODOCS;
else if (Opts->Value == "--allfiles")
*tsFlags |= RPMTRANS_FLAG_ALLFILES;
else if (Opts->Value == "--justdb")
*tsFlags |= RPMTRANS_FLAG_JUSTDB;
#if RPM_VERSION >= 0x040000
else if (Opts->Value == "--nomd5")
*tsFlags |= RPMTRANS_FLAG_NOMD5;
else if (Opts->Value == "--repackage")
*tsFlags |= RPMTRANS_FLAG_REPACKAGE;
#endif
#if RPM_VERSION >= 0x040200
else if (Opts->Value == "--noconfigs" ||
Opts->Value == "--excludeconfigs")
*tsFlags |= RPMTRANS_FLAG_NOCONFIGS;
#endif
// Problem filter flags
else if (Opts->Value == "--replacefiles")
{
*probFilter |= RPMPROB_FILTER_REPLACEOLDFILES;
*probFilter |= RPMPROB_FILTER_REPLACENEWFILES;
}
else if (Opts->Value == "--replacepkgs")
*probFilter |= RPMPROB_FILTER_REPLACEPKG;
else if (Opts->Value == "--ignoresize")
{
*probFilter |= RPMPROB_FILTER_DISKSPACE;
#if RPM_VERSION >= 0x040000
*probFilter |= RPMPROB_FILTER_DISKNODES;
#endif
}
else if (Opts->Value == "--badreloc")
*probFilter |= RPMPROB_FILTER_FORCERELOCATE;
// Misc things having apt config counterparts
else if (Opts->Value == "--force")
_config->Set("APT::Get::ReInstall", true);
else if (Opts->Value == "--oldpackage")
_config->Set("RPM::OldPackage", true);
else if (Opts->Value == "--nodeps")
_config->Set("RPM::NoDeps", true);
else if (Opts->Value == "--noorder")
_config->Set("RPM::Order", false);
// TODO: --root, --relocate, --prefix, --excludepath etc...
}
}
return true;
}
#endif /* HAVE_RPM */
// vim:sts=3:sw=3

View File

@ -11,6 +11,16 @@
#ifndef PKGLIB_rpmPM_H
#define PKGLIB_rpmPM_H
#include <rpm/rpmlib.h>
#if RPM_VERSION >= 0x040100
#include <rpm/rpmts.h>
#endif
#if RPM_VERSION >= 0x040000
#include <rpm/rpmcli.h>
#endif
/*}}}*/
typedef Header rpmHeader;
#ifdef __GNUG__
#pragma interface "apt-pkg/rpmpm.h"
#endif
@ -46,10 +56,9 @@ class pkgRPMPM : public pkgPackageManager
virtual bool Configure(PkgIterator Pkg);
virtual bool Remove(PkgIterator Pkg,bool Purge = false);
bool ExecRPM(Item::RPMOps op, vector<const char*> &files);
bool Process(vector<const char*> &install,
virtual bool Process(vector<const char*> &install,
vector<const char*> &upgrade,
vector<const char*> &uninstall);
vector<const char*> &uninstall) {return false;};
virtual bool Go();
virtual void Reset();
@ -60,6 +69,41 @@ class pkgRPMPM : public pkgPackageManager
virtual ~pkgRPMPM();
};
class pkgRPMExtPM : public pkgRPMPM
{
protected:
bool ExecRPM(Item::RPMOps op, vector<const char*> &files);
virtual bool Process(vector<const char*> &install,
vector<const char*> &upgrade,
vector<const char*> &uninstall);
public:
pkgRPMExtPM(pkgDepCache *Cache);
virtual ~pkgRPMExtPM();
};
class pkgRPMLibPM : public pkgRPMPM
{
protected:
#if RPM_VERSION >= 0x040100
rpmts TS;
#else
rpmTransactionSet TS;
rpmdb DB;
#endif
bool ParseRpmOpts(const char *Cnf, int *tsFlags, int *probFilter);
bool AddToTransaction(Item::RPMOps op, vector<const char*> &files);
virtual bool Process(vector<const char*> &install,
vector<const char*> &upgrade,
vector<const char*> &uninstall);
public:
pkgRPMLibPM(pkgDepCache *Cache);
virtual ~pkgRPMLibPM();
};
#endif
// vim:sts=3:sw=3

View File

@ -23,6 +23,8 @@
#include <apt-pkg/rpmhandler.h>
#include <apt-pkg/rpmsystem.h>
#include <apti18n.h>
// RecordParser::rpmRecordParser - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
@ -37,6 +39,8 @@ rpmRecordParser::rpmRecordParser(string File, pkgCache &Cache)
struct stat Buf;
if (stat(File.c_str(),&Buf) == 0 && S_ISDIR(Buf.st_mode))
Handler = new RPMDirHandler(File);
else if (flExtension(File) == "rpm")
Handler = new RPMSingleFileHandler(File);
else
Handler = new RPMFileHandler(File);
}
@ -172,6 +176,8 @@ string rpmRecordParser::LongDesc()
/* */
string rpmRecordParser::SourcePkg()
{
// This must be the *package* name, not the *file* name. We have no
// current way to extract it safely from the file name.
return "";
}
/*}}}*/
@ -192,7 +198,7 @@ void rpmRecordParser::BufCat(const char *begin, const char *end)
char *tmp = (char*)realloc(Buffer, BufSize);
if (tmp == NULL)
{
_error->Errno("realloc", "could not allocate buffer for record text");
_error->Errno("realloc", _("Could not allocate buffer for record text"));
return;
}
Buffer = tmp;
@ -275,7 +281,6 @@ void rpmRecordParser::GetRec(const char *&Start,const char *&Stop)
char *str;
char **strv;
char **strv2;
int num;
int_32 *numv;
char buf[32];
@ -419,6 +424,24 @@ void rpmRecordParser::GetRec(const char *&Start,const char *&Stop)
Stop = Buffer + BufUsed;
}
/*}}}*/
bool rpmRecordParser::HasFile(const char *File)
{
if (*File == '\0')
return false;
char **names = NULL;
int_32 count = 0;
rpmHeaderGetEntry(HeaderP, RPMTAG_OLDFILENAMES,
NULL, (void **) &names, &count);
while (count--)
{
char *name = names[count];
if (strcmp(name, File) == 0)
return true;
}
return false;
}
#endif /* HAVE_RPM */
// vim:sts=3:sw=3

View File

@ -65,6 +65,8 @@ class rpmRecordParser : public pkgRecords::Parser
// The record in raw text, in standard Debian format
virtual void GetRec(const char *&Start,const char *&Stop);
virtual bool HasFile(const char *File);
rpmRecordParser(string File,pkgCache &Cache);
~rpmRecordParser();
};

Some files were not shown because too many files have changed in this diff Show More