#!/usr/bin/env python3
-#
-# This file is part of the libsigrokdecode project.
-#
-# Copyright (C) 2013 Bert Vermeulen <bert@biot.com>
-#
-# 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 3 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, see <http://www.gnu.org/licenses/>.
-#
+##
+## This file is part of the libsigrokdecode project.
+##
+## Copyright (C) 2013 Bert Vermeulen <bert@biot.com>
+##
+## 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 3 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, see <http://www.gnu.org/licenses/>.
+##
import os
import sys
from getopt import getopt
-def install(srcdir, dstdir):
+def install(srcdir, dstdir, s):
worklist = []
for pd in os.listdir(srcdir):
pd_dir = srcdir + '/' + pd
install_list.extend(config_get_extra_install(pd_file))
elif f[-3:] == '.py':
install_list.append(f)
- worklist.append((pd, pd_dir, install_list))
+ if install_list:
+ worklist.append((pd, pd_dir, install_list))
- print("Installing %d protocol decoders:" % len(worklist))
+ print("Installing %d %s:" % (len(worklist), s))
col = 0
for pd, pd_dir, install_list in worklist:
msg = pd + ' '
if len(args) != 0 or dst is None:
usage()
-install(src, dst)
+install(src, dst, 'protocol decoders')
+install(src + '/common', dst + '/common', 'common modules')