[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Package integration date into repository



On Sun, Apr 26, 2020 at 01:30:11AM +0200, l0f4r0@tuta.io wrote:
> Hi Marco,
> 
> 25 avr. 2020 à 23:12 de talby@debianlists.mobilxpress.net:
> 
> > To receive the date from the changelog is the closest I would know of, after I for myself have been searching for this in the past. I then constructed some ugly but well working CLI (bash) command:
> >
> > apt-get changelog PACKAGENAME 2> /dev/null| grep -m 1 "^ --" 2> /dev/null| cut -d'>' -f2 2> /dev/null| cut -c 3- 2> /dev/null | cut -d' ' --complement -s -f6 2> /dev/null
> >
> I didn't know about apt(-get) changelog, thank you :)
> However, I note there is no direct command to obtain the expected result according to you.
> NB: I have a suggestion for your command, same logic but probably less resource-consuming because there is only one pipe:
> apt-get changelog PACKAGENAME 2>/dev/null | awk 'BEGIN{FS=">"} /--/{sub("  ","",$2);print $2;exit}'
> 
That's neat.  You could turn into a shell function too:

roberto@miami:~$ pkg_date() {
> apt-get changelog "$1" 2>/dev/null | awk 'BEGIN{FS=">"} /--/{sub("  ","",$2);print $2;exit}'
> }
roberto@miami:~$ pkg_date chromium
Thu, 02 Apr 2020 22:23:57 +0000

Regards,

-Roberto

-- 
Roberto C. Sánchez


Reply to: