summary refs log blame commit diff stats
path: root/plugins/sysinfo/xsys-changelog
blob: 9ea20727a161b07c1704c20140de8c52756af7c0 (plain) (tree)



















































































































                                                                                                                                 
v2.2.0
	* (Thomas Cort) Report L2 cache info for Alpha CPUs
	* (Tony Vroon) Drop XMMS, port audacious features to D-Bus, make dependency mandatory
	* (Tony Vroon) Use pretty_freespace for memory & swap reporting as well as disk space
	* (Tony Vroon) Make pretty_freespace report none if total_size is 0, thanks to Emopig <andrew@nelless.net> for the report
	* (Tony Vroon) Make pretty_freespace aware of terabytes, petabytes, exabytes, zettabytes & yottabytes
	* (Tony Vroon) Remove xchatdirfs workaround

v2.1.0
	Removals & pending removal:
	* (Tony Vroon) Remove support for BMP, it is an abandoned project. Suggested upgrade path: audacious
	* (Tony Vroon) Remove /uname & /euname; the OS part of sysinfo displays similar info without requiring a process pipe
	* (Tony Vroon) Added a note that the xchatdirfs workaround is due for removal as X-Chat Gnome has fixed the bug

	Bugfixes:
	* (Tony Vroon) Actually show the vendor that we retrieve in cpuinfo
	* (Tony Vroon) Display Gentoo Linux as stable or ~arch, the baselayout version doesn't really interest anyone
	* (Tony Vroon) Match framework: Make remove_leading_whitespace actually work
	* (Tony Vroon) Match framework: Do not assume that a delimiter is always followed by a space

	Code improvements:
	* (Tony Vroon) PCI framework: We were requesting more info then we actually return to the caller
	* (Tony Vroon) Match framework: Consolidate delimiters in a single define & use 1 strpbrk instead of 2 strstr's
	* (Tony Vroon) Display the machine string instead of the pmac-generation as vendor info for PPC machines

	New features
	* (Tony Vroon) Show memory capacity in gigabytes instead of in megabytes when appropriate
	* (Tony Vroon) Cut cpu name at comma (so overly long other info such as "altivec supported" is no longer displayed)
	* (Tony Vroon) Now Playing: Report time played as well as the song length
	* (Tony Vroon) Now Playing: Support reporting as an action; configurable at runtime
	* (Tony Vroon) Check LSB release data, prefer above all others; based on a code sample submitted by Thomas Winwood

v2.0.9
	* (Tony Vroon) Protect the matching framework against spurious matches (bug reported by Harm Geerts)
	* (Tony Vroon) Unexporting unnecessary symbols for PCI framework
	* (Tony Vroon) Deal with incompatible header changes in pciutils
	* (Tony Vroon) Begin implementing hardware monitoring support, not yet activated
	* (Tony Vroon) Add support for Audacious, a BMP fork

v2.0.8
	* (Tony Vroon) Make XMMS interface actually work, thanks to a patch from Morten Cools
	* (Tony Vroon) Use percentages for df information as well
	* (Gustavo Zacarias) Add support for Sparc architecture, cache size detection on sparc64 only
	* (Gustavo Zacarias) Consolidate buffer sizes into a single define

v2.0.7
	* (Tony Vroon) Have df parser ignore pseudo-filesystems; deal with other locales more gracefully
	* (Tony Vroon) Change default formatstring not to use mIRC color codes
	* (Tony Vroon) Add fallback to ~/.xchat2 for xchat-gnome which does not report xchatdirfs properly
	* (Tony Vroon) Revert to beepctrl.h style calls as infopipe is too unreliable

v2.0.6
	* (Tony Vroon) Rewrote PCI framework, no longer depends on sysfs, kernel 2.4 and lower will work now
	* (Tony Vroon) Made percentages configurable, can be set at runtime (feature request by Halcy0n)
	* (Tony Vroon) Abstract out all pointer voodoo from xsys.c
	* (Tony Vroon) Do not return XCHAT_EAT_NONE, causes spurious "unknown command" errors
	* (Tony Vroon) Deal more gracefully with a missing soundcard or unknown linux distribution
	* (Tony Vroon) Add error handling to the matching framework

