version 1.24, 2001/11/29 19:00:56
|
version 1.25, 2001/12/01 16:51:07
|
Line 49 Only the 1st argument is mandatory for t
|
Line 49 Only the 1st argument is mandatory for t
|
Example: |
Example: |
|
|
cat ../../doc/loncapafiles.lpml |\\ |
cat ../../doc/loncapafiles.lpml |\\ |
perl lpml_parse.pl html default /home/sherbert/loncapa /tmp/install |
perl lpml_parse.pl html development default /home/sherbert/loncapa /tmp/install |
END |
END |
|
|
# ------------------------------------------------- Grab command line arguments |
# ------------------------------------------------- Grab command line arguments |
Line 198 my $category_att_name;
|
Line 198 my $category_att_name;
|
my $category_att_type; |
my $category_att_type; |
my $chown; |
my $chown; |
my $chmod; |
my $chmod; |
|
my $abbreviation; # space-free abbreviation; esp. for image names |
my $rpm; |
my $rpm; |
my $rpmSummary; |
my $rpmSummary; |
my $rpmName; |
my $rpmName; |
Line 255 $parser->{textify}={
|
Line 256 $parser->{textify}={
|
sourceroot => \&format_sourceroot, |
sourceroot => \&format_sourceroot, |
categories => \&format_categories, |
categories => \&format_categories, |
category => \&format_category, |
category => \&format_category, |
|
abbreviation => \&format_abbreviation, |
targetdir => \&format_targetdir, |
targetdir => \&format_targetdir, |
chown => \&format_chown, |
chown => \&format_chown, |
chmod => \&format_chmod, |
chmod => \&format_chmod, |
Line 339 sub format_lpml {
|
Line 341 sub format_lpml {
|
$lpml=<<END; |
$lpml=<<END; |
<html> |
<html> |
<head> |
<head> |
<title>LPML Description Page (dist=$dist, $date)</title> |
<title>LPML Description Page |
|
(dist=$dist, categorytype=$categorytype, $date)</title> |
</head> |
</head> |
<body> |
<body> |
END |
END |
$lpml .= "<br /><font size='+2'>LPML Description Page (dist=$dist, ". |
$lpml .= "<br /><font size='+2'>LPML Description Page (dist=$dist, ". |
"$date)". |
"categorytype=$categorytype, $date)". |
"</font>"; |
"</font>"; |
$lpml .=<<END; |
$lpml .=<<END; |
<ul> |
<ul> |
Line 453 sub format_categories {
|
Line 456 sub format_categories {
|
"\n<a name='ownperms'>". |
"\n<a name='ownperms'>". |
"\n<font size='+2'>File Type Ownership and Permissions". |
"\n<font size='+2'>File Type Ownership and Permissions". |
" Descriptions</font>". |
" Descriptions</font>". |
"\n<table>\n". |
"\n<p>This table shows what permissions and ownership settings ". |
"<br />\n$text\n". |
"correspond to each category.</p>". |
|
"\n<table border='1' cellpadding='5' width='60%'>\n". |
|
"<tr>". |
|
"<th align='left' bgcolor='#ffffff'>Icon</th>". |
|
"<th align='left' bgcolor='#ffffff'>Category Name</th>". |
|
"<th align='left' bgcolor='#ffffff'>Permissions ". |
|
"($categorytype)</th>". |
|
"</tr>". |
|
"\n$text\n". |
"</table>\n"; |
"</table>\n"; |
} |
} |
elsif ($mode eq 'text') { |
elsif ($mode eq 'text') { |
return $categories="\n". |
return $categories="\n". |
"\nFile Type Ownership and Permissions". |
"\nFile Type Ownership and Permissions". |
" Descriptions". |
" Descriptions". |
|
"\n$text". |
"\n"; |
"\n"; |
} |
} |
else { |
else { |
Line 472 sub format_category {
|
Line 484 sub format_category {
|
my (@tokeninfo)=@_; |
my (@tokeninfo)=@_; |
$category_att_name=$tokeninfo[2]->{'name'}; |
$category_att_name=$tokeninfo[2]->{'name'}; |
$category_att_type=$tokeninfo[2]->{'type'}; |
$category_att_type=$tokeninfo[2]->{'type'}; |
$chmod='';$chown=''; |
$abbreviation=''; $chmod='';$chown=''; |
$parser->get_text('/category'); |
$parser->get_text('/category'); |
$parser->get_tag('/category'); |
$parser->get_tag('/category'); |
if ($mode eq 'html') { |
if ($mode eq 'html') { |
return $category="\n<br />CATEGORY $category_att_name ". |
if ($category_att_type eq $categorytype) { |
"$category_att_type $chmod $chown"; |
return $category="<tr>". |
|
"<td><img src='$abbreviation.gif' ". |
|
"alt='${category_att_name}' /></td>\n". |
|
"<td>${category_att_name}</td>\n". |
|
"<td>$chmod $chown</td>\n". |
|
"</tr>". |
|
"\n"; |
|
# return $category="\n<br />CATEGORY $category_att_name ". |
|
# "$category_att_type $chmod $chown"; |
|
} |
} |
} |
else { |
else { |
if ($category_att_type eq $categorytype) { |
if ($category_att_type eq $categorytype) { |
Line 488 sub format_category {
|
Line 509 sub format_category {
|
return ''; |
return ''; |
} |
} |
} |
} |
|
# --------------------------------------------------- Format categories section |
|
sub format_abbreviation { |
|
my @tokeninfo=@_; |
|
$abbreviation=''; |
|
my $text=&trim($parser->get_text('/abbreviation')); |
|
if ($text) { |
|
$parser->get_tag('/abbreviation'); |
|
$abbreviation=$text; |
|
} |
|
return ''; |
|
} |
# -------------------------------------------------------- Format chown section |
# -------------------------------------------------------- Format chown section |
sub format_chown { |
sub format_chown { |
my @tokeninfo=@_; |
my @tokeninfo=@_; |
Line 682 sub format_rpmAutoReqProv {
|
Line 714 sub format_rpmAutoReqProv {
|
sub format_rpmdescription { |
sub format_rpmdescription { |
my $text=$parser->get_text('/rpmdescription'); |
my $text=$parser->get_text('/rpmdescription'); |
$parser->get_tag('/rpmdescription'); |
$parser->get_tag('/rpmdescription'); |
$text=~s/\n//g; |
|
$text=~s/\\n/\n/g; |
|
if ($mode eq 'html') { |
if ($mode eq 'html') { |
|
$text=~s/\n//g; |
|
$text=~s/\\n/\n/g; |
return $rpmdescription="\nDescription : $text"; |
return $rpmdescription="\nDescription : $text"; |
} |
} |
elsif ($mode eq 'text') { |
elsif ($mode eq 'text') { |
|
$text=~s/\n//g; |
|
$text=~s/\\n/\n/g; |
return $rpmdescription="\nDescription : $text"; |
return $rpmdescription="\nDescription : $text"; |
} |
} |
else { |
else { |