// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: configuration.cc,v 1.13 1999/07/02 23:17:00 jgg Exp $
+// $Id: configuration.cc,v 1.14 2000/01/16 05:36:17 jgg Exp $
/* ######################################################################
Configuration Class
break;
}
}
-
+
// Look for multi line comments
+ InQuote = false;
for (char *I = Buffer; *I != 0; I++)
{
if (*I == '"')
continue;
// We now have a valid line fragment
+ InQuote = false;
for (char *I = Buffer; *I != 0;)
{
- if (*I == '{' || *I == ';' || *I == '}')
+ if (*I == '"')
+ InQuote = !InQuote;
+
+ if (InQuote == false && (*I == '{' || *I == ';' || *I == '}'))
{
// Put the last fragement into the buffer
char *Start = Buffer;
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: strutl.cc,v 1.33 2000/01/14 06:26:37 jgg Exp $
+// $Id: strutl.cc,v 1.34 2000/01/16 05:36:17 jgg Exp $
/* ######################################################################
String Util - Some usefull string functions.
// ---------------------------------------------------------------------
/* This grabs a single word, converts any % escaped characters to their
proper values and advances the pointer. Double quotes are understood
- and striped out as well. This is for URI/URL parsing. */
+ and striped out as well. This is for URI/URL parsing. It also can
+ understand [] brackets.*/
bool ParseQuoteWord(const char *&String,string &Res)
{
// Skip leading whitespace
{
if (*C == '"')
{
- for (C++;*C != 0 && *C != '"'; C++);
+ for (C++; *C != 0 && *C != '"'; C++);
+ if (*C == 0)
+ return false;
+ }
+ if (*C == '[')
+ {
+ for (C++; *C != 0 && *C != ']'; C++);
if (*C == 0)
return false;
}
Res = Access + ':';
if (Host.empty() == false)
- {
+ {
if (Access.empty() == false)
Res += "//";
-
+
if (User.empty() == false)
{
Res += User;
Res += "@";
}
- Res += Host;
+ // Add RFC 2732 escaping characters
+ if (Access.empty() == false &&
+ (Host.find('/') != string::npos || Host.find(':') != string::npos))
+ Res += '[' + Host + ']';
+ else
+ Res += Host;
+
if (Port != 0)
{
char S[30];
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: orderlist.cc,v 1.9 1999/11/04 06:05:02 jgg Exp $
+// $Id: orderlist.cc,v 1.10 2000/01/16 05:36:17 jgg Exp $
/* ######################################################################
Order List - Represents and Manipulates an ordered list of packages.
for (iterator I = List; I != End; I++)
{
PkgIterator P(Cache,*I);
- cout << P.Name() << endl;
+ cout << P.Name() << ' ' << IsMissing(P) << endl;
}*/
return true;
// We order packages with a set state toward the front
int Res;
- if ((Res = BoolCompare(Me->IsNow(A),Me->IsNow(B))) == 0)
+ if ((Res = BoolCompare(Me->IsNow(A),Me->IsNow(B))) != 0)
return -1*Res;
// We order missing files to toward the end
if (Me->FileList != 0)
{
if ((Res = BoolCompare(Me->IsMissing(A),
- Me->IsMissing(B))) == 0)
+ Me->IsMissing(B))) != 0)
return Res;
}
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-cdrom.cc,v 1.32 1999/09/03 05:46:48 jgg Exp $
+// $Id: apt-cdrom.cc,v 1.33 2000/01/16 05:36:17 jgg Exp $
/* ######################################################################
APT CDROM - Tool for handling APT's CDROM database.
Res += 2;
if (Path.find("/source/") != string::npos)
Res += 1;
+ if (Path.find("/debian/") != string::npos)
+ Res -= 1;
return Res;
}
/*}}}*/
"Failed to open %s.new",File.c_str());
// Create a short uri without the path
- string ShortURI = "cdrom:" + Name + "/";
+ string ShortURI = "cdrom:[" + Name + "]/";
+ string ShortURI2 = "cdrom:" + Name + "/"; // For Compatibility
const char *Type;
if (Source == true)
string::size_type Space = (*I).find(' ');
if (Space == string::npos)
return _error->Error("Internal error");
- Out << Type << " \"cdrom:" << Name << "/" << string(*I,0,Space) <<
- "\" " << string(*I,Space+1) << endl;
+ Out << Type << " cdrom:[" << Name << "]/" << string(*I,0,Space) <<
+ " " << string(*I,Space+1) << endl;
}
}
First = false;
}
// Emit lines like this one
- if (cType != Type || string(URI,0,ShortURI.length()) != ShortURI)
+ if (cType != Type || (string(URI,0,ShortURI.length()) != ShortURI &&
+ string(URI,0,ShortURI.length()) != ShortURI2))
{
Out << Buffer << endl;
continue;
if (Space == string::npos)
return _error->Error("Internal error");
- Out << "deb \"cdrom:" << Name << "/" << string(*I,0,Space) <<
- "\" " << string(*I,Space+1) << endl;
+ Out << "deb cdrom:[" << Name << "]/" << string(*I,0,Space) <<
+ " " << string(*I,Space+1) << endl;
}
}
string::iterator J = Name.begin();
for (; J != Name.end(); J++)
- if (*J == '/' || *J == '"' || *J == ':')
+ if (*J == '"' || *J == ']' || *J == '[')
*J = '_';
Database.Set("CD::" + ID,Name);
- cout << "This Disc is called '" << Name << "'" << endl;
+ cout << "This Disc is called:" << endl << " '" << Name << "'" << endl;
// Copy the package files to the state directory
PackageCopy Copy;
if (Space == string::npos)
return _error->Error("Internal error");
- cout << "deb \"cdrom:" << Name << "/" << string(*I,0,Space) <<
- "\" " << string(*I,Space+1) << endl;
+ cout << "deb cdrom:[" << Name << "]/" << string(*I,0,Space) <<
+ " " << string(*I,Space+1) << endl;
}
for (vector<string>::iterator I = sList.begin(); I != sList.end(); I++)
if (Space == string::npos)
return _error->Error("Internal error");
- cout << "deb-src \"cdrom:" << Name << "/" << string(*I,0,Space) <<
- "\" " << string(*I,Space+1) << endl;
+ cout << "deb-src cdrom:[" << Name << "]/" << string(*I,0,Space) <<
+ " " << string(*I,Space+1) << endl;
}
cout << "Repeat this process for the rest of the CDs in your set." << endl;
+
+ // Unmount and finish
+ if (_config->FindB("APT::CDROM::NoMount",false) == false)
+ UnmountCdrom(CDROM);
+
return true;
}
/*}}}*/
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: indexcopy.cc,v 1.3 1999/12/10 23:40:29 jgg Exp $
+// $Id: indexcopy.cc,v 1.4 2000/01/16 05:36:17 jgg Exp $
/* ######################################################################
Index Copying - Aid for copying and verifying the index files
// Open the output file
char S[400];
- sprintf(S,"cdrom:%s/%s%s",Name.c_str(),(*I).c_str() + CDROM.length(),
+ sprintf(S,"cdrom:[%s]/%s%s",Name.c_str(),(*I).c_str() + CDROM.length(),
GetFileName());
string TargetF = _config->FindDir("Dir::State::lists") + "partial/";
TargetF += URItoFileName(S);
return _error->Errno("rename","Failed to rename");
// Copy the release file
- sprintf(S,"cdrom:%s/%sRelease",Name.c_str(),(*I).c_str() + CDROM.length());
+ sprintf(S,"cdrom:[%s]/%sRelease",Name.c_str(),(*I).c_str() + CDROM.length());
string TargetF = _config->FindDir("Dir::State::lists") + "partial/";
TargetF += URItoFileName(S);
if (FileExists(*I + "Release") == true)
// Not a dists type.
if (stringcmp(Path.begin(),Path.begin()+strlen("dists/"),"dists/") != 0)
return;
-
+
// Isolate the dist
string::size_type Slash = strlen("dists/");
string::size_type Slash2 = Path.find('/',Slash + 1);
+apt (0.3.16.1) unstable; urgency=low
+
+ * RFC 2732 usage for CDROM URIs and fixes to apt-cdrom
+ * Fixed the configuration parser to not blow up if ; is in the config
+ string
+ * Applied visual patch to dselect install script . Closes #55214
+ * Included the configure-index example
+
+ -- Ben Gertzfield <che@debian.org> Fri, 14 Jan 2000 08:04:15 -0800
+
apt (0.3.16) unstable; urgency=low
* Made --no-download work. Closes: #52993
include $(YODL_MANPAGE_H)
# Examples
-SOURCE = examples/apt.conf examples/sources.list
+SOURCE = examples/apt.conf examples/sources.list examples/configure-index
TO = $(DOC)
include $(COPY_H)
local ans def defp
if [ "$2" ];then
case $2 in
- Y|y) defp="(Y/n)" def=y;;
- N|n) defp="(y/N)" def=n;;
+ Y|y) defp="[Y/n]" def=y;;
+ N|n) defp="[y/N]" def=n;;
*) echo "Bad default setting!" 1>&2; exit 1;;
esac
else
- defp="(y/N)" def=n
+ defp="[y/N]" def=n
fi
while :;do
- echo -n "$1$defp" 1>&3
+ echo -n "$1 $defp" 1>&3
read ans
case $ans in
Y|y|N|n) break;;
;;
prompt)
exec 3>&1
- if [ `yesno "Do you want to erase the downloaded .deb files " y` = y ]; then
+ if [ `yesno "Do you want to erase the downloaded .deb files?" y` = y ]; then
$APTGET clean && echo "Press enter to continue." && read RES && exit 0;
fi
;;