New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mb makehashes path not canonicalized #72

Closed
poeml opened this Issue Jun 5, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@poeml
Owner

poeml commented Jun 5, 2015

                                                                                                           [          ]

Issue migrated (2015-06-05) from old issue tracker http://mirrorbrain.org/issues/issue72

Title    mb makehashes path not canonicalized
 Priority   bug      Status    resolved
Superseder          Nosy List  poeml, theuni
Assigned To poeml   Keywords

msg274 (view) Author: theuni Date: 2010-09-21.19:28:26

This is a very small bug, and easily fixed by the user, but it bit me in my
hashing script.

Failed attempt:
git@atlantis:/tmp$ mb makehashes -t /home/git/hashes/var/www/downloads -b
/var/www/downloads "/var/www/downloads/addons//dharma-pre" --copy-permissions

Works correctly:
git@atlantis:/tmp$ mb makehashes -t /home/git/hashes/var/www/downloads -b
/var/www/downloads "/var/www/downloads/addons/dharma-pre" --copy-permissions
Hashing '/var/www/downloads/addons/dharma-pre/addons.xml'... done.
Hashing '/var/www/downloads/addons/dharma-pre/metadata.filmweb.pl/addon.xml'...
done.
File 'addons/dharma-pre/metadata.filmweb.pl/changelog-1.1.1.txt' not in
database. Not on mirrors yet? Will be inserted.
Hashing
'/var/www/downloads/addons/dharma-pre/metadata.filmweb.pl/changelog-1.1.1.txt'... done.
Hashing '/var/www/downloads/addons/dharma-pre/metadata.filmweb.pl/icon.png'... done.
File 'addons/dharma-pre/metadata.filmweb.pl/metadata.filmweb.pl-1.1.1.zip' not
in database. Not on mirrors yet? Will be inserted.
Hashing
'/var/www/downloads/addons/dharma-pre/metadata.filmweb.pl/metadata.filmweb.pl-1.1.1.zip'...
done.
Obsolete hash in db: 'addons/dharma-pre/metadata.filmweb.pl/changelog-1.1.0.txt'
(id 3071)
Obsolete hash in db:
'addons/dharma-pre/metadata.filmweb.pl/metadata.filmweb.pl-1.1.0.zip' (id 3072)
Deleting 2 obsolete hashes from hash table
Hashing '/var/www/downloads/addons/dharma-pre/script.mpdc/addon.xml'... done.
Hashing
'/var/www/downloads/addons/dharma-pre/script.mpdc/changelog-0.9.2.txt'... done.
Hashing '/var/www/downloads/addons/dharma-pre/script.mpdc/fanart.jpg'... done.
Hashing '/var/www/downloads/addons/dharma-pre/script.mpdc/icon.png'... done.
Hashing
'/var/www/downloads/addons/dharma-pre/script.mpdc/script.mpdc-0.9.2.zip'... done.

(notice the // in the failed path)

It seems as though this could be easily avoided by cleaning the paths passed
before traversing them.

msg310 (view) Author: poeml Date: 2010-11-14.16:22:11

Surely an annoying bug, because it tends to put the wrong files into the database! Thanks much for catching
this.

I'm committing a fix to trunk that goes into 2.15.0.

The following give the correct result now, in my testing:

mb makehashes -t ////srv/metalink-hashes/srv/nullmirrors////centos/// -b /srv/nullmirrors///centos
/srv/nullmirrors/centos////5.5/updates////SRPMS//

Hashing '/srv/nullmirrors/centos/5.5/updates/SRPMS/java-1.6.0-openjdk-1.6.0.0-1.16.b17.el5.src.rpm'... done.
Hashing '/srv/nullmirrors/centos/5.5/updates/SRPMS/kdebase-3.5.4-21.el5.centos.1.src.rpm'... done.
Hashing '/srv/nullmirrors/centos/5.5/updates/SRPMS/kdegraphics-3.5.4-17.el5_5.1.src.rpm'... done.

msg311 (view) Author: poeml Date: 2010-11-14.16:25:24

In trunk.
http://svn.mirrorbrain.org/viewvc/mirrorbrain?view=revision&revision=8229

History
         Date          User  Action              Args
2010-11-14 16:25:24 poeml  set    status: in-progress -> resolved
                                    messages: + msg311
2010-11-14 16:22:12 poeml  set    status: unread -> in-progress
                                    messages: + msg310
2010-09-21 19:28:27 theuni create

(end of migrated issue)

@poeml poeml added bug resolved labels Jun 5, 2015

@poeml poeml closed this Jun 5, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment