]>
git.proxmox.com Git - mirror_ovs.git/blob - build-aux/dpdkstrip.py
2 # Copyright (c) 2017 Red Hat, Inc.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at:
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
20 def strip_dpdk(check_dpdk
, src
, dst
):
21 disabled_print
= False
26 if '@begin_dpdk@' in line
or '@end_dpdk@' in line
:
28 disabled_print
= not disabled_print
30 if not disabled_print
:
34 if __name__
== '__main__':
36 options
, args
= getopt
.gnu_getopt(sys
.argv
[1:], '', ['dpdk', 'nodpdk'])
37 for key
, value
in options
:
40 elif key
== '--nodpdk':
46 strip_dpdk(check_dpdk
, open(arg
), sys
.stdout
)
48 strip_dpdk(check_dpdk
, sys
.stdin
, sys
.stdout
)