Skip to content

Commit e56ce3c

Browse files
authored
Merge pull request #4 from patrickelectric/fix_no_exist
Check if file exist or if it's a format
2 parents 23e9014 + c5a3407 commit e56ce3c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

linuxdeploy-plugin-gstreamer.sh

+6
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ mkdir -p "$plugins_target_dir"
9696
echo "Copying plugins into $plugins_target_dir"
9797
for i in "$plugins_dir"/*; do
9898
[ -d "$i" ] && continue
99+
[ ! -f "$i" ] && echo "File does not exist: $i" && continue
99100

100101
echo "Copying plugin: $i"
101102
cp "$i" "$plugins_target_dir"
@@ -105,6 +106,8 @@ done
105106

106107
for i in "$plugins_target_dir"/*; do
107108
[ -d "$i" ] && continue
109+
[ ! -f "$i" ] && echo "File does not exist: $i" && continue
110+
"$(file "$i" | grep -v ELF --silent)" && echo "Ignoring non ELF file: $i" && continue
108111

109112
echo "Manually setting rpath for $i"
110113
patchelf --set-rpath '$ORIGIN/..:$ORIGIN' "$i"
@@ -115,13 +118,16 @@ mkdir -p "$helpers_target_dir"
115118
echo "Copying helpers in $helpers_target_dir"
116119
for i in "$helpers_dir"/*; do
117120
[ -d "$i" ] && continue
121+
[ ! -f "$i" ] && echo "File does not exist: $i" && continue
118122

119123
echo "Copying helper: $i"
120124
cp "$i" "$helpers_target_dir"
121125
done
122126

123127
for i in "$helpers_target_dir"/*; do
124128
[ -d "$i" ] && continue
129+
[ ! -f "$i" ] && echo "File does not exist: $i" && continue
130+
"$(file "$i" | grep -v ELF --silent)" && echo "Ignoring non ELF file: $i" && continue
125131

126132
echo "Manually setting rpath for $i"
127133
patchelf --set-rpath '$ORIGIN/../..' "$i"

0 commit comments

Comments
 (0)