Age | Commit message (Collapse) | Author |
|
We don't need the full mirror log objects; we just need a very small
subset of values from them here to do the required math and object
building.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Fixes FS#31503.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This makes it easier to do manual manipulation/insertion/etc. at the
database level, as well as just making things act more sane from an
overall software stack perspective.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Now that Django actually provides a concise way to use a RequestContext
object without instantiating it, we can use that rather than the old
function-based generic view that worked well to do the same.
Additionally, these function-based generic views will be gone in Django
1.5, so might as well make the move now.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This was around from the time when we handled timezones sanely and
Django did not; now that we are on 1.4 we no longer need our own code to
handle this.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This was a dumb oversight on my part in commit 0f3c894e7a0.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
It isn't worth it, as we run into the 999 max SQL statement variables
issue when using it on any significant amount of mirrors. Since this is
just a development database setup, and it isn't a command we need to run
especially fast, we can ditch it.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Because this function isn't shipped by default, it makes more sense to
just omit it completely from the query we do to build the tables on this
page when in development. Substitute 0.0 for the value so the rest of
the calculations and display work as expected.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Managed to see this bubble up today when running the mirrorcheck command
on a less than ideal connection that was experiencing timeouts at the
wrong time.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
We have a lot of these in the freeform text area in the mirror notes;
attempt to make this data usable as necessary if we want to do some sort
of mirror notification automation in the future.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This should make it easier to catch errors in our Tier 1 mirrors.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
The main changes in this patch implement rsync:// protocol checking
support by calling the rsync binary, requested in FS#29878. We track and
log much of the same things as we already do for FTP and HTTP URLs-
check time, last sync, total check duration, etc.
Also added in this patch is a configurable timeout value which defaults
to the previous hardcoded value of 10 seconds; this can be passed as an
option to the mirrorcheck command.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Use TextField rather than a limited-length CharField; leave it up to the
code filling this field to determine an appropriate length.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
If results weren't available for certain URLs, they won't show up anyway
in this list, and if we start to check rsync URLs, then we want their
values to come back in this status list.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
As of Python 2.6, this is a builtin module that has all the same
functions and capabilities of the Django simplejson module. Additionally
simplejson is deprecated in the upcoming Django 1.5 release.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This will only list FTP mirrors for a given country if there are no HTTP
mirrors available, since FTP must die.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Add a helper method that checks if we know about the protocol; if so, we
can spit out a URL for it. This allows (if you are insane) generation of
an rsync mirrorlist, for instance.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
98% of the time, we won't need to update the existing values as it will
be the same as the prior run of this command. Do a quick check of the
old and new values and don't send anything to the database if there is
no need for an update.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
It would be straightforward if we just needed to remove the field class
definition, but we also need to update all migrations that referenced it
so we don't have problems starting and migrating from scratch.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
We had one sorting order in the backend, and another once the JS sorting
routine kicked in. Match them so we aren't doing more on the client-side
on initial display than we have to.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Rename template since it really isn't an index of mirrors at all, and
convert the form to use multiple checkboxes for both ftp/http and
ipv4/ipv6 selection.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
* Add a migration to drop the old countries field.
* Update all templates/views/utility methods to point at the new country
field and dereference it as necessary.
* Add the flags images to a few views where it makes sense.
* Cleanup the download page layout quite a bit.
* Bump the mirror status JSON version to 3; add country_code attribute.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This adds these columns and attempts to populate them with data from our
existing country column data.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
We're going to move to using ISO 2 character codes via django countries,
so start by moving the old data out of the way first.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This should fix the issues reported in FS#23228 for the most part.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
The check here was wrong before; in the case of no mirror log entries
the returned value will not be empty, but will contain two empty values.
Check the values instead to see if we have valid data available.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
I don't think these end up doing anything at the database level, but
since South insists on generating alter_column() calls for these
changes, do them once so they don't keep reappearing in auto-generated
future migrations.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Given that we collect a lot of mirror status data, we can utilize it to
ensure the download link on the website actually works and newly-added
packages have actually been mirrored out. Add a method that attempts to
use the mirror status data to determine a mirror we should redirect our
download requests to. This can change on a regular basis, and falls back
to the old method if no mirror status data is available.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Due to datetime formatting changes in Django 1.4, we know follow the
ECMA specification more closely and use 'yyyy-mm-ddThh:mm_ssZ' format.
As this could break existing users of the JSON data, bump the version.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This is most of the transition to Django 1.4 `USE_TZ = True`. We need to
ensure we don't mix aware and non-aware datetime objects when dealing
with datetimes in the code. Add a utc_now() helper method that we can
use most places, and ensure there is always a timezone attached when
necessary.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Until Django 1.3, the functions include(), patterns() and url() plus
handler404, handler500 were located in a django.conf.urls.defaults
module.
In Django 1.4, they live in django.conf.urls.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
More generally, add a new 'default' column to the mirror protocol model
so we can determine what is selected and shown by default.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Remove never_cache from many places now that we don't actually need it
since we aren't caching by default. Adjust our cache_function decorator
times be shorter values, and also randomize them a bit to make cache
invalidations not all line up.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This got checked in by default, whoops.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
* Don't capitalize things in verbose_name, Django does this
automatically and uses title case
* Add overrides for IP, URL, ISO, etc.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This allows access to the same data (and even a bit more) from the
signoffs overview page in a machine-friendly way.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
These are retrieved by adding 'json/' to the normal package details or
files view.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
You need a custom field type in Django to allow this.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Now that we aren't seeing odd segfaults and hung tasks, we can remove
the traceback stuff from the scripts. Also use the 'io' module only, it
has been long enough.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
We should be encouraging our mirrors to serve us the original file, not
something they create and come up with.
Signed-off-by: Dan McGee <dan@archlinux.org>
|