1
0
mirror of https://github.com/jordansissel/fpm synced 2025-04-29 14:58:00 +02:00

Merge a53e09e711252f4fdffb5c9582eff59ed017252b into 08dc21b8f1f09af0a975dad144f8b6ffb535ffd7

This commit is contained in:
Elan Ruusamäe 2025-01-29 13:47:10 +00:00 committed by GitHub
commit e6e2ff30bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -10,8 +10,11 @@ require 'digest/sha1'
# Support for Alpine packages (.apk files)
#
# https://wiki.alpinelinux.org/wiki/Alpine_package_format
# https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package
#
# This class supports both input and output of packages.
class FPM::Package::APK< FPM::Package
class FPM::Package::APK < FPM::Package
TAR_CHUNK_SIZE = 512
TAR_TYPEFLAG_OFFSET = 156
@ -127,7 +130,7 @@ class FPM::Package::APK< FPM::Package
pkginfo << "arch = #{architecture()}\n"
pkginfo << "pkgdesc = #{description()}\n"
pkginfo << "url = #{url()}\n"
pkginfo << "size = 102400\n" # totally magic, not sure what it's used for.
pkginfo << "size = #{installed_size()}\n"
# write depends lines
for dependency in dependencies()
@ -137,6 +140,16 @@ class FPM::Package::APK< FPM::Package
File.write("#{base_path}/.PKGINFO", pkginfo)
end
def installed_size()
total = 0
Find.find(staging_path) do |path|
stat = File.lstat(path)
next if stat.directory?
total += stat.size
end
total
end
# Writes each control script from template into the build path,
# in the folder given by [base_path]
def write_control_scripts(base_path)