File manager - Edit - /home/newsbmcs.com/public_html/static/img/logo/emacsen-common.tar
Back
emacs-package-install 0000755 00000004331 15027402473 0010624 0 ustar 00 #!/usr/bin/perl -w use Errno; use strict; my $lib_dir = "/usr/lib/emacsen-common"; my $invoked_by_old_pkg; my $context; my $pkg; require $lib_dir . "/lib.pl"; umask 0022 or die "emacs-package-install: can't set umask, aborting."; sub usage { my($file_handle) = @_; if($invoked_by_old_pkg) { print $file_handle "Usage: emacs-package-install FLAVOR\n"; } else { print $file_handle "Usage: emacs-package-install (--preinst|--postinst) FLAVOR\n"; } } sub is_new_pkg { my($pkg) = @_; return (-e "$lib_dir/packages/compat/$pkg"); } if(scalar(@ARGV) == 1) { $invoked_by_old_pkg = 1; $pkg = $ARGV[0]; $context = 'postinst'; } elsif (scalar(@ARGV) == 2) { if($ARGV[0] eq '--preinst') { $context = 'preinst'; } elsif($ARGV[0] eq '--postinst') { $context = 'postinst'; } else { usage(*STDERR{IO}); exit(1); } $pkg = $ARGV[1]; } else { usage(*STDERR{IO}); exit(1); } if($context eq 'preinst') { die "ERROR: cannot unlink $::installed_package_state_dir/$pkg: $!, " unless (unlink("$::installed_package_state_dir/$pkg") or $!{ENOENT}); exit(0); } # Must be --postinst. validate_add_on_pkg($pkg, 'emacs-package-install', $invoked_by_old_pkg); # Mark package as safe to attempt to setup. ex('touch', "$::installed_package_state_dir/$pkg"); # Get all the packages $pkg depends on, dependency sorted. my @pkgs_to_handle = generate_add_on_install_list([$pkg]); my @installed_flavors = get_installed_flavors(); foreach my $pkg (@pkgs_to_handle) { my $script = $lib_dir . "/packages/install/$pkg"; if(is_new_pkg($pkg)) { foreach my $flavor (@installed_flavors) { print "Install $pkg for $flavor\n"; if(-e $script && (system($script, $flavor) != 0)) { print STDERR "ERROR: install script from $pkg package failed\n"; exit(1); } } } else # old pkg { print "Install $pkg for emacs\n"; ex($script, 'emacs', @installed_flavors) if -e $script; foreach my $flavor (@installed_flavors) { print "Install $pkg for $flavor\n"; if(-e $script && (system($script, $flavor, @installed_flavors) != 0)) { print STDERR "ERROR: install script from $pkg package failed\n"; exit(1); } } } } emacs-install 0000755 00000003365 15027402473 0007241 0 ustar 00 #!/usr/bin/perl -w use Errno; use strict; my $lib_dir = "/usr/lib/emacsen-common"; my $invoked_by_old_pkg; my $context; my $flavor; require $lib_dir . "/lib.pl"; umask 0022 or die "emacs-install: can't set umask, aborting."; sub usage { my($file_handle) = @_; if($invoked_by_old_pkg) { print $file_handle "Usage: emacs-install FLAVOR\n"; } else { print $file_handle "Usage: emacs-install (--preinst|--postinst) FLAVOR\n"; } } if(scalar(@ARGV) == 1) { $invoked_by_old_pkg = 1; $flavor = $ARGV[0]; $context = 'postinst;' } elsif (scalar(@ARGV) == 2) { if($ARGV[0] eq '--preinst') { $context = 'preinst'; } elsif($ARGV[0] eq '--postinst') { $context = 'postinst'; } else { usage(*STDERR{IO}); exit(1); } $flavor = $ARGV[1]; } else { usage(*STDERR{IO}); exit(1); } if($context eq 'preinst') { my $f = "$::installed_flavor_state_dir/$flavor"; unlink("$f"); die "ERROR: cannot unlink $f: $!, " unless (unlink($f) or $!{ENOENT}); exit(0); } # Must be --postinst. my @installed_flavors = get_installed_flavors(); # Mark as safe to include in list of flavors for package setup. ex('touch', "$::installed_flavor_state_dir/$flavor"); my @ordered_pkg_list = generate_add_on_install_list(get_installed_add_on_packages()); foreach my $pkg (@ordered_pkg_list) { print "Install $pkg for $flavor\n"; my $script = $lib_dir . "/packages/install/$pkg"; my $failed; if(-e "$lib_dir/packages/compat/$pkg") # New-style package. { $failed = -e $script && (system($script, $flavor) != 0); } else # Old-style package. { $failed = -e $script && (system($script, $flavor, @installed_flavors) != 0); } if($failed) { print STDERR "ERROR: install script from $pkg package failed\n"; exit(1); } } emacs-package-remove 0000755 00000003240 15027402473 0010451 0 ustar 00 #!/usr/bin/perl -w use Errno; use strict; my $lib_dir = "/usr/lib/emacsen-common"; my $invoked_by_old_pkg; my $pkg; require $lib_dir . "/lib.pl"; umask 0022 or die "emacs-remove: can't set umask, aborting."; sub usage { my($file_handle) = @_; if($invoked_by_old_pkg) { print $file_handle "Usage: emacs-package-remove FLAVOR\n"; } else { print $file_handle "Usage: emacs-package-remove --prerm FLAVOR\n"; } } if(scalar(@ARGV) == 1) { $invoked_by_old_pkg = 1; $pkg = $ARGV[0]; } elsif (scalar(@ARGV) == 2 && $ARGV[0] eq '--prerm') { $pkg = $ARGV[1]; } else { usage(*STDERR{IO}); exit(1); } validate_add_on_pkg($pkg, 'emacs-package-remove', $invoked_by_old_pkg); # Silence "single use" warning. $::installed_package_state_dir = $::installed_package_state_dir; my @installed_flavors = get_installed_flavors(); my $script = $lib_dir . "/packages/remove/$pkg"; if(!$invoked_by_old_pkg) { foreach my $flavor (@installed_flavors) { print "Remove $pkg for $flavor\n"; if(-e $script && (system($script, $flavor) != 0)) { print STDERR "ERROR: remove script from $pkg package failed\n"; exit(1); } } } else # $invoked_by_old_pkg { print "Remove $pkg for emacs\n"; ex($script, 'emacs', @installed_flavors) if -e $script; foreach my $flavor (@installed_flavors) { print "Remove $pkg for $flavor\n"; if(-e $script && (system($script, $flavor, @installed_flavors) != 0)) { print STDERR "ERROR: remove script from $pkg package failed\n"; exit(1); } } } die "ERROR: cannot unlink $::installed_package_state_dir/$pkg: $!, " unless (unlink("$::installed_package_state_dir/$pkg") or $!{ENOENT}); packages/compat/dictionaries-common 0000644 00000000002 15027402473 0013467 0 ustar 00 0 packages/compat/emacsen-common 0000644 00000000002 15027402473 0012425 0 ustar 00 0 packages/remove/dictionaries-common 0000755 00000001332 15027402473 0013513 0 ustar 00 #!/bin/sh # # emacsen remove script for the Debian GNU/Linux # dictionaries-common package # # Written by Rafael Laboissiere <rafael@debian.org> and # Agustin Martin <agmartin@debian.org> based on # Dirk Eddelbuettel <edd@debian.org> script for the octave package. # ----------------------------------------------------------------- set -e # Canadian spelling ;-) flavour=$1 package=dictionaries-common destination=/usr/share/${flavour}/site-lisp/${package} if [ -d $destination ]; then echo remove/${package}: Purging byte-compiled files for flavour ${flavour} rm -f ${destination}/*.elc ${destination}/*.el ${destination}/done ${destination}/.nosearch rmdir --ignore-fail-on-non-empty ${destination} fi exit 0; packages/remove/emacsen-common 0000755 00000000326 15027402473 0012453 0 ustar 00 #!/bin/sh set -e flavor="$1" echo "emacsen-common: Handling removal of emacsen flavor $flavor" rm -f \ "/usr/share/$flavor/site-lisp/debian-startup.el" \ "/usr/share/$flavor/site-lisp/debian-startup.elc" packages/install/dictionaries-common 0000755 00000003700 15027402473 0013665 0 ustar 00 #!/bin/sh # # emacsen install script for the Debian GNU/Linux # dictionaries-common package # # Written by Rafael Laboissiere <rafael@debian.org> and # Agustin Martin <agmartin@debian.org> # # Some things taken from Dirk Eddelbuettel script for the octave package. # lpath.el trick is stolen from Davide Salvetti's auctex package # -------------------------------------------------------------- set -e # Canadian spelling ;-) flavour=$1 package=dictionaries-common files_base="debian-ispell.el" files="$files_base ispell.el flyspell.el" source=/usr/share/dictionaries-common/site-elisp destination=/usr/share/${flavour}/site-lisp/${package} case "$flavour" in xemacs*) flags="-no-site-file" ;; emacs19|emacs20|emacs21|emacs22|emacs-snapshot*) # Do not byte-compile anything for above emacsen flavours echo "install/${package}: Skipping byte-compilation for $flavour" exit 0 ;; emacs*) flags="--no-site-file" emacs_version=$($flavour -no-site-file --version | head -n 1 | sed 's/^.* Emacs //' ) if dpkg --compare-versions ${emacs_version} ge "24.5"; then files=${files_base} fi ;; *) echo install/${package}: Ignoring emacsen flavour [${flavour}] exit 0 ;; esac if [ -e "${destination}/done" ]; then echo "install/${package}: Already byte-compiled for ${flavour}. Skipping ..." else echo install/${package}: Byte-compiling for emacsen flavour ${flavour} # Make sure destination directory is available install -m 0755 -d ${destination} # Make sure current dir is in the load path cat << EOF > ${destination}/path.el (setq load-path (cons "." load-path) byte-compile-warnings nil) EOF flags="${flags} -q -batch -l path.el -f batch-byte-compile" ( # Go to the .elc dir, set sources symlinks, byte compile files and remove temp .el files from the .elc dir cd ${destination} touch .nosearch for i in $files; do ln -sf $source/$i done ${flavour} ${flags} ${files} rm path.el touch done ) fi exit 0; packages/install/emacsen-common 0000755 00000000771 15027402473 0012630 0 ustar 00 #!/bin/sh set -e flavor="$1" echo "emacsen-common: Handling install of emacsen flavor $flavor" rm -f \ "/usr/share/$flavor/site-lisp/debian-startup.el" \ "/usr/share/$flavor/site-lisp/debian-startup.elc" # Create symlinks to the .el files (see section 5E in debian-emacs polcy). (cd "/usr/share/$flavor/site-lisp" ln -s ../../emacsen-common/debian-startup.el .) "$flavor" --no-init-file --no-site-file -batch -f batch-byte-compile \ "/usr/share/$flavor/site-lisp/debian-startup.el" emacs-remove 0000755 00000002745 15027402473 0007071 0 ustar 00 #!/usr/bin/perl -w use Errno; use strict; my $lib_dir = "/usr/lib/emacsen-common"; my $invoked_by_old_pkg; my $flavor; require $lib_dir . "/lib.pl"; umask 0022 or die "emacs-remove: can't set umask, aborting."; sub usage { my($file_handle) = @_; if($invoked_by_old_pkg) { print $file_handle "Usage: emacs-remove FLAVOR\n"; } else { print $file_handle "Usage: emacs-remove --prerm FLAVOR\n"; } } if(scalar(@ARGV) == 1) { $invoked_by_old_pkg = 1; $flavor = $ARGV[0]; } elsif(scalar(@ARGV) == 2 && $ARGV[0] eq '--prerm') { $flavor = $ARGV[1]; } else { usage(*STDERR{IO}); exit(1); } my @ordered_pkg_list = reverse generate_add_on_install_list(get_installed_add_on_packages()); my @installed_flavors = get_installed_flavors(); foreach my $pkg (@ordered_pkg_list) { print "Remove $pkg for $flavor\n"; my $script = $lib_dir . "/packages/remove/$pkg"; my $failed; if(-e "$lib_dir/packages/compat/$pkg") # New-style package. { $failed = -e $script && (system($script, $flavor) != 0); } else # Old-style package. { $failed = -e $script && (system($script, $flavor, @installed_flavors) != 0); } if($failed) { print STDERR "ERROR: remove script from $pkg package failed\n"; exit(1); } } # Silence "single use" warning. $::installed_flavor_state_dir = $::installed_flavor_state_dir; die "ERROR: cannot unlink $::installed_flavor_state_dir/$flavor: $!, " unless (unlink("$::installed_flavor_state_dir/$flavor") or $!{ENOENT}); lib.pl 0000755 00000011540 15027402473 0005657 0 ustar 00 #!/usr/bin/perl -w use strict; use Cwd; # depends on: dpkg, tsort, perl my $lib_dir = "/usr/lib/emacsen-common"; my $var_dir = "/var/lib/emacsen-common"; $::installed_package_state_dir = "${var_dir}/state/package/installed"; $::installed_flavor_state_dir = "${var_dir}/state/flavor/installed"; sub ex { my(@cmd) = @_; if(system(@cmd) != 0) { die join(" ", @cmd) . " failed"; } } sub glob_in_dir { my ($dir, $pattern) = @_; my $oldir = getcwd; chdir($dir) or die "chdir $dir: $!"; my @files = glob("*[!~]"); chdir($oldir); return \@files; } sub validate_add_on_pkg { my ($pkg, $script, $old_invocation_style) = @_; if($old_invocation_style) { if(-e "$lib_dir/packages/compat/$pkg") { print STDERR "ERROR: $pkg is broken - called $script as an old-style add-on, but has compat file.\n"; #exit(1); } } else # New invocation style. { unless(-e "$lib_dir/packages/compat/$pkg") { print STDERR "ERROR: $pkg is broken - called $script as a new-style add-on, but has no compat file.\n"; #exit(1); } } } sub get_installed_add_on_packages { # Return all of the old format packages, plus all of the new-format # packages that are ready (i.e. have a state/installed file). In # this case ready means ready for compilation. my $all_pkgs = glob_in_dir("$lib_dir/packages/install", '*[!~]'); my $new_format_pkgs = glob_in_dir("$lib_dir/packages/compat", '*[!~]'); my %ready_pkgs = map { $_ => 1 } @$all_pkgs; for my $p (@$new_format_pkgs) { delete $ready_pkgs{$p} unless (-e "$::installed_package_state_dir/$p"); } my @result = keys %ready_pkgs; return \@result; } sub get_installed_flavors { my $flavors = glob_in_dir($::installed_flavor_state_dir, '*[!~]'); return @$flavors; } sub get_package_status { my($pkg) = @_; my $status = `dpkg --status $pkg`; die 'emacsen-common: dpkg invocation failed' if($? != 0); $status =~ s/\n\s+//gmo; # handle any continuation lines... return $status; } sub filter_depends { my($depends_string, $installed_add_ons) = @_; # Filter out all the "noise" (version number dependencies, etc) # and handle or deps too, i.e. "Depends: foo, bar | baz" my @relevant_depends = split(/[,|]/, $depends_string); @relevant_depends = map { /\s*(\S+)/o; $1; } @relevant_depends; # Filter out all non-add-on packages. @relevant_depends = grep { my $candidate = $_; grep { $_ eq $candidate } @$installed_add_ons; } @relevant_depends; return @relevant_depends; } sub generate_relevant_tsort_dependencies_internals { my($pkglist, $installed_add_ons, $progress_hash) = @_; # print "GRD: " . join(" ", @$pkglist) . "\n"; my $pkg = shift @$pkglist; if(!$pkg || $$progress_hash{$pkg}) { return (); } else { my $status = get_package_status($pkg); $status =~ /^Depends:\s+(.*)/mo; my $depends = $1; $depends = "" if ! $depends; my @relevant_depends = filter_depends($depends, $installed_add_ons); my $newpkglist = [@$pkglist, @relevant_depends]; $$progress_hash{$pkg} = 1; # pkg is in twice so we don't have to worry about package with no # relevant dependencies. tsort can't handle that. my @tsort_strings = "$pkg $pkg\n"; map { push @tsort_strings, "$_ $pkg\n"; } @relevant_depends; return (@tsort_strings, generate_relevant_tsort_dependencies_internals($newpkglist, $installed_add_ons, $progress_hash)); } } sub generate_relevant_tsort_dependencies { my($pkglist, $installed_add_ons, $progress_hash) = @_; # Make a copy because we're going to mangle it. my @listcopy = @$pkglist; shift @_; return(generate_relevant_tsort_dependencies_internals(\@listcopy, @_)); } sub reorder_add_on_packages { my($pkglist, $installed_add_ons) = @_; my @depends = generate_relevant_tsort_dependencies($pkglist, $installed_add_ons, {}); my $pid = open(TSORT, "-|"); die "Couldn't fork for tsort: $!" unless defined($pid); # What a strange idiom... if($pid == 0) { my $sub_pid = open(IN, "|-"); die "Couldn't sub-fork for tsort: $!" unless defined($sub_pid); if($sub_pid == 0) { exec 'tsort' or die "Couldn't run tsort: $!"; } print IN @depends; exit 0; } my @ordered_pkgs = <TSORT>; chomp @ordered_pkgs; return @ordered_pkgs } sub generate_add_on_install_list { my($packages_to_sort) = @_; my @sorted_pkgs = reorder_add_on_packages($packages_to_sort, get_installed_add_on_packages()); return(@sorted_pkgs); } # Test code # my @input_packages = <STDIN>; # my @result = generate_add_on_install_list(@input_packages); # print " " . join("\n ", @result); # To make require happy... 1; debian-startup.el 0000644 00000011143 15027444743 0010022 0 ustar 00 ;;; debian-startup.el --- Debian specific emacsen startup code. ;; Copyright (C) 1998-2017 Rob Browning ;; Maintainer: Rob Browning <rlb@defaultvalue.org> ;; Keywords: debian ;; This file is part of the debian release of GNU Emacs, and will ;; be contributed to the FSF after testing. It is released under the same ;; terms, namely the GPL v2 or later. ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: ;; This file contains startup code needed by all the various flavors ;; of Emacs for a Debian system. (defun debian-pkg-add-load-path-item (item) "Takes a path item (a string) and adds it to load path in the correct position for an add-on package, before the emacs system directories, but after the /usr/local/ directories. After modifying load-path, returns the new load-path." (let ((pos 0) (last-local-pos nil) (lp-rest load-path)) ;; Find the last /usr/local/ element. (while (not (null lp-rest)) (if (and (not (null (car lp-rest))) (string-match "^/usr/local" (car lp-rest))) (setq last-local-pos pos)) (setq pos (+ pos 1)) (setq lp-rest (cdr lp-rest))) (if (not last-local-pos) (error "No /usr/local/ prefixed paths in load-path")) (let ((result '()) (pos 0) (remainder load-path)) (while (consp remainder) (setq result (cons (car remainder) result)) (setq remainder (cdr remainder)) (if (= pos last-local-pos) (setq result (cons item result))) (setq pos (+ pos 1))) (setq load-path (nreverse result)) load-path))) (defun debian-unique-strings (strings) "Takes a list of strings and returns the list with *adjacent* duplicates removed." (let ((result '())) (while (consp strings) (if (not (string= (car strings) (car (cdr strings)))) (setq result (cons (car strings) result))) (setq strings (cdr strings))) (nreverse result))) (defun debian-run-directories (&rest dirs) "Load each file of the form XXfilename.el or XXfilename.elc in any of the dirs, where XX must be a number. The files will be run in alphabetical order. If a file appears in more than one of the dirs, then the earlier dir takes precedence, and a .elc file always supercedes a .el file of the same name." (let* ((paths (mapcar 'copy-sequence dirs)) ; Ensure we have unique objects. ;; Get a list of all the files in all the specified ;; directories that match the pattern. (files (apply 'append (mapcar (lambda (dir) (directory-files dir nil "^[0-9][0-9].*\\.elc?$" t)) paths))) ;; Now strip the directory portion, remove any .el or .elc ;; extension. (stripped-names (mapcar (lambda (file) (if (string-match "\\.el$" file) (substring file 0 -3) (if (string-match "\\.elc$" file) (substring file 0 -4) file))) (mapcar (lambda (file) (file-name-nondirectory file)) files))) ;; Finally sort them, and delete duplicates (base-names (debian-unique-strings (sort stripped-names 'string<)))) (setq load-path (append paths load-path)) ; Prefix paths temporarily. ;; Now load the files. "load" will make sure we get the byte ;; compiled one first, if any, and will respect load-path's ;; ordering. (mapc (lambda (file) (condition-case err (load file nil) (error (message "Error while loading %s: %s" file (error-message-string err))))) base-names) ;; Remove the paths we inserted, and only those paths. (dolist (item paths) (setq load-path (remq item load-path))))) (defun debian-startup (flavor) (debian-run-directories (format "/etc/%s/site-start.d" (symbol-name flavor))))
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings