summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-07-26 16:56:09 +0100
committerMichael Meeks <michael.meeks@suse.com>2013-07-26 17:00:30 +0100
commita44a1b4396e4591bd9e3e5806ec0ee1cbbdf4cc5 (patch)
treed423c0af4034220c666d2cc6c8646b691f7d2d2e /solenv
parent5d071dda3701289ad73c786446ba2e054e74a388 (diff)
Various fixes for icon theme link files.
Don't package icons we have links for instead. Also check that links don't point to themselves or other links. Also warn if we have links to files that are not mentioned in the filelists. Also check that links have targets packed and warn if not. Change-Id: I9e69340432b7289e49c854fecd4944ae459acc75
Diffstat (limited to 'solenv')
-rw-r--r--solenv/bin/packimages.pl36
1 files changed, 36 insertions, 0 deletions
diff --git a/solenv/bin/packimages.pl b/solenv/bin/packimages.pl
index 556af2c5fe10..3e7015bba2ed 100644
--- a/solenv/bin/packimages.pl
+++ b/solenv/bin/packimages.pl
@@ -73,8 +73,11 @@ read_links(\%links, $global_path);
for my $path (@custom_path) {
read_links(\%links, $path);
}
+check_links(\%links);
my $zip_hash_ref = create_zip_list($global_hash_ref, $module_hash_ref, $custom_hash_ref);
+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);
@@ -491,3 +494,36 @@ sub write_links($)
binmode $tmp; # force flush
return $tmp;
}
+
+# Ensure that no link points to another link
+sub check_links($)
+{
+ my $links = shift;
+
+ for my $link (keys %{$links}) {
+ my $value = $links->{$link};
+ if (defined $links->{$value}) {
+ die "Link to another link: $link -> $value -> " . $links->{$value};
+ }
+ }
+}
+
+# remove any files from our zip list that are linked
+sub remove_links_from_zip_list($$)
+{
+ my $zip_hash_ref = shift;
+ my $links = shift;
+ for my $link (keys %{$links}) {
+ if (defined $zip_hash_ref->{$link}) {
+ delete $zip_hash_ref->{$link};
+ } else {
+ print STDERR "Note: redundant '$link' -> '" .
+ $links->{$link} . "' not found in filelist\n";
+ }
+ my $target = $links->{$link};
+ if (!defined $zip_hash_ref->{$target}) {
+ print STDERR "Warning: link '$link' to missing icon '" .
+ $links->{$link} . "'\n";
+ }
+ }
+}