[csw-maintainers] Catalog generation date information in catalog/pkgutil?
James Lee
james at opencsw.org
Fri Apr 15 11:15:02 CEST 2011
On 14/04/11, 20:20:53, Philip Brown <phil at bolthole.com> wrote regarding Re:
[csw-maintainers] Catalog generation date information in
catalog/pkgutil?:
> > date=$(grep '^# CreationDate:' catalog)
> > echo ${date#*:}
> >
> > echo $(sed -n -e '/^# CreationDate: /s///p' catalog)
> awk 'NR==1{print $NF;exit}' catalog
Which does?
$ cat catalog
1111
2222
# CreationDate: 2011-04-15 11:02:45
4444
5555
6666
$ awk 'NR==1{print $NF;exit}' catalog
1111
# Here again sed but with quit after print. I thought I could put all
# on one line with enough back slashes but gave up:
$ sed -n -f /dev/stdin catalog << 'EOF'
/^# CreationDate: /{
s///p
q
}
EOF
2011-04-15 11:02:45
> > The token "CreationDate" is the same token used by PDF and Postscript
> > DSC [1] [2]. PS DSC is a similar example of how to use comments to
> > embed data in the catalog.
> thats a nice reference. However, going by your examples, either of
> them use ISO8601 format, so in a way, that is an argument NOT to use
> it.
Correct, it wasn't supposed to be. Focus on the use of DSC to add data
to a file using structured comments. Take the 1 minute PS DSC tutorial,
here is the top of a DSC conforming PostScript file:
%!PS-Adobe-3.0
%%Pages: (atend)
%%BoundingBox: 18 42 593 774
%%HiResBoundingBox: 18.700000 42.300000 593.000000 774.000000
%.....................................
%%Creator: GPL Ghostscript 901 (pswrite)
%%CreationDate: 2011/03/24 14:07:25
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%EndComments
And here is a notional catalog head with formalised comments:
#OpenCSW catalog 1.0
#CreationDate: 2010-04-15 09:11:12Z
#Version: 1.2
#Creator: bldcat 2.3
#Author: Philip Brown
#SiteFeatures: gzipcatalog
#EndComments
James.
More information about the maintainers
mailing list