aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn/ar.py
blob: dc3ae8d948e49c5a923ca38b623b3c7b5786f8f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python
#
# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import os
import subprocess
import sys

# Equivalent to: rm -f $2 && $1 rcs $2 @$3

ar, output, rspfile = sys.argv[1:]

if os.path.exists(output):
  os.remove(output)
sys.exit(subprocess.call([ar, "rcs", output, "@" + rspfile]))