Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-build-utils
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
korinf
etersoft-build-utils
Commits
97830493
Commit
97830493
authored
Feb 24, 2012
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tarball: add conv for zip
parent
cd25fbb4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
tarball
share/eterbuild/functions/tarball
+28
-0
No files found.
share/eterbuild/functions/tarball
View file @
97830493
...
...
@@ -20,6 +20,27 @@ bzipit()
fi
}
# TODO: use external converter?
# $1 - zip name $2 - tar name
conv_zip_to_tar
()
{
local
RZ
=
$(
realpath
"
$1
"
)
local
RT
=
$(
realpath
"
$2
"
)
# FIXME: use normal mktempdir
mkdir
$1
.tmpdir
||
fatal
cd
$1
.tmpdir
||
fatal
# unzip or remove broken file
unzip
-q
"
$RZ
"
&&
tar
cf
"
$RT
"
./
*
||
{
rm
-fv
"
$RT
"
;
return
1
;
}
cd
..
rm
-rf
$1
.tmpdir
}
get_archive_type
()
{
file
"
$1
"
|
grep
-q
"Zip archive data"
&&
echo
"zip"
&&
return
return
1
}
# TODO: use bzipit
copy_tarball_to_tar_bz2
()
{
...
...
@@ -45,6 +66,7 @@ copy_tarball_to_tar_bz2()
bzip
-c
"
$SNAME
"
>
"
$TNAME
"
return
fi
fatal
"Can't repack
$SNAME
to tar.bz2"
}
...
...
@@ -75,6 +97,12 @@ copy_tarball_to_tar()
cp
-fv
"
$SNAME
"
"
$TNAME
"
return
fi
# TODO: use conv_zip_to_$type (type may be undetected)
if
[
$(
get_archive_type
$SNAME
)
=
"zip"
]
;
then
conv_zip_to_tar
$SNAME
$TNAME
&&
return
fi
fatal
"Can't repack
$SNAME
to tar"
}
...
...
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