Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
ENH: reprotest:lib: add distro abstraction
Many distros may want to use reprotest and the current implementation depends on the Debian toolchain. Abstract away the debian-specific toolchain to a separate module, and provide a way to extend this for cross-distro compatility.
- Loading branch information
1 parent
06456d3
commit dbda486
Showing
3 changed files
with
89 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # adt_testbed.py is part of autopkgtest | ||
| # autopkgtest is a tool for testing Debian binary packages | ||
| # | ||
| # autopkgtest is Copyright (C) 2006-2015 Canonical Ltd. | ||
| # | ||
| # This program is free software; you can 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 of the License, or | ||
| # (at your option) any later version. | ||
| # | ||
| # This program 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 this program; if not, write to the Free Software | ||
| # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| # | ||
| # See the file CREDITS for a full list of credits information (often | ||
| # installed as /usr/share/doc/autopkgtest/CREDITS). | ||
|
|
||
| class system_interface: | ||
|
|
||
| def __init__ (self): | ||
| print("lel") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # adt_testbed.py is part of autopkgtest | ||
| # autopkgtest is a tool for testing Debian binary packages | ||
| # | ||
| # autopkgtest is Copyright (C) 2006-2015 Canonical Ltd. | ||
| # | ||
| # This program is free software; you can 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 of the License, or | ||
| # (at your option) any later version. | ||
| # | ||
| # This program 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 this program; if not, write to the Free Software | ||
| # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| # | ||
| # See the file CREDITS for a full list of credits information (often | ||
| # installed as /usr/share/doc/autopkgtest/CREDITS). | ||
|
|
||
| import os | ||
| import sys | ||
| import errno | ||
| import time | ||
| import pipes | ||
| import traceback | ||
| import re | ||
| import signal | ||
| import subprocess | ||
| import tempfile | ||
| import shutil | ||
| import urllib.parse | ||
|
|
||
| from . import system_interface | ||
|
|
||
| # TODO: removing this import disables install_tmp, may want to restore | ||
| # it at some point if I'm improving support for building Debian packages in | ||
| # particular. | ||
|
|
||
| class debian_interface(system_interface): | ||
|
|
||
| def get_arch_exec(self): | ||
| return ['dpkg', '--print-architecture'] | ||
|
|
||
| def get_testbed_packages(self, target_file): | ||
| return ['sh', '-ec', | ||
| "dpkg-query --show -f '${Package}\\t${Version}\\n' > %s" % target_file.tb] | ||
|
|
||
| def can_query_packages(self): | ||
| try: | ||
| return subprocess.check_call(['which', 'dpkg-query'], stdout=subprocess.DEVNULL) == 0 | ||
| except: | ||
| return 0 | ||
|
|