xref: /freebsd/tools/build/cross-build/fake_chflags/chflags (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
1*5bb9250eSAlex Richardson#!/bin/sh -e
2*5bb9250eSAlex Richardson#
3*5bb9250eSAlex Richardson# SPDX-License-Identifier: BSD-2-Clause
4*5bb9250eSAlex Richardson#
5*5bb9250eSAlex Richardson# Copyright 2018-2020 Alex Richardson <arichardson@FreeBSD.org>
6*5bb9250eSAlex Richardson#
7*5bb9250eSAlex Richardson# This software was developed by SRI International and the University of
8*5bb9250eSAlex Richardson# Cambridge Computer Laboratory (Department of Computer Science and
9*5bb9250eSAlex Richardson# Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the
10*5bb9250eSAlex Richardson# DARPA SSITH research programme.
11*5bb9250eSAlex Richardson#
12*5bb9250eSAlex Richardson# This software was developed by SRI International and the University of
13*5bb9250eSAlex Richardson# Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
14*5bb9250eSAlex Richardson# ("CTSRD"), as part of the DARPA CRASH research programme.
15*5bb9250eSAlex Richardson#
16*5bb9250eSAlex Richardson# Redistribution and use in source and binary forms, with or without
17*5bb9250eSAlex Richardson# modification, are permitted provided that the following conditions
18*5bb9250eSAlex Richardson# are met:
19*5bb9250eSAlex Richardson# 1. Redistributions of source code must retain the above copyright
20*5bb9250eSAlex Richardson#    notice, this list of conditions and the following disclaimer.
21*5bb9250eSAlex Richardson# 2. Redistributions in binary form must reproduce the above copyright
22*5bb9250eSAlex Richardson#    notice, this list of conditions and the following disclaimer in the
23*5bb9250eSAlex Richardson#    documentation and/or other materials provided with the distribution.
24*5bb9250eSAlex Richardson#
25*5bb9250eSAlex Richardson# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
26*5bb9250eSAlex Richardson# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27*5bb9250eSAlex Richardson# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28*5bb9250eSAlex Richardson# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
29*5bb9250eSAlex Richardson# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30*5bb9250eSAlex Richardson# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31*5bb9250eSAlex Richardson# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32*5bb9250eSAlex Richardson# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33*5bb9250eSAlex Richardson# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34*5bb9250eSAlex Richardson# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35*5bb9250eSAlex Richardson# SUCH DAMAGE.
36*5bb9250eSAlex Richardson#
37*5bb9250eSAlex Richardson#
38*5bb9250eSAlex Richardson# chflags doesn't exist on Linux, just skip the calls for now
39*5bb9250eSAlex Richardson# TODO: we could also create a wrapper that calls `chattr +i` for `chflags schg`, etc
40*5bb9250eSAlex Richardsonecho "WARNING: Ignoring chflags $@"
41*5bb9250eSAlex Richardson# TODO: exit 1
42