summaryrefslogtreecommitdiff
path: root/cmdline/apt-cdrom.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:55:53 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:55:53 +0000
commit5633a7c28bb3f7bdc10a2fba41caaeb4d67c17f4 (patch)
treed59810ce55217db4aa025d199b876eb1b5f80b2c /cmdline/apt-cdrom.cc
parent01b64152bafe4df766345faa5b8f1fcc242aaee2 (diff)
Allowed source only CDs. Closes: #58952
Author: jgg Date: 2000-05-10 06:03:52 GMT Allowed source only CDs. Closes: #58952
Diffstat (limited to 'cmdline/apt-cdrom.cc')
-rw-r--r--cmdline/apt-cdrom.cc31
1 files changed, 17 insertions, 14 deletions
diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc
index 1d742d725..204cef366 100644
--- a/cmdline/apt-cdrom.cc
+++ b/cmdline/apt-cdrom.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-cdrom.cc,v 1.34 2000/01/17 07:11:49 jgg Exp $
+// $Id: apt-cdrom.cc,v 1.35 2000/05/10 06:03:52 jgg Exp $
/* ######################################################################
APT CDROM - Tool for handling APT's CDROM database.
@@ -172,25 +172,27 @@ int Score(string Path)
{
int Res = 0;
if (Path.find("stable/") != string::npos)
- Res += 2;
+ Res += 29;
if (Path.find("/binary-") != string::npos)
- Res += 2;
+ Res += 20;
if (Path.find("frozen/") != string::npos)
- Res += 2;
+ Res += 28;
+ if (Path.find("unstable/") != string::npos)
+ Res += 27;
if (Path.find("/dists/") != string::npos)
- Res += 4;
+ Res += 40;
if (Path.find("/main/") != string::npos)
- Res += 2;
+ Res += 20;
if (Path.find("/contrib/") != string::npos)
- Res += 2;
+ Res += 20;
if (Path.find("/non-free/") != string::npos)
- Res += 2;
+ Res += 20;
if (Path.find("/non-US/") != string::npos)
- Res += 2;
+ Res += 20;
if (Path.find("/source/") != string::npos)
- Res += 1;
+ Res += 10;
if (Path.find("/debian/") != string::npos)
- Res -= 1;
+ Res -= 10;
return Res;
}
/*}}}*/
@@ -557,7 +559,7 @@ bool DoAdd(CommandLine &)
cout << "Found " << List.size() << " package indexes and " << sList.size() <<
" source indexes." << endl;
- if (List.size() == 0)
+ if (List.size() == 0 && sList.size() == 0)
return _error->Error("Unable to locate any package files, perhaps this is not a Debian Disc");
// Check if the CD is in the database
@@ -598,7 +600,8 @@ bool DoAdd(CommandLine &)
}
else
Name = Database.Find("CD::" + ID);
-
+
+ // Escape special characters
string::iterator J = Name.begin();
for (; J != Name.end(); J++)
if (*J == '"' || *J == ']' || *J == '[')
@@ -724,7 +727,7 @@ int main(int argc,const char *argv[])
}
// See if the help should be shown
- if (_config->FindB("help") == true ||
+ if (_config->FindB("help") == true || _config->FindB("version") == true ||
CmdL.FileSize() == 0)
return ShowHelp();