--- libfile-chdir-perl-0.1008.orig/MYMETA.yml +++ libfile-chdir-perl-0.1008/MYMETA.yml @@ -0,0 +1,31 @@ +--- +abstract: 'a more sensible way to change directories' +author: + - 'David A Golden , Michael G Schwern (original author)' +build_requires: + File::Find: 0 + File::Temp: 0 + Test::More: 0 + warnings: 0 +configure_requires: + ExtUtils::MakeMaker: 6.30 +distribution_type: module +dynamic_config: 0 +generated_by: 'ExtUtils::MakeMaker version 6.57_05' +license: perl +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 +name: File-chdir +no_index: + directory: + - t + - inc +requires: + Carp: 0 + Cwd: 3.16 + Exporter: 0 + File::Spec::Functions: 3.27 + strict: 0 + vars: 0 +version: 0.1008 --- libfile-chdir-perl-0.1008.orig/Makefile +++ libfile-chdir-perl-0.1008/Makefile @@ -0,0 +1,809 @@ +# This Makefile is for the File::chdir extension to perl. +# +# It was generated automatically by MakeMaker version +# 6.57_05 (Revision: 65705) from the contents of +# Makefile.PL. Don't edit this file, edit Makefile.PL instead. +# +# ANY CHANGES MADE HERE WILL BE LOST! +# +# MakeMaker ARGV: (q[INSTALLDIRS=vendor]) +# + +# MakeMaker Parameters: + +# ABSTRACT => q[a more sensible way to change directories] +# AUTHOR => [q[David A Golden , Michael G Schwern (original author)]] +# BUILD_REQUIRES => { warnings=>q[0], Test::More=>q[0], File::Find=>q[0], File::Temp=>q[0] } +# CONFIGURE_REQUIRES => { ExtUtils::MakeMaker=>q[6.30] } +# DISTNAME => q[File-chdir] +# EXE_FILES => [] +# LICENSE => q[perl] +# NAME => q[File::chdir] +# PREREQ_PM => { warnings=>q[0], vars=>q[0], Exporter=>q[0], Carp=>q[0], strict=>q[0], Test::More=>q[0], File::Find=>q[0], File::Temp=>q[0], File::Spec::Functions=>q[3.27], Cwd=>q[3.16] } +# VERSION => q[0.1008] +# test => { TESTS=>q[t/*.t] } + +# --- MakeMaker post_initialize section: + + +# --- MakeMaker const_config section: + +# These definitions are from config.sh (via /usr/lib/perl/5.14/Config.pm). +# They may have been overridden via Makefile.PL or on the command line. +AR = ar +CC = cc +CCCDLFLAGS = -fPIC +CCDLFLAGS = -Wl,-E +DLEXT = so +DLSRC = dl_dlopen.xs +EXE_EXT = +FULL_AR = /usr/bin/ar +LD = cc +LDDLFLAGS = -shared -L/usr/local/lib -fstack-protector +LDFLAGS = -fstack-protector -L/usr/local/lib +LIBC = +LIB_EXT = .a +OBJ_EXT = .o +OSNAME = linux +OSVERS = 3.2.0-4-686-pae +RANLIB = : +SITELIBEXP = /usr/local/share/perl/5.14.2 +SITEARCHEXP = /usr/local/lib/perl/5.14.2 +SO = so +VENDORARCHEXP = /usr/lib/perl5 +VENDORLIBEXP = /usr/share/perl5 + + +# --- MakeMaker constants section: +AR_STATIC_ARGS = cr +DIRFILESEP = / +DFSEP = $(DIRFILESEP) +NAME = File::chdir +NAME_SYM = File_chdir +VERSION = 0.1008 +VERSION_MACRO = VERSION +VERSION_SYM = 0_1008 +DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\" +XS_VERSION = 0.1008 +XS_VERSION_MACRO = XS_VERSION +XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\" +INST_ARCHLIB = blib/arch +INST_SCRIPT = blib/script +INST_BIN = blib/bin +INST_LIB = blib/lib +INST_MAN1DIR = blib/man1 +INST_MAN3DIR = blib/man3 +MAN1EXT = 1p +MAN3EXT = 3pm +INSTALLDIRS = vendor +DESTDIR = +PREFIX = /usr +PERLPREFIX = $(PREFIX) +SITEPREFIX = $(PREFIX)/local +VENDORPREFIX = $(PREFIX) +INSTALLPRIVLIB = $(PERLPREFIX)/share/perl/5.14 +DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB) +INSTALLSITELIB = $(SITEPREFIX)/share/perl/5.14.2 +DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB) +INSTALLVENDORLIB = $(VENDORPREFIX)/share/perl5 +DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB) +INSTALLARCHLIB = $(PERLPREFIX)/lib/perl/5.14 +DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB) +INSTALLSITEARCH = $(SITEPREFIX)/lib/perl/5.14.2 +DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH) +INSTALLVENDORARCH = $(VENDORPREFIX)/lib/perl5 +DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH) +INSTALLBIN = $(PERLPREFIX)/bin +DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN) +INSTALLSITEBIN = $(SITEPREFIX)/bin +DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN) +INSTALLVENDORBIN = $(VENDORPREFIX)/bin +DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN) +INSTALLSCRIPT = $(PERLPREFIX)/bin +DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT) +INSTALLSITESCRIPT = $(SITEPREFIX)/bin +DESTINSTALLSITESCRIPT = $(DESTDIR)$(INSTALLSITESCRIPT) +INSTALLVENDORSCRIPT = $(VENDORPREFIX)/bin +DESTINSTALLVENDORSCRIPT = $(DESTDIR)$(INSTALLVENDORSCRIPT) +INSTALLMAN1DIR = $(PERLPREFIX)/share/man/man1 +DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR) +INSTALLSITEMAN1DIR = $(SITEPREFIX)/man/man1 +DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR) +INSTALLVENDORMAN1DIR = $(VENDORPREFIX)/share/man/man1 +DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR) +INSTALLMAN3DIR = $(PERLPREFIX)/share/man/man3 +DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR) +INSTALLSITEMAN3DIR = $(SITEPREFIX)/man/man3 +DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR) +INSTALLVENDORMAN3DIR = $(VENDORPREFIX)/share/man/man3 +DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR) +PERL_LIB = /usr/share/perl/5.14 +PERL_ARCHLIB = /usr/lib/perl/5.14 +LIBPERL_A = libperl.a +FIRST_MAKEFILE = Makefile +MAKEFILE_OLD = Makefile.old +MAKE_APERL_FILE = Makefile.aperl +PERLMAINCC = $(CC) +PERL_INC = /usr/lib/perl/5.14/CORE +PERL = /usr/bin/perl +FULLPERL = /usr/bin/perl +ABSPERL = $(PERL) +PERLRUN = $(PERL) +FULLPERLRUN = $(FULLPERL) +ABSPERLRUN = $(ABSPERL) +PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" +FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" +ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" +PERL_CORE = 0 +PERM_DIR = 755 +PERM_RW = 644 +PERM_RWX = 755 + +MAKEMAKER = /usr/share/perl/5.14/ExtUtils/MakeMaker.pm +MM_VERSION = 6.57_05 +MM_REVISION = 65705 + +# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle). +# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle) +# PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar) +# DLBASE = Basename part of dynamic library. May be just equal BASEEXT. +MAKE = make +FULLEXT = File/chdir +BASEEXT = chdir +PARENT_NAME = File +DLBASE = $(BASEEXT) +VERSION_FROM = +OBJECT = +LDFROM = $(OBJECT) +LINKTYPE = dynamic +BOOTDEP = + +# Handy lists of source code files: +XS_FILES = +C_FILES = +O_FILES = +H_FILES = +MAN1PODS = +MAN3PODS = lib/File/chdir.pm + +# Where is the Config information that we are using/depend on +CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h + +# Where to build things +INST_LIBDIR = $(INST_LIB)/File +INST_ARCHLIBDIR = $(INST_ARCHLIB)/File + +INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT) +INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT) + +INST_STATIC = +INST_DYNAMIC = +INST_BOOT = + +# Extra linker info +EXPORT_LIST = +PERL_ARCHIVE = +PERL_ARCHIVE_AFTER = + + +TO_INST_PM = lib/File/chdir.pm + +PM_TO_BLIB = lib/File/chdir.pm \ + blib/lib/File/chdir.pm + + +# --- MakeMaker platform_constants section: +MM_Unix_VERSION = 6.57_05 +PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc + + +# --- MakeMaker tool_autosplit section: +# Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto +AUTOSPLITFILE = $(ABSPERLRUN) -e 'use AutoSplit; autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1)' -- + + + +# --- MakeMaker tool_xsubpp section: + + +# --- MakeMaker tools_other section: +SHELL = /bin/sh +CHMOD = chmod +CP = cp +MV = mv +NOOP = $(TRUE) +NOECHO = @ +RM_F = rm -f +RM_RF = rm -rf +TEST_F = test -f +TOUCH = touch +UMASK_NULL = umask 0 +DEV_NULL = > /dev/null 2>&1 +MKPATH = $(ABSPERLRUN) -MExtUtils::Command -e 'mkpath' -- +EQUALIZE_TIMESTAMP = $(ABSPERLRUN) -MExtUtils::Command -e 'eqtime' -- +FALSE = false +TRUE = true +ECHO = echo +ECHO_N = echo -n +UNINST = 0 +VERBINST = 0 +MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e 'install([ from_to => {@ARGV}, verbose => '\''$(VERBINST)'\'', uninstall_shadows => '\''$(UNINST)'\'', dir_mode => '\''$(PERM_DIR)'\'' ]);' -- +DOC_INSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'perllocal_install' -- +UNINSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'uninstall' -- +WARN_IF_OLD_PACKLIST = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'warn_if_old_packlist' -- +MACROSTART = +MACROEND = +USEMAKEFILE = -f +FIXIN = $(ABSPERLRUN) -MExtUtils::MY -e 'MY->fixin(shift)' -- + + +# --- MakeMaker makemakerdflt section: +makemakerdflt : all + $(NOECHO) $(NOOP) + + +# --- MakeMaker dist section: +TAR = tar +TARFLAGS = cvf +ZIP = zip +ZIPFLAGS = -r +COMPRESS = gzip --best +SUFFIX = .gz +SHAR = shar +PREOP = $(NOECHO) $(NOOP) +POSTOP = $(NOECHO) $(NOOP) +TO_UNIX = $(NOECHO) $(NOOP) +CI = ci -u +RCS_LABEL = rcs -Nv$(VERSION_SYM): -q +DIST_CP = best +DIST_DEFAULT = tardist +DISTNAME = File-chdir +DISTVNAME = File-chdir-0.1008 + + +# --- MakeMaker macro section: + + +# --- MakeMaker depend section: + + +# --- MakeMaker cflags section: + + +# --- MakeMaker const_loadlibs section: + + +# --- MakeMaker const_cccmd section: + + +# --- MakeMaker post_constants section: + + +# --- MakeMaker pasthru section: + +PASTHRU = LIBPERL_A="$(LIBPERL_A)"\ + LINKTYPE="$(LINKTYPE)"\ + LD="$(LD)"\ + PREFIX="$(PREFIX)" + + +# --- MakeMaker special_targets section: +.SUFFIXES : .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT) + +.PHONY: all config static dynamic test linkext manifest blibdirs clean realclean disttest distdir + + + +# --- MakeMaker c_o section: + + +# --- MakeMaker xs_c section: + + +# --- MakeMaker xs_o section: + + +# --- MakeMaker top_targets section: +all :: pure_all manifypods + $(NOECHO) $(NOOP) + + +pure_all :: config pm_to_blib subdirs linkext + $(NOECHO) $(NOOP) + +subdirs :: $(MYEXTLIB) + $(NOECHO) $(NOOP) + +config :: $(FIRST_MAKEFILE) blibdirs + $(NOECHO) $(NOOP) + +help : + perldoc ExtUtils::MakeMaker + + +# --- MakeMaker blibdirs section: +blibdirs : $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists + $(NOECHO) $(NOOP) + +# Backwards compat with 6.18 through 6.25 +blibdirs.ts : blibdirs + $(NOECHO) $(NOOP) + +$(INST_LIBDIR)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_LIBDIR) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_LIBDIR) + $(NOECHO) $(TOUCH) $(INST_LIBDIR)$(DFSEP).exists + +$(INST_ARCHLIB)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_ARCHLIB) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHLIB) + $(NOECHO) $(TOUCH) $(INST_ARCHLIB)$(DFSEP).exists + +$(INST_AUTODIR)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_AUTODIR) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_AUTODIR) + $(NOECHO) $(TOUCH) $(INST_AUTODIR)$(DFSEP).exists + +$(INST_ARCHAUTODIR)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHAUTODIR) + $(NOECHO) $(TOUCH) $(INST_ARCHAUTODIR)$(DFSEP).exists + +$(INST_BIN)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_BIN) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_BIN) + $(NOECHO) $(TOUCH) $(INST_BIN)$(DFSEP).exists + +$(INST_SCRIPT)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_SCRIPT) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_SCRIPT) + $(NOECHO) $(TOUCH) $(INST_SCRIPT)$(DFSEP).exists + +$(INST_MAN1DIR)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_MAN1DIR) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN1DIR) + $(NOECHO) $(TOUCH) $(INST_MAN1DIR)$(DFSEP).exists + +$(INST_MAN3DIR)$(DFSEP).exists :: Makefile.PL + $(NOECHO) $(MKPATH) $(INST_MAN3DIR) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN3DIR) + $(NOECHO) $(TOUCH) $(INST_MAN3DIR)$(DFSEP).exists + + + +# --- MakeMaker linkext section: + +linkext :: $(LINKTYPE) + $(NOECHO) $(NOOP) + + +# --- MakeMaker dlsyms section: + + +# --- MakeMaker dynamic section: + +dynamic :: $(FIRST_MAKEFILE) $(INST_DYNAMIC) $(INST_BOOT) + $(NOECHO) $(NOOP) + + +# --- MakeMaker dynamic_bs section: + +BOOTSTRAP = + + +# --- MakeMaker dynamic_lib section: + + +# --- MakeMaker static section: + +## $(INST_PM) has been moved to the all: target. +## It remains here for awhile to allow for old usage: "make static" +static :: $(FIRST_MAKEFILE) $(INST_STATIC) + $(NOECHO) $(NOOP) + + +# --- MakeMaker static_lib section: + + +# --- MakeMaker manifypods section: + +POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--" +POD2MAN = $(POD2MAN_EXE) + + +manifypods : pure_all \ + lib/File/chdir.pm + $(NOECHO) $(POD2MAN) --section=$(MAN3EXT) --perm_rw=$(PERM_RW) \ + lib/File/chdir.pm $(INST_MAN3DIR)/File::chdir.$(MAN3EXT) + + + + +# --- MakeMaker processPL section: + + +# --- MakeMaker installbin section: + + +# --- MakeMaker subdirs section: + +# none + +# --- MakeMaker clean_subdirs section: +clean_subdirs : + $(NOECHO) $(NOOP) + + +# --- MakeMaker clean section: + +# Delete temporary files but do not touch installed files. We don't delete +# the Makefile here so a later make realclean still has a makefile to use. + +clean :: clean_subdirs + - $(RM_F) \ + *$(LIB_EXT) core \ + core.[0-9] $(INST_ARCHAUTODIR)/extralibs.all \ + core.[0-9][0-9] $(BASEEXT).bso \ + pm_to_blib.ts core.[0-9][0-9][0-9][0-9] \ + MYMETA.yml $(BASEEXT).x \ + $(BOOTSTRAP) perl$(EXE_EXT) \ + tmon.out *$(OBJ_EXT) \ + pm_to_blib $(INST_ARCHAUTODIR)/extralibs.ld \ + blibdirs.ts core.[0-9][0-9][0-9][0-9][0-9] \ + *perl.core core.*perl.*.? \ + $(MAKE_APERL_FILE) $(BASEEXT).def \ + perl core.[0-9][0-9][0-9] \ + mon.out lib$(BASEEXT).def \ + perlmain.c perl.exe \ + so_locations $(BASEEXT).exp + - $(RM_RF) \ + blib + - $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL) + + +# --- MakeMaker realclean_subdirs section: +realclean_subdirs : + $(NOECHO) $(NOOP) + + +# --- MakeMaker realclean section: +# Delete temporary files (via clean) and also delete dist files +realclean purge :: clean realclean_subdirs + - $(RM_F) \ + $(MAKEFILE_OLD) $(FIRST_MAKEFILE) + - $(RM_RF) \ + $(DISTVNAME) + + +# --- MakeMaker metafile section: +metafile : create_distdir + $(NOECHO) $(ECHO) Generating META.yml + $(NOECHO) $(ECHO) '--- #YAML:1.0' > META_new.yml + $(NOECHO) $(ECHO) 'name: File-chdir' >> META_new.yml + $(NOECHO) $(ECHO) 'version: 0.1008' >> META_new.yml + $(NOECHO) $(ECHO) 'abstract: a more sensible way to change directories' >> META_new.yml + $(NOECHO) $(ECHO) 'author:' >> META_new.yml + $(NOECHO) $(ECHO) ' - David A Golden , Michael G Schwern (original author)' >> META_new.yml + $(NOECHO) $(ECHO) 'license: perl' >> META_new.yml + $(NOECHO) $(ECHO) 'distribution_type: module' >> META_new.yml + $(NOECHO) $(ECHO) 'configure_requires:' >> META_new.yml + $(NOECHO) $(ECHO) ' ExtUtils::MakeMaker: 6.30' >> META_new.yml + $(NOECHO) $(ECHO) 'build_requires:' >> META_new.yml + $(NOECHO) $(ECHO) ' File::Find: 0' >> META_new.yml + $(NOECHO) $(ECHO) ' File::Temp: 0' >> META_new.yml + $(NOECHO) $(ECHO) ' Test::More: 0' >> META_new.yml + $(NOECHO) $(ECHO) ' warnings: 0' >> META_new.yml + $(NOECHO) $(ECHO) 'requires:' >> META_new.yml + $(NOECHO) $(ECHO) ' Carp: 0' >> META_new.yml + $(NOECHO) $(ECHO) ' Cwd: 3.16' >> META_new.yml + $(NOECHO) $(ECHO) ' Exporter: 0' >> META_new.yml + $(NOECHO) $(ECHO) ' File::Spec::Functions: 3.27' >> META_new.yml + $(NOECHO) $(ECHO) ' strict: 0' >> META_new.yml + $(NOECHO) $(ECHO) ' vars: 0' >> META_new.yml + $(NOECHO) $(ECHO) 'no_index:' >> META_new.yml + $(NOECHO) $(ECHO) ' directory:' >> META_new.yml + $(NOECHO) $(ECHO) ' - t' >> META_new.yml + $(NOECHO) $(ECHO) ' - inc' >> META_new.yml + $(NOECHO) $(ECHO) 'generated_by: ExtUtils::MakeMaker version 6.57_05' >> META_new.yml + $(NOECHO) $(ECHO) 'meta-spec:' >> META_new.yml + $(NOECHO) $(ECHO) ' url: http://module-build.sourceforge.net/META-spec-v1.4.html' >> META_new.yml + $(NOECHO) $(ECHO) ' version: 1.4' >> META_new.yml + -$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml + + +# --- MakeMaker signature section: +signature : + cpansign -s + + +# --- MakeMaker dist_basics section: +distclean :: realclean distcheck + $(NOECHO) $(NOOP) + +distcheck : + $(PERLRUN) "-MExtUtils::Manifest=fullcheck" -e fullcheck + +skipcheck : + $(PERLRUN) "-MExtUtils::Manifest=skipcheck" -e skipcheck + +manifest : + $(PERLRUN) "-MExtUtils::Manifest=mkmanifest" -e mkmanifest + +veryclean : realclean + $(RM_F) *~ */*~ *.orig */*.orig *.bak */*.bak *.old */*.old + + + +# --- MakeMaker dist_core section: + +dist : $(DIST_DEFAULT) $(FIRST_MAKEFILE) + $(NOECHO) $(ABSPERLRUN) -l -e 'print '\''Warning: Makefile possibly out of date with $(VERSION_FROM)'\''' \ + -e ' if -e '\''$(VERSION_FROM)'\'' and -M '\''$(VERSION_FROM)'\'' < -M '\''$(FIRST_MAKEFILE)'\'';' -- + +tardist : $(DISTVNAME).tar$(SUFFIX) + $(NOECHO) $(NOOP) + +uutardist : $(DISTVNAME).tar$(SUFFIX) + uuencode $(DISTVNAME).tar$(SUFFIX) $(DISTVNAME).tar$(SUFFIX) > $(DISTVNAME).tar$(SUFFIX)_uu + +$(DISTVNAME).tar$(SUFFIX) : distdir + $(PREOP) + $(TO_UNIX) + $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME) + $(RM_RF) $(DISTVNAME) + $(COMPRESS) $(DISTVNAME).tar + $(POSTOP) + +zipdist : $(DISTVNAME).zip + $(NOECHO) $(NOOP) + +$(DISTVNAME).zip : distdir + $(PREOP) + $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME) + $(RM_RF) $(DISTVNAME) + $(POSTOP) + +shdist : distdir + $(PREOP) + $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar + $(RM_RF) $(DISTVNAME) + $(POSTOP) + + +# --- MakeMaker distdir section: +create_distdir : + $(RM_RF) $(DISTVNAME) + $(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \ + -e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');" + +distdir : create_distdir distmeta + $(NOECHO) $(NOOP) + + + +# --- MakeMaker dist_test section: +disttest : distdir + cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL "INSTALLDIRS=vendor" + cd $(DISTVNAME) && $(MAKE) $(PASTHRU) + cd $(DISTVNAME) && $(MAKE) test $(PASTHRU) + + + +# --- MakeMaker dist_ci section: + +ci : + $(PERLRUN) "-MExtUtils::Manifest=maniread" \ + -e "@all = keys %{ maniread() };" \ + -e "print(qq{Executing $(CI) @all\n}); system(qq{$(CI) @all});" \ + -e "print(qq{Executing $(RCS_LABEL) ...\n}); system(qq{$(RCS_LABEL) @all});" + + +# --- MakeMaker distmeta section: +distmeta : create_distdir metafile + $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{META.yml} => q{Module meta-data (added by MakeMaker)}}) } ' \ + -e ' or print "Could not add META.yml to MANIFEST: $${'\''@'\''}\n"' -- + + + +# --- MakeMaker distsignature section: +distsignature : create_distdir + $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) } ' \ + -e ' or print "Could not add SIGNATURE to MANIFEST: $${'\''@'\''}\n"' -- + $(NOECHO) cd $(DISTVNAME) && $(TOUCH) SIGNATURE + cd $(DISTVNAME) && cpansign -s + + + +# --- MakeMaker install section: + +install :: pure_install doc_install + $(NOECHO) $(NOOP) + +install_perl :: pure_perl_install doc_perl_install + $(NOECHO) $(NOOP) + +install_site :: pure_site_install doc_site_install + $(NOECHO) $(NOOP) + +install_vendor :: pure_vendor_install doc_vendor_install + $(NOECHO) $(NOOP) + +pure_install :: pure_$(INSTALLDIRS)_install + $(NOECHO) $(NOOP) + +doc_install :: doc_$(INSTALLDIRS)_install + $(NOECHO) $(NOOP) + +pure__install : pure_site_install + $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site + +doc__install : doc_site_install + $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site + +pure_perl_install :: all + $(NOECHO) umask 022; $(MOD_INSTALL) \ + $(INST_LIB) $(DESTINSTALLPRIVLIB) \ + $(INST_ARCHLIB) $(DESTINSTALLARCHLIB) \ + $(INST_BIN) $(DESTINSTALLBIN) \ + $(INST_SCRIPT) $(DESTINSTALLSCRIPT) \ + $(INST_MAN1DIR) $(DESTINSTALLMAN1DIR) \ + $(INST_MAN3DIR) $(DESTINSTALLMAN3DIR) + $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ + $(SITEARCHEXP)/auto/$(FULLEXT) + + +pure_site_install :: all + $(NOECHO) umask 02; $(MOD_INSTALL) \ + read $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist \ + write $(DESTINSTALLSITEARCH)/auto/$(FULLEXT)/.packlist \ + $(INST_LIB) $(DESTINSTALLSITELIB) \ + $(INST_ARCHLIB) $(DESTINSTALLSITEARCH) \ + $(INST_BIN) $(DESTINSTALLSITEBIN) \ + $(INST_SCRIPT) $(DESTINSTALLSITESCRIPT) \ + $(INST_MAN1DIR) $(DESTINSTALLSITEMAN1DIR) \ + $(INST_MAN3DIR) $(DESTINSTALLSITEMAN3DIR) + $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ + $(PERL_ARCHLIB)/auto/$(FULLEXT) + +pure_vendor_install :: all + $(NOECHO) umask 022; $(MOD_INSTALL) \ + $(INST_LIB) $(DESTINSTALLVENDORLIB) \ + $(INST_ARCHLIB) $(DESTINSTALLVENDORARCH) \ + $(INST_BIN) $(DESTINSTALLVENDORBIN) \ + $(INST_SCRIPT) $(DESTINSTALLVENDORSCRIPT) \ + $(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) \ + $(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR) + +doc_perl_install :: all + +doc_site_install :: all + $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLSITEARCH)/perllocal.pod + -$(NOECHO) umask 02; $(MKPATH) $(DESTINSTALLSITEARCH) + -$(NOECHO) umask 02; $(DOC_INSTALL) \ + "Module" "$(NAME)" \ + "installed into" "$(INSTALLSITELIB)" \ + LINKTYPE "$(LINKTYPE)" \ + VERSION "$(VERSION)" \ + EXE_FILES "$(EXE_FILES)" \ + >> $(DESTINSTALLSITEARCH)/perllocal.pod + +doc_vendor_install :: all + + +uninstall :: uninstall_from_$(INSTALLDIRS)dirs + $(NOECHO) $(NOOP) + +uninstall_from_perldirs :: + +uninstall_from_sitedirs :: + $(NOECHO) $(UNINSTALL) $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist + +uninstall_from_vendordirs :: + + + +# --- MakeMaker force section: +# Phony target to force checking subdirectories. +FORCE : + $(NOECHO) $(NOOP) + + +# --- MakeMaker perldepend section: + + +# --- MakeMaker makefile section: +# We take a very conservative approach here, but it's worth it. +# We move Makefile to Makefile.old here to avoid gnu make looping. +$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP) + $(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?" + $(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..." + -$(NOECHO) $(RM_F) $(MAKEFILE_OLD) + -$(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) + - $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL) + $(PERLRUN) Makefile.PL "INSTALLDIRS=vendor" + $(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <==" + $(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <==" + $(FALSE) + + + +# --- MakeMaker staticmake section: + +# --- MakeMaker makeaperl section --- +MAP_TARGET = perl +FULLPERL = /usr/bin/perl + +$(MAP_TARGET) :: static $(MAKE_APERL_FILE) + $(MAKE) $(USEMAKEFILE) $(MAKE_APERL_FILE) $@ + +$(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib + $(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET) + $(NOECHO) $(PERLRUNINST) \ + Makefile.PL DIR= \ + MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \ + MAKEAPERL=1 NORECURS=1 CCCDLFLAGS= \ + INSTALLDIRS=vendor + + +# --- MakeMaker test section: + +TEST_VERBOSE=0 +TEST_TYPE=test_$(LINKTYPE) +TEST_FILE = test.pl +TEST_FILES = t/*.t +TESTDB_SW = -d + +testdb :: testdb_$(LINKTYPE) + +test :: $(TEST_TYPE) subdirs-test + +subdirs-test :: + $(NOECHO) $(NOOP) + + +test_dynamic :: pure_all + PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) + +testdb_dynamic :: pure_all + PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE) + +test_ : test_dynamic + +test_static :: test_dynamic +testdb_static :: testdb_dynamic + + +# --- MakeMaker ppd section: +# Creates a PPD (Perl Package Description) for a binary distribution. +ppd : + $(NOECHO) $(ECHO) '' > $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' a more sensible way to change directories' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' David A Golden <dagolden@cpan.org>, Michael G Schwern <schwern@pobox.com> (original author)' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) '' >> $(DISTNAME).ppd + + +# --- MakeMaker pm_to_blib section: + +pm_to_blib : $(FIRST_MAKEFILE) $(TO_INST_PM) + $(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', q[$(PM_FILTER)], '\''$(PERM_DIR)'\'')' -- \ + lib/File/chdir.pm blib/lib/File/chdir.pm + $(NOECHO) $(TOUCH) pm_to_blib + + +# --- MakeMaker selfdocument section: + + +# --- MakeMaker postamble section: + + +# End. --- libfile-chdir-perl-0.1008.orig/blib/lib/File/chdir.pm +++ libfile-chdir-perl-0.1008/blib/lib/File/chdir.pm @@ -0,0 +1,460 @@ +package File::chdir; +use 5.004; +use strict; +use vars qw($VERSION @ISA @EXPORT $CWD @CWD); +# ABSTRACT: a more sensible way to change directories +our $VERSION = '0.1008'; # VERSION + +require Exporter; +@ISA = qw(Exporter); +@EXPORT = qw(*CWD); + +use Carp; +use Cwd 3.16; +use File::Spec::Functions 3.27 qw/canonpath splitpath catpath splitdir catdir/; + +tie $CWD, 'File::chdir::SCALAR' or die "Can't tie \$CWD"; +tie @CWD, 'File::chdir::ARRAY' or die "Can't tie \@CWD"; + +sub _abs_path { + # Otherwise we'll never work under taint mode. + my($cwd) = Cwd::getcwd =~ /(.*)/s; + # Run through File::Spec, since everything else uses it + return canonpath($cwd); +} + +# splitpath but also split directory +sub _split_cwd { + my ($vol, $dir) = splitpath(_abs_path, 1); + my @dirs = splitdir( $dir ); + shift @dirs; # get rid of leading empty "root" directory + return ($vol, @dirs); +} + +# catpath, but take list of directories +# restore the empty root dir and provide an empty file to avoid warnings +sub _catpath { + my ($vol, @dirs) = @_; + return catpath($vol, catdir(q{}, @dirs), q{}); +} + +sub _chdir { + # Untaint target directory + my ($new_dir) = $_[0] =~ /(.*)/s; + + local $Carp::CarpLevel = $Carp::CarpLevel + 1; + if ( ! CORE::chdir($new_dir) ) { + croak "Failed to change directory to '$new_dir': $!"; + }; + return 1; +} + +{ + package File::chdir::SCALAR; + use Carp; + + BEGIN { + *_abs_path = \&File::chdir::_abs_path; + *_chdir = \&File::chdir::_chdir; + *_split_cwd = \&File::chdir::_split_cwd; + *_catpath = \&File::chdir::_catpath; + } + + sub TIESCALAR { + bless [], $_[0]; + } + + # To be safe, in case someone chdir'd out from under us, we always + # check the Cwd explicitly. + sub FETCH { + return _abs_path; + } + + sub STORE { + return unless defined $_[1]; + _chdir($_[1]); + } +} + + +{ + package File::chdir::ARRAY; + use Carp; + + BEGIN { + *_abs_path = \&File::chdir::_abs_path; + *_chdir = \&File::chdir::_chdir; + *_split_cwd = \&File::chdir::_split_cwd; + *_catpath = \&File::chdir::_catpath; + } + + sub TIEARRAY { + bless {}, $_[0]; + } + + sub FETCH { + my($self, $idx) = @_; + my ($vol, @cwd) = _split_cwd; + return $cwd[$idx]; + } + + sub STORE { + my($self, $idx, $val) = @_; + + my ($vol, @cwd) = _split_cwd; + if( $self->{Cleared} ) { + @cwd = (); + $self->{Cleared} = 0; + } + + $cwd[$idx] = $val; + my $dir = _catpath($vol,@cwd); + + _chdir($dir); + return $cwd[$idx]; + } + + sub FETCHSIZE { + my ($vol, @cwd) = _split_cwd; + return scalar @cwd; + } + sub STORESIZE {} + + sub PUSH { + my($self) = shift; + + my $dir = _catpath(_split_cwd, @_); + _chdir($dir); + return $self->FETCHSIZE; + } + + sub POP { + my($self) = shift; + + my ($vol, @cwd) = _split_cwd; + my $popped = pop @cwd; + my $dir = _catpath($vol,@cwd); + _chdir($dir); + return $popped; + } + + sub SHIFT { + my($self) = shift; + + my ($vol, @cwd) = _split_cwd; + my $shifted = shift @cwd; + my $dir = _catpath($vol,@cwd); + _chdir($dir); + return $shifted; + } + + sub UNSHIFT { + my($self) = shift; + + my ($vol, @cwd) = _split_cwd; + my $dir = _catpath($vol, @_, @cwd); + _chdir($dir); + return $self->FETCHSIZE; + } + + sub CLEAR { + my($self) = shift; + $self->{Cleared} = 1; + } + + sub SPLICE { + my $self = shift; + my $offset = shift || 0; + my $len = shift || $self->FETCHSIZE - $offset; + my @new_dirs = @_; + + my ($vol, @cwd) = _split_cwd; + my @orig_dirs = splice @cwd, $offset, $len, @new_dirs; + my $dir = _catpath($vol, @cwd); + _chdir($dir); + return @orig_dirs; + } + + sub EXTEND { } + sub EXISTS { + my($self, $idx) = @_; + return $self->FETCHSIZE >= $idx ? 1 : 0; + } + + sub DELETE { + my($self, $idx) = @_; + croak "Can't delete except at the end of \@CWD" + if $idx < $self->FETCHSIZE - 1; + local $Carp::CarpLevel = $Carp::CarpLevel + 1; + $self->POP; + } +} + +1; + +__END__ + +=pod + +=head1 NAME + +File::chdir - a more sensible way to change directories + +=head1 VERSION + +version 0.1008 + +=head1 SYNOPSIS + + use File::chdir; + + $CWD = "/foo/bar"; # now in /foo/bar + { + local $CWD = "/moo/baz"; # now in /moo/baz + ... + } + + # still in /foo/bar! + +=head1 DESCRIPTION + +Perl's C<<< chdir() >>> has the unfortunate problem of being very, very, very +global. If any part of your program calls C<<< chdir() >>> or if any library +you use calls C<<< chdir() >>>, it changes the current working directory for +the B program. + +This sucks. + +File::chdir gives you an alternative, C<<< $CWD >>> and C<<< @CWD >>>. These two +variables combine all the power of C<<< chdir() >>>, L and L. + +=head1 $CWD + +Use the C<<< $CWD >>> variable instead of C<<< chdir() >>> and Cwd. + + use File::chdir; + $CWD = $dir; # just like chdir($dir)! + print $CWD; # prints the current working directory + +It can be localized, and it does the right thing. + + $CWD = "/foo"; # it's /foo out here. + { + local $CWD = "/bar"; # /bar in here + } + # still /foo out here! + +C<<< $CWD >>> always returns the absolute path in the native form for the +operating system. + +C<<< $CWD >>> and normal C<<< chdir() >>> work together just fine. + +=head1 @CWD + +C<<< @CWD >>> represents the current working directory as an array, each +directory in the path is an element of the array. This can often make +the directory easier to manipulate, and you don't have to fumble with +C<<< File::Spec->splitpath >>> and C<<< File::Spec->catdir >>> to make portable code. + + # Similar to chdir("/usr/local/src/perl") + @CWD = qw(usr local src perl); + +pop, push, shift, unshift and splice all work. pop and push are +probably the most useful. + + pop @CWD; # same as chdir(File::Spec->updir) + push @CWD, 'some_dir' # same as chdir('some_dir') + +C<<< @CWD >>> and C<<< $CWD >>> both work fine together. + +B Due to a perl bug you can't localize C<<< @CWD >>>. See L for a work around. + +=head1 EXAMPLES + +(We omit the C<<< use File::chdir >>> from these examples for terseness) + +Here's C<<< $CWD >>> instead of C<<< chdir() >>>: + + $CWD = 'foo'; # chdir('foo') + +and now instead of Cwd. + + print $CWD; # use Cwd; print Cwd::abs_path + +you can even do zsh style C<<< cd foo bar >>> + + $CWD = '/usr/local/foo'; + $CWD =~ s/usr/var/; + +if you want to localize that, make sure you get the parens right + + { + (local $CWD) =~ s/usr/var/; + ... + } + +It's most useful for writing polite subroutines which don't leave the +program in some strange directory: + + sub foo { + local $CWD = 'some/other/dir'; + ...do your work... + } + +which is much simpler than the equivalent: + + sub foo { + use Cwd; + my $orig_dir = Cwd::getcwd; + chdir('some/other/dir'); + + ...do your work... + + chdir($orig_dir); + } + +C<<< @CWD >>> comes in handy when you want to start moving up and down the +directory hierarchy in a cross-platform manner without having to use +File::Spec. + + pop @CWD; # chdir(File::Spec->updir); + push @CWD, 'some', 'dir' # chdir(File::Spec->catdir(qw(some dir))); + +You can easily change your parent directory: + + # chdir from /some/dir/bar/moo to /some/dir/foo/moo + $CWD[-2] = 'foo'; + +=head1 CAVEATS + +=head3 C<<< local @CWD >>> does not work. + +C<<< local @CWD >>> will not localize C<<< @CWD >>>. This is a bug in Perl, you +can't localize tied arrays. As a work around localizing $CWD will +effectively localize @CWD. + + { + local $CWD; + pop @CWD; + ... + } + +=head3 Assigning to C<<< @CWD >>> calls C<<< chdir() >>> for each element + + @CWD = qw/a b c d/; + +Internally, Perl clears C<<< @CWD >>> and assigns each element in turn. Thus, this +code above will do this: + + chdir 'a'; + chdir 'a/b'; + chdir 'a/b/c'; + chdir 'a/b/c/d'; + +Generally, avoid assigning to C<<< @CWD >>> and just use push and pop instead. + +=head3 Volumes not handled + +There is currently no way to change the current volume via File::chdir. + +=head1 NOTES + +C<<< $CWD >>> returns the current directory using native path separators, i.e. \ +on Win32. This ensures that C<<< $CWD >>> will compare correctly with directories +created using File::Spec. For example: + + my $working_dir = File::Spec->catdir( $CWD, "foo" ); + $CWD = $working_dir; + doing_stuff_might_chdir(); + is( $CWD, $working_dir, "back to original working_dir?" ); + +Deleting the last item of C<<< @CWD >>> will act like a pop. Deleting from the +middle will throw an exception. + + delete @CWD[-1]; # OK + delete @CWD[-2]; # Dies + +What should %CWD do? Something with volumes? + + # chdir to C:\Program Files\Sierra\Half Life ? + $CWD{C} = '\\Program Files\\Sierra\\Half Life'; + +=head1 DIAGNOSTICS + +If an error is encountered when changing C<<< $CWD >>> or C<<< @CWD >>>, one of +the following exceptions will be thrown: + +=over + +=item * + +I + +=item * + +I + +=back + +=head1 HISTORY + +Michael wanted C<<< local chdir >>> to work. p5p didn't. But it wasn't over! +Was it over when the Germans bombed Pearl Harbor? Hell, no! + +Abigail andEor Bryan Warnock suggested the C<<< $CWD >>> thing (Michael forgets +which). They were right. + +The C<<< chdir() >>> override was eliminated in 0.04. + +David became co-maintainer with 0.06_01 to fix some chronic +Win32 path bugs. + +As of 0.08, if changing C<<< $CWD >>> or C<<< @CWD >>> fails to change the directory, an +error will be thrown. + +=head1 SEE ALSO + +L, L, L, L, +"Animal House" L + +=for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan + +=head1 SUPPORT + +=head2 Bugs / Feature Requests + +Please report any bugs or feature requests through the issue tracker +at L. +You will be notified automatically of any progress on your issue. + +=head2 Source Code + +This is open source software. The code repository is available for +public review and contribution under the terms of the license. + +L + + git clone git://github.com/dagolden/file-chdir.git + +=head1 AUTHORS + +=over 4 + +=item * + +David A Golden + +=item * + +Michael G Schwern (original author) + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2012 by Michael G Schwern and David A Golden. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut --- libfile-chdir-perl-0.1008.orig/blib/man3/File::chdir.3pm +++ libfile-chdir-perl-0.1008/blib/man3/File::chdir.3pm @@ -0,0 +1,403 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.22) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "File::chdir 3pm" +.TH File::chdir 3pm "2012-12-03" "perl v5.14.2" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +File::chdir \- a more sensible way to change directories +.SH "VERSION" +.IX Header "VERSION" +version 0.1008 +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 1 +\& use File::chdir; +\& +\& $CWD = "/foo/bar"; # now in /foo/bar +\& { +\& local $CWD = "/moo/baz"; # now in /moo/baz +\& ... +\& } +\& +\& # still in /foo/bar! +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Perl's \f(CW\*(C`chdir()\*(C'\fR has the unfortunate problem of being very, very, very +global. If any part of your program calls \f(CW\*(C`chdir()\*(C'\fR or if any library +you use calls \f(CW\*(C`chdir()\*(C'\fR, it changes the current working directory for +the \fBwhole\fR program. +.PP +This sucks. +.PP +File::chdir gives you an alternative, \f(CW$CWD\fR and \f(CW@CWD\fR. These two +variables combine all the power of \f(CW\*(C`chdir()\*(C'\fR, File::Spec and Cwd. +.ie n .SH "$CWD" +.el .SH "\f(CW$CWD\fP" +.IX Header "$CWD" +Use the \f(CW$CWD\fR variable instead of \f(CW\*(C`chdir()\*(C'\fR and Cwd. +.PP +.Vb 3 +\& use File::chdir; +\& $CWD = $dir; # just like chdir($dir)! +\& print $CWD; # prints the current working directory +.Ve +.PP +It can be localized, and it does the right thing. +.PP +.Vb 5 +\& $CWD = "/foo"; # it\*(Aqs /foo out here. +\& { +\& local $CWD = "/bar"; # /bar in here +\& } +\& # still /foo out here! +.Ve +.PP +\&\f(CW$CWD\fR always returns the absolute path in the native form for the +operating system. +.PP +\&\f(CW$CWD\fR and normal \f(CW\*(C`chdir()\*(C'\fR work together just fine. +.ie n .SH "@CWD" +.el .SH "\f(CW@CWD\fP" +.IX Header "@CWD" +\&\f(CW@CWD\fR represents the current working directory as an array, each +directory in the path is an element of the array. This can often make +the directory easier to manipulate, and you don't have to fumble with +\&\f(CW\*(C`File::Spec\->splitpath\*(C'\fR and \f(CW\*(C`File::Spec\->catdir\*(C'\fR to make portable code. +.PP +.Vb 2 +\& # Similar to chdir("/usr/local/src/perl") +\& @CWD = qw(usr local src perl); +.Ve +.PP +pop, push, shift, unshift and splice all work. pop and push are +probably the most useful. +.PP +.Vb 2 +\& pop @CWD; # same as chdir(File::Spec\->updir) +\& push @CWD, \*(Aqsome_dir\*(Aq # same as chdir(\*(Aqsome_dir\*(Aq) +.Ve +.PP +\&\f(CW@CWD\fR and \f(CW$CWD\fR both work fine together. +.PP +\&\fB\s-1NOTE\s0\fR Due to a perl bug you can't localize \f(CW@CWD\fR. See \*(L"\s-1CAVEATS\s0\*(R" for a work around. +.SH "EXAMPLES" +.IX Header "EXAMPLES" +(We omit the \f(CW\*(C`use File::chdir\*(C'\fR from these examples for terseness) +.PP +Here's \f(CW$CWD\fR instead of \f(CW\*(C`chdir()\*(C'\fR: +.PP +.Vb 1 +\& $CWD = \*(Aqfoo\*(Aq; # chdir(\*(Aqfoo\*(Aq) +.Ve +.PP +and now instead of Cwd. +.PP +.Vb 1 +\& print $CWD; # use Cwd; print Cwd::abs_path +.Ve +.PP +you can even do zsh style \f(CW\*(C`cd foo bar\*(C'\fR +.PP +.Vb 2 +\& $CWD = \*(Aq/usr/local/foo\*(Aq; +\& $CWD =~ s/usr/var/; +.Ve +.PP +if you want to localize that, make sure you get the parens right +.PP +.Vb 4 +\& { +\& (local $CWD) =~ s/usr/var/; +\& ... +\& } +.Ve +.PP +It's most useful for writing polite subroutines which don't leave the +program in some strange directory: +.PP +.Vb 4 +\& sub foo { +\& local $CWD = \*(Aqsome/other/dir\*(Aq; +\& ...do your work... +\& } +.Ve +.PP +which is much simpler than the equivalent: +.PP +.Vb 4 +\& sub foo { +\& use Cwd; +\& my $orig_dir = Cwd::getcwd; +\& chdir(\*(Aqsome/other/dir\*(Aq); +\& +\& ...do your work... +\& +\& chdir($orig_dir); +\& } +.Ve +.PP +\&\f(CW@CWD\fR comes in handy when you want to start moving up and down the +directory hierarchy in a cross-platform manner without having to use +File::Spec. +.PP +.Vb 2 +\& pop @CWD; # chdir(File::Spec\->updir); +\& push @CWD, \*(Aqsome\*(Aq, \*(Aqdir\*(Aq # chdir(File::Spec\->catdir(qw(some dir))); +.Ve +.PP +You can easily change your parent directory: +.PP +.Vb 2 +\& # chdir from /some/dir/bar/moo to /some/dir/foo/moo +\& $CWD[\-2] = \*(Aqfoo\*(Aq; +.Ve +.SH "CAVEATS" +.IX Header "CAVEATS" +\fI\f(CI\*(C`local @CWD\*(C'\fI does not work.\fR +.IX Subsection "local @CWD does not work." +.PP +\&\f(CW\*(C`local @CWD\*(C'\fR will not localize \f(CW@CWD\fR. This is a bug in Perl, you +can't localize tied arrays. As a work around localizing \f(CW$CWD\fR will +effectively localize \f(CW@CWD\fR. +.PP +.Vb 5 +\& { +\& local $CWD; +\& pop @CWD; +\& ... +\& } +.Ve +.PP +\fIAssigning to \f(CI@CWD\fI calls \f(CI\*(C`chdir()\*(C'\fI for each element\fR +.IX Subsection "Assigning to @CWD calls chdir() for each element" +.PP +.Vb 1 +\& @CWD = qw/a b c d/; +.Ve +.PP +Internally, Perl clears \f(CW@CWD\fR and assigns each element in turn. Thus, this +code above will do this: +.PP +.Vb 4 +\& chdir \*(Aqa\*(Aq; +\& chdir \*(Aqa/b\*(Aq; +\& chdir \*(Aqa/b/c\*(Aq; +\& chdir \*(Aqa/b/c/d\*(Aq; +.Ve +.PP +Generally, avoid assigning to \f(CW@CWD\fR and just use push and pop instead. +.PP +\fIVolumes not handled\fR +.IX Subsection "Volumes not handled" +.PP +There is currently no way to change the current volume via File::chdir. +.SH "NOTES" +.IX Header "NOTES" +\&\f(CW$CWD\fR returns the current directory using native path separators, i.e. \e +on Win32. This ensures that \f(CW$CWD\fR will compare correctly with directories +created using File::Spec. For example: +.PP +.Vb 4 +\& my $working_dir = File::Spec\->catdir( $CWD, "foo" ); +\& $CWD = $working_dir; +\& doing_stuff_might_chdir(); +\& is( $CWD, $working_dir, "back to original working_dir?" ); +.Ve +.PP +Deleting the last item of \f(CW@CWD\fR will act like a pop. Deleting from the +middle will throw an exception. +.PP +.Vb 2 +\& delete @CWD[\-1]; # OK +\& delete @CWD[\-2]; # Dies +.Ve +.PP +What should \f(CW%CWD\fR do? Something with volumes? +.PP +.Vb 2 +\& # chdir to C:\eProgram Files\eSierra\eHalf Life ? +\& $CWD{C} = \*(Aq\e\eProgram Files\e\eSierra\e\eHalf Life\*(Aq; +.Ve +.SH "DIAGNOSTICS" +.IX Header "DIAGNOSTICS" +If an error is encountered when changing \f(CW$CWD\fR or \f(CW@CWD\fR, one of +the following exceptions will be thrown: +.IP "\(bu" 4 +\&\fICan't delete except at the end of \f(CI@CWD\fI\fR +.IP "\(bu" 4 +\&\fIFailed to change directory to '$dir'\fR +.SH "HISTORY" +.IX Header "HISTORY" +Michael wanted \f(CW\*(C`local chdir\*(C'\fR to work. p5p didn't. But it wasn't over! +Was it over when the Germans bombed Pearl Harbor? Hell, no! +.PP +Abigail and/or Bryan Warnock suggested the \f(CW$CWD\fR thing (Michael forgets +which). They were right. +.PP +The \f(CW\*(C`chdir()\*(C'\fR override was eliminated in 0.04. +.PP +David became co-maintainer with 0.06_01 to fix some chronic +Win32 path bugs. +.PP +As of 0.08, if changing \f(CW$CWD\fR or \f(CW@CWD\fR fails to change the directory, an +error will be thrown. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +File::pushd, File::Spec, Cwd, \*(L"chdir\*(R" in perlfunc, +\&\*(L"Animal House\*(R" +.SH "SUPPORT" +.IX Header "SUPPORT" +.SS "Bugs / Feature Requests" +.IX Subsection "Bugs / Feature Requests" +Please report any bugs or feature requests through the issue tracker +at https://rt.cpan.org/Public/Dist/Display.html?Name=File\-chdir . +You will be notified automatically of any progress on your issue. +.SS "Source Code" +.IX Subsection "Source Code" +This is open source software. The code repository is available for +public review and contribution under the terms of the license. +.PP +https://github.com/dagolden/file\-chdir +.PP +.Vb 1 +\& git clone git://github.com/dagolden/file\-chdir.git +.Ve +.SH "AUTHORS" +.IX Header "AUTHORS" +.IP "\(bu" 4 +David A Golden +.IP "\(bu" 4 +Michael G Schwern (original author) +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +This software is copyright (c) 2012 by Michael G Schwern and David A Golden. +.PP +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. --- libfile-chdir-perl-0.1008.orig/debian/changelog +++ libfile-chdir-perl-0.1008/debian/changelog @@ -0,0 +1,51 @@ +libfile-chdir-perl (0.1008-1.1) unstable; urgency=medium + + * Non maintainer upload by the Reproducible Builds team. + * No source change upload to rebuild on buildd with .buildinfo files. + + -- Holger Levsen Sun, 27 Dec 2020 16:17:20 +0100 + +libfile-chdir-perl (0.1008-1) unstable; urgency=low + + * New upstream release + * Update watch file to version 3; stricter regex + * Update debian/compat to 9. + * Update copyright file (remove boilerplate) + * Update debian/rules to recommended targets for build-arch/indep + * Update standards version to 3.9.5 (no changes) + + -- James Bromberger Fri, 01 Nov 2013 13:13:15 +0000 + +libfile-chdir-perl (0.1006-1) unstable; urgency=low + + * New upstream release + + -- James Bromberger Thu, 24 Nov 2011 13:47:46 +0000 + +libfile-chdir-perl (0.1003-0.1) unstable; urgency=low + + * Non-maintainer upload. + * New upstream release (closes: Bug#579187) + + -- Ivan Kohler Sat, 08 May 2010 16:48:01 -0700 + +libfile-chdir-perl (0.06-2.1) unstable; urgency=low + + * Non-maintainer upload. + * Empty dir is gone (closes: #467782) + + -- Stephen Gran Sun, 06 Apr 2008 02:27:29 +0100 + +libfile-chdir-perl (0.06-2) unstable; urgency=low + + * Updated standards version to 3.7.2 (no changes required, just + bumping to remove Lintian warning). + + -- James Bromberger Wed, 20 Dec 2006 22:25:37 +0000 + +libfile-chdir-perl (0.06-1) unstable; urgency=low + + * Initial Release. + + -- James Bromberger Tue, 22 Jun 2004 15:16:55 +0100 + --- libfile-chdir-perl-0.1008.orig/debian/compat +++ libfile-chdir-perl-0.1008/debian/compat @@ -0,0 +1 @@ +9 --- libfile-chdir-perl-0.1008.orig/debian/control +++ libfile-chdir-perl-0.1008/debian/control @@ -0,0 +1,21 @@ +Source: libfile-chdir-perl +Section: perl +Priority: optional +Build-Depends: debhelper (>= 9) +Build-Depends-Indep: perl (>= 5.8.0-7) +Maintainer: James Bromberger +Standards-Version: 3.9.5 + +Package: libfile-chdir-perl +Architecture: all +Depends: ${perl:Depends}, ${misc:Depends} +Description: more sensible way to change directories + Perl's chdir() has the unfortunate problem of being very, very, very + global. If any part of your program calls chdir() or if any library you + use calls chdir(), it changes the current working directory for the + whole program. + . + This sucks. + . + File::chdir gives you an alternative, $CWD and @CWD. These two variables + combine all the power of chdir(), File::Spec and Cwd. --- libfile-chdir-perl-0.1008.orig/debian/copyright +++ libfile-chdir-perl-0.1008/debian/copyright @@ -0,0 +1,16 @@ +Original code by chromatic, maintained by Michael G Schwern +. + + +Copyright 2001 by chromatic , + Michael G Schwern . + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See http://www.perl.com/perl/misc/Artistic.html + +Perl is distributed under your choice of the GNU General Public License or +the Artistic License. On Debian GNU/Linux systems, the complete text of the +GNU General Public License can be found in `/usr/share/common-licenses/GPL' +and the Artistic Licence in `/usr/share/common-licenses/Artistic'. --- libfile-chdir-perl-0.1008.orig/debian/rules +++ libfile-chdir-perl-0.1008/debian/rules @@ -0,0 +1,89 @@ +#!/usr/bin/make -f +# This debian/rules file is provided as a template for normal perl +# packages. It was created by Marc Brockschmidt for +# the Debian Perl Group (http://pkg-perl.alioth.debian.org/) but may +# be used freely wherever it is useful. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# If set to a true value then MakeMaker's prompt function will +# always return the default without waiting for user input. +export PERL_MM_USE_DEFAULT=1 + +PACKAGE=$(shell dh_listpackages) + +ifndef PERL +PERL = /usr/bin/perl +endif + +TMP =$(CURDIR)/debian/$(PACKAGE) + +# Allow disabling build optimation by setting noopt in +# $DEB_BUILD_OPTIONS +CFLAGS = -Wall -g +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +build: build-arch build-indep +build-arch: build-stamp +build-indep: build-stamp +build-stamp: + dh_testdir + + # Add commands to compile the package here + $(PERL) Makefile.PL INSTALLDIRS=vendor + $(MAKE) OPTIMIZE="$(CFLAGS)" + + touch build-stamp + +clean: + dh_testdir + dh_testroot + + # Add commands to clean up after the build process here + [ ! -f Makefil ] || $(MAKE) distclean + + dh_clean build-stamp install-stamp + +install: install-stamp +install-stamp: build-stamp + dh_testdir + dh_testroot + dh_prep + + #$(MAKE) test + $(MAKE) install DESTDIR=$(TMP) PREFIX=/usr + + # As this is a architecture independent package, we are not supposed to install + # stuff to /usr/lib. MakeMaker creates the dirs, we delete them from the deb: + [ ! -d $(TMP)/usr/lib/perl5 ] || rmdir --ignore-fail-on-non-empty --parents $(TMP)/usr/lib/perl5 + + touch install-stamp + +binary-arch: +# We have nothing to do by default. + +binary-indep: build install + dh_testdir + dh_testroot + dh_installdocs + dh_installchangelogs Changes + dh_perl + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary --- libfile-chdir-perl-0.1008.orig/debian/watch +++ libfile-chdir-perl-0.1008/debian/watch @@ -0,0 +1,2 @@ +version=2 +http://www.cpan.org/modules/by-module/File/File-chdir-(.*)\.tar\.gz debian uupdate