Skip to content

Commit

Permalink
fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
QiuSimons committed Jun 11, 2024
1 parent 0015f7d commit a4da6d1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions SCRIPTS/08_fix_permissions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,25 @@
BASE_DIR=$(pwd)

# Setting permissions for directories, excluding staging_dir
find "$BASE_DIR" -path "$BASE_DIR/staging_dir" -prune -o -type d -exec chmod 755 {} \;
find "$BASE_DIR" -path "$BASE_DIR/staging_dir" -prune -o -type d -exec chmod 755 "{}" +

# Setting permissions for files, excluding staging_dir
find "$BASE_DIR" -path "$BASE_DIR/staging_dir" -prune -o -type f -exec chmod 644 {} \;
find "$BASE_DIR" -path "$BASE_DIR/staging_dir" -prune -o -type f -exec chmod 644 "{}" +

# Setting executable permissions for specific scripts, excluding staging_dir
find "$BASE_DIR" -path "$BASE_DIR/staging_dir" -prune -o -type f \( -name "*.sh" -o -name "*.pl" -o -name "*.py" -o -name "*.awk" -o -name "*bin*" -o -name "Makefile" -o -name "configure" \) -exec chmod 755 {} \;
find "$BASE_DIR" -path "$BASE_DIR/staging_dir" -prune -o -type f \( -name "*.sh" -o -name "*.pl" -o -name "*.py" -o -name "*.awk" -o -name "*bin*" -o -name "Makefile" -o -name "configure" \) -exec chmod 755 "{}" +

# Setting executable permissions for scripts in scripts directory, excluding staging_dir
find "$BASE_DIR/scripts" -path "$BASE_DIR/staging_dir" -prune -o -type f -exec chmod 755 {} \;
find "$BASE_DIR/scripts" -path "$BASE_DIR/staging_dir" -prune -o -type f -exec chmod 755 "{}" +

# Setting special permissions for feeds, excluding staging_dir
find "$BASE_DIR/feeds" -path "$BASE_DIR/staging_dir" -prune -o -type f -exec chmod 755 {} \;
find "$BASE_DIR/feeds" -path "$BASE_DIR/staging_dir" -prune -o -type f -exec chmod 755 "{}" +

# Setting executable permissions for init scripts in package, excluding staging_dir
find "$BASE_DIR" -path "$BASE_DIR/staging_dir" -prune -o -type f -exec grep -l 'sh' {} \; | xargs chmod 755
find "$BASE_DIR" -path "$BASE_DIR/staging_dir" -prune -o -type f -exec grep -l 'PKG' {} \; | xargs chmod 755
find "$BASE_DIR" -path "$BASE_DIR/staging_dir" -prune -o -type f -exec grep -l 'uci' {} \; | xargs chmod 755
find "$BASE_DIR" -path "$BASE_DIR/staging_dir" -prune -o -type f -exec grep -l 'config' "{}" + -exec chmod 644 "{}" +
find "$BASE_DIR" -path "$BASE_DIR/staging_dir" -prune -o -type f -exec grep -l 'bin' "{}" + -exec chmod 755 "{}" +
find "$BASE_DIR" -path "$BASE_DIR/staging_dir" -prune -o -type f -exec grep -l 'PKG' "{}" + -exec chmod 755 "{}" +
find "$BASE_DIR" -path "$BASE_DIR/staging_dir" -prune -o -type f -exec grep -l 'uci' "{}" + -exec chmod 755 "{}" +

# Setting special permissions for the build system scripts
chmod 755 "$BASE_DIR/scripts/feeds"
Expand Down

0 comments on commit a4da6d1

Please sign in to comment.