diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-03-27 22:45:19 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-03-27 22:45:19 +0200 |
| commit | 287de31cec8313b10af47ede92483199bbde2200 (patch) | |
| tree | 1ebf928eaf895f3b973fb0f7265cab3c2c7bd624 /SoftwareProperties/aptsources.py | |
| parent | 6297fce66c8243488048690472f0d1ebc329dd52 (diff) | |
| parent | 3aa98f64592d44a6c65ad1bac11e03292c7deb39 (diff) | |
| download | python-apt-287de31cec8313b10af47ede92483199bbde2200.tar.gz | |
* various fixes
Diffstat (limited to 'SoftwareProperties/aptsources.py')
| -rw-r--r-- | SoftwareProperties/aptsources.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py index 77de510b..53ae2e84 100644 --- a/SoftwareProperties/aptsources.py +++ b/SoftwareProperties/aptsources.py @@ -102,8 +102,16 @@ class SourceEntry: line = line[:i] # source is ok, split it and see what we have pieces = self.mysplit(line) + # Sanity check + if len(pieces) < 3: + self.invalid = True + return # Type, deb or deb-src self.type = string.strip(pieces[0]) + # Sanity check + if self.type not in ("deb", "deb-src"): + self.invalid = True + return # URI self.uri = string.strip(pieces[1]) # distro and components (optional) |
