Bug 11558 - updxlrator - huge windows 10 downloads duplicated coming from different mirrors
Summary: updxlrator - huge windows 10 downloads duplicated coming from different mirrors
Status: CLOSED FIXED
Alias: None
Product: IPFire
Classification: Unclassified
Component: --- (show other bugs)
Version: 2
Hardware: unspecified Unspecified
: - Unknown - - Unknown -
Assignee: jluth
QA Contact:
URL:
Keywords:
Depends on: 10504
Blocks:
  Show dependency treegraph
 
Reported: 2017-12-06 09:47 UTC by jluth
Modified: 2018-04-09 19:29 UTC (History)
4 users (show)

See Also:


Attachments
use_sha_name.sh: script to link the filename-md5sum folder to the existing url-md5sum folder (1.37 KB, patch)
2017-12-06 09:47 UTC, jluth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jluth 2017-12-06 09:47:36 UTC
Created attachment 546 [details]
use_sha_name.sh: script to link the filename-md5sum folder to the existing url-md5sum folder

Microsoft downloads are cached based on the URL ($unique) rather than on the filename ($mirror). However, most downloads now contain an SHA1 hash in the filename. Windows Update on Windows 10 has proven to attempt to download the huge (6+GB/month) updates from multiple URLs, so that 6GB is multiplied by each mirror that is hit.

The filename switch can easily be made with:
if ( $source_url =~ m@.*[0-9a-f]{40}\.[^\.]+@i ) {
$xlrator_url = &check_cache($source_url,$hostaddr,$username,"Microsoft",$mirror);
} else {
$xlrator_url = &check_cache($source_url,$hostaddr,$username,"Microsoft",$unique);
}

Of course, only doing that means that everything gets downloaded yet again.  However, a cleanup script could rename the existing url-based-folder to be a filename-based-folder.

NOTE: I did this via a symbolic link (scripted attached), but then I also had to allow SymLinks in apache. The script needs the helper file md5name.pl
-----------md5name.pl----------
#!/usr/bin/perl
        $sourceurl=shift;
        $sourceurl =~ s@\%2b@+@ig;
        $sourceurl =~ s@\%2f@/@ig;
        $sourceurl =~ s@\%7e@~@ig;
        $uuid = `echo $sourceurl | md5sum`;
        $uuid =~ s/[^0-9a-f]//g;
        $uuid =~ s/([a-f\d]{8})([a-f\d]{4})([a-f\d]{4})([a-f\d]{4})([a-f\d]{12})/$1-$2-$3-$4-$5/;
print $uuid;
exit 0;
------------------------------
Comment 2 Michael Tremer 2018-01-29 12:15:35 UTC
About to be released with c118
Comment 3 Peter Müller 2018-04-09 19:29:15 UTC
Core Update has been released, fixed.