software/ 0000755 0005671 0000012 00000000000 11205635233 012370 5 ustar jcameron wheel software/config.info.uk_UA 0000664 0005671 0000012 00000000265 11205635233 015522 0 ustar jcameron wheel package_system= ,1,rpm-RPM,pkgadd-Solaris,hpux-HPUX,freebsd-FreeBSD,slackware-Slackware,debian-Debian,aix-AIX,emerge-Gentoo
line2= ,11
software/config.info.tr 0000644 0005671 0000012 00000000172 11205635233 015136 0 ustar jcameron wheel package_system=Paket ynetim sistemi,1,rpm-RPM,pkgadd-Solaris,hpux-HPUX,freebsd-FreeBSD,slackware-Slackware,debian-Debian
software/file_info.cgi 0000755 0005671 0000012 00000004125 11205635233 015013 0 ustar jcameron wheel #!/usr/local/bin/perl
# file_info.cgi
# Display information about a file owned by the package management system
require './software-lib.pl';
&ReadParse();
$f = $in{'file'};
&ui_print_header(undef, $text{'file_title'}, "", "file_info");
$f =~ s/\/$//;
if ($f !~ /^\//) {
# if the filename is not absolute, look for it
foreach $p (split(/:/, $ENV{'PATH'})) {
last if (&installed_file("$p/$f"));
}
}
else {
# absolute path.. must exist in DB
&installed_file($f);
}
if (!%file) {
print "",&text('file_notfound', "$f "),"
\n";
}
else {
# display file info
$nc = "width=10% nowrap";
print &ui_table_start($text{'file_title'}, "width=100%", 4);
print &ui_table_row($text{'file_path'},
"".&html_escape($file{'path'})." ", 3);
print &ui_table_row($text{'file_type'},
$type_map[$file{'type'}]);
if ($file{'type'} != 3 && $file{'type'} != 4) {
print &ui_table_row($text{'file_perms'}, $file{'mode'});
print &ui_table_row($text{'file_owner'}, $file{'user'});
print &ui_table_row($text{'file_group'}, $file{'group'});
if ($file{'type'} == 0) {
print &ui_table_row($text{'file_size'}, $file{'size'});
}
}
else {
print &ui_table_row($text{'file_link'},
"".&html_escape($file{'link'})." ", 3);
}
print &ui_table_end();
# Show packages containing the file (usually only one)
print &ui_columns_start([ $text{'file_pack'},
$text{'file_class'},
$text{'file_desc'} ], 100);
@pkgs = split(/\s+/, $file{'packages'});
@vers = split(/\s+/, $file{'versions'});
$n = &list_packages(@pkgs);
for($j=0; $j<@pkgs; $j++) {
for($i=0; $i<$n; $i++) {
next if ($vers[$i] &&
$packages{$i,'version'} ne $vers[$j] ||
$packages{$i,'name'} ne $pkgs[$j]);
local @cols;
push(@cols, "$pkgs[$j] ");
$c = $packages{$i,'class'};
push(@cols, $c || $text{'file_none'});
push(@cols, $packages{$i,'desc'});
print &ui_columns_row(\@cols);
}
}
print &ui_columns_end();
}
&ui_print_footer("", $text{'index_return'});
software/software-lib.pl 0000755 0005671 0000012 00000015314 11205635233 015332 0 ustar jcameron wheel # software-lib.pl
# A generalized system for package management on solaris, linux, etc..
BEGIN { push(@INC, ".."); };
use WebminCore;
&init_config();
$heiropen_file = "$module_config_directory/heiropen";
# Use the appropriate function set for whatever package management system
# we are using.
do "$config{package_system}-lib.pl";
if ($config{'update_system'} eq '*') {
# User specifically doesn't want any
$update_system = undef;
}
elsif ($config{'update_system'}) {
# User-specified system
$update_system = $config{'update_system'};
}
else {
# Guess which update system we are using
if (&has_command($config{'apt_mode'} ? "aptitude" : "apt-get")) {
$update_system = "apt";
}
elsif (&has_command("yum") && -r "/etc/yum.conf") {
$update_system = "yum";
}
elsif (&has_command("up2date") && &has_command("rhn_check")) {
$update_system = "rhn";
}
elsif (-x "/opt/csw/bin/pkg-get" || &has_command("pkg-get") ||
-x "/opt/csw/bin/pkgutil" || &has_command("pkgutil")) {
$update_system = "csw";
}
elsif (&has_command("urpmi")) {
$update_system = "urpmi";
}
elsif (&has_command("emerge")) {
$update_system = "emerge";
}
elsif (&has_command("cupdate")) {
# not done yet!
}
}
if ($update_system) {
do $update_system."-lib.pl";
$has_update_system = 1;
}
# uncompress_if_needed(file, disposable)
# If some file needs to be uncompressed or ungzipped, do it and return the
# new temp file path. Otherwise, return the original path.
sub uncompress_if_needed
{
return $_[0] if (&is_readonly_mode()); # don't even bother
open(PFILE, $_[0]);
read(PFILE, $two, 2);
close(PFILE);
if ($two eq "\037\235") {
if (!&has_command("uncompress")) {
&unlink_file($_[0]) if ($_[1]);
&error($text{'soft_euncompress'});
}
local $temp = $_[0] =~ /\/([^\/]+)\.Z/i ? &tempname("$1")
: &tempname();
local $out = `uncompress -c $_[0] 2>&1 >$temp`;
unlink($_[0]) if ($_[1]);
if ($?) {
unlink($temp);
&error(&text('soft_euncmsg', $out));
}
return $temp;
}
elsif ($two eq "\037\213") {
if (!&has_command("gunzip")) {
unlink($_[0]) if ($_[1]);
&error($text{'soft_egzip'});
}
local $temp = $_[0] =~ /\/([^\/]+)\.gz/i ? &tempname("$1")
: &tempname();
local $out = `gunzip -c $_[0] 2>&1 >$temp`;
unlink($_[0]) if ($_[1]);
if ($?) {
unlink($temp);
&error(&text('soft_egzmsg', $out));
}
return $temp;
}
return $_[0];
}
# show_package_info(package, version, [no-installed-message])
sub show_package_info
{
@pinfo = &package_info($_[0], $_[1]);
return () if (!@pinfo);
print &ui_subheading(&text('do_success', $_[0])) if (!$_[2]);
print &ui_table_start($text{'edit_details'}, "width=100%", 4,
[ "width=20%", undef, "width=20%", undef ]);
# Package description
if ($pinfo[2]) {
$desc = &html_escape(&entities_to_ascii($pinfo[2]));
$desc =~ s/\r?\n/ /g;
print &ui_table_row($text{'edit_desc'}, "$desc ", 3);
}
# Name
print &ui_table_row($text{'edit_pack'}, &html_escape($pinfo[0]));
# Class, if any
print &ui_table_row($text{'edit_class'},
$pinfo[1] ? &html_escape($pinfo[1]) : $text{'edit_none'});
# Version number
print &ui_table_row($text{'edit_ver'},
&html_escape($pinfo[4]));
# Vendor
print &ui_table_row($text{'edit_vend'},
&html_escape(&entities_to_ascii($pinfo[5])));
# Architecture
print &ui_table_row($text{'edit_arch'},
&html_escape($pinfo[3]));
# Install date
print &ui_table_row($text{'edit_inst'},
&html_escape($pinfo[6]));
print &ui_table_end();
return @pinfo;
}
@type_map = ( $text{'soft_reg'}, $text{'soft_dir'}, $text{'soft_spec'},
$text{'soft_sym'}, $text{'soft_hard'}, $text{'soft_edit'} );
# get_heiropen()
# Returns an array of open categories
sub get_heiropen
{
open(HEIROPEN, $heiropen_file);
local @heiropen = ;
chop(@heiropen);
close(HEIROPEN);
return @heiropen;
}
# save_heiropen(&heir)
sub save_heiropen
{
&open_tempfile(HEIR, ">$heiropen_file");
foreach $h (@{$_[0]}) {
&print_tempfile(HEIR, $h,"\n");
}
&close_tempfile(HEIR);
}
# missing_install_link(package, description, return, return-desc)
# Returns HTML for installing some package that is missing, from the
# appropriate update system for this OS. Returns undef if automatic installation
# is not possible for some reason.
# Supported package names are :
# apache
# sendmail
# postfix
# squid
# procmail
# samba
# mysql
# postgresql
# clamav
# spamassassin
sub missing_install_link
{
local ($name, $desc, $return, $returndesc) = @_;
return undef if (!defined(&update_system_resolve));
return undef if (!&foreign_check($module_name));
local $pkg = &update_system_resolve($name);
return undef if (!$pkg);
local ($cpkg) = caller();
local $caller = eval '$'.$cpkg.'::module_name';
return &text('missing_link', $desc, "../$module_name/install_pack.cgi?source=3&update=".&urlize($pkg)."&return=".&urlize($return)."&returndesc=".&urlize($returndesc)."&caller=".&urlize($caller), $text{$update_system."_name"});
}
# update_system_button(field-name, label)
# Returns HTML for a button that opens the update system search window
sub update_system_button
{
local ($name, $label) = @_;
if (defined(&update_system_available) || defined(&update_system_search)) {
return " ";
}
return undef;
}
# compare_versions(ver1, ver2)
# Returns -1 if ver1 is older than ver2, 1 if newer, 0 if same
sub compare_versions
{
local @sp1 = split(/[\.\-]/, $_[0]);
local @sp2 = split(/[\.\-]/, $_[1]);
for(my $i=0; $i<@sp1 || $i<@sp2; $i++) {
local $v1 = $sp1[$i];
local $v2 = $sp2[$i];
local $comp;
if ($v1 =~ /^\d+$/ && $v2 =~ /^\d+$/) {
$comp = $v1 <=> $v2;
}
else {
$comp = $v1 cmp $v2;
}
return $comp if ($comp);
}
return 0;
}
# check_package_system()
# Returns an error message if some command needed by the selected package
# management system is missing.
sub check_package_system
{
local $err;
if (defined(&validate_package_system)) {
$err = &validate_package_system();
}
if (defined(&list_package_system_commands)) {
foreach my $c (&list_package_system_commands()) {
if (!&has_command($c)) {
$err ||= &text('index_epackagecmd', &package_system(),
"$c ");
}
}
}
return $err;
}
# check_update_system()
# Returns an error message if some command needed by the selected update
# system is missing.
sub check_update_system
{
return undef if (!$update_system);
local $err;
if (defined(&validate_update_system)) {
$err = &validate_update_system();
}
if (defined(&list_update_system_commands)) {
foreach my $c (&list_update_system_commands()) {
if (!&has_command($c)) {
$err ||= &text('index_eupdatecmd',
$text{$update_system.'_name'} || uc($update_system),
"$c ");
}
}
}
return $err;
}
1;
software/config-openmamba-linux 0000664 0005671 0000012 00000000060 11205635233 016650 0 ustar jcameron wheel package_system=rpm
update_system=apt
apt_mode=0
software/yum-lib.pl 0000775 0005671 0000012 00000010045 11205635233 014310 0 ustar jcameron wheel # yum-lib.pl
# Functions for installing packages with yum
$yum_config = $config{'yum_config'} || "/etc/yum.conf";
sub list_update_system_commands
{
return ("yum");
}
# update_system_install([package], [&in])
# Install some package with yum
sub update_system_install
{
local $update = $_[0] || $in{'update'};
local $in = $_[1];
local $enable;
if ($in->{'enablerepo'}) {
$enable = "enablerepo=".quotemeta($in->{'enablerepo'});
}
local (@rv, @newpacks);
print "",&text('yum_install', "yum $enable -y install $update ")," \n";
print "
";
&additional_log('exec', undef, "yum $enable -y install $update");
local $qm = join(" ", map { quotemeta($_) } split(/\s+/, $update));
&open_execute_command(CMD, "yum $enable -y install $qm ) {
s/\r|\n//g;
if (/^\[(update|install|deps):\s+(\S+)\s+/) {
push(@rv, $2);
}
elsif (/^(Installed|Dependency Installed|Updated|Dependency Updated):\s+(.*)/) {
local @pkgs = split(/\s+/, $2);
foreach my $p (@pkgs) {
if ($p !~ /:/ && $p =~ /^(\S+)\.(\S+)$/) {
my $pname = $1;
if ($p =~ /[^0-9\.\-\_i]/) {
push(@rv, $pname);
}
}
}
}
if (!/ETA/ && !/\%\s+done\s+\d+\/\d+\s*$/) {
print &html_escape($_."\n");
}
}
close(CMD);
print " \n";
if ($?) {
print "$text{'yum_failed'} \n";
return ( );
}
else {
print "$text{'yum_ok'}
\n";
return &unique(@rv);
}
}
# show_update_system_opts()
# Returns HTML for enabling a repository, if any are disabled
sub show_update_system_opts
{
local @pinfo = &package_info("yum");
if (&compare_versions($pinfo[4], "2.1.10") > 0) {
local $conf = &get_yum_config();
local @ena;
foreach my $r (@$conf) {
if ($r->{'values'}->{'enabled'} eq '0') {
push(@ena, $r->{'name'});
}
}
if (@ena) {
return $text{'yum_enable'}." ".
&ui_select("enablerepo", "",
[ [ "", $text{'yum_none'} ],
map { [ $_ ] } @ena ]);
}
}
return undef;
}
# update_system_form()
# Shows a form for updating all packages on the system
sub update_system_form
{
print &ui_subheading($text{'yum_form'});
print &ui_form_start("yum_upgrade.cgi");
print &ui_form_end([ [ undef, $text{'yum_apply'} ] ]);
}
# update_system_resolve(name)
# Converts a standard package name like apache, sendmail or squid into
# the name used by YUM.
sub update_system_resolve
{
local ($name) = @_;
return $name eq "apache" ? "httpd" :
$name eq "dhcpd" ? "dhcp" :
$name eq "mysql" ? "mysql mysql-server mysql-devel" :
$name eq "openssh" ? "openssh openssh-server" :
$name eq "postgresql" ? "postgresql postgresql-libs postgresql-server" :
$name eq "openldap" ? "openldap-servers openldap-clients" :
$name;
}
# update_system_available()
# Returns a list of package names and versions that are available from YUM
sub update_system_available
{
local @rv;
local %done;
&open_execute_command(PKG, "yum list", 1, 1);
while() {
next if (/^Setting\s+up/i);
if (/^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s*$/ ||
/^(\S+)\.(\S+)\s+(\S+)\s+(\S+)\s*$/) {
local $name = $1;
if ($done{$name}) {
# Seen twice - assume second is better
$done{$name}->{'version'} = $3;
$done{$name}->{'source'} = $4;
if ($done{$name}->{'version'} =~ s/^(\S+)://) {
$done{$name}->{'epoch'} = $1;
}
else {
$done{$name}->{'epoch'} = undef;
}
}
else {
# First occurrance
local $pkg = { 'name' => $1,
'arch' => $2,
'version' => $3,
'source' => $4 };
if ($pkg->{'version'} =~ s/^(\S+)://) {
$pkg->{'epoch'} = $1;
}
push(@rv, $pkg);
$done{$pkg->{'name'}} = $pkg;
}
}
}
close(PKG);
return @rv;
}
# get_yum_config()
# Returns entries from the YUM config file, as a list of hash references
sub get_yum_config
{
local @rv;
local $sect;
open(CONF, $yum_config);
while() {
s/\r|\n//g;
s/^\s*#.*$//;
if (/^\s*\[(.*)\]/) {
# Start of a section
$sect = { 'name' => $1,
'values' => { } };
push(@rv, $sect);
}
elsif (/^\s*(\S+)\s*=\s*(.*)/ && $sect) {
# Value in a section
$sect->{'values'}->{lc($1)} = $2;
}
}
close(CONF);
return \@rv;
}
1;
software/config-mandrake-linux 0000644 0005671 0000012 00000000036 11205635233 016474 0 ustar jcameron wheel package_system=rpm
apt_mode=0
software/log_parser.pl 0000775 0005671 0000012 00000002504 11205635233 015070 0 ustar jcameron wheel # log_parser.pl
# Functions for parsing this module's logs
do 'software-lib.pl';
# parse_webmin_log(user, script, action, type, object, ¶ms)
# Converts logged information from this module into human-readable form
sub parse_webmin_log
{
local ($user, $script, $action, $type, $object, $p, $long) = @_;
if ($action eq 'install') {
return &text("log_install_package", "$object ");
}
elsif ($action eq 'apt') {
local @p = split(/\0/, $p->{'packages'});
return &text($long || @p < 2 ? "log_${type}_apt_l" : "log_${type}_apt",
"".join(" ",@p)." ", scalar(@p));
}
elsif ($action eq 'rhn') {
local @p = @{$p->{'packages'}};
return &text($long || @p < 2 ? "log_${type}_rhn_l" : "log_${type}_rhn",
"".join(" ",@p)." ", scalar(@p));
}
elsif ($action eq "yum") {
local @p = @{$p->{'packages'}};
return &text($long || @p < 2 ? "log_${type}_yum_l" : "log_${type}_yum",
"".join(" ",@p)." ", scalar(@p));
}
elsif ($action eq "urpmi") {
return $text{'log_urpmi_'.$type};
}
elsif ($action eq 'delete') {
return &text('log_delete', "$object ");
}
elsif ($action eq 'deletes') {
local @p = split(/\0/, $p->{'packs'});
if ($long) {
return &text('log_deletes_l', "".join(" ", @p)." ");
}
else {
return &text('log_deletes', scalar(@p));
}
}
else {
return undef;
}
}
software/config-suse-linux 0000644 0005671 0000012 00000000036 11205635233 015671 0 ustar jcameron wheel package_system=rpm
apt_mode=0
software/edit_pack.cgi 0000755 0005671 0000012 00000002342 11205635233 015003 0 ustar jcameron wheel #!/usr/local/bin/perl
# edit_pack.cgi
# Displays the details of an existing package, with links to uninstall and
# other options
require './software-lib.pl';
&ReadParse();
@pinfo = &package_info($in{'package'}, $in{'version'});
$pinfo[0] || &error($text{'edit_egone'});
&ui_print_header(undef, $text{'edit_title'}, "", "edit_pack");
@pinfo = &show_package_info($in{'package'}, $in{'version'}, 1);
print "\n";
# Show button to list files, if supported
if (!$pinfo[8]) {
print &ui_form_start("list_pack.cgi");
print &ui_hidden("package", $pinfo[0]);
print &ui_hidden("version", $pinfo[4]);
print &ui_hidden("search", $in{'search'});
print "",&ui_submit($text{'edit_list'})," \n";
print &ui_form_end();
}
# Show button to un-install (if possible)
if (!$pinfo[7]) {
print &ui_form_start("delete_pack.cgi");
print &ui_hidden("package", $pinfo[0]);
print &ui_hidden("version", $pinfo[4]);
print &ui_hidden("search", $in{'search'});
print "",&ui_submit($text{'edit_uninst'})," \n";
print &ui_form_end();
}
print "
\n";
if ($in{'search'}) {
&ui_print_footer("search.cgi?search=$in{'search'}", $text{'search_return'});
}
else {
&ui_print_footer("tree.cgi#$pinfo[1]", $text{'index_treturn'});
}
software/delete_file.cgi.bak 0000775 0005671 0000012 00000000260 11205635233 016054 0 ustar jcameron wheel #!/usr/local/bin/perl
# delete_file.cgi
# Delete a downloaded package that is no longer needed
require './software-lib.pl';
&ReadParse();
unlink($in{'file'});
&redirect("");
software/config-slackware-linux 0000644 0005671 0000012 00000000044 11205635233 016665 0 ustar jcameron wheel package_system=slackware
apt_mode=0
software/config-freebsd 0000644 0005671 0000012 00000000042 11205635233 015164 0 ustar jcameron wheel package_system=freebsd
apt_mode=0
software/yum_upgrade.cgi 0000775 0005671 0000012 00000001602 11205635233 015401 0 ustar jcameron wheel #!/usr/local/bin/perl
# yum_upgrade.cgi
# Upgrade all packages
require './software-lib.pl';
&ReadParse();
&ui_print_unbuffered_header(undef, $text{'yum_upgrade'}, "");
&clean_environment();
$cmd = "yum -y update";
print "",&text('yum_upgradedesc', "$cmd ")," \n";
print "
";
&additional_log("exec", undef, $cmd);
open(CMD, "$cmd 2>&1 ) {
if (/^\[(update|install):\s+(\S+)\s+/) {
push(@packs, $2);
}
if (!/ETA/ && !/\%\s+done\s+\d+\/\d+\s*$/) {
print &html_escape($_);
}
}
close(CMD);
&reset_environment();
print " \n";
if ($?) {
print "$text{'yum_upgradefailed'} \n";
}
else {
print "$text{'yum_upgradeok'}
\n";
foreach $p (@packs) {
local @pinfo = &show_package_info($p);
}
&webmin_log("yum", "upgrade", undef, { 'packages' => \@packs })
if (@packs);
}
&ui_print_footer("", $text{'index_return'});
software/config-unixware 0000644 0005671 0000012 00000000041 11205635233 015413 0 ustar jcameron wheel package_system=pkgadd
apt_mode=0
software/config.info.zh_TW.Big5 0000644 0005671 0000012 00000000165 11205635233 016333 0 ustar jcameron wheel package_system=MztO,1,rpm-RPM,pkgadd-Solaris,hpux-HPUX,freebsd-FreeBSD,slackware-Slackware,debian-Debian
software/urpmi-lib.pl 0000775 0005671 0000012 00000004130 11205635233 014630 0 ustar jcameron wheel # urpmi-lib.pl
# Functions for installing packages with Mandrake urpmi
sub list_update_system_commands
{
return ("urpmi");
}
# update_system_install([package])
# Install some package with urpmi
sub update_system_install
{
local $update = $_[0] || $in{'update'};
local (@rv, @newpacks);
local $cmd = "urpmi --force --auto --media main";
print "",&text('urpmi_install', "$cmd $update "),"
\n";
print "
";
&additional_log('exec', undef, "$cmd $update");
local $qm = join(" ", map { quotemeta($_) } split(/\s+/, $update));
&open_execute_command(CMD, "$cmd $qm ) {
s/\r|\n//g;
if (/installing\s+(\S+)\s+from/) {
# Found a package
local $pkg = $1;
$pkg =~ s/\-\d.*//; # remove version
push(@rv, $pkg);
}
print &html_escape($_."\n");
}
close(CMD);
print " \n";
if ($?) {
print "$text{'urpmi_failed'} \n";
return ( );
}
else {
print "$text{'urpmi_ok'}
\n";
return &unique(@rv);
}
}
# update_system_form()
# Shows a form for updating all packages on the system
sub update_system_form
{
print &ui_subheading($text{'urpmi_form'});
print &ui_form_start("urpmi_upgrade.cgi");
print &ui_submit($text{'urpmi_update'}, "update")," \n";
print &ui_submit($text{'urpmi_upgrade'}, "upgrade")," \n";
print &ui_form_end();
}
# update_system_resolve(name)
# Converts a standard package name like apache, sendmail or squid into
# the name used by YUM.
sub update_system_resolve
{
local ($name) = @_;
return $name eq "apache" ? "apache2" :
$name eq "dhcpd" ? "dhcp-server" :
$name eq "mysql" ? "MySQL MySQL-client MySQL-common" :
$name eq "postgresql" ? "postgresql postgresql-server" :
$name;
}
# update_system_available()
# Returns a list of package names and versions that are available from URPMI
sub update_system_available
{
local @rv;
local %done;
&open_execute_command(PKG, "urpmq -f --list", 1, 1);
while() {
if (/^(\S+)\-(\d[^\-]*)\-([^\.]+)\.(\S+)/) {
next if ($done{$1,$2}++);
push(@rv, { 'name' => $1,
'version' => $2,
'release' => $3,
'arch' => $4 });
}
}
close(PKG);
return @rv;
}
software/delete_packs.cgi 0000755 0005671 0000012 00000003544 11205635233 015510 0 ustar jcameron wheel #!/usr/local/bin/perl
# delete_packs.cgi
# Ask if the user wants to delete multiple packages, and if so do it
# XXX logging
require './software-lib.pl';
&ReadParse();
&error_setup($text{'deletes_err'});
foreach $d (split(/\0/, $in{'del'})) {
local ($p, $v) = split(/\s/, $d);
local @pinfo;
(@pinfo = &package_info($p, $v)) ||
&error(&text('delete_epack', $p));
push(@packs, $p);
push(@vers, $v);
push(@infos, \@pinfo);
}
@packs || &error($text{'deletes_enone'});
&ui_print_header(undef, $text{'deletes_title'}, "", "delete");
if ($in{'sure'}) {
# do the deletion
print "\n";
if (defined(&delete_packages)) {
# Can just use one function
print &text('deletes_desc', "".join(" ", @packs)." "),
"
\n";
$error = &delete_packages(\@packs, \%in, \@vers);
if ($error) {
print "",&text('deletes_failed2', $error),"
\n";
}
else {
print "$text{'deletes_success2'}
\n";
}
}
else {
# Need to use a loop
for($i=0; $i<@packs; $i++) {
$error = &delete_package($packs[$i], \%in, $vers[$i]);
if ($error) {
print "",&text('deletes_failed1', "$packs[$i] ", $error)," \n";
}
else {
print &text('deletes_success1', "$packs[$i] ")," \n";
}
}
}
&webmin_log("deletes", "package", undef, { 'packs' => \@packs });
}
else {
# Ask if the user is sure..
print "
\n";
print &text('deletes_rusure', "".join(" ", @packs)." "),
"\n";
print &ui_form_start("delete_packs.cgi", "post");
foreach $d (split(/\0/, $in{'del'})) {
print &ui_hidden("del", $d);
}
print &ui_hidden("sure", 1);
print &ui_hidden("search", $in{'search'});
print &ui_submit($text{'deletes_ok'});
if (defined(&delete_options)) {
&delete_options($packs[0]);
}
print &ui_form_end(),"
\n";
}
&ui_print_footer("search.cgi?search=$in{'search'}", $text{'search_return'});
software/config.info.ru_RU 0000664 0005671 0000012 00000000263 11205635233 015550 0 ustar jcameron wheel package_system= ,1,rpm-RPM,pkgadd-Solaris,hpux-HPUX,freebsd-FreeBSD,slackware-Slackware,debian-Debian,aix-AIX,emerge-Gentoo
line2= ,11
software/slackware-lib.pl 0000755 0005671 0000012 00000015145 11205635233 015456 0 ustar jcameron wheel # slackware-lib.pl
# Functions for slackware package management
$package_dir = "/var/log/packages";
%class_map = ( 'a', 'Base Linux system',
'ap', 'Applications',
'd', 'Program development',
'des', 'Crypt library',
'e', 'GNU Emacs',
'f', 'FAQs and documentation',
'gtk', 'GTK+ and GNOME programs',
'k', 'Linux kernel source',
'kde', 'KDE desktop and programs',
'n', 'Networking',
't', 'TeX',
'tcl', 'TcL/Tk',
'xap', 'X applications',
'xd', 'X server development',
'xv', 'XView programs',
'y', 'Games' );
use POSIX;
chop($system_arch = `uname -m`);
sub validate_package_system
{
return -d &translate_filename($package_dir) ? undef :
&text('slack_edir', "$package_dir ");
}
# list_packages([package]*)
# Fills the array %packages with a list of all packages
sub list_packages
{
local ($i, $f, @list);
opendir(DIR, &translate_filename($package_dir));
local @list = @_ ? @_ : grep { !/^\./ } readdir(DIR);
$i = 0;
foreach $f (@list) {
$packages{$i,'name'} = $f;
$packages{$i,'class'} = $text{'slack_unclass'};
&open_tempfile(PKG, "$package_dir/$f");
while() {
if (/^PACKAGE LOCATION:\s+disk([a-z]+)\d+/i) {
$packages{$i,'class'} = $class_map{$1};
}
elsif (/^PACKAGE DESCRIPTION:/i) {
local $desc = ;
$desc =~ s/^\S+:\s+//;
$desc =~ s/\n//;
$packages{$i,'desc'} = $desc;
}
}
close(PKG);
$i++;
}
closedir(DIR);
return $i;
}
# package_info(package)
# Returns an array of package information in the order
# name, class, description, arch, version, vendor, installtime
sub package_info
{
local @rv = ( $_[0], $text{'slack_unclass'}, $text{'slack_unknown'},
$system_arch, $text{'slack_unknown'}, "Slackware" );
local @st = stat(&translate_filename("$package_dir/$_[0]"));
$rv[6] = ctime($st[9]);
&open_readfile(PKG, "$package_dir/$_[0]");
while() {
if (/^PACKAGE LOCATION:\s+disk([a-z]+)\d+/i) {
$rv[1] = $class_map{$1};
}
elsif (/^PACKAGE DESCRIPTION:/i) {
$rv[2] = "";
while() {
last if (/^FILE LIST/i);
s/^\S+: *//;
if (!$rv[2] && /([0-9][0-9\.]*)/) {
$rv[4] = $1;
}
$rv[2] .= $_;
}
$rv[2] =~ s/\s+$//;
}
}
close(PKG);
return @rv;
}
# check_files(package)
# Fills in the %files array with information about the files belonging
# to some package. Values in %files are path type user group mode size error
sub check_files
{
local $i = 0;
local $file;
&open_readfile(PKG, "$package_dir/$_[0]");
while() {
last if (/^FILE LIST:/i);
}
while($file = ) {
$file =~ s/\r|\n//g;
next if ($file eq "./");
$file = '/'.$file;
local $real = &translate_filename($file);
$files{$i,'path'} = $file;
local @st = stat($real);
if (@st) {
$files{$i,'type'} = -l $real ? 3 :
-d $real ? 1 : 0;
$files{$i,'user'} = getpwuid($st[4]);
$files{$i,'group'} = getgrgid($st[5]);
$files{$i,'mode'} = sprintf "%o", $st[2] & 07777;
$files{$i,'size'} = $st[7];
$files{$i,'link'} = readlink($file);
}
else {
$files{$i,'type'} = $file =~ /\// ? 1 : 0;
$files{$i,'user'} = $files{$i,'group'} =
$files{$i,'mode'} = $files{$i,'size'} = $text{'slack_unknown'};
$files{$i,'error'} = $text{'slack_missing'};
}
$i++;
}
return $i;
}
# package_files(package)
# Returns a list of all files in some package
sub package_files
{
local ($pkg) = @_;
local @rv;
&open_readfile(PKG, "$package_dir/$_[0]");
while() {
last if (/^FILE LIST:/i);
}
while(my $file = ) {
$file =~ s/\r|\n//g;
next if ($file eq "./");
$file = '/'.$file;
push(@rv, $file);
}
close(PKG);
return @rv;
}
# installed_file(file)
# Given a filename, fills %file with details of the given file and returns 1.
# If the file is not known to the package system, returns 0
# Usable values in %file are path type user group mode size packages
sub installed_file
{
local ($f, $file, @pkgin);
opendir(DIR, &translate_filename($package_dir));
while($f = readdir(DIR)) {
next if ($f =~ /^\./);
&open_readfile(PKG, "$package_dir/$f");
while() {
last if (/^FILE LIST:/);
}
while($file = ) {
next if ($file eq "./");
$file =~ s/[\/\r\n]+$//;
$file = '/'.$file;
if ($_[0] eq $file) {
# found it!
push(@pkgin, $f);
last;
}
}
close(PKG);
}
closedir(DIR);
if (@pkgin) {
local $real = &translate_filename($_[0]);
local @st = stat($real);
$file{'path'} = $_[0];
$file{'type'} = -l $real ? 3 :
-d $real ? 1 : 0;
$file{'user'} = getpwuid($st[4]);
$file{'group'} = getgrgid($st[5]);
$file{'mode'} = sprintf "%o", $st[2] & 07777;
$file{'size'} = $st[7];
$file{'link'} = readlink($real);
$file{'packages'} = join(" ", @pkgin);
return 1;
}
else {
return 0;
}
}
# is_package(file)
sub is_package
{
local $count;
local $qm = quotemeta($_[0]);
&open_execute_command(TAR, "gunzip -c $qm | tar tf - 2>&1", 1, 1);
while() {
$count++ if (/^[^\/\s]\S+/);
}
close(TAR);
return $count < 2 ? 0 : 1;
}
# file_packages(file)
# Returns a list of all packages in the given file, in the form
# package description
sub file_packages
{
if ($_[0] !~ /^(.*)\/(([^\/]+)(\.tgz|\.tar\.gz))$/) {
return "$_[0] $text{'slack_unknown'}";
}
local ($dir, $file, $base) = ($1, $2, $3);
local $diskfile;
opendir(DIR, &translate_filename($dir));
while($f = readdir(DIR)) {
if ($f =~ /^disk\S+\d+$/ || $f eq 'package_descriptions') {
# found the slackware disk file
$diskfile = "$dir/$f";
last;
}
}
closedir(DIR);
return "$base $text{'slack_unknown'}" if (!$diskfile);
# read the disk file
local $desc;
&open_readfile(DISK, $diskfile);
while() {
if (/^$base:\s*(.*)/) {
$desc = $1;
last;
}
}
close(DISK);
return $desc ? "$base $desc" : "$base $text{'slack_unknown'}";
}
# install_options(file, package)
# Outputs HTML for choosing install options
sub install_options
{
print &ui_table_row($text{'slack_root'},
&ui_textbox("root", "/", 50)." ".
&file_chooser_button("root", 1), 3);
}
# install_package(file, package)
# Installs the package in the given file, with options from %in
sub install_package
{
local $in = $_[2] ? $_[2] : \%in;
return $text{'slack_eroot'} if (!-d $in->{'root'});
$ENV{'ROOT'} = $in->{'root'};
local $out;
local $qm = quotemeta($_[0]);
if (&has_command("upgradepkg") &&
-r &translate_filename("$package_dir/$_[1]")) {
# Try to upgrade properly
$out = &backquote_logged("upgradepkg $qm 2>&1");
}
else {
# Just install
$out = &backquote_logged("installpkg $qm 2>&1");
}
if ($?) {
return "$out ";
}
return undef;
}
# delete_package(package)
# Totally remove some package
sub delete_package
{
local $qm = quotemeta($_[0]);
local $out = &backquote_logged("removepkg $qm 2>&1");
if ($?) { return "$out "; }
return undef;
}
sub package_system
{
return $text{'slack_manager'};
}
sub package_help
{
return "installpkg removepkg";
}
1;
software/config-open-linux 0000644 0005671 0000012 00000000036 11205635233 015653 0 ustar jcameron wheel package_system=rpm
apt_mode=0
software/rhn_check.cgi 0000775 0005671 0000012 00000003536 11205635233 015014 0 ustar jcameron wheel #!/usr/local/bin/perl
# rhn_check.cgi
# Save redhat network checking options
require './software-lib.pl';
&ReadParse();
&foreign_require("init", "init-lib.pl");
&error_setup($text{'rhn_err'});
$conf = &read_up2date_config();
# Validate inputs
$in{'interval'} =~ /^\d+$/ || &error($text{'rhn_einterval'});
$in{'interval'} >= 120 || &error($text{'rhn_einterval2'});
!$in{'proxy_on'} && $in{'proxy'} eq '' ||
$in{'proxy'} =~ /^http:\/\/\S+$/ || &error($text{'rhn_eproxy'});
@skip = split(/\s+/, $in{'skip'});
# Save and apply
&save_up2date_config($conf, "enableProxy", $in{'proxy_on'});
&save_up2date_config($conf, $conf->{'pkgProxy[comment]'} ? "pkgProxy" : "httpProxy", $in{'proxy'});
&save_up2date_config($conf, "pkgSkipList", join(";", @skip).";");
&flush_file_lines();
&read_env_file($rhn_sysconfig, \%rhnsd);
$rhnsd{'INTERVAL'} = $in{'interval'};
&write_env_file($rhn_sysconfig, \%rhnsd);
if ($in{'auto'}) {
&init::enable_at_boot("rhnsd");
}
else {
&init::disable_at_boot("rhnsd");
}
local $init = &init::action_filename("rhnsd");
&system_logged("$init stop >/dev/null 2>&1");
if ($in{'auto'}) {
&system_logged("$init start >/dev/null 2>&1");
}
if ($in{'now'}) {
# Run rhn_check now ..
&ui_print_unbuffered_header(undef, $text{'rhn_check'}, "");
print "",&text('rhn_checkdesc', "up2date -u ")," \n";
print "
";
&additional_log('exec', undef, "rhn_check");
open(CMD, "up2date -u 2>&1 |");
while() {
while(s/^[^\015]+\015([^\012])/$1/) { }
if (/\/([^\/\s]+)\-([^\-]+)\-([^\-]+)\.rpm/i) {
push(@packs, $1);
}
print;
}
close(CMD);
print " \n";
@packs || print "$text{'rhn_nocheck'} \n";
foreach $p (@packs) {
local @pinfo = &show_package_info($p);
}
&webmin_log("rhn", "check", undef, { 'packages' => \@packs })
if (@packs);
&ui_print_footer("", $text{'index_return'});
}
else {
&redirect("");
}
software/debian-lib.pl 0000755 0005671 0000012 00000013214 11205635233 014717 0 ustar jcameron wheel # debian-lib.pl
# Functions for debian DPKG package management
sub list_package_system_commands
{
return ("dpkg");
}
# list_packages([package]*)
# Fills the array %packages with a list of all packages
sub list_packages
{
local $i = 0;
local $arg = @_ ? join(" ", map { quotemeta($_) } @_) : "";
&open_execute_command(PKGINFO, "COLUMNS=200 dpkg --list $arg", 1, 1);
while() {
next if (/^\|/ || /^\+/);
if (/^[uirph]i..(\S+)\s+(\S+)\s+(.*)/) {
$packages{$i,'name'} = $1;
$packages{$i,'class'} = &alphabet_name($1);
$packages{$i,'version'} = $2;
$packages{$i,'desc'} = $3;
if ($packages{$i,'version'} =~ /^(\d+):(.*)$/) {
$packages{$i,'epoch'} = $1;
$packages{$i,'version'} = $2;
}
$i++;
}
}
close(PKGINFO);
return $i;
}
sub alphabet_name
{
return lc($_[0]) =~ /^[a-e]/ ? "A-E" :
lc($_[0]) =~ /^[f-j]/ ? "F-J" :
lc($_[0]) =~ /^[k-o]/ ? "K-O" :
lc($_[0]) =~ /^[p-t]/ ? "P-T" :
lc($_[0]) =~ /^[u-z]/ ? "U-Z" : "Other";
}
# package_info(package)
# Returns an array of package information in the order
# name, class, description, arch, version, vendor, installtime
sub package_info
{
local $qm = quotemeta($_[0]);
# First check if it is really installed, and not just known to the package
# system in some way
local $out = &backquote_command("dpkg --list $qm 2>&1", 1);
local @lines = split(/\r?\n/, $out);
if ($lines[$#lines] !~ /^.[ih]/) {
return ( );
}
# Get full status
local $out = &backquote_command("dpkg --print-avail $qm 2>&1", 1);
return () if ($? || $out =~ /Package .* is not available/i);
local @rv = ( $_[0], &alphabet_name($_[0]) );
push(@rv, $out =~ /Description:\s+([\0-\177]*\S)/i ? $1
: $text{'debian_unknown'});
push(@rv, $out =~ /Architecture:\s+(\S+)/i ? $1 : $text{'debian_unknown'});
push(@rv, $out =~ /Version:\s+(\S+)/i ? $1 : $text{'debian_unknown'});
push(@rv, $out =~ /Maintainer:\s+(.*)/i ? &html_escape($1)
: $text{'debian_unknown'});
push(@rv, $text{'debian_unknown'});
return @rv;
}
# check_files(package)
# Fills in the %files array with information about the files belonging
# to some package. Values in %files are path type user group mode size error
sub check_files
{
local $i = 0;
local $file;
local $qm = quotemeta($_[0]);
&open_execute_command(PKGINFO, "dpkg --listfiles $qm", 1, 1);
while($file = ) {
$file =~ s/\r|\n//g;
next if ($file !~ /^\/[^\.]/);
local @st = stat($file);
$files{$i,'path'} = $file;
$files{$i,'type'} = -l $file ? 3 :
-d $file ? 1 : 0;
$files{$i,'user'} = getpwuid($st[4]);
$files{$i,'group'} = getgrgid($st[5]);
$files{$i,'mode'} = sprintf "%o", $st[2] & 07777;
$files{$i,'size'} = $st[7];
$files{$i,'link'} = readlink($file);
$i++;
}
return $i;
}
# package_files(package)
# Returns a list of all files in some package
sub package_files
{
local ($pkg) = @_;
local $qn = quotemeta($pkg);
local @rv;
&open_execute_command(RPM, "dpkg --listfiles $qn", 1, 1);
while() {
s/\r|\n//g;
push(@rv, $_);
}
close(RPM);
return @rv;
}
# installed_file(file)
# Given a filename, fills %file with details of the given file and returns 1.
# If the file is not known to the package system, returns 0
# Usable values in %file are path type user group mode size packages
sub installed_file
{
local $qm = quotemeta($_[0]);
local $out = &backquote_command("dpkg --search $qm 2>&1", 1);
return 0 if ($out =~ /not found/i);
$out =~ s/:\s+\S+\n$//;
local @pkgin = split(/[\s,]+/, $out);
local $real = &translate_filename($_[0]);
local @st = stat($real);
$file{'path'} = $_[0];
$file{'type'} = -l $real ? 3 :
-d $real ? 1 : 0;
$file{'user'} = getpwuid($st[4]);
$file{'group'} = getgrgid($st[5]);
$file{'mode'} = sprintf "%o", $st[2] & 07777;
$file{'size'} = $st[7];
$file{'link'} = readlink($real);
$file{'packages'} = join(" ", @pkgin);
return 1;
}
# is_package(file)
sub is_package
{
local $qm = quotemeta($_[0]);
local $out = &backquote_command("dpkg --info $qm 2>&1", 1);
return $? || $out !~ /Package:/ ? 0 : 1;
}
# file_packages(file)
# Returns a list of all packages in the given file, in the form
# package description
sub file_packages
{
local $qm = quotemeta($_[0]);
local $out = &backquote_command("dpkg --info $qm 2>&1", 1);
local $name;
if ($out =~ /Package:\s+(\S+)/i && ($name=$1) &&
$out =~ /Description:\s+(.*)/i) {
return ( "$name $1" );
}
return ();
}
# install_options(file, package)
# Outputs HTML for choosing install options
sub install_options
{
print &ui_table_row($text{'debian_depends'},
&ui_yesno_radio("depends", 0));
print &ui_table_row($text{'debian_conflicts'},
&ui_yesno_radio("conflicts", 0));
print &ui_table_row($text{'debian_overwrite'},
&ui_yesno_radio("overwrite", 0));
print &ui_table_row($text{'debian_downgrade'},
&ui_yesno_radio("downgrade", 0));
}
# install_package(file, package)
# Installs the package in the given file, with options from %in
sub install_package
{
local $in = $_[2] ? $_[2] : \%in;
local $args = ($in->{'depends'} ? " --force-depends" : "").
($in->{'conflicts'} ? " --force-conflicts" : "").
($in->{'overwrite'} ? " --force-overwrite" : "").
($in->{'downgrade'} ? " --force-downgrade" : "");
local $qm = quotemeta($_[0]);
$ENV{'DEBIAN_FRONTEND'} = 'noninteractive';
local $out = &backquote_logged("dpkg --install $args $qm 2>&1 $out";
}
return undef;
}
# delete_package(package)
# Totally remove some package
sub delete_package
{
local $qm = quotemeta($_[0]);
$ENV{'DEBIAN_FRONTEND'} = 'noninteractive';
local $out = &backquote_logged("dpkg --remove $qm 2>&1 $out";
}
return undef;
}
sub package_system
{
return $text{'debian_manager'};
}
sub package_help
{
return "dpkg";
}
1;
software/config-debian-linux 0000644 0005671 0000012 00000000063 11205635233 016134 0 ustar jcameron wheel package_system=debian
update_system=apt
apt_mode=0
software/config.info.ja_JP.UTF-8 0000644 0005671 0000012 00000000654 11205635233 016303 0 ustar jcameron wheel package_system=パッケージ管理システム,4,rpm-RPM,pkgadd-Solaris,hpux-HPUX,freebsd-FreeBSD,slackware-Slackware,debian-Debian,aix-AIX,emerge-Gentoo,cygwin-Cygwin,msi-Microsoft Installer
update_system=パッケージアップデートシステム,1,-自動判別,apt-APT,yum-YUM,rhn-Redhat Network,csw-Blastwave,urpmi-URPMI,emerge-Emerge
apt_mode=APT のインストールに使うコマンド,1,0-apt-get,1-aptitute
software/module.info 0000644 0005671 0000012 00000002162 11205635233 014533 0 ustar jcameron wheel desc_ko_KR.euc=Ʈ Ű
risk=high
desc_ru_SU=
desc_zh_TW.Big5=nM
desc_pl=Pakiety oprogramowania
desc_de=Softwarepakete
name=PackageAdmin
desc_zh_CN=
desc_pt=Pacotes de Software
category=system
desc_tr=Yazlm Paketleri
os_support=solaris coherent-linux redhat-linux mandrake-linux suse-linux united-linux hpux open-linux openserver unixware freebsd/3.0-* slackware-linux/4.0-* debian-linux/2.0-* turbo-linux openbsd corel-linux cobalt-linux netbsd msc-linux aix gentoo-linux trustix-linux openmamba-linux cygwin windows
desc=Software Packages
desc_es=Paquetes de Software
desc_sv=Programpaket
desc_fr=Composants Logiciels
desc_ja_JP.euc=եȥ ѥå
desc_hu=Szoftver csomagok
desc_ru_RU=
desc_ca=Paquets de Programari
desc_cz=Softwarov balky
longdesc=Manage software packages on your system, and install new packages.
desc_ms=Pakej Perisian
readonly=1
desc_zh_TW.UTF-8=軟體套件
desc_zh_CN.UTF-8=软件包
desc_ja_JP.UTF-8=ソフトウェア パッケージ
desc_ko_KR.UTF-8=소프트웨어 패키지
desc_nl=Software pakketten
desc_ru.UTF-8=Менеджер ПО
version=1.472
software/openbsd-lib.pl 0000755 0005671 0000012 00000011314 11205635233 015126 0 ustar jcameron wheel # openbsd-lib.pl
# Functions for OpenBSD package management
use POSIX;
chop($system_arch = `uname -m`);
$package_dir = "/var/db/pkg";
sub list_package_system_commands
{
return ("pkg_info", "pkg_add");
}
# list_packages([package]*)
# Fills the array %packages with a list of all packages
sub list_packages
{
local $i = 0;
local $arg = @_ ? join(" ", map { quotemeta($_) } @_) : "-a";
&open_execute_command(PKGINFO, "pkg_info -I $arg", 1, 1);
while() {
if (/^(\S+)\s+(.*)/) {
$packages{$i,'name'} = $1;
$packages{$i,'class'} = "";
$packages{$i,'desc'} = $2;
$i++;
}
}
close(PKGINFO);
return $i;
}
# package_info(package)
# Returns an array of package information in the order
# name, class, description, arch, version, vendor, installtime
sub package_info
{
local $qm = quotemeta($_[0]);
local $out = &backquote_command("pkg_info $_[0] 2>&1", 1);
return () if ($?);
local @rv = ( $_[0] );
push(@rv, "");
push(@rv, $out =~ /Description:\n([\0-\177]*\S)/i ? $1 : $text{'bsd_unknown'});
push(@rv, $system_arch);
push(@rv, $_[0] =~ /-([^\-]+)$/ ? $1 : $text{'bsd_unknown'});
push(@rv, "OpenBSD");
local @st = stat(&translate_filename("$package_dir/$_[0]"));
push(@rv, @st ? ctime($st[9]) : $text{'bsd_unknown'});
return @rv;
}
# check_files(package)
# Fills in the %files array with information about the files belonging
# to some package. Values in %files are path type user group mode size error
sub check_files
{
local $i = 0;
local $file;
local $qm = quotemeta($_[0]);
&open_execute_command(PKGINFO, "pkg_info -L $qm", 1, 1);
while($file = ) {
$file =~ s/\r|\n//g;
next if ($file !~ /^\//);
local $real = &translate_filename($file);
local @st = stat($real);
$files{$i,'path'} = $file;
$files{$i,'type'} = -l $real ? 3 :
-d $real ? 1 : 0;
$files{$i,'user'} = getpwuid($st[4]);
$files{$i,'group'} = getgrgid($st[5]);
$files{$i,'mode'} = sprintf "%o", $st[2] & 07777;
$files{$i,'size'} = $st[7];
$files{$i,'link'} = readlink($real);
$i++;
}
return $i;
}
# installed_file(file)
# Given a filename, fills %file with details of the given file and returns 1.
# If the file is not known to the package system, returns 0
# Usable values in %file are path type user group mode size packages
sub installed_file
{
local (%packages, $file, $i, @pkgin);
local $n = &list_packages();
for($i=0; $i<$n; $i++) {
&open_execute_command(PKGINFO, "pkg_info -L $packages{$i,'name'}", 1,1);
while($file = ) {
$file =~ s/\r|\n//g;
if ($file eq $_[0]) {
# found it
push(@pkgin, $packages{$i,'name'});
}
}
close(PKGINFO);
}
if (@pkgin) {
local $real = &translate_filename($_[0]);
local @st = stat($real);
$file{'path'} = $_[0];
$file{'type'} = -l $real ? 3 :
-d $real ? 1 : 0;
$file{'user'} = getpwuid($st[4]);
$file{'group'} = getgrgid($st[5]);
$file{'mode'} = sprintf "%o", $st[2] & 07777;
$file{'size'} = $st[7];
$file{'link'} = readlink($real);
$file{'packages'} = join(" ", @pkgin);
return 1;
}
else {
return 0;
}
}
# is_package(file)
sub is_package
{
local ($desc, $contents);
local $qm = quotemeta($_[0]);
&open_execute_command(TAR, "gunzip -c $qm | tar tf -", 1, 1);
while() {
$desc++ if (/^\+DESC/);
$contents++ if (/^\+CONTENTS/);
}
close(TAR);
return $desc && $contents;
}
# file_packages(file)
# Returns a list of all packages in the given file, in the form
# package description
sub file_packages
{
local $temp = &transname();
&make_dir($temp, 0700);
local $qm = quotemeta($_[0]);
&execute_command("cd $temp && gunzip -c $qm | tar xf - +CONTENTS +COMMENT");
local ($comment, $name);
&open_readfile(COMMENT, "$temp/+COMMENT");
($comment = ) =~ s/\r|\n//g;
close(COMMENT);
&open_readfile(CONTENTS, "$temp/+CONTENTS");
while() {
$name = $1 if (/^\@name\s+(\S+)/);
}
close(CONTENTS);
&unlink_file($temp);
return ( "$name $comment" );
}
# install_options(file, package)
# Outputs HTML for choosing install options
sub install_options
{
print &ui_table_row($text{'bsd_scripts'},
&ui_radio("scripts", 0, [ [ 0, $text{'yes'} ], [ 1, $text{'no'} ] ]));
print &ui_table_row($text{'bsd_force'},
&ui_yesno_radio("force", 1));
}
# install_package(file, package)
# Installs the package in the given file, with options from %in
sub install_package
{
local $in = $_[2] ? $_[2] : \%in;
local $args = ($in->{"scripts"} ? " -I" : "").
($in->{"force"} ? " -f" : "");
local $out = &backquote_logged("pkg_add $args $_[0] 2>&1");
if ($?) {
return "$out ";
}
return undef;
}
# delete_package(package)
# Totally remove some package
sub delete_package
{
local $out = &backquote_logged("pkg_delete $_[0] 2>&1");
if ($?) { return "$out "; }
return undef;
}
sub package_system
{
return &text('bsd_manager', "OpenBSD");
}
sub package_help
{
return "pkg_add pkg_info pkg_delete";
}
1;
software/rpmfind.cgi 0000775 0005671 0000012 00000004217 11205635233 014524 0 ustar jcameron wheel #!/usr/local/bin/perl
# rpmfind.cgi
# Display a search window for rpmfind.net
require './software-lib.pl';
&ReadParse();
$rpmfind_host = "rpmfind.net";
$rpmfind_port = 80;
$rpmfind_page = "/linux/rpm2html/search.php?query=";
&header();
print <
function sel(m)
{
window.opener.ifield.value = m;
window.close();
return false;
}
EOF
# Search form
print &ui_form_start("rpmfind.cgi");
print &ui_submit($text{'rpm_search'});
print &ui_textbox("search", $in{'search'}, 20);
print &ui_form_end();
if ($in{'search'}) {
# Call the rpmfind.net website to get matches
print &ui_hr();
$out = "";
&http_download($rpmfind_host, $rpmfind_port,
$rpmfind_page.&urlize($in{'search'}), \$out);
while($out =~ /]*>.*?]*>([^<]*)<\/td>.*? ]*>([^<]*)<\/td>.*?((ftp|http|https):[^>]+\.rpm).*?<\/tr>([\000-\377]*)/i) {
local $pkg = { 'url' => $3,
'dist' => $2,
'desc' => $1 };
$out = $5;
$pkg->{'source'}++ if ($pkg->{'url'} =~ /\.src\.rpm$/ ||
$pkg->{'url'} =~ /\.srpm$/);
if ($pkg->{'url'} =~ /\/(([^\/]+)-([^\-\/]+)-([^-\/]+).([^-\/]+)\.rpm)$/) {
$pkg->{'file'} = $1;
$pkg->{'prefix'} = $2;
$pkg->{'version'} = $3;
$pkg->{'release'} = $4;
$pkg->{'arch'} = $5;
if ($pkg->{'version'} =~ /^(\d+)\.([0-9\.]+)$/){
local ($v1 = $1, $v2 = $2);
$v2 =~ s/\.//g;
$pkg->{'version'} = "$v1.$v2";
}
}
elsif ($pkg->{'file'} =~ /\/([^\/]+)$/) {
$pkg->{'file'} = $1;
}
push(@rv, $pkg);
}
# Show the search results
@rv = grep { !$_->{'source'} } @rv;
@rv = sort { local $vc = $b->{'version'} <=> $a->{'version'};
local $rc = $b->{'version'} <=> $a->{'version'};
return $vc ? $vc : $rc } @rv;
if (@rv) {
print "\n";
print &ui_columns_start([ $text{'rpm_findrpm'},
$text{'rpm_finddistro'},
$text{'rpm_finddesc'} ], 100);
foreach $r (@rv) {
print &ui_columns_row([
"".
"$r->{'file'} ",
$r->{'dist'},
$r->{'desc'}
]);
}
print &ui_columns_end();
}
else {
print "$text{'rpm_none'} \n";
}
}
&ui_print_footer();
software/config.info.ko_KR.UTF-8 0000664 0005671 0000012 00000000631 11205635233 016322 0 ustar jcameron wheel package_system=패키지 관리 시스템,4,rpm-RPM,pkgadd-Solaris,hpux-HPUX,freebsd-FreeBSD,slackware-Slackware,debian-Debian,aix-AIX,emerge-Gentoo,cygwin-Cygwin,msi-Microsoft Installer
apt_mode=APT 설치를 위해 사용할 명령,1,0-apt-get,1-aptitute
update_system=패키지 업데이트 시스템,1,-자동 감지,apt-APT,yum-YUM,rhn-Redhat 네트워크,csw-Blastwave,urpmi-URPMI,emerge-Emerge
software/images/ 0000755 0005671 0000012 00000000000 11205635233 013635 5 ustar jcameron wheel software/images/close.gif 0000644 0005671 0000012 00000000160 11205635233 015426 0 ustar jcameron wheel GIF89a ̙fff! , Aqbk"phyZ:V
SЙv05g<%|vh ; software/images/open.gif 0000644 0005671 0000012 00000000153 11205635233 015264 0 ustar jcameron wheel GIF89a ̙fff! , <qbk"phyvR٢oδ\xy9¡mX)U B=G ; software/images/pack.gif 0000644 0005671 0000012 00000000173 11205635233 015243 0 ustar jcameron wheel GIF89a fff! , Lj(S7MuZXV:'
⡵/*~OĢ/8Dr46=(BRrzi.R ; software/images/icon.gif 0000644 0005671 0000012 00000000451 11205635233 015254 0 ustar jcameron wheel GIF89a0 0 fff! , 0 0
T؋TNly UV8-α40fPyaN@(+q&,i*Q0TJfqe7Y
c:ܬDl%Ww6gx嘗XY7vD94yXyBj'jH) kۉ[#v%|kW9@]m}'Imw]]=^G=]N3LanJ~ݎO_oO n`}ĉ ; software/images/smallicon.gif 0000664 0005671 0000012 00000000315 11205635233 016306 0 ustar jcameron wheel GIF87a MMM333fff@@@ , IȌͻ)h]X
亝s[ٱLWo; `<\h&E' Pn )'` XXZÄ
ҝ+i9$e|R0~N!yMdM(qke(GGt ; software/closeall.cgi 0000755 0005671 0000012 00000000206 11205635233 014653 0 ustar jcameron wheel #!/usr/local/bin/perl
# closeall.cgi
# Empty the open list
require './software-lib.pl';
&save_heiropen([ ]);
&redirect("tree.cgi");
software/rhn.cgi 0000775 0005671 0000012 00000002411 11205635233 013646 0 ustar jcameron wheel #!/usr/local/bin/perl
# rhn.cgi
# Display a list of packages available for download from RHN
require './software-lib.pl';
$bgcolor = defined($gconfig{'cs_page'}) ? $gconfig{'cs_page'} : "ffffff";
$link = defined($gconfig{'cs_link'}) ? $gconfig{'cs_link'} : "0000ee";
$text = defined($gconfig{'cs_text'}) ? $gconfig{'cs_text'} : "000000";
&PrintHeader();
print <
$text{'rhn_title'}
EOF
$out = `up2date -l 2>&1`;
if ($out =~ /Error Message:/i) {
print "$out \n";
}
else {
print "\n";
foreach (split(/\n/, $out)) {
if ($dashes && /^(\S+)\s+(\S+)\s+(\S+)/) {
if (!$count++) {
print " $text{'rhn_pack'} ",
"",
"$text{'rhn_version'} \n";
}
print "\n";
print "$1 \n";
print "$2 - $3 \n";
print " \n";
}
elsif (/^----/) {
last if ($dashes);
$dashes++;
}
}
print "
\n";
if (!$count) {
print "$text{'rhn_nonefound'} \n";
}
}
print "