[Slapt-get-user] lzma support

Miguel Reynosso miguel at ikimlinux.org
Mon Aug 4 00:51:47 EDT 2008


Jason Woodward escribió:
> Hi,
>
>   
>> Okay, thank you for responding.
>> you are absolutely razon (. I modified file src/package.h adapting to 
>> the needs to handle the extension (. ikg) as follows.
>>
>> #define SLAPT_PKG_PARSE_REGEX "(.*{1,})\\-(.*[\\-].*[\\-].*).ikg[ ]{0,}$"
>> #define SLAPT_PKG_NAME_PATTERN "^PACKAGE NAME:[ 
>> ]{1,}(.*{1,})\\-(.*[\\-].*[\\-].*)(.ikg)[ ]{0,}$"
>> #define SLAPT_MD5SUM_REGEX "([a-zA-Z0-9]{1,})[ 
>> ]{1,}([a-zA-Z0-9\\/._\\-]{1,})\\/(.*{1,})\\-(.*[\\-].*[\\-].*).ikg$"
>>
>> But unfortunately for me, the situation is persistent
>> looking a little code in the file src/packages.c, find that my problem 
>> is generated by the function "slapt_verify_downloaded_pkg" in the variable
>> "file_size = slapt_get_pkg_file_size(global_config,pkg)" around the line 
>> 2201 if any comment on this variable besides the line 2193
>>
>> package.c - line 
>> 2193----------------------------------------------------------
>> /*size_t file_size = 0;*/
>> -------------------------------------------------------------------------------------------
>>
>> package.c - line 2201-2204--------------------------------------------------
>>   /*
>>   file_size = slapt_get_pkg_file_size(global_config,pkg);
>>   if ((unsigned int)(file_size/1024) != pkg->size_c) {
>>     return SLAPT_DOWNLOAD_INCOMPLETE;
>>   }
>>   */
>> -------------------------------------------------------------------------------------------
>>
>> The code compiles and the program does not give more problems; But I 
>> suppose this is not the best way to solve the problem
>>     
>
> It looks like your file sizes, as reported in the PACKAGES.TXT, are indeed off.
>
> PACKAGE NAME:  gcc-objc-4.3.1-i486-1.ikg
> PACKAGE LOCATION:  ./Desarrollo/aplicaciones/gcc-objc
> PACKAGE SIZE (compressed):  2306 K
>
> -rw-r--r-- 1 root root 2301 2008-07-28 23:26
> /var/slapt-get/Desarrollo/aplicaciones/gcc-objc/gcc-objc-4.3.1-i486-1.ikg
>
> You need to correct whatever mechanism you are using to generate the PACKAGES.TXT to report the
> correct file sizes (an example can be found here to compare against:
> http://software.jaos.org/BUILD/slapt-get/FAQ.html#slgFAQ17).
>
>
> take care,
> jason
> --
> Jason Woodward
> woodwardj at jaos.org
>
>
> _______________________________________________
> Slapt-get-user mailing list
> Slapt-get-user at software.jaos.org
> http://software.jaos.org/cgi-bin/mailman/listinfo/slapt-get-user
>
>   
Perfect, you had all the reason, the problem was the method by which 
obtained the size of the packages because due to 'LZMA' is very erratic 
at this point, I decided to use the command 'du' as follows

 SIZE=$( expr `du -B 1 $1 | awk '{print $1}'` / 1024)

That suggestion to compare to yours, with the output of 'ls' (2355247) I 
realized it was actually worth wrong 2306.
The solution was to change the way the command 'du' presents the 
information as follows

SIZE=$( expr `du --apparent-size --block-size=1 $1 | awk '{print $1}'` / 
1024 )

and the problem is solved. Thank you so much for your time and help.

Greetings



More information about the Slapt-get-user mailing list