Kaydet (Commit) fb86ce5c authored tarafından aaaaa's avatar aaaaa

fixes vol2

üst 237b8e57
......@@ -2,27 +2,17 @@ DESTDIR=/
all: clean build
build: buildmo
mkdir -p build/usr/lib/ || true
cp -prfv live-installer build/usr/lib/
build:
mkdir -p build/usr/local/lib/ || true
cp -prfv live-installer build/usr/local/lib/
#set parmissions
chmod 755 -R build
chown root -R build
buildmo:
mkdir -p build/usr/share/ || true
@echo "Building the mo files"
# WARNING: the second sed below will only works correctly with the languages that don't contain "-"
for file in `ls po/*.po`; do \
lang=`echo $$file | sed 's@po/@@' | sed 's/\.po//' | sed 's/live-installer-//'`; \
install -d build/usr/share/live-installer/locale/$$lang/LC_MESSAGES/; \
msgfmt -o build/usr/share/live-installer/locale/$$lang/LC_MESSAGES/live-installer.mo $$file; \
done \
install:
cp -prfv build/* $(DESTDIR)/
uninstall:
rm -rf $(DESTDIR)//usr/lib/live-installer
rm -rf $(DESTDIR)//usr/local/lib/live-installer
clean:
rm -rf build
......@@ -38,6 +38,7 @@ done
for item in msgfmt install python3 chown chmod
do
is_exists $item
done
sed -i "s|@prefix@|$prefix|g" Makefile.ac
echo -e " Prefix: $prefix"
echo -e " Locale-Support: $nsl"
......
......@@ -87,14 +87,14 @@ def get_disks():
if str(type) == "b'disk" and device not in exclude_devices:
# convert size to manufacturer's size for show, e.g. in GB, not GiB!
unit_index = 'BKMGTPEZY'.index(size.upper()[-1])
l10n_unit = [_('B'), _('kB'), _('MB'), _('GB'), _(
l10n_unit = [('B'), ('kB'), ('MB'), ('GB'), (
'TB'), 'PB', 'EB', 'ZB', 'YB'][unit_index]
size = "%s %s" % (
str(int(float(size[:-1]) * (1024/1000)**unit_index)), l10n_unit)
model = model.replace("\\x20", " ")
description = '{} ({})'.format(model.strip(), size)
if int(removable):
description = _('Removable:') + ' ' + description
description = ('Removable:') + ' ' + description
disks.append((device, description))
except Exception as detail:
print("Could not parse blkid output: %s (%s)" % (line, detail))
......@@ -432,7 +432,7 @@ def full_disk_format(device, create_boot=False, create_swap=True):
def to_human_readable(size):
for unit in [' ', _('kB'), _('MB'), _('GB'), _('TB'), 'PB', 'EB', 'ZB', 'YB']:
for unit in [' ', ('kB'), ('MB'), ('GB'), ('TB'), 'PB', 'EB', 'ZB', 'YB']:
if size < 1000:
return "{:.1f} {}".format(size, unit)
size /= 1000
......@@ -481,12 +481,12 @@ class Partition(object):
parted.PARTITION_RAID: 'RAID',
parted.PARTITION_PALO: 'PALO',
parted.PARTITION_PREP: 'PReP',
parted.PARTITION_LOGICAL: _('Logical partition'),
parted.PARTITION_EXTENDED: _('Extended partition'),
parted.PARTITION_FREESPACE: _('Free space'),
parted.PARTITION_LOGICAL: ('Logical partition'),
parted.PARTITION_EXTENDED: ('Extended partition'),
parted.PARTITION_FREESPACE: ('Free space'),
parted.PARTITION_HPSERVICE: 'HP Service',
parted.PARTITION_MSFT_RESERVED: 'MSFT Reserved',
}.get(partition.type, _('Unknown'))
}.get(partition.type, ('Unknown'))
self.style = {
parted.PARTITION_SWAP: 'swap',
parted.PARTITION_FREESPACE: 'freespace',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment