:: [DNG] About amprolla-3
Página Inicial
Delete this message
Reply to this message
Autor: aitor_czr
Data:  
Para: dng
Assunto: [DNG] About amprolla-3
Hi all,

Having a look at the code of the amprolla_init.py script:

https://github.com/parazyd/amprolla/blob/master/amprolla_init.py

you'll find the following commented lines 76-81:

# if k.endswith('/binary-armhf/Packages.gz'):
# for a in arches:
#   for c in categories:
#     if a in k and ("/%s/" % c) in k:
#       urls = (join(url[0], k), join(url[1], k))
#       tpl.append(urls)

Obviously, they were being tested under an armhf architecture, but they
didn't seem to work since they are commented.
In a more general scope we should replace the first line in order to
complay with the whole list of architectures as follows:

if k.endswith('/Packages.gz'):

At this point, let's clarify that the *release_contents* python
dictionary can take different values within the *for* loop above (see
the line 60),
depending on the value of the *dist* variable (say 'gnuinos', 'devuan'
or 'debian', in my concrete case). For example, for dist='gnuinos' the
instruction
'print(release_contents) should throw something like this:

{

'main/source/Release':
('6ac08b835a4af4612418e2f94e1870e4cff8588e7d76fe88b687f88d49d33905', '129'),
'main/Contents-all.bz2':
('4e1468a9098c25653df085b47e8a07883a9d7eff8fa8d72ce2fbd01976557caa',
'86697'),
'main/binary-amd64/Release':
('2940b51273608494b88f6d62ae1381f5a9a9fe82d0a562069b6cb1d91b91e134',
'128'),
'main/debian-installer/binary-amd64/Release':
('2940b51273608494b88f6d62ae1381f5a9a9fe82d0a562069b6cb1d91b91e134',
'128'),
'main/Contents-i386.gz':
('4a668df2a548c96634fb8f5de914f2b097fa4cbce36e2893d218056b1de3afff',
'388221'),
'main/binary-all/Packages.gz':
('8fb999c8c9152e4b74801cbd08cfb205dd405e98734fd63c58ac5ca3d5556497',
'13468'),
'main/debian-installer/binary-i386/Packages.gz':
('4e30cd269b57c46ec94b464f7be8f9f366ed235bce9f4df1be97f6b89c863200',
'15236'),
'main/Contents-i386.bz2':
('c846be19c27d9f65ea741a8b1384efa96669d75a0622aab15a6cc0d531e38964',
'296180'),
'main/debian-installer/binary-i386/Release':
('e80ebfe3fab8b3a7e7e211cf323982110509a8172db4e540c6d651ebb86db9c3',
'127'),
'main/source/Sources.bz2':
('44be781abbc7bd2c457c91cb224232f8c7bb320266c9c318a14c1c595c5c426f',
'27068'),
'main/Contents-i386':
('e552d78bf459de48607f6825ee183afc6cdafce349abe4d708f83c4d47aef3b7',
'5730743'),
'main/source/Sources':
('d42702641f669ea8e148d3c5eb956e5a39d727c9d4de1d56ef0b81cf37e941ab',
'218384'),
'main/binary-i386/Packages.gz':
('98ec7d3c3d761c8ca3e08fdfbc3f0ae5c102362b3f6cec6f73e2be06e9c985d9',
'66641'),
'main/source/Sources.gz':
('011c2edae24ffeb414df8562293a869ceaa16fd9568bfcd19e9fbfa3de75dc7a',
'35398'),
'main/debian-installer/binary-all/Packages':
('483bdbf818dba2d97562cca9de4622f53b31abe8a64716b19731f288efd877cb',
'726'),
'main/Contents-all':
('cf80c86286974b8d944da5b7f552890b9f8a4b41aacd792093d28fed9eeaf7b6',
'1275824'),
'main/binary-amd64/Packages.gz':
('cde0dc0180b806e33ec015a23cdce7252be77bcec93237dc8d6aa81298686dd0',
'64478'),
'main/Contents-all.gz':
('e80d7fc7fb34445796a1ea59c053266d3157ed6db2f20af472e76e4ea07a550c',
'104332'),
'main/debian-installer/binary-amd64/Packages':
('1017fac3c3b3703737124b3330e9d62b04eb1f21afd9a617eec8759a5d09b455',
'41675'),
'main/debian-installer/binary-all/Release':
('aeda45f8528299e45bd726306a20aef04175b8a76cfbb4aebde09fff38647407',
'126'),
'main/binary-i386/Release':
('e80ebfe3fab8b3a7e7e211cf323982110509a8172db4e540c6d651ebb86db9c3',
'127'),
'main/debian-installer/binary-all/Packages.gz':
('bf18c4b295e4b2f416ab6f24ac079c7d1d83e47fde316b950c31b44a576aba41',
'481'),
'main/Contents-amd64.bz2':
('f820fbf1fcbdf53cabf32a9a75a199a4e0e05e41f08834f6f9d5ee673064c7e4',
'262172'),
'main/debian-installer/binary-amd64/Packages.gz':
('ff9fd291958c79c71c1ba27f1591f894d8293025b30ad8f28157c93a0551ba6f',
'9004'),
'main/binary-i386/Packages':
('04d563842c9d921e79e98c00b459632ee5e75b3b6fa05366f93d0c31204b20bc',
'285503'),
'main/debian-installer/binary-i386/Packages':
('5fb434475ab503ea25b9eccfb982544308742a93d0d0474efdcc16de21552b78',
'80531'),
'main/Contents-amd64.gz':
('34b71529f439275b98cd8b7c7ace9bb16d2dfd653f81609a58c108ae39c35080',
'320050'),
'main/binary-all/Packages':
('61ff4f5097b9649507538657f42999212c0c6d108a9d15b600f1f5d17db43bb8',
'43601'),
'main/binary-all/Release':
('aeda45f8528299e45bd726306a20aef04175b8a76cfbb4aebde09fff38647407',
'126'),
'main/binary-amd64/Packages':
('382aa290f73ba0b9852d36e419f02915bc77a6647b59cfca3263a2d846a0056d',
'276479'),
'main/Contents-amd64':
('8e4d1ddb1891450a13414e35d2195bee79183670094a3e2e269b0511c6c1dfd3',
'4379342')

}

for other values of *dist* we would find also other categories like
'contrib' or 'non-free' and also other different architectures (
'source' 'all' 'i386 and 'amd64' aside)
getting lines like this other one:

'non-free/debian-installer/binary-hppa/Packages.xz':
('0040f94d11d0039505328a90b2ff48968db873e9e7967307631bf40ef5679275', '32'),

This said, and coming back to the commented lines in the
amprolla_init.py script, you'll understand the reason why these lines
didn't work properly:
all the keys in the python dictionary start with the value of the 'c'
category; therefore, the line nº 79 should be replaced by:

if a in k and ("%s/" % c) in k:

(Note the missing '/' symbol at the begining of the string) and the code
above will stay this way:

if k.endswith('/binary-armhf/Packages.gz'):
for a in arches:
  for c in categories:
    if a in k and ("/%s/" % c) in k:
      urls = (join(url[0], k), join(url[1], k))
      tpl.append(urls)

which worked for me :)

A similar code might be defined for the Contents.gz

Cheers,

Aitor.