5 $filename or die "no filename";
8 $basename =~ s/.tar.gz$//g;
9 $directory = $basename;
12 mkdir("$directory/tmp/");
14 chdir("$directory/tmp/") or die;
16 print "Extracting $filename\n";
17 system("tar -zxf ../../$filename") and die;
18 system("find . -type f -exec mv {} .. \\;") and die;
20 system("find . -type d -exec rmdir {} \\; 2> /dev/null");
22 print "Applying security patches...\n";
23 for($a=1;$a<10;$a++) {
24 $patchname = "../${basename}pl$a.patch";
26 print "*pl$a.patch\n";
27 system("patch -s < $patchname") and die;
31 $c = 'find . \( -name "*.cc" -or -name "*.h" -or -name "*.c" \) -exec cp {} {}.orig \;';
35 system("patch < ../xpdf-changes.patch 2>&1 | grep -i failed");
38 system("ln -s $directory xpdf");
48 if test "x\$VERSION" = "x";then
49 select V in stable latest;do VERSION="\$V";break;done
51 if test "x\$VERSION" = "xstable";then
52 echo "Switching to stable version"
55 elif test "x\$VERSION" = "xlatest";then
56 echo "Switching to latest version"
63 system("chmod a+x switch");