public
Last active

  • Download Gist
update-drupal.pl
Perl
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
#!/usr/bin/perl
# updated 2008-08-21
 
$baseurl = 'http://ftp.drupal.org/files/projects/';
$fileextension = '.tar.gz';
$core = 'drupal-6.4';
$modulesfolder = 'sites/all/modules/';
$themesfoler = 'sites/all/themes/';
$settingsfolder = 'sites/default/';
 
my %modules;
$modules{'abuse'} = 'abuse-6.x-1.x-dev';
$modules{'addresses'} = 'addresses-6.x-1.0-alpha2';
$modules{'addtoany'} = 'addtoany-6.x-1.36';
$modules{'about_this_node'} = 'about_this_node-6.x-1.0-rc3';
$modules{'apply_for_role'} = 'apply_for_role-6.x-1.4';
$modules{'backup_migrate'} = 'backup_migrate-6.x-1.0';
$modules{'block_save_edit'} = 'block_save_edit-6.x-1.0-beta1';
$modules{'community_tags'} = 'community_tags-6.x-1.0-beta1';
$modules{'content_profile'} = 'content_profile-6.x-1.0-beta2';
$modules{'cck'} = 'cck-6.x-2.0-rc6';
$modules{'charts'} = 'charts-6.x-1.0-alpha4';
$modules{'captcha'} = 'captcha-6.x-1.0-rc2';
$modules{'calendar'} = 'calendar-6.x-2.0-rc1';
$modules{'codefilter'} = 'codefilter-6.x-1.0';
$modules{'commentrss'} = 'commentrss-6.x-1.2';
$modules{'comment_notify'} = 'comment_notify-6.x-1.0';
$modules{'creativecommons_lite'} = 'creativecommons_lite-6.x-1.0';
$modules{'date'} = 'date-6.x-2.0-rc2';
$modules{'devel'} = 'devel-6.x-1.11';
$modules{'diff'} = 'diff-6.x-2.0';
$modules{'extlink'} = 'extlink-6.x-1.6';
$modules{'flickr'} = 'flickr-6.x-1.0-alpha1';
$modules{'feedapi'} = 'feedapi-6.x-1.2';
$modules{'geshifilter'} = 'geshifilter-6.x-1.1';
$modules{'gravatar'} = 'gravatar-6.x-1.3';
$modules{'google_groups'} = 'google_groups-6.x-1.0';
$modules{'link'} = 'link-6.x-2.3.1';
$modules{'og'} = 'og-6.x-1.0-rc6';
$modules{'og_profiles'} = 'og_profiles-6.x-1.x-dev';
$modules{'pathauto'} = 'pathauto-6.x-1.1';
$modules{'persistent_login'} = 'persistent_login-6.x-1.4-beta2';
$modules{'pingback'} = 'pingback-6.x-1.0';
$modules{'plugin_manager'} = 'plugin_manager-6.x-1.1';
$modules{'poormanscron'} = 'poormanscron-6.x-1.0';
$modules{'quote'} = 'quote-6.x-1.1-beta';
$modules{'recaptcha'} = 'recaptcha-6.x-1.0';
$modules{'revisiontags'} = 'revisiontags-6.x-1.0';
$modules{'tagadelic'} = 'tagadelic-6.x-1.0';
$modules{'textile'} = 'textile-5.x-2.1';
$modules{'token'} = 'token-6.x-1.11';
$modules{'user_mailman_register'} = 'user_mailman_register-6.x-1.1';
$modules{'user_stats'} = 'user_stats-6.x-1.0-alpha1';
$modules{'vcard'} = 'vcard-6.x-1.1';
$modules{'views'} = 'views-6.x-2.0-rc3';
$modules{'wikitools'} = 'wikitools-6.x-1.0';
$modules{'wp_comments'} = 'wp_comments-6.x-1.0';
$modules{'xmlsitemap'} = 'xmlsitemap-6.x-0.x-dev';
 
&download($core);
&extract($core);
&rmtar($core);
system("mv $core/* ./");
system("mv $core/.htaccess ./.htaccess");
system("rmdir $core");
chmod(0777, "sites/default");
system("touch $settingsfolder/settings.php");
chmod(0777, "sites/default/settings.php");
system("mkdir sites/all/modules sites/all/themes");
 
my %themes;
$themes{'zen-6.x-1.0-beta2'} = 'zen-6.x-1.0-beta2';
 
while ( my ($key, $value) = each(%modules)) #$module (values %modules)
{
&download($value);
&extract($value);
&rmtar($value);
&mvfolder($key, $modulesfolder);
}
 
sub download { #takes nameversion
my ($nameversion) = @_;
$remoteurl = $baseurl.$nameversion.$fileextension;
system("wget $remoteurl");
}
 
sub extract { #takes nameversion
my($nameversion) = @_;
$file = $nameversion.$fileextension;
system("tar xvzf $file");
}
 
sub rmtar { #takes nameversion
my($nameversion) = @_;
$tar = $nameversion.$fileextension;
system("rm $tar");
}
 
sub mvfolder { #takes name, path
my($foldername, $path) = @_;
$newlocation = $path.$foldername;
system("mv $foldername $newlocation");
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.