v2.0.5
	* (Tony Vroon) Added support for parisc/hppa & ia64 architectures
	* (Tony Vroon) Proper report of L2 cache as "unknown" instead of showing bits of unitialized memory
	* (Tony Vroon) Upped PCI parser yield for ppc64 architecture, has high bus number for AGP card
	* (Tony Vroon) Use percentages in memory/swap information

v2.0.4
	* (Tony Vroon) /sound uses ALSA if possible, PCI now fallback (false positives reported with PCI code)
	* (Tony Vroon) Remove 0 prefix from first ALSA card; 1: and up will be shown for extra cards
	* (Tony Vroon) Matching code rewritten and separated out from other code
	* (Tony Vroon) Use new matching framework where possible
	* (Tony Vroon) Added support for Alpha architecture, thanks to Bert (bert@ev6.net)

v2.0.3
	* (Tony Vroon) Fix buttons, XMMS -> NP
	* (Tony Vroon) PCI functions separated out from other code; fully rewritten
	* (Tony Vroon) Use new PCI framework for sound detection; ALSA is now fallback
	* (Tony Vroon) Implement /ether
	* (Tony Vroon) /video now reports video card @ AGP bridge; resolution info dropped

v2.0.2
	* (Tony Vroon) XMMS/BMP: Delete XMMS/BMP detection; it just got obsoleted by a BMP bugfix
	* (Tony Vroon) XMMS/BMP: Change to /np & /enp as commands (np -> now playing)
	* (Tony Vroon) Allow customization of now_playing with /playing
	* (Tony Vroon) Separate out the length field for now_playing
	* (Tony Vroon) Better configuration file handling
	* (Tony Vroon) Set homepage to http://dev.gentoo.org/~chainsaw/xsys
	* (Tony Vroon) Make channel buttons optional, not everyone appreciates them
	* (Tony Vroon) Fix cpuinfo parsing on x86_64, a necessary define was missing

v2.0.1
	* (Tony Vroon) XMMS/BMP: Report "stream" if song length is -1
	* (Tony Vroon) XMMS/BMP: Determine whether XMMS or BMP is playing
	* (Tony Vroon) Better errorhandling if pci.ids parsing fails; at least mention raw PCI ID of card
	* (Tony Vroon) Remove AGP from video card messages; we detect plain PCI cards too
	* (Tony Vroon) Fix Debian release detector

v2.0.0
	* (mikeshoup)  Clean up of code for 2.0.0 release
	* (Tony Vroon) Added PowerPC /proc/cpuinfo support
	* (Tony Vroon) Changed LSPCI to SYSFS

v1.9.3
	* (mikeshoup) Introduced distro function
	* (mikeshoup, Tony Vroon's suggestion) Removed bitrate from /XMMS

v1.9.2
	* 2005/01/14 (mikeshoup) Put in the userlist buttons
	* 2005/01/10 (mikeshoup) Added XMMS/BMP Support

v1.9.1
	* 2004/12/20 (mikeshoup) Added a dynamic formatting scheme
	* 2004/12/19 (mikeshoup) Changed some commands
	* 2004/12/18 (mikeshoup) Reintroducted /VIDEO

v1.9.0
	* 2004/12/17 (mikeshoup) Initial Release
span>; # list of loaded scripts keyed by their package names # The package names are generated from the filename of the script using # the file2pkg() function. # The values of this hash are hash references with the following keys: # filename # The full path to the script. # gui_entry # This is hexchat_plugin pointer that is used to remove the script from # Plugins and Scripts window when a script is unloaded. This has also # been converted with the PTR2IV() macro. # hooks # This is an array of hooks that are associated with this script. # These are pointers that have been converted with the PTR2IV() macro. # inner_packages # Other packages that are defined in a script. This is not recommended # partly because these will also get removed when a script is unloaded. # loaded_at # A timestamp of when the script was loaded. The value is whatever # Time::HiRes::time() returns. This is used to retain load order when # using the RELOADALL command. # shutdown # This is either a code ref or undef. It will be executed just before a # script is unloaded. our %scripts; # This is a mapping of "inner package" => "containing script package" our %owner_package; # used to keep track of which package a hook belongs to, if the normal way of # checking which script is calling a hook function fails this will be used # instead. When a hook is created this will be copied to the HookData structure # and when a callback is invoked this it will be used to set this value. our $current_package; sub load { my $file = expand_homedir( shift @_ ); my $package = file2pkg( $file ); if( exists $scripts{$package} ) { my $pkg_info = pkg_info( $package ); my $filename = File::Basename::basename( $pkg_info->{filename} ); Xchat::printf( qq{'%s' already loaded from '%s'.\n}, $filename, $pkg_info->{filename} ); Xchat::print( 'If this is a different script then it rename and try '. 'loading it again.' ); return 2; } if( open my $source_handle, $file ) { my $source = do {local $/; <$source_handle>}; close $source_handle; # we shouldn't care about things after __END__ $source =~ s/^__END__.*//ms; # this must come before the eval or the filename will not be found in # Xchat::register $scripts{$package}{filename} = $file; $scripts{$package}{loaded_at} = Time::HiRes::time(); # this must be done before the error check so the unload will remove # any inner packages defined by the script. if a script fails to load # then any inner packages need to be removed as well. my @inner_packages = $source =~ m/^\s*package \s+ ((?:[^\W:]+(?:::)?)+)\s*? # package name # strict version number (?:\d+(?:[.]\d+) # positive integer or decimal-fraction |v\d+(?:[.]\d+){2,})? # dotted-decimal v-string [{;] /mgx; # check if any inner package defined in the to be loaded script has # already been defined by another script my @conflicts; for my $inner ( @inner_packages ) { if( exists $owner_package{ $inner } ) { push @conflicts, $inner; } } # report conflicts and bail out if( @conflicts ) { my $error_message = "'$file' won't be loaded due to conflicting inner packages:\n"; for my $conflict_package ( @conflicts ) { $error_message .= " $conflict_package already defined in " . pkg_info($owner_package{ $conflict_package })->{filename}."\n"; } Xchat::print( $error_message ); return 2; } my $full_path = File::Spec->rel2abs( $file ); $source =~ s/^/#line 1 "$full_path"\n\x7Bpackage $package;/; # make sure we add the closing } even if the last line is a comment if( $source =~ /^#.*\Z/m ) { $source =~ s/^(?=#.*\Z)/\x7D/m; } else { $source =~ s/\Z/\x7D/; } $scripts{$package}{inner_packages} = [ @inner_packages ]; @owner_package{ @inner_packages } = ($package) x @inner_packages; _do_eval( $source ); unless( exists $scripts{$package}{gui_entry} ) { $scripts{$package}{gui_entry} = Xchat::Internal::register( "", "unknown", "", $file ); } if( $@ ) { # something went wrong $@ =~ s/\(eval \d+\)/$file/g; Xchat::print( "Error loading '$file':\n$@\n" ); # make sure the script list doesn't contain false information unload( $scripts{$package}{filename} ); return 1; } } else { Xchat::print( "Error opening '$file': $!\n" ); return 2; } return 0; } sub _do_eval { no strict; no warnings; eval $_[0]; } sub unload { my $file = shift @_; my $package = file2pkg( $file ); my $pkg_info = pkg_info( $package ); if( $pkg_info ) { # take care of the shutdown callback if( exists $pkg_info->{shutdown} ) { # allow incorrectly written scripts to be unloaded eval { if( ref $pkg_info->{shutdown} eq 'CODE' ) { $pkg_info->{shutdown}->(); } elsif ( $pkg_info->{shutdown} ) { no strict 'refs'; &{$pkg_info->{shutdown}}; } }; } if( exists $pkg_info->{hooks} ) { for my $hook ( @{$pkg_info->{hooks}} ) { Xchat::unhook( $hook, $package ); } } if( exists $pkg_info->{gui_entry} ) { plugingui_remove( $pkg_info->{gui_entry} ); } delete @owner_package{ @{$pkg_info->{inner_packages}} }; for my $inner_package ( @{$pkg_info->{inner_packages}} ) { Symbol::delete_package( $inner_package ); } Symbol::delete_package( $package ); delete $scripts{$package}; return Xchat::EAT_ALL; } else { Xchat::print( qq{"$file" is not loaded.\n} ); return Xchat::EAT_NONE; } } sub unload_all { for my $package ( keys %scripts ) { unload( $scripts{$package}->{filename} ); } return Xchat::EAT_ALL; } sub reload { my $file = shift @_; my $package = file2pkg( $file ); my $pkg_info = pkg_info( $package ); my $fullpath = $file; if( $pkg_info ) { $fullpath = $pkg_info->{filename}; unload( $file ); } load( $fullpath ); return Xchat::EAT_ALL; } sub reload_all { my @dirs = Xchat::get_info( "configdir" ); push @dirs, File::Spec->catdir( $dirs[0], "plugins" ); for my $dir ( @dirs ) { my $auto_load_glob = File::Spec->catfile( $dir, "*.pl" ); my @scripts = map { $_->{filename} } sort { $a->{loaded_at} <=> $b->{loaded_at} } values %scripts; push @scripts, File::Glob::bsd_glob( $auto_load_glob ); my %seen; @scripts = grep { !$seen{ $_ }++ } @scripts; unload_all(); for my $script ( @scripts ) { if( !pkg_info( file2pkg( $script ) ) ) { load( $script ); } } } } sub expand_homedir { my $file = shift @_; if ( $^O eq "MSWin32" ) { $file =~ s/^~/$ENV{USERPROFILE}/; } else { $file =~ s{^~}{ (getpwuid($>))[7] || $ENV{HOME} || $ENV{LOGDIR} }ex; } return $file; } sub file2pkg { my $string = File::Basename::basename( shift @_ ); $string =~ s/\.pl$//i; $string =~ s|([^A-Za-z0-9/])|'_'.unpack("H*",$1)|eg; return "Xchat::Script::" . $string; } sub pkg_info { my $package = shift @_; return $scripts{$package}; } sub find_external_pkg { my $level = 1; while( my @frame = caller( $level ) ) { return @frame if $frame[0] !~ /(?:^IRC$|^Xchat)/; $level++; } return; } sub find_pkg { my $level = 1; while( my ($package, $file, $line) = caller( $level ) ) { return $package if $package =~ /^Xchat::Script::/; $level++; } my $current_package = get_current_package(); if( defined $current_package ) { return $current_package; } my @frame = find_external_pkg(); my $location; if( $frame[0] or $frame[1] ) { my $calling_package = $frame[0]; if( defined( my $owner = $owner_package{ $calling_package } ) ) { return ($owner, $calling_package); } $location = $frame[1] ? $frame[1] : "package $frame[0]"; $location .= " line $frame[2]"; } else { $location = "unknown location"; } die "Unable to determine which script this hook belongs to. at $location\n"; } # convert function names into code references sub fix_callback { my ($package, $calling_package, $callback) = @_; unless( ref $callback ) { unless( $callback =~ /::/ ) { my $prefix = defined $calling_package ? $calling_package : $package; $callback =~ s/^/${prefix}::/; } no strict 'subs'; $callback = \&{$callback}; } return $callback; } sub get_current_package { return $current_package; } sub set_current_package { my $old_package = $current_package; $current_package = shift; return $old_package; } 1