// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: strutl.cc,v 1.32 2000/01/10 03:44:54 jgg Exp $
+// $Id: strutl.cc,v 1.33 2000/01/14 06:26:37 jgg Exp $
/* ######################################################################
String Util - Some usefull string functions.
string::const_iterator SingleSlash = I;
if (I + 3 < U.end() && I[1] == '/' && I[2] == '/')
SingleSlash += 3;
- for (; SingleSlash < U.end() && *SingleSlash != '/'; SingleSlash++);
+
+ /* Find the / indicating the end of the hostname, ignoring /'s in the
+ square brackets */
+ bool InBracket = false;
+ for (; SingleSlash < U.end() && (*SingleSlash != '/' || InBracket == true); SingleSlash++)
+ {
+ if (*SingleSlash == '[')
+ InBracket = true;
+ if (InBracket == true && *SingleSlash == ']')
+ InBracket = false;
+ }
+
if (SingleSlash > U.end())
SingleSlash = U.end();
Password = string(U,SecondColon - U.begin() + 1,At - SecondColon - 1);
}
+ // Now we parse the RFC 2732 [] hostnames.
+ unsigned long PortEnd = 0;
+ InBracket = false;
+ for (unsigned I = 0; I != Host.length();)
+ {
+ if (Host[I] == '[')
+ {
+ InBracket = true;
+ Host.erase(I,1);
+ continue;
+ }
+
+ if (InBracket == true && Host[I] == ']')
+ {
+ InBracket = false;
+ Host.erase(I,1);
+ PortEnd = I;
+ continue;
+ }
+ I++;
+ }
+
+ // Tsk, weird.
+ if (InBracket == true)
+ {
+ Host = string();
+ return;
+ }
+
// Now we parse off a port number from the hostname
Port = 0;
string::size_type Pos = Host.rfind(':');
- if (Pos == string::npos)
+ if (Pos == string::npos || Pos < PortEnd)
return;
Port = atoi(string(Host,Pos+1).c_str());
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: pkgcachegen.cc,v 1.44 2000/01/10 03:44:54 jgg Exp $
+// $Id: pkgcachegen.cc,v 1.45 2000/01/14 06:26:36 jgg Exp $
/* ######################################################################
Package Cache Generator - Generator for the cache structure.
{
string SCacheFile = _config->FindFile("Dir::Cache::srcpkgcache");
FileFd SCacheF(SCacheFile,FileFd::WriteEmpty);
+
+ /* Open the pkgcache, we want a new inode here so we do no corrupt
+ existing mmaps */
+ unlink(CacheFile.c_str());
FileFd CacheF(CacheFile,FileFd::WriteEmpty);
DynamicMMap Map(CacheF,MMap::Public,MapSize);
if (_error->PendingError() == true)
// We use the source cache to generate the package cache
string SCacheFile = _config->FindFile("Dir::Cache::srcpkgcache");
-
FileFd SCacheF(SCacheFile,FileFd::ReadOnly);
+
+ /* Open the pkgcache, we want a new inode here so we do no corrupt
+ existing mmaps */
+ unlink(CacheFile.c_str());
FileFd CacheF(CacheFile,FileFd::WriteEmpty);
DynamicMMap Map(CacheF,MMap::Public,MapSize);
if (_error->PendingError() == true)
veryclean: veryclean/$(LOCAL)
# The clean rules
-.PHONY: clean/$(LOCAL) veryclean/$(LOCAL)
+.PHONY: clean/$(LOCAL) veryclean/$(LOCAL)
clean/$(LOCAL):
-rm -f $($(@F)-OBJS) $($(@F)-DEP)
veryclean/$(LOCAL): clean/$(LOCAL)
-rm -f $($(@F)-BIN)
+# The convience binary build rule
+.PHONY: $(PROGRAM)
+$(PROGRAM): $($(LOCAL)-BIN)
+
# The binary build rule
$($(LOCAL)-BIN): $($(LOCAL)-OBJS) $($(LOCAL)-MKS)
echo Building program $@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-get.cc,v 1.94 1999/12/10 07:27:03 jgg Exp $
+// $Id: apt-get.cc,v 1.95 2000/01/14 06:26:37 jgg Exp $
/* ######################################################################
apt-get - Cover for dpkg
}
// Clean out any old list files
- if (_config->FindB("APT::Get::List-Cleanup",false) == false)
+ if (_config->FindB("APT::Get::List-Cleanup",true) == true)
{
if (Fetcher.Clean(_config->FindDir("Dir::State::lists")) == false ||
Fetcher.Clean(_config->FindDir("Dir::State::lists") + "partial/") == false)
_config->FindB("version") == true ||
CmdL.FileSize() == 0)
return ShowHelp(CmdL);
-
+
// Deal with stdout not being a tty
if (ttyname(STDOUT_FILENO) == 0 && _config->FindI("quiet",0) < 1)
_config->Set("quiet","1");
* Made --no-download work. Closes: #52993
* Now compiles on OpenBSD, Solaris and HP-UX
* Clarify segfault errors
- * More debhelper fixes. Closes: #52662, #54566
+ * More debhelper fixes. Closes: #52662, #54566, #52090, #53531, #54769
* Fix for Joel's discovery of glibc removal behavoir.
* Fix for Ben Collins file: uri from slink upgrade.
* Fixed resume code in FTP. Closes: #54323
+ * Take more precautions to prevent the corruption Joey Hess saw.
+ * Fixed --no-list-cleanup
+ * RFC 2732 URI parsing ([] for hostnames).
+ * Typo in apt-cache man page. Closes: #54949
-- Jason Gunthorpe <jgg@debian.org> Sat, 4 Dec 1999 21:17:24 -0800
dit(bf(dumpavail))
bf(dumpavail) prints out an available list to stdout. This is suitable for use
-with df(dpkg) and is used by the bf(dselect) method.
+with bf(dpkg) and is used by the bf(dselect) method.
dit(bf(unmet))
bf(unmet) displays a summary of all unmet dependencies in the package cache.
SOURCE = mthdcat.cc
include $(PROGRAM_H)
+# Program for testing methods
+PROGRAM=uritest
+SLIBS = -lapt-pkg
+SOURCE = uri.cc
+include $(PROGRAM_H)
+
# Scratch program to test incomplete code fragments in
PROGRAM=scratch-test
SLIBS = -lapt-inst -lapt-pkg