This file is indexed.

/usr/bin/click-show-files is in click-reviewers-tools 0.42.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#!/usr/bin/python3
'''check-show-files: show files'''
#
# Copyright (C) 2014-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; version 3 of the License.
#
# 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, see <http://www.gnu.org/licenses/>.

from __future__ import print_function
import os
import sys

from clickreviews import common
from clickreviews import cr_desktop
from clickreviews import cr_lint
from clickreviews import cr_security
from clickreviews import cr_url_dispatcher
from clickreviews import cr_scope
from clickreviews import cr_content_hub
from clickreviews import cr_online_accounts
from clickreviews import cr_push_helper
from clickreviews import cr_bin_path
from clickreviews import cr_framework
from clickreviews import cr_systemd

# This script just dumps important files to stdout

if __name__ == "__main__":
    if len(sys.argv) < 2:
        common.error("Must give path to package")

    review = cr_lint.ClickReviewLint(sys.argv[1])

    fn = os.path.join(review.unpack_dir, "meta", "snap.yaml")
    if os.path.exists(fn):  # just show snap.yaml for snap v2+ snaps
        print("= %s =" % os.path.basename(fn))
        fh = common.open_file_read(fn)
        for line in fh.readlines():
            print(line, end="")
        fh.close()
        print("")
        sys.exit(0)

    for i in sorted(review.control_files):
        fh = common.open_file_read(review.control_files[i])
        print("= %s =" % os.path.basename(i))
        for line in fh.readlines():
            print(line, end="")
        fh.close()
        print("")

    fn = os.path.join(review.unpack_dir, "meta", "package.yaml")
    if os.path.exists(fn):
        print("= %s =" % os.path.basename(fn))
        fh = common.open_file_read(fn)
        for line in fh.readlines():
            print(line, end="")
        fh.close()
        print("")

    print("= hooks =")

    review_content_hub = cr_content_hub.ClickReviewContentHub(sys.argv[1])
    for app in sorted(review_content_hub.content_hub_files):
        f = review_content_hub.content_hub_files[app]
        fh = common.open_file_read(os.path.join(
            review_content_hub.unpack_dir, f))
        print("== content_hub: %s ==" % os.path.basename(f))
        for line in fh.readlines():
            print(line, end="")
        fh.close()
        print("")

    review_desktop = cr_desktop.ClickReviewDesktop(sys.argv[1])
    for app in sorted(review_desktop.desktop_files):
        f = review_desktop.desktop_files[app]
        fh = common.open_file_read(os.path.join(review_desktop.unpack_dir, f))
        print("== desktop: %s ==" % os.path.basename(f))
        for line in fh.readlines():
            print(line, end="")
        fh.close()
        print("")

    review_accounts = cr_online_accounts.ClickReviewAccounts(sys.argv[1])
    for app in sorted(review_accounts.accounts_files):
        for account_type in review_accounts.account_hooks:
            if account_type not in review_accounts.accounts_files[app]:
                continue
            f = review_accounts.accounts_files[app][account_type]
            fh = common.open_file_read(os.path.join(
                review_accounts.unpack_dir, f))
            print("== online %s: %s ==" % (account_type, os.path.basename(f)))
            for line in fh.readlines():
                print(line, end="")
            fh.close()
            print("")

    review_push_helper = cr_push_helper.ClickReviewPushHelper(sys.argv[1])
    for app in sorted(review_push_helper.push_helper_files):
        f = review_push_helper.push_helper_files[app]
        fh = common.open_file_read(os.path.join(
            review_push_helper.unpack_dir, f))
        print("== push_helper: %s ==" % os.path.basename(f))
        for line in fh.readlines():
            print(line, end="")
        fh.close()
        print("")

    review_scope = cr_scope.ClickReviewScope(sys.argv[1])
    for app in sorted(review_scope.scopes):
        f = review_scope.scopes[app]["ini_file"]
        fh = common.open_file_read(os.path.join(review_scope.unpack_dir, f))
        print("== scope .INI: %s ==" % os.path.basename(f))
        for line in fh.readlines():
            print(line, end="")
        fh.close()
        print("")

    review_framework = cr_framework.ClickReviewFramework(sys.argv[1])
    for app in sorted(review_framework.frameworks_file):
        f = os.path.join(review_framework.unpack_dir,
                         review_framework.frameworks_file[app])
        fh = common.open_file_read(os.path.join(review_framework.unpack_dir, f))
        print("== click .framework: %s ==" % os.path.basename(f))
        for line in fh.readlines():
            print(line, end="")
        fh.close()
        print("")

    review_bin_path = cr_bin_path.ClickReviewBinPath(sys.argv[1])
    for app in sorted(review_bin_path.bin_paths):
        f = os.path.join(review_bin_path.unpack_dir, review_bin_path.bin_paths[app])
        print("== bin_path: %s ==" % os.path.relpath(f, review_bin_path.unpack_dir))
        print("")

    review_apparmor = cr_security.ClickReviewSecurity(sys.argv[1])
    for f in sorted(review_apparmor.security_manifests):
        fh = common.open_file_read(os.path.join(review_apparmor.unpack_dir, f))
        print("== security: %s ==" % os.path.basename(f))
        for line in fh.readlines():
            print(line, end="")
        fh.close()
        print("")

    review_systemd = cr_systemd.ClickReviewSystemd(sys.argv[1])
    for app in sorted(review_systemd.systemd_files):
        f = review_systemd.systemd_files[app]
        fh = common.open_file_read(os.path.join(review_systemd.unpack_dir, f))
        print("== systemd: %s ==" % os.path.basename(f))
        for line in fh.readlines():
            print(line, end="")
        fh.close()
        print("")

    review_url_dispatcher = cr_url_dispatcher.ClickReviewUrlDispatcher(sys.argv[1])
    for app in sorted(review_url_dispatcher.url_dispatcher_files):
        f = review_url_dispatcher.url_dispatcher_files[app]
        fh = common.open_file_read(os.path.join(review_url_dispatcher.unpack_dir,
                                                f))
        print("== url_dispatcher: %s ==" % os.path.basename(f))
        for line in fh.readlines():
            print(line, end="")
        fh.close()
        print("")

    # Cleanup our unpack directory
    common.cleanup_unpack()