Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
abuild
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
27
Issues
27
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
abuild
Commits
9b3f7789
Commit
9b3f7789
authored
Oct 04, 2012
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
abuild: show package size in human readable format
parent
1fa61905
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
abuild.in
abuild.in
+11
-1
No files found.
abuild.in
View file @
9b3f7789
...
...
@@ -995,8 +995,16 @@ scan_shared_objects() {
done
>
"
$controldir
"
/.needs-so
}
# read size in bytes from stdin and show as human readable
human_size
()
{
awk
'{ split("B KB MB GB TB PB", type)
for(i=5; y < 1; i--)
y = $1 / (2**(10*i))
printf("%.1f %s\n", y, type[i+2]) }'
}
create_apks
()
{
local
file
=
dir
=
name
=
ver
=
apk
=
datadir
=
local
file
=
dir
=
name
=
ver
=
apk
=
datadir
=
size
=
getpkgver
||
return
1
mkdir
-p
"
$PKGDEST
"
if
[
"
$arch
"
!=
"noarch"
]
&&
!
options_has
"!tracedeps"
;
then
...
...
@@ -1012,11 +1020,13 @@ create_apks() {
dir
=
"
${
file
%/.PKGINFO
}
"
name
=
$(
pkginfo_val pkgname
$file
)
ver
=
$(
pkginfo_val pkgver
$file
)
size
=
$(
pkginfo_val size
$file
| human_size
)
apk
=
$name
-
$ver
.apk
datadir
=
"
$pkgbasedir
"
/
$name
subpkgname
=
$name
trace_apk_deps
"
$name
"
"
$dir
"
||
return
1
msg
"Package size:
${
size
}
"
msg
"Compressing data..."
(
cd
"
$datadir
"
...
...
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