apt and synaptic filenames

Discuss Applications
Post Reply
caveman
programmer
programmer
Posts: 130
Joined: Sun Feb 09, 2003 1:08 pm
Location: Midrand Gauteng, South Africa

apt and synaptic filenames

Post by caveman »

Hi guys.

Have looked around but can't find an answer :oops:

Is it possible to set apt (specific synaptic) to use the filenames
as is in the reposits and not add all those "%" "_"
(percent and unserscore) characters etc?

Don't know about you - but to me it is very frustrating to check filenames
(I'm only on a 64k modem) everytime I download big files at work or
where ever I find a fast link and try and cross manage them.

Why does it actually change the characters? does it think its on a
winbloze platform? or try and get thru the web? and the filenames
being straight forward ascii at that.... must be a reason.

It is specially annoying trying to keep 3 different machines in step,
all using (as the users are allowed to) different update progs.

TX in advance.

Sorry for the rant - but this been bugging me for a long time :D

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

I found this message that appears to explain it:

http://lists.debian.org/debian-user/200 ... 01343.html

Code: Select all

Dan Jacobson wrote:

>     $ man apt-get
>
>        --print-uris Instead of fetching the files to install their
>               URIs are printed.  Each URI will have the path, the
>               destination file name, ... Note that the file name to
>               write to will not always match the file name on the
>               remote site!...
>
>
> Indeed, why are some of those names different?  The difference I found
> was that sometimes an [0-9]%3a is inserted:
>
>
> $ apt-get -qq --print-uris dist-upgrade|sed "s=.*/==;s/'//;s/.%3a//"|\
> awk '$1!=$2{print $1,$2}' #eliminated the differences with ^^^^^^^^
>
>
> But why the need to be different?  I'm following
> /usr/share/doc/apt/offline.html/ch3.html .


The difference is the epoch. %3a is the escape code for ":". When the upstream versioning becomes screwy for whatever reason, an epoch[a number followed by a colon] is prepended to the debian version[or the epoch is bumped up a notch] so that it sorts correctly[newer versions need to sort before older versions]. It isn't possible to get the uri to match the filename conservatively cause both "%" and/or ":" would need to be escaped/would be escaped by wget so this is how it was decided it would be done since it was also decided that the filename would include the full version.

Also, I don't understand why are you are trying to eliminate the differences, they are there for a reason[apt will look for the filenames with the %3a in /var/cache/apt/archives/ not the filenames corresponding to the uri's.

Also, something interesting I found in the wget man page that does similar things:

Code: Select all

       --restrict-file-names=mode
           Change which characters found in remote URLs may show up in local
           file names generated from those URLs.  Characters that are
           restricted by this option are escaped, i.e. replaced with %HH,
           where HH is the hexadecimal number that corresponds to the
           restricted character.

           By default, Wget escapes the characters that are not valid as part
           of file names on your operating system, as well as control charac-
           ters that are typically unprintable.  This option is useful for
           changing these defaults, either because you are downloading to a
           non-native partition, or because you want to disable escaping of
           the control characters.

           When mode is set to ‘‘unix’’, Wget escapes the character / and the
           control characters in the ranges 0--31 and 128--159.  This is the
           default on Unix-like OS’es.

           When mode is set to ‘‘windows’’, Wget escapes the characters \, │,
           /, :, ?, ", *, <, >, and the control characters in the ranges 0--31
           and 128--159.  In addition to this, Wget in Windows mode uses +
           instead of : to separate host and port in local file names, and
           uses
            @  instead of  ?  to separate the query portion of the file name
           from the rest.  Therefore, a URL that would be saved as
           www.xemacs.org:4300/search.pl?input=blah in Unix mode would be
           saved as www.xemacs.org+4300/search.pl@input=blah in Windows mode.
           This mode is the default on Windows.

           If you append ,nocontrol to the mode, as in unix,nocontrol, escap-
           ing of the control characters is also switched off.  You can use
           --restrict-file-names=nocontrol to turn off escaping of control
           characters without affecting the choice of the OS to use as file
           name restriction mode.

Post Reply