3 # This all could (maybe) be done in a shell script, but I suck at those.
21 elsif ($Version eq "")
25 elsif ($SMVersion eq "")
31 print "Unrecognized argument: $arg\n";
38 print "Syntax: make_archive.pl [-v] plugin_name version sm_version\n";
39 print "-v = be verbose\n";
40 print "plugin_name: The name of the plugin\n";
41 print "version: The plugin's version number (1.0, 2.3, etc)\n";
42 print "sm_version: The oldest version of SquirrelMail that this\n";
43 print " plugin is for sure compatible with (1.0.1, 0.5, 1.1.0, etc)\n";
48 print "Validating name and version\n" if ($Verbose);
50 if ($Plugin =~ /[^a-z_]/)
52 print "Plugin name can only contain a-z and _\n";
55 if ($Version =~ /[^\.0-9]/ || $SMVersion =~ /[^\.0-9]/)
57 print "Version numbers can only have 0-9 and period\n";
61 VerifyPluginDir
($Plugin);
63 print "Getting file list.\n" if ($Verbose);
64 @Files = RecurseDir
($Plugin);
66 $QuietString = " > /dev/null 2> /dev/null" if (! $Verbose);
68 print "\n\n" if ($Verbose);
69 print "Creating $Plugin.$Version-$SMVersion.tar.gz\n";
70 system("tar cvfz $Plugin.$Version-$SMVersion.tar.gz $Plugin" .
71 FindTarExcludes
(@Files) . $QuietString);
73 #print "\n\n" if ($Verbose);
74 #print "Creating $Plugin.$Version-$SMVersion.zip\n";
75 #system("zip -r $Plugin.$Version-$SMVersion.zip $Plugin/" .
76 # FindZipExcludes(@Files) . $QuietString);
84 if (! -e
$Plugin && ! -d
$Plugin)
86 print "The $Plugin directory doesn't exist, " .
87 "or else it is not a directory.\n";
99 foreach $File (@Files)
101 if ($File =~ /^(.*\/CVS
)\
/$/)
103 $ExcludeStr .= " --exclude $1";
116 foreach $File (@Files)
118 if ($File =~ /^(.*\/CVS
)\
/$/)
120 $ExcludeStr .= " $1/ $1/*";
124 if ($ExcludeStr ne "")
126 $ExcludeStr = " -x" . $ExcludeStr;
135 local (@Files, @Results);
138 @Files = readdir(DIR
);
141 @Results = ("$Dir/");
143 foreach $file (@Files)
145 next if ($file =~ /^[\.]+/);
148 push (@Results, RecurseDir
("$Dir/$file"));
152 push (@Results, "$Dir/$file");