Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
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
Nurlan
eepm
Commits
458659db
Commit
458659db
authored
Apr 07, 2022
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
split common functions from common-chromium-browser.sh to chromium.sh
parent
6f687d97
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
56 deletions
+62
-56
common-chromium-browser.sh
repack.d/common-chromium-browser.sh
+2
-56
common.sh
repack.d/common.sh
+60
-0
No files found.
repack.d/common-chromium-browser.sh
View file @
458659db
...
...
@@ -7,6 +7,8 @@
# PRODUCTCUR=mybrowser-nightly
# PRODUCTDIR=/opt/my/browser
.
$(
dirname
$0
)
/common.sh
set_alt_alternatives
()
{
local
priority
=
"
$1
"
...
...
@@ -43,15 +45,6 @@ copy_icons_to_share()
}
remove_file
()
{
local
file
=
"
$1
"
[
-f
$BUILDROOT
/
$file
]
||
return
rm
-fv
$BUILDROOT
/
$file
subst
"s|.*
$file
.*||"
$SPEC
}
cleanup
()
{
subst
'1iAutoProv:no'
$SPEC
...
...
@@ -85,43 +78,6 @@ install_deps()
}
pack_file
()
{
grep
-q
"^
$1
$"
$SPEC
&&
return
grep
-q
"
\"
$1
\"
"
$SPEC
&&
return
subst
"s|%files|%files
\n
$1
|"
$SPEC
}
add_bin_link_command
()
{
local
name
=
"
$1
"
local
target
=
"
$2
"
[
-n
"
$name
"
]
||
name
=
"
$PRODUCT
"
[
-n
"
$target
"
]
||
target
=
"
$PRODUCTDIR
/
$name
"
[
-e
$BUILDROOT
/usr/bin/
$name
]
&&
return
mkdir
-p
$BUILDROOT
/usr/bin/
ln
-s
$target
$BUILDROOT
/usr/bin/
$name
pack_file /usr/bin/
$name
}
add_bin_exec_command
()
{
local
name
=
"
$1
"
local
target
=
"
$2
"
[
-n
"
$name
"
]
||
name
=
"
$PRODUCT
"
[
-n
"
$target
"
]
||
target
=
"
$PRODUCTDIR
/
$name
"
[
-e
$BUILDROOT
/usr/bin/
$name
]
&&
return
mkdir
-p
$BUILDROOT
/usr/bin/
echo
"exec
$target
\"\$
@
\"
"
>
$BUILDROOT
/usr/bin/
$name
chmod
0755
$BUILDROOT
/usr/bin/
$name
pack_file /usr/bin/
$name
}
# FIXME: too many heruistic due https://bugzilla.altlinux.org/42189
add_bin_commands
()
{
...
...
@@ -149,16 +105,6 @@ add_bin_commands()
add_bin_link_command
$PRODUCT
$PRODUCTCUR
}
move_to_opt
()
{
local
from
=
"
$1
"
[
-n
"
$from
"
]
||
from
=
"/usr/share/
$PRODUCT
"
mkdir
-p
$BUILDROOT$PRODUCTDIR
/
mv
$BUILDROOT
/
$from
/
*
$BUILDROOT$PRODUCTDIR
/
subst
"s|
$from
|
$PRODUCTDIR
|g"
$SPEC
}
fix_chrome_sandbox
()
{
...
...
repack.d/common.sh
0 → 100755
View file @
458659db
#!/bin/sh
# Usage: remove_file <path_to_file>
remove_file
()
{
local
file
=
"
$1
"
[
-f
$BUILDROOT
/
$file
]
||
return
rm
-fv
$BUILDROOT
/
$file
subst
"s|.*
$file
.*||"
$SPEC
}
# Usage: pack_file <path_to_file>
pack_file
()
{
grep
-q
"^
$1
$"
$SPEC
&&
return
grep
-q
"
\"
$1
\"
"
$SPEC
&&
return
subst
"s|%files|%files
\n
$1
|"
$SPEC
}
add_bin_link_command
()
{
local
name
=
"
$1
"
local
target
=
"
$2
"
[
-n
"
$name
"
]
||
name
=
"
$PRODUCT
"
[
-n
"
$target
"
]
||
target
=
"
$PRODUCTDIR
/
$name
"
[
-e
$BUILDROOT
/usr/bin/
$name
]
&&
return
mkdir
-p
$BUILDROOT
/usr/bin/
ln
-s
$target
$BUILDROOT
/usr/bin/
$name
pack_file /usr/bin/
$name
}
add_bin_exec_command
()
{
local
name
=
"
$1
"
local
target
=
"
$2
"
[
-n
"
$name
"
]
||
name
=
"
$PRODUCT
"
[
-n
"
$target
"
]
||
target
=
"
$PRODUCTDIR
/
$name
"
[
-e
$BUILDROOT
/usr/bin/
$name
]
&&
return
mkdir
-p
$BUILDROOT
/usr/bin/
echo
"exec
$target
\"\$
@
\"
"
>
$BUILDROOT
/usr/bin/
$name
chmod
0755
$BUILDROOT
/usr/bin/
$name
pack_file /usr/bin/
$name
}
# move files to $PRODUCTDIR
move_to_opt
()
{
local
from
=
"
$1
"
[
-n
"
$from
"
]
||
from
=
"/usr/share/
$PRODUCT
"
mkdir
-p
$BUILDROOT$PRODUCTDIR
/
mv
$BUILDROOT
/
$from
/
*
$BUILDROOT$PRODUCTDIR
/
subst
"s|
$from
|
$PRODUCTDIR
|g"
$SPEC
}
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