Changeset 91ece11b in mainline


Ignore:
Timestamp:
2021-10-28T15:13:50Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7b11315
Parents:
8edec53
Message:

Fix list_profiles.sh not working on Btrfs

There is no guarantee per UN*X standards that the link count for a leaf
directory is any specific number.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/list_profiles.sh

    r8edec53 r91ece11b  
    22
    33#
     4# Copyright (c) 2021 Jiri Svoboda
    45# Copyright (c) 2019 Jiří Zárevúcky
    56# All rights reserved.
     
    3940CONFIG_DEFAULTS="${SOURCE_DIR}/defaults"
    4041
    41 # Find all the leaf subdirectories in the defaults directory.
    42 find ${CONFIG_DEFAULTS} -type d -links 2 -printf "%P\n" | sort
     42# Find the leaf subdirectories in the defaults directory.
     43level1dirs=`ls "$CONFIG_DEFAULTS"`
     44for dname in $level1dirs; do
     45        l2dirs=`ls "$CONFIG_DEFAULTS"/"$dname"`
     46        havel2=
     47        for dn in $l2dirs; do
     48                if [ -d "$CONFIG_DEFAULTS/$dname/$dn" ]; then
     49                        echo "$dname/$dn"
     50                        havel2=true
     51                fi
     52        done
     53        if [ -z "$havel2" ]; then
     54                echo "$dname"
     55        fi
     56done
Note: See TracChangeset for help on using the changeset viewer.