You are not logged in.

#1 2014-06-26 23:23:43

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 238

[SOLVED] can makepkg perform integrity check on files in an archive?

Hello, I have this wierd problem... a ZIP file that I want to package changes every time it's downloaded which means I can't compare its hash.

The only change is to 4 bytes in the center of the zip file that differ on each download. I've checked the files inside the ZIP and they do retain the same hashes. So, I wondered if there was any way to instruct makepkg to checksum against files incide a downloaded archive like a zip?

I'm sure the answer will be "no" but you never know....

Last edited by starfry (2014-06-27 08:52:40)

Offline

#2 2014-06-26 23:40:29

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: [SOLVED] can makepkg perform integrity check on files in an archive?

You can just set the checksum to 'SKIP'.  Then if you want to verfiy files individually after that, you could put your own checks in the prepare function.

What is this source?  Why are only those 4 bytes changing?  Is there any other way to obtain the source?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2014-06-27 00:01:22

ids1024
Member
From: California
Registered: 2013-08-16
Posts: 243
Website

Re: [SOLVED] can makepkg perform integrity check on files in an archive?

You could use SKIP and then manually verify the checksums.  For example, you could include a file with the checksums and use "md5sum -c" to verify them.


"Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it."—Linus Torvalds
s/ftp/git/

https://iandouglasscott.com | https://github.org/ids1024 | https://keybase.io/ids1024

Offline

#4 2014-06-27 08:51:45

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 238

Re: [SOLVED] can makepkg perform integrity check on files in an archive?

Thaks, that's what I had done to work around the problem. I just wanted to make sure I wasn't missing out on some makepkg magic that I might have been unaware of.

For anyone else reading this, I made a checksum file of the relevant files in the "src" directory using "sha256sum -c > checksums.sha256" and then added the file "checksums.sha256" in the PKGBUILD sources, along with its own sha256 and I used 'SKIP' in place of a sha256 of the original zip. I then provided a "prepare()" function:

prepare() {                                                                                              
  cd "${srcdir}"
  sha256sum -c checksums.sha256
}

Offline

#5 2014-06-27 09:24:16

progandy
Member
Registered: 2012-05-17
Posts: 5,306

Re: [SOLVED] can makepkg perform integrity check on files in an archive?

If the license allows you to redistribute the sources, then you could create your own mirror with a static archive.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#6 2014-06-27 13:55:04

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 238

Re: [SOLVED] can makepkg perform integrity check on files in an archive?

progandy wrote:

If the license allows you to redistribute the sources, then you could create your own mirror with a static archive.

heh! after messing about, I did find an alternative mirror that did not suffer the problem. I'm now using that and it's back to being sensible.

One might say it wasted some time, but I like to think I learnt something new in the process big_smile

Offline

Board footer

Powered by FluxBB