]> git.deb.at Git - deb/packages.git/commitdiff
- Fix some issues with non-US handling
authorFrank Lichtenheld <frank@lichtenheld.de>
Fri, 3 Mar 2006 00:54:09 +0000 (00:54 +0000)
committerFrank Lichtenheld <frank@lichtenheld.de>
Fri, 3 Mar 2006 00:54:09 +0000 (00:54 +0000)
- volatile and backports are archives, partly revert a earlier patch
  that accidently removed that
- after that we can clean-up some ftp_site handling code
  (except for some ugly non-US hacks)
- add kfreebsd-amd64

cgi-bin/dispatcher.pl
config.sh
cron.d/100syncarchive_backports
cron.d/100syncarchive_kfreebsd
cron.d/100syncarchive_volatile
lib/Packages/DoDownload.pm
lib/Packages/DoShow.pm
lib/Packages/HTML.pm

index 50a92f653b570109e167c3a375de7e64b9a6a06e..6235cc5e39854b6b746d09100700d5dca287e6d4 100755 (executable)
@@ -118,6 +118,7 @@ if (my $path = $input->path_info() || $input->param('PATH_INFO')) {
        my %params_set;
        sub set_param_once {
            my ($cgi, $params_set, $key, $val) = @_;
+           debug("set_param_once key=$key val=$val",4) if DEBUG;
            if ($params_set->{$key}++) {
                fatal_error( sprintf( _g( "%s set more than once in path" ), $key ) );
            } else {
@@ -129,6 +130,7 @@ if (my $path = $input->path_info() || $input->param('PATH_INFO')) {
        foreach (reverse @components) {
            $need_pkg = !@pkg
                && ($what_to_do !~ /^(index|allpackages|newpkg)$/);
+           debug("need_pkg=$need_pkg component=$_",4) if DEBUG;
            if (!$need_pkg && $SUITES{$_}) {
                set_param_once( $input, \%params_set, 'suite', $_);
            } elsif (!$need_pkg && (my $s = $SUITES_ALIAS{$_})) {
@@ -139,6 +141,8 @@ if (my $path = $input->path_info() || $input->param('PATH_INFO')) {
                set_param_once( $input, \%params_set, 'archive', $_);
            } elsif (!$need_pkg && $sections_descs{$_}) {
                set_param_once( $input, \%params_set, 'subsection', $_);
+           } elsif (!$need_pkg && ($_ eq 'non-us')) { # non-US hack
+               set_param_once( $input, \%params_set, 'subsection', 'non-US');
            } elsif (!$need_pkg && ($_ eq 'source')) {
                set_param_once( $input, \%params_set, 'source', 1);
            } elsif ($ARCHITECTURES{$_}) {
index 299c5390b1b6f0f79eb80972c4db3cab598330d6..eab1b2b5504898946b697cf51d89107f6ae32b9c 100644 (file)
--- a/config.sh
+++ b/config.sh
@@ -48,16 +48,16 @@ cn_help_url="http://www.debian.org/intro/cn"
 #
 polangs="de fi nl fr uk"
 ddtplangs="de cs da eo es fi fr hu it ja nl pl pt_BR pt_PT ru sk sv_SE uk"
-archives="us non-US security amd64 kfreebsd"
+archives="us non-US security amd64 kfreebsd backports volatile"
 sections="main contrib non-free"
 parts="$sections"
 suites="oldstable stable stable-volatile stable-backports testing unstable experimental"
 dists="$suites"
-architectures="alpha amd64 arm hppa hurd-i386 i386 ia64 kfreebsd-i386 m68k mips mipsel powerpc s390 sparc"
+architectures="alpha amd64 arm hppa hurd-i386 i386 ia64 kfreebsd-i386 kfreebsd-amd64 m68k mips mipsel powerpc s390 sparc"
 arch_oldstable="alpha arm hppa i386 ia64 m68k mips mipsel powerpc s390 sparc"
 arch_stable="${arch_oldstable} amd64"
 arch_testing="${arch_stable}"
-arch_unstable="${arch_stable} hurd-i386 kfreebsd-i386"
+arch_unstable="${arch_stable} hurd-i386 kfreebsd-i386 kfreebsd-amd64"
 arch_experimental="${arch_unstable}"
 arch_testing_proposed_updates="${arch_testing}"
 arch_stable_proposed_updates="${arch_stable}"
index b482dc76dd123c3d4aeb1ef71a87d51ea6d81fde..fef94c2af3086acfc7c2fdec47994c87be15bda9 100755 (executable)
@@ -15,19 +15,19 @@ do
       for part in ${parts}
       do
        echo retrieve Packages $dist-backports/$part/$arch
-       test -d us/${dist}-backports/${part}/binary-${arch} || mkdir -p us/${dist}-backports/${part}/binary-${arch}
-       (cd us/${dist}-backports/${part}/binary-${arch} &&
+       test -d backports/${dist}-backports/${part}/binary-${arch} || mkdir -p backports/${dist}-backports/${part}/binary-${arch}
+       (cd backports/${dist}-backports/${part}/binary-${arch} &&
            wget -q -N ${backports_ftpsite}/dists/sarge-backports/${part}/binary-${arch}/Packages.gz)
       done
       echo retrieve Contents $dist-backports/$arch
-      (cd us/${dist}-backports &&
+      (cd backports/${dist}-backports &&
          wget -q -N ${backports_ftpsite}/dists/sarge-backports/Contents-${arch}.gz)
     done
     for part in ${parts}
     do
         echo retrieve Sources $dist-backports/$part
-        test -d us/${dist}-backports/${part}/source || mkdir -p us/${dist}-backports/${part}/source
-        (cd us/${dist}-backports/${part}/source &&
+        test -d backports/${dist}-backports/${part}/source || mkdir -p backports/${dist}-backports/${part}/source
+        (cd backports/${dist}-backports/${part}/source &&
             wget -q -N ${backports_ftpsite}/dists/sarge-backports/${part}/source/Sources.gz)
     done
 done
index dff6cd29c4e2f237c9e13f607cf1cf6f72009dc2..85160dca068d630c7fd93809d5c74c63d6abe842 100755 (executable)
@@ -7,19 +7,21 @@ cd ${archivedir}
 
 # Main archive
 #
-arch=kfreebsd-i386
+architectures="kfreebsd-i386 kfreebsd-amd64"
 
-for dist in unstable experimental
+for arch in $architectures
   do
-  for part in ${parts} main/debian-installer
+  for dist in unstable experimental
     do
-    echo retrieve Packages $dist/$part/$arch
-    test -d kfreebsd/${dist}/${part}/binary-${arch} || mkdir -p kfreebsd/${dist}/${part}/binary-${arch}
-    (cd kfreebsd/${dist}/${part}/binary-${arch} &&
-       wget -q -N ${kfreebsd_ftpsite}/dists/${dist}/${part}/binary-${arch}/Packages.gz)
+    for part in ${parts} main/debian-installer
+      do
+      echo retrieve Packages $dist/$part/$arch
+      test -d kfreebsd/${dist}/${part}/binary-${arch} || mkdir -p kfreebsd/${dist}/${part}/binary-${arch}
+      (cd kfreebsd/${dist}/${part}/binary-${arch} &&
+         wget -q -N ${kfreebsd_ftpsite}/dists/${dist}/${part}/binary-${arch}/Packages.gz)
+    done
+    echo retrieve Contents $dist/$arch
+    (cd kfreebsd/${dist} &&
+       wget -q -N ${kfreebsd_ftpsite}/dists/${dist}/Contents-${arch}.gz)
   done
-  echo retrieve Contents $dist/$arch
-  (cd kfreebsd/${dist} &&
-      wget -q -N ${kfreebsd_ftpsite}/dists/${dist}/Contents-${arch}.gz)
 done
-
index 9fa2366c97d0d48f12086ac2abffbf048a40b1d6..44bb5c9aee11a1fc8e6358a219578236c77d1c7a 100755 (executable)
@@ -15,16 +15,16 @@ do
       for part in ${parts}
       do
        echo retrieve Packages $dist-volatile/$part/$arch
-       test -d us/${dist}-volatile/${part}/binary-${arch} || mkdir -p us/${dist}-volatile/${part}/binary-${arch}
-       (cd  us/${dist}-volatile/${part}/binary-${arch} &&
+       test -d volatile/${dist}-volatile/${part}/binary-${arch} || mkdir -p volatile/${dist}-volatile/${part}/binary-${arch}
+       (cd  volatile/${dist}-volatile/${part}/binary-${arch} &&
            wget -q -N ${volatile_ftpsite}/dists/${dist}/volatile/${part}/binary-${arch}/Packages.gz)
       done
     done
     for part in ${parts}
     do
         echo retrieve Sources $dist-volatile/$part
-        test -d us/${dist}-volatile/${part}/source || mkdir -p us/${dist}-volatile/${part}/source
-        (cd us/${dist}-volatile/$part/source &&
+        test -d volatile/${dist}-volatile/${part}/source || mkdir -p volatile/${dist}-volatile/${part}/source
+        (cd volatile/${dist}-volatile/$part/source &&
             wget -q -N ${volatile_ftpsite}/dists/${dist}/volatile/${part}/source/Sources.gz)
     done
 done
index c90eef1d0aafb54493629a25a45f5e70be08911b..89da639639cad7ced9e5f9352b2e191aeb6856a4 100644 (file)
@@ -305,14 +305,17 @@ sub do_download {
            $$page_content .= '<p>'._g( 'Note that GNU/kFreeBSD is not officialy included in the Debian archive yet, but the GNU/kFreeBSD porter group keeps their archive in sync with the official archive as close as possible. See the <a href="http://www.debian.org/ports/kfreebsd-gnu/">GNU/kFreeBSD ports page</a> for current information.' ).'</p>';
        } elsif ($archive eq 'non-US') {
 
+           $$page_content .= '<div class="cardleft">';
            $$page_content .= print_links( _g( "North America" ), $file, @nonus_north_american_sites );
-           $$page_content .= print_links( _g( "Europe" ), $file, @nonus_european_sites );
            $$page_content .= print_links( _g( "Australia and New Zealand" ), $file,
                                           @nonus_australian_sites );
            $$page_content .= print_links( _g( "Asia" ), $file, @nonus_asian_sites );
            $$page_content .= print_links( _g( "South America" ), $file, @nonus_south_american_sites );
-           
-           $$page_content .= '<p>'.sprintf( _g('If none of the above sites are fast enough for you, please see our <a href="%s">complete mirror list</a>.' ), 'http://www.debian.org/mirror/list-non-US' ).'</p>';
+           $$page_content .= '</div><div class="cardright">';
+           $$page_content .= print_links( _g( "Europe" ), $file, @nonus_european_sites );
+           $$page_content .= '</div>';
+
+           $$page_content .= '<p style="clear:both">'.sprintf( _g('If none of the above sites are fast enough for you, please see our <a href="%s">complete mirror list</a>.' ), 'http://www.debian.org/mirror/list-non-US' ).'</p>';
        } elsif ($archive eq 'backports') {
        
            $$page_content .= '<div class="cardleft">';
index 1261544a0ecebc4d9dac6603607741ed7781d253..1f0beb06c4092d9ff8815dfabf7c00190fa4e7cd 100644 (file)
@@ -382,19 +382,9 @@ sub do_show {
                    foreach( @$source_files ) {
                        my ($src_file_md5, $src_file_size, $src_file_name)
                            = split /\s+/, $_;
-                       my $src_url;
-                       for ("$suite/$archive") {
-                           /security/o &&  do {
-                               $src_url = $FTP_SITES{security}; last };
-                           /volatile/o &&  do {
-                               $src_url = $FTP_SITES{volatile}; last };
-                           /backports/o &&  do {
-
-                               $src_url = $FTP_SITES{backports}; last };
-                           /non-us/io  &&  do {
-                               $src_url = $FTP_SITES{'non-US'}; last };
-                           $src_url = $FTP_SITES{us};
-                       }
+                       (my $server = lc $archive) =~ s/-//go; # non-US hack
+                       my $src_url = $FTP_SITES{$server}
+                           || $FTP_SITES{us};
                        $src_url .= "/$source_dir/$src_file_name";
                        
                        $package_page .= "<tr><td><a href=\"$src_url\">$src_file_name</a></td>\n"
index fb16d2fdc66837214586de6ceda1648e747bfc3f..dca294ec72533f403915acaf4707c6a6bc71a1c8 100644 (file)
@@ -136,17 +136,10 @@ sub pmoreinfo {
        } else {
            foreach( @$files ) {
                my ($src_file_md5, $src_file_size, $src_file_name) = split /\s/o, $_;
-               for ("$suite/".$page->get_newest('archive')) {
-                   /security/o && do {
-                       $str .= "<a href=\"$env->{security}/$src_dir/$src_file_name\">["; last };
-                   /volatile/o && do {
-                       $str .= "<a href=\"$env->{volatile}/$src_dir/$src_file_name\">["; last };
-                   /backports/o && do {
-                       $str .= "<a href=\"$env->{backports}/$src_dir/$src_file_name\">["; last };
-                   /non-us/io && do {
-                       $str .= "<a href=\"$env->{'non-US'}/$src_dir/$src_file_name\">["; last };
-                   $str .= "<a href=\"$env->{us}/$src_dir/$src_file_name\">[";
-               }
+               # non-US hack
+               (my $server = lc $page->get_newest('archive')) =~ s/-//go;
+               $str .= sprintf("<a href=\"%s/$src_dir/$src_file_name\">[",
+                               $env->{$server}||$env->{us});
                if ($src_file_name =~ /dsc$/) {
                    $str .= "dsc";
                } else {