Browse Source

remove func dpkg_listfiles()

Fabian Peter Hammerle 5 years ago
parent
commit
95396fc634
1 changed files with 2 additions and 8 deletions
  1. 2 8
      rc.xsh

+ 2 - 8
rc.xsh

@@ -103,12 +103,6 @@ def chdir(path):
         os.chdir(previous)
         sys.stderr.write('cd {}\n'.format(shlex.quote(previous)))
 
-def dpkg_listfiles(pkg_name):
-    assert isinstance(pkg_name, str)
-    paths = $(dpkg --listfiles @(pkg_name)).split('\n')[:-1]
-    assert len(paths) > 0, 'pkg {!r} not installed'.format(pkg_name)
-    return paths
-
 def dpkg_search(path_search_pattern):
     assert isinstance(path_search_pattern, str)
     return re.findall(
@@ -118,8 +112,8 @@ def dpkg_search(path_search_pattern):
     )
 
 def dpkg_welse(cmd):
-    pkg_name, cmd_path = dpkg_which(cmd)
-    return dpkg_listfiles(pkg_name)
+    pkg_name, _ = dpkg_which(cmd)
+    return $(dpkg --listfiles @(pkg_name)).split('\n')[:-1]
 
 def dpkg_which(cmd):
     cmd_path = shutil.which(cmd)