Created
September 6, 2009 05:22
-
-
Save kentfredric/181658 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
BEGIN { | |
eval "require Path::Class; 1" or die "Please emerge dev-perl/Path-Class"; | |
} | |
#==========VARIABLES============ | |
my $gentoo_portage_profiles = "/usr/portage/profiles/"; | |
my $normal_profile = "default/linux/amd64/2008.0"; | |
my $fake_profile_dir = "/etc/paludis/profile-override"; | |
my $fake_profile_name = "profile-faker"; | |
my $override_name = "profile-override"; | |
#+==============================+ | |
use Path::Class qw( file dir ); | |
my $g = dir($gentoo_portage_profiles); | |
my $profile = $g->subdir($normal_profile); | |
printf "\nThis is the full path to your currently selected profile:\n\n\t%s\n\n", $profile; | |
my $fakeroot = dir($fake_profile_dir); | |
my $fakeprof = $fakeroot->subdir($fake_profile_name); | |
my $overprof = $fakeroot->subdir($override_name); | |
printf "Going to create these dirs:\n\n\t%s\n\n\t%s\n\n", $fakeprof, $overprof; | |
$fakeprof->mkpath(1); | |
$overprof->mkpath(1); | |
my $mask = $overprof->file('use.mask'); | |
if ( not -e "$mask" ) { | |
printf "Injecting a demo unmask of kdeprefix\n\n"; | |
{ | |
my $fh = $overprof->file('use.mask')->open('w'); | |
print {$fh} "-kdeprefix\n"; | |
close $fh; | |
} | |
} | |
printf "Generating the profile faking\n\n"; | |
printf "Path from fake-profile to real profile is:\n\n\t%s\n\n", $profile->relative($fakeprof); | |
printf "Path from fake-profile to override profile is:\n\n\t%s\n\n", $overprof->relative($fakeprof); | |
{ | |
my $fh = $fakeprof->file('parent')->open('w'); | |
print {$fh} $profile->relative($fakeprof); | |
print {$fh} "\n"; | |
print {$fh} $overprof->relative($fakeprof); | |
print {$fh} "\n"; | |
close $fh; | |
} | |
print "All done!\n\n stick this in your /etc/paludis/repositories/gentoo.conf \n\n"; | |
printf "\tprofiles = \${ROOT}%s\n\n", $fakeprof->absolute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is the full path to your currently selected profile: | |
/usr/portage/profiles/default/linux/amd64/2008.0 | |
Going to create these dirs: | |
/etc/paludis/profile-override/profile-faker | |
/etc/paludis/profile-override/profile-override | |
Generating the profile faking | |
Path from fake-profile to real profile is: | |
../../../../usr/portage/profiles/default/linux/amd64/2008.0 | |
Path from fake-profile to override profile is: | |
../profile-override | |
All done! | |
stick this in your /etc/paludis/repositories/gentoo.conf | |
profiles = ${ROOT}/etc/paludis/profile-override/profile-faker | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment