Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
4e3dc8c1
Kaydet (Commit)
4e3dc8c1
authored
Haz 03, 2016
tarafından
David Tardon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
remove use of Archive::Zip
Change-Id: I7c1e0057c3c1c0b6be524d1e9ad37357259ebd7c
üst
c3393443
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
43 deletions
+48
-43
README.Solaris
README.Solaris
+0
-2
configure.ac
configure.ac
+1
-5
packimages.pl
solenv/bin/packimages.pl
+47
-36
No files found.
README.Solaris
Dosyayı görüntüle @
4e3dc8c1
...
...
@@ -20,8 +20,6 @@ sudo -s
pkg install git make gcc-45 autoconf autogen automake-110 gnu-m4
perl -MCPAN -e 'install Archive::Zip::Archive'
pkg install pkg:/system/header@0.5.11-0.175.0.0.0.2.1
pkg install pkg:/developer/gperf@3.0.3-0.175.0.0.0.2.537
pkg install pkg:/developer/parser/bison@2.3-0.175.0.0.0.2.537
...
...
configure.ac
Dosyayı görüntüle @
4e3dc8c1
...
...
@@ -5122,15 +5122,11 @@ dnl Testing for required Perl modules
dnl ===================================================================
AC_MSG_CHECKING([for required Perl modules])
if `$PERL -e 'use
Archive::Zip; use
Cwd; use Digest::MD5'>/dev/null 2>&1`; then
if `$PERL -e 'use Cwd; use Digest::MD5'>/dev/null 2>&1`; then
AC_MSG_RESULT([all modules found])
else
AC_MSG_RESULT([failed to find some modules])
# Find out which modules are missing.
missing_perl_modules=
if ! `$PERL -e 'use Archive::Zip;'>/dev/null 2>&1`; then
missing_perl_modules=Archive::Zip
fi
if ! `$PERL -e 'use Cwd;'>/dev/null 2>&1`; then
missing_perl_modules="$missing_perl_modules Cwd"
fi
...
...
solenv/bin/packimages.pl
Dosyayı görüntüle @
4e3dc8c1
...
...
@@ -27,9 +27,10 @@ use strict;
use
Getopt::
Long
;
use
File::
Find
;
use
File::
Basename
;
use
File::
Copy
qw(copy)
;
use
File::
Path
qw(make_path)
;
require
File::
Temp
;
use
File::
Temp
();
use
Archive::
Zip
qw(:ERROR_CODES :CONSTANTS)
;
#### globals ####
...
...
@@ -91,7 +92,8 @@ remove_links_from_zip_list($zip_hash_ref, \%links);
$do_rebuild
=
is_file_newer
(
$zip_hash_ref
)
if
$do_rebuild
==
0
;
if
(
$do_rebuild
==
1
)
{
create_zip_archive
(
$zip_hash_ref
,
\%
links
);
my
$tmpdir
=
copy_images
(
$zip_hash_ref
);
create_zip_archive
(
$zip_hash_ref
,
\%
links
,
$tmpdir
);
replace_file
(
$tmp_out_file
,
$out_file
);
print_message
(
"packing $out_file finished."
)
if
$verbose
;
}
else
{
...
...
@@ -351,40 +353,50 @@ sub optimize_zip_layout($)
return
@sorted
;
}
sub
c
reate_zip_archive
sub
c
opy_images
($)
{
my
$zip_hash_ref
=
shift
;
my
$links_hash_ref
=
shift
;
my
(
$zip_hash_ref
)
=
@_
;
my
$dir
=
File::
Temp
->
newdir
();
foreach
(
keys
%
$zip_hash_ref
)
{
my
$path
=
$zip_hash_ref
->
{
$_
}
.
"/$_"
;
my
$outpath
=
$dir
.
"/$_"
;
print_message
(
"copying '$path' to '$outpath' ..."
)
if
$extra_verbose
;
if
(
-
e
$path
)
{
my
$dirname
=
dirname
(
$outpath
);
if
(
!-
d
$dirname
)
{
make_path($dirnam
e
);
}
copy
(
$path
,
$outpath
)
or
print_error
(
"can't add file '$path' to image dir: $!"
,
5
);
}
}
return
$dir
;
}
sub
create_zip_archive
($$$)
{
my
(
$zip_hash_ref
,
$links_hash_ref
,
$image_dir_ref
)
=
@_
;
print_message
(
"creating image archive ..."
)
if
$verbose
;
my
$zip
=
Archive::
Zip
->
new
();
my
$linktmp
;
chdir
$image_dir_ref
;
if
(
keys
%
{
$links_hash_ref
})
{
$linktmp
=
write_links
(
$links_hash_ref
);
my
$member
=
$zip
->
addFile
(
$linktmp
->
filename
,
"links.txt"
,
COMPRESSION_DEFLATED
);
if
(
!
$member
)
{
print_error
(
"failed to add links file: $!"
,
5
);
}
write_links
(
$links_hash_ref
,
$image_dir_ref
);
system
"zip $tmp_out_file links.txt"
;
# print_error("failed to add links file: $!", 5);
}
# FIXME: test - $member = addfile ... $member->desiredCompressionMethod( COMPRESSION_STORED );
# any measurable performance win/loss ?
foreach
(
optimize_zip_layout
(
$zip_hash_ref
)
)
{
my
$path
=
$zip_hash_ref
->
{
$_
}
.
"/$_"
;
print_message
(
"zipping '$path' ..."
)
if
$extra_verbose
;
if
(
-
e
$path
)
{
my
$member
=
$zip
->
addFile
(
$path
,
$_
,
COMPRESSION_STORED
);
if
(
!
$member
)
{
print_error
(
"can't add file '$path' to image zip archive: $!"
,
5
);
}
}
my
@sorted_list
=
optimize_zip_layout
(
$zip_hash_ref
);
my
$sorted_file
=
File::
Temp
->
new
();
foreach
my
$item
(
@sorted_list
)
{
print
$sorted_file
"$item\n"
;
}
my
$status
=
$zip
->
writeToFileNamed
(
$tmp_out_file
);
if
(
$status
!=
AZ_OK
)
{
print_error
(
"write image zip archive '$tmp_out_file' failed. Reason: $status"
,
6
)
;
}
return
;
binmode
$sorted_file
;
# flush
system
"cat $sorted_file | zip -0 -@ $tmp_out_file"
;
# print_error("write image zip archive '$tmp_out_file' failed. Reason: $!", 6);
chdir
;
# just go out of the temp dir
}
sub
replace_file
...
...
@@ -486,18 +498,17 @@ sub read_links($$)
close
(
$fh
);
}
# write out the links
to a tmp file
sub
write_links
($)
# write out the links
sub
write_links
($
$
)
{
my
$links
=
shift
;
my
$tmp
=
File::
Temp
->
new
(
TEMPLATE
=>
"linksXXXXXXX"
);
$tmp
||
die
"can't create tmp: $!
"
;
my
(
$links
,
$out_dir_ref
)
=
@_
;
open
(
my
$fh
,
">"
,
"$out_dir_ref/links.txt"
)
||
die
"can't create links.txt
"
;
for
my
$missing
(
sort
keys
%
{
$links
})
{
my
$line
=
$missing
.
" "
.
$links
->
{
$missing
}
.
"\n"
;
print
$
tmp
$line
;
print
$
fh
$line
;
}
binmode
$tmp
;
# force flush
return
$tmp
;
close
$fh
;
}
# Ensure that no link points to another link
...
...
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