Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
epmgpi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
epmgpi
Commits
8ec78254
Commit
8ec78254
authored
Jul 30, 2024
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added warning about the launch of extraneous files
parent
72bfce45
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
0 deletions
+72
-0
epmgpi
bin/epmgpi
+54
-0
epmgpi.pot
po/epmgpi.pot
+9
-0
ru.po
po/ru.po
+9
-0
No files found.
bin/epmgpi
View file @
8ec78254
...
@@ -29,6 +29,16 @@ VALID_FILE_EXTENSIONS=(
...
@@ -29,6 +29,16 @@ VALID_FILE_EXTENSIONS=(
"*.appimage"
"*.AppImage"
"*.Appimage"
"*.appimage"
"*.AppImage"
"*.Appimage"
)
)
check_extension
()
{
local
FILE
=
"
$1
"
for
EXT
in
"
${
VALID_FILE_EXTENSIONS
[@]
}
"
;
do
if
[[
"
$FILE
"
==
$EXT
]]
;
then
return
0
fi
done
return
1
}
# Notifications
# Notifications
ntf
()
{
ntf
()
{
notify-send
--icon
=
epmgpi
"
$1
"
notify-send
--icon
=
epmgpi
"
$1
"
...
@@ -39,6 +49,45 @@ ntf_error() {
...
@@ -39,6 +49,45 @@ ntf_error() {
notify-send
--icon
=
error
"
$1
"
notify-send
--icon
=
error
"
$1
"
}
}
file_exec_warn
()
{
local
NEED_RULES
if
[
-x
"
$1
"
]
;
then
NEED_RULES
=
False
else
NEED_RULES
=
True
fi
$YAD_DEFAULT
--image
=
"dialog-warning"
\
\
--width
=
500
--height
=
200
\
--text
=
"
$(
gtxt
\
"epmgpi has detected that you are running a file.
Launching extraneous files can lead to unforeseen consequences."
echo
echo
if
[
"
$NEED_RULES
"
=
True
]
;
then
gtxt
"Additionally, the file needs execute permissions.
Do you want to grant the file execute permissions and run it?"
else
gtxt
"Do you really want to run the file?"
fi
)
"
\
--button
=
"yad-yes:0"
\
--button
=
"yad-no:1"
local
ANSWER
=
$?
if
[[
$ANSWER
-eq
0
]]
;
then
if
[
"
$NEED_RULES
"
=
True
]
;
then
chmod
+x
"
$1
"
fi
exec
"
$1
"
fi
}
# Function to ask the user if the package should be repacked
# Function to ask the user if the package should be repacked
repackq
()
{
repackq
()
{
# Non-rpm files are repacked without --repack key
# Non-rpm files are repacked without --repack key
...
@@ -153,6 +202,11 @@ main() {
...
@@ -153,6 +202,11 @@ main() {
exit
1
exit
1
fi
fi
if
!
check_extension
"
$FILE_PATH
"
;
then
file_exec_warn
"
$FILE_PATH
"
exit
0
fi
if
echo
"
$FILE_PATH
"
|
grep
-q
" "
;
then
if
echo
"
$FILE_PATH
"
|
grep
-q
" "
;
then
gtxt
"Package path contains spaces"
gtxt
"Package path contains spaces"
echo
echo
...
...
po/epmgpi.pot
View file @
8ec78254
...
@@ -54,6 +54,15 @@ msgstr ""
...
@@ -54,6 +54,15 @@ msgstr ""
msgid "Package path not specified. Calling package selection function..."
msgid "Package path not specified. Calling package selection function..."
msgstr ""
msgstr ""
msgid "epmgpi has detected that you are running a file.\nLaunching extraneous files can lead to unforeseen consequences."
msgstr ""
msgid "Do you really want to run the file?"
msgstr ""
msgid "Additionally, the file needs execute permissions.\n\nDo you want to grant the file execute permissions and run it?"
msgstr ""
msgid "Error: %s is not a file."
msgid "Error: %s is not a file."
msgstr ""
msgstr ""
...
...
po/ru.po
View file @
8ec78254
...
@@ -54,6 +54,15 @@ msgstr "Передайте путь к пакету, если не хотите
...
@@ -54,6 +54,15 @@ msgstr "Передайте путь к пакету, если не хотите
msgid "Package path not specified. Calling package selection function..."
msgid "Package path not specified. Calling package selection function..."
msgstr "Путь к пакету не указан. Вызов функции выбора пакета..."
msgstr "Путь к пакету не указан. Вызов функции выбора пакета..."
msgid "epmgpi has detected that you are running a file.\nLaunching extraneous files can lead to unforeseen consequences."
msgstr "epmgpi обнаружил, что вы запускаете файл.\nЗапуск посторонних файлов может привести к непредвиденным последствиям."
msgid "Do you really want to run the file?"
msgstr "Вы действительно хотите запустить файл?"
msgid "Additionally, the file needs execute permissions.\n\nDo you want to grant the file execute permissions and run it?"
msgstr "Кроме того, файлу необходимы права на выполнение.\n\nВы хотите предоставить файлу права на выполнение и запустить его?"
msgid "Error: %s is not a file."
msgid "Error: %s is not a file."
msgstr "Ошибка: %s - это не файл."
msgstr "Ошибка: %s - это не файл."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment