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
etersoft
eepm
Commits
55c12832
Commit
55c12832
authored
2 years ago
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-repack: fix package name-version before convert
parent
7770fc65
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
3 deletions
+25
-3
epm-repack
bin/epm-repack
+10
-3
test_pkgname.sh
tests/test_pkgname.sh
+15
-0
No files found.
bin/epm-repack
View file @
55c12832
...
@@ -232,15 +232,22 @@ __prepare_source_package()
...
@@ -232,15 +232,22 @@ __prepare_source_package()
__set_version_pkgname
$alpkg
__set_version_pkgname
$alpkg
if
[
-n
"
$VERSION
"
]
;
then
if
[
-n
"
$VERSION
"
]
;
then
# TODO: don't use erc for detect type? then we potentially can skip install it
assure_exists erc
||
fatal
assure_exists erc
||
fatal
pkgtype
=
"
$(
a
=
erc
type
$alpkg
)
"
pkgtype
=
"
$(
a
=
erc
type
$alpkg
)
"
[
-n
"
$PKGNAME
"
]
||
PKGNAME
=
$(
basename
$alpkg
.
$pkgtype
)
local
newalpkg
newalpkg
=
$PKGNAME
-
$VERSION
.
$pkgtype
#[ -n "$PKGNAME" ] || PKGNAME=$(basename $alpkg .$pkgtype)
if
[
"
$pkgtype
"
=
"tar"
]
||
[
"
$pkgtype
"
=
"tar.gz"
]
||
[
"
$pkgtype
"
=
"tgz"
]
;
then
if
[
"
$pkgtype
"
=
"tar"
]
||
[
"
$pkgtype
"
=
"tar.gz"
]
||
[
"
$pkgtype
"
=
"tgz"
]
;
then
mv
$alpkg
$newalpkg
:
:
else
else
newalpkg
=
$(
basename
$alpkg
.
$pkgtype
)
.tar
newalpkg
=
$PKGNAME
-
$VERSION
.tar
#newalpkg=$(basename $alpkg .$pkgtype).tar
assure_exists erc
||
fatal
assure_exists erc
||
fatal
a
=
erc repack
$alpkg
$newalpkg
||
fatal
a
=
erc repack
$alpkg
$newalpkg
||
fatal
fi
if
[
"
$alpkg
"
!=
"
$newalpkg
"
]
;
then
rm
-f
$verbose
$alpkg
rm
-f
$verbose
$alpkg
alpkg
=
$newalpkg
alpkg
=
$newalpkg
fi
fi
...
@@ -309,7 +316,7 @@ __epm_repack_to_rpm()
...
@@ -309,7 +316,7 @@ __epm_repack_to_rpm()
[
-s
"
$spec
"
]
||
fatal
"can't find spec"
[
-s
"
$spec
"
]
||
fatal
"can't find spec"
mv
$spec
$tmpbuilddir
||
fatal
mv
$spec
$tmpbuilddir
||
fatal
spec
=
"
$tmpbuilddir
/
$(
basename
"
$spec
"
)
"
spec
=
"
$tmpbuilddir
/
$(
basename
"
$spec
"
)
"
__set_name_version
$spec
$PKGNAME
$VERSION
#
__set_name_version $spec $PKGNAME $VERSION
local
pkgname
=
"
$(
grep
"^Name: "
$spec
|
sed
-e
"s|Name: ||g"
|
head
-n1
)
"
local
pkgname
=
"
$(
grep
"^Name: "
$spec
|
sed
-e
"s|Name: ||g"
|
head
-n1
)
"
# for tarballs fix permissions
# for tarballs fix permissions
...
...
This diff is collapsed.
Click to expand it.
tests/test_pkgname.sh
0 → 100755
View file @
55c12832
#!/bin/sh
__set_version_pkgname
()
{
local
alpkg
=
"
$1
"
VERSION
=
"
$(
echo
"
$alpkg
"
|
grep
-o
-P
"[-_.]([0-9])([0-9])*(
\.
[0-9])*"
|
head
-n1
|
sed
-e
's|^[-_.]||'
)
"
#"
[
-n
"
$VERSION
"
]
&&
PKGNAME
=
"
$(
echo
"
$alpkg
"
|
sed
-e
"s|[-_.]
$VERSION
.*||"
)
"
}
NAME
=
"Telegram.4.0.4.beta.tar"
__set_version_pkgname
$NAME
echo
"
$NAME
:
$PKGNAME
--
$VERSION
"
# $ fakeroot alien -d -k Telegram.4.0.4.beta.tar
# telegram.4.0.4.beta_1-1_all.deb
This diff is collapsed.
Click to expand it.
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