3 # 1999 (c) Piotr Roszatycki <dexter@debian.org>
4 # This software is under GNU license
5 # last modification: 1999-12-08
11 s/([^\w\/.+-])/\\$1/g;
18 $qarchive = quote($qarchive);
19 chop($date=`LC_ALL=C date "+%m-%d-%Y %H:%M"`);
20 chop($info_size=`apt-cache show $qarchive | wc -c`);
21 $install_size=length($pressinstall);
22 $upgrade_size=length($pressupgrade);
24 print "-r--r--r-- 1 root root $info_size $date INFO\n";
26 chop($debd = `dpkg -s $qarchive | grep -i ^Version | sed 's/^version: //i'`);
27 chop($deba = `apt-cache show $qarchive | grep -i ^Version | sed 's/^version: //i'`);
29 print "-r-xr--r-- 1 root root $install_size $date INSTALL\n";
30 } elsif( $debd ne $deba ) {
31 print "-r-xr--r-- 1 root root $upgrade_size $date UPGRADE\n";
37 my($archive,$filename,$destfile)=@_;
38 my $qarchive = quote($archive);
39 my $qdestfile = quote($destfile);
40 if($filename eq "INFO") {
41 system("apt-cache show $qarchive > $qdestfile");
42 } elsif($filename eq "INSTALL") {
43 if ( open(FILEOUT, "> $destfile") ) {
44 print FILEOUT $pressinstall;
46 system("chmod a+x $qdestfile");
48 } elsif($filename eq "UPGRADE") {
49 if ( open(FILEOUT, ">, $destfile") ) {
50 print FILEOUT $pressupgrade;
52 system("chmod a+x $qdestfile");
55 die "extfs: $filename: No such file or directory\n";
61 my($archive,$filename)=@_;
62 my $qarchive = quote($archive);
63 if($filename eq "INSTALL") {
64 system("apt-get install $qarchive");
65 } elsif($filename eq "UPGRADE") {
66 system("apt-get install $qarchive");
68 die "extfs: $filename: Permission denied\n";
72 $pressinstall=<<EOInstall;
75 Don\'t use this method if you are not willing to install this package...
77 This is not a real file. It is a way to install the package you are browsing.
79 To install this package go back to the panel and press Enter on this file.
83 $pressupgrade=<<EOInstall;
86 Don\'t use this method if you are not willing to upgrade this package...
88 This is not a real file. It is a way to upgrade the package you are browsing.
90 To upgrade this package go back to the panel and press Enter on this file.
97 chop($name = `if [ -f "$ARGV[1]" ]; then cat $ARGV[1]; else echo $ARGV[1]; fi`);
98 $name =~ s%.*/([0-9a-z.-]*)_.*%$1%;
102 if($ARGV[0] eq "list") { &list($name); exit 0; }
103 elsif($ARGV[0] eq "copyout") { ©out($name,$ARGV[2],$ARGV[3]); exit 0; }
104 elsif($ARGV[0] eq "run") { &run($name,$ARGV[2]); exit 0; }