Link Here
|
13 |
# and to support .directory files |
13 |
# and to support .directory files |
14 |
# modified by Frederic Crozat <fcrozat@mandrakesoft.com> Aug 07 2001 use new mimetype keyword for Mdk 8.1 |
14 |
# modified by Frederic Crozat <fcrozat@mandrakesoft.com> Aug 07 2001 use new mimetype keyword for Mdk 8.1 |
15 |
# modified by Laurent Montel <lmontel@mandrakesoft.com> Fri Aug 10 2001 init icon variable some desktop |
15 |
# modified by Laurent Montel <lmontel@mandrakesoft.com> Fri Aug 10 2001 init icon variable some desktop |
16 |
# modified by Sergey V Turchin <lzerg@altlinux.org> Tue Mar 9 2004 to adopt for freedesktop |
16 |
# modified by Sergey V Turchin <zerg@altlinux.org> Tue Mar 9 2004 to |
17 |
# file doesn't have icon |
17 |
# adopt for freedesktop file doesn't have icon |
|
|
18 |
# modified by php-coder <php-coder@altlinux.org> Tue Sep 13 2005 to |
19 |
# small fixes and changed output format |
18 |
|
20 |
|
19 |
(($#ARGV == 3) or ($#ARGV == 4) or ($#ARGV == 5)) or die "E: You gave me $#ARGV parameters. This script must be invoked with parameters: <package> <section> <file_in> <file_out> [requires] [title]\n"; |
21 |
(($#ARGV == 3) or ($#ARGV == 4) or ($#ARGV == 5)) or die "E: You gave me $#ARGV parameters. This script must be invoked with parameters: <package> <section> <file_in> <file_out> [requires] [title]\n"; |
20 |
|
22 |
|
Link Here
|
32 |
($requires eq "text") or ($requires eq "x11") or ($requires eq "kde") or ($requires eq "gnome") or print "W: requires is $requires (e.g. not text nor x11 nor kde nor gnome)\n"; |
34 |
($requires eq "text") or ($requires eq "x11") or ($requires eq "kde") or ($requires eq "gnome") or print "W: requires is $requires (e.g. not text nor x11 nor kde nor gnome)\n"; |
33 |
|
35 |
|
34 |
my $debug = 1; |
36 |
my $debug = 1; |
35 |
open (MDKVERSION,"/etc/altlinux-release") or die "Can't open /etc/altlinux-release"; |
37 |
open (ALTVERSION,"/etc/altlinux-release") or die "Can't open /etc/altlinux-release"; |
36 |
while (<MDKVERSION>) |
38 |
while (<ALTVERSION>) |
37 |
{ |
39 |
{ |
38 |
chomp; |
40 |
chomp; |
39 |
if (/\S+\s+\S+\s+\S+\s+(\S+)/) { |
41 |
if (/\S+\s+\S+\s+\S+\s+(\S+)/) { |
40 |
$mdk_version = $1; |
42 |
$mdk_version = $1; |
41 |
} |
43 |
} |
42 |
} |
44 |
} |
43 |
close (MDKVERSION); |
45 |
close (ALTVERSION); |
44 |
open (INPUT, $ARGV[2]) or die "Can't open $ARGV[2]!\n"; |
46 |
open (INPUT, $ARGV[2]) or die "Can't open $ARGV[2]!\n"; |
45 |
open (OUTPUT, ">$ARGV[3]") or die "Can't open $ARGV[3]!\n"; |
47 |
open (OUTPUT, ">$ARGV[3]") or die "Can't open $ARGV[3]!\n"; |
46 |
|
48 |
|
Link Here
|
49 |
next if (/^\s*#/); # Ignore comments |
51 |
next if (/^\s*#/); # Ignore comments |
50 |
next if (/^\s*$/); # Ignore void lines |
52 |
next if (/^\s*$/); # Ignore void lines |
51 |
chomp; # Remove trailing slash |
53 |
chomp; # Remove trailing slash |
52 |
if (m/^([^=]+)\s*=(.*)/) # Line of the form Key = Value ? |
54 |
if (m/^([^=]+)\s*=(.+)/) # Line of the form Key = Value ? |
53 |
{ |
55 |
{ |
54 |
$key = $1; |
56 |
$key = $1; |
55 |
$value = $2; |
57 |
$value = $2; |
Link Here
|
125 |
# if ($mdk_version >= 8.1) { |
127 |
# if ($mdk_version >= 8.1) { |
126 |
if (1) { |
128 |
if (1) { |
127 |
$_ = $command; |
129 |
$_ = $command; |
128 |
if ( $requires == "text" or $requires == "x11" ) { |
130 |
if ( $requires eq "text" or $requires eq "x11" ) { |
129 |
if (/.*%u.*/) { |
131 |
if (/.*%u.*/) { |
130 |
$accept_url = "true"; |
132 |
$accept_url = "true"; |
131 |
$multiple_files = "false"; |
133 |
$multiple_files = "false"; |
Link Here
|
167 |
} |
169 |
} |
168 |
|
170 |
|
169 |
# Ok, we've got all the info, write the menu file. |
171 |
# Ok, we've got all the info, write the menu file. |
170 |
print OUTPUT "?package($package_name): needs=\"$requires\" extra_filename=\"$extra_filename\" section=\"$section\"". |
172 |
print OUTPUT "?package($package_name):\\\n\tneeds=\"$requires\" \\\n\textra_filename=\"$extra_filename\" \\\n\tsection=\"$section\" \\\n\ttitle=\"$name\" \\\n"; |
171 |
" title=\"$name\" icon=\"$icon.png\""; |
173 |
defined $icon and print OUTPUT "\ticon=\"$icon.png\" \\\n"; |
172 |
defined $command and print OUTPUT " command=\"$command\""; |
174 |
defined $command and print OUTPUT "\tcommand=\"$command\" \\\n"; |
173 |
defined $command and print OUTPUT " genericname=\"$genericname\""; |
175 |
defined $genericname print OUTPUT "\tgenericname=\"$genericname\" \\\n"; |
174 |
defined $comment and print OUTPUT " longtitle=\"$comment\""; |
176 |
defined $comment and print OUTPUT "\tlongtitle=\"$comment\" \\\n"; |
175 |
#if ($mdk_version >= 8.1) { |
177 |
defined $mimetype and print OUTPUT "\tmimetypes=\"$mimetype\" \\\n"; |
176 |
if (1) { |
178 |
defined $command and print OUTPUT "\thints=\"$hint\" \\\n"; |
177 |
defined $mimetype and print OUTPUT " mimetypes=\"$mimetype\""; |
179 |
defined $multiple_files and print OUTPUT "\tmultiple_files=\"$multiple_files\" \\\n"; |
178 |
defined $command and print OUTPUT " hints=\"$hint\""; |
180 |
defined $accept_url and print OUTPUT "\taccept_url=\"$accept_url\" \\\n"; |
179 |
defined $multiple_files and print OUTPUT " multiple_files=\"$multiple_files\""; |
181 |
defined $mimetype and print OUTPUT "\textra_mimetype=\"$mimetype\" \\\n"; |
180 |
defined $accept_url and print OUTPUT " accept_url=\"$accept_url\""; |
182 |
|
181 |
} |
183 |
print OUTPUT "\textra_opt=\"$extra_opt\""; |
182 |
else { |
|
|
183 |
defined $mimetype and print OUTPUT " extra_mimetype=\"$mimetype\""; |
184 |
} |
185 |
print OUTPUT " extra_opt=\"$extra_opt\""; |
186 |
close(OUTPUT); |
184 |
close(OUTPUT); |