From cbc91f425b4308c26237c594e4ad64be3a4a54f1 Mon Sep 17 00:00:00 2001 From: kink Date: Mon, 14 Aug 2006 13:48:29 +0000 Subject: [PATCH] - Drop obsolete script plugins/make_archive.pl. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11583 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 1 + plugins/make_archive.pl | 157 ---------------------------------------- 2 files changed, 1 insertion(+), 157 deletions(-) delete mode 100755 plugins/make_archive.pl diff --git a/ChangeLog b/ChangeLog index 5eed1b87..c232c698 100644 --- a/ChangeLog +++ b/ChangeLog @@ -128,6 +128,7 @@ Version 1.5.2 - CVS to main configuration file. - Fixed subscription of new 'noselect' folders (#1315912). - Moving the development documentation to the documentation module. + - Drop obsolete script plugins/make_archive.pl. Version 1.5.1 (branched on 2006-02-12) -------------------------------------- diff --git a/plugins/make_archive.pl b/plugins/make_archive.pl deleted file mode 100755 index 5df90b9d..00000000 --- a/plugins/make_archive.pl +++ /dev/null @@ -1,157 +0,0 @@ -#!/usr/bin/perl -# -# This all could (maybe) be done in a shell script, but I suck at those. - -$i = 0; -$Verbose = 0; -$Plugin = ""; -$Version = ""; -$SMVersion = ""; - -foreach $arg (@ARGV) -{ - if ($arg eq "-v") - { - $Verbose = 1; - } - elsif ($Plugin eq "") - { - $Plugin = $arg; - } - elsif ($Version eq "") - { - $Version = $arg; - } - elsif ($SMVersion eq "") - { - $SMVersion = $arg; - } - else - { - print "Unrecognized argument: $arg\n"; - exit(0); - } -} - -if ($SMVersion eq "") -{ - print "Syntax: make_archive.pl [-v] plugin_name version sm_version\n"; - print "-v = be verbose\n"; - print "plugin_name: The name of the plugin\n"; - print "version: The plugin's version number (1.0, 2.3, etc)\n"; - print "sm_version: The oldest version of SquirrelMail that this\n"; - print " plugin is for sure compatible with (1.0.1, 0.5, 1.1.0, etc)\n"; - exit(0); -} - - -print "Validating name and version\n" if ($Verbose); -$Plugin =~ s/\///g; -if ($Plugin =~ /[^a-z_]/) -{ - print "Plugin name can only contain a-z and _\n"; - exit(0); -} -if ($Version =~ /[^\.0-9]/ || $SMVersion =~ /[^\.0-9]/) -{ - print "Version numbers can only have 0-9 and period\n"; - exit(0); -} - -VerifyPluginDir($Plugin); - -print "Getting file list.\n" if ($Verbose); -@Files = RecurseDir($Plugin); - -$QuietString = " > /dev/null 2> /dev/null" if (! $Verbose); - -print "\n\n" if ($Verbose); -print "Creating $Plugin.$Version-$SMVersion.tar.gz\n"; -system("tar cvfz $Plugin.$Version-$SMVersion.tar.gz $Plugin" . - FindTarExcludes(@Files) . $QuietString); - -#print "\n\n" if ($Verbose); -#print "Creating $Plugin.$Version-$SMVersion.zip\n"; -#system("zip -r $Plugin.$Version-$SMVersion.zip $Plugin/" . -# FindZipExcludes(@Files) . $QuietString); - - - -sub VerifyPluginDir -{ - local ($Plugin) = @_; - - if (! -e $Plugin && ! -d $Plugin) - { - print "The $Plugin directory doesn't exist, " . - "or else it is not a directory.\n"; - exit(0); - } -} - - -sub FindTarExcludes -{ - local (@Files) = @_; - - $ExcludeStr = ""; - - foreach $File (@Files) - { - if ($File =~ /^(.*\/CVS)\/$/) - { - $ExcludeStr .= " --exclude $1"; - } - } - - return $ExcludeStr; -} - -sub FindZipExcludes -{ - local (@Files) = @_; - - $ExcludeStr = ""; - - foreach $File (@Files) - { - if ($File =~ /^(.*\/CVS)\/$/) - { - $ExcludeStr .= " $1/ $1/*"; - } - } - - if ($ExcludeStr ne "") - { - $ExcludeStr = " -x" . $ExcludeStr; - } - - return $ExcludeStr; -} - -sub RecurseDir -{ - local ($Dir) = @_; - local (@Files, @Results); - - opendir(DIR, $Dir); - @Files = readdir(DIR); - closedir(DIR); - - @Results = ("$Dir/"); - - foreach $file (@Files) - { - next if ($file =~ /^[\.]+/); - if (-d "$Dir/$file") - { - push (@Results, RecurseDir("$Dir/$file")); - } - else - { - push (@Results, "$Dir/$file"); - } - } - - return @Results; -} -- 2.25.1