head 1.4; access; symbols libarchive-3-8-10:1.1.1.3 pkgsrc-2026Q3:1.4.0.94 pkgsrc-2026Q3-base:1.4 libarchive-3-8-9:1.1.1.3 libarchive-3-8-8:1.1.1.3 pkgsrc-2026Q2:1.4.0.92 pkgsrc-2026Q2-base:1.4 libarchive-3-8-7:1.1.1.3 libarchive-3-8-6:1.1.1.3 pkgsrc-2026Q1:1.4.0.90 pkgsrc-2026Q1-base:1.4 libarchive-3-8-5:1.1.1.3 libarchive-3-8-4:1.1.1.3 pkgsrc-2025Q4:1.4.0.88 pkgsrc-2025Q4-base:1.4 libarchive-3-8-3:1.1.1.3 libarchive-3-8-2:1.1.1.3 pkgsrc-2025Q3:1.4.0.86 pkgsrc-2025Q3-base:1.4 libarchive-3-8-1:1.1.1.3 pkgsrc-2025Q2:1.4.0.84 pkgsrc-2025Q2-base:1.4 libarchive-3-8-0:1.1.1.3 libarchive-3-7-9:1.1.1.3 pkgsrc-2025Q1:1.4.0.82 pkgsrc-2025Q1-base:1.4 pkgsrc-2024Q4:1.4.0.80 pkgsrc-2024Q4-base:1.4 libarchive-3-7-7:1.1.1.3 pkgsrc-2024Q3:1.4.0.78 pkgsrc-2024Q3-base:1.4 libarchive-3-7-5:1.1.1.3 pkgsrc-2024Q2:1.4.0.76 pkgsrc-2024Q2-base:1.4 libarchive-3-7-4:1.1.1.3 libarchive-3-7-3:1.1.1.3 pkgsrc-2024Q1:1.4.0.74 pkgsrc-2024Q1-base:1.4 libarchive-3-7-2:1.1.1.3 pkgsrc-2023Q4:1.4.0.72 pkgsrc-2023Q4-base:1.4 pkgsrc-2023Q3:1.4.0.70 pkgsrc-2023Q3-base:1.4 pkgsrc-2023Q2:1.4.0.68 pkgsrc-2023Q2-base:1.4 pkgsrc-2023Q1:1.4.0.66 pkgsrc-2023Q1-base:1.4 pkgsrc-2022Q4:1.4.0.64 pkgsrc-2022Q4-base:1.4 pkgsrc-2022Q3:1.4.0.62 pkgsrc-2022Q3-base:1.4 pkgsrc-2022Q2:1.4.0.60 pkgsrc-2022Q2-base:1.4 pkgsrc-2022Q1:1.4.0.58 pkgsrc-2022Q1-base:1.4 pkgsrc-2021Q4:1.4.0.56 pkgsrc-2021Q4-base:1.4 pkgsrc-2021Q3:1.4.0.54 pkgsrc-2021Q3-base:1.4 pkgsrc-2021Q2:1.4.0.52 pkgsrc-2021Q2-base:1.4 pkgsrc-2021Q1:1.4.0.50 pkgsrc-2021Q1-base:1.4 pkgsrc-2020Q4:1.4.0.48 pkgsrc-2020Q4-base:1.4 pkgsrc-2020Q3:1.4.0.46 pkgsrc-2020Q3-base:1.4 pkgsrc-2020Q2:1.4.0.42 pkgsrc-2020Q2-base:1.4 pkgsrc-2020Q1:1.4.0.22 pkgsrc-2020Q1-base:1.4 pkgsrc-2019Q4:1.4.0.44 pkgsrc-2019Q4-base:1.4 pkgsrc-2019Q3:1.4.0.40 pkgsrc-2019Q3-base:1.4 libarchive-3-4-0:1.1.1.3 libarchive-3-3-3:1.1.1.3 pkgsrc-2019Q2:1.4.0.38 pkgsrc-2019Q2-base:1.4 pkgsrc-2019Q1:1.4.0.36 pkgsrc-2019Q1-base:1.4 pkgsrc-2018Q4:1.4.0.34 pkgsrc-2018Q4-base:1.4 pkgsrc-2018Q3:1.4.0.32 pkgsrc-2018Q3-base:1.4 pkgsrc-2018Q2:1.4.0.30 pkgsrc-2018Q2-base:1.4 pkgsrc-2018Q1:1.4.0.28 pkgsrc-2018Q1-base:1.4 pkgsrc-2017Q4:1.4.0.26 pkgsrc-2017Q4-base:1.4 pkgsrc-2017Q3:1.4.0.24 pkgsrc-2017Q3-base:1.4 libarchive-3-3-2:1.1.1.3 pkgsrc-2017Q2:1.4.0.20 pkgsrc-2017Q2-base:1.4 pkgsrc-2017Q1:1.4.0.18 pkgsrc-2017Q1-base:1.4 libarchive-3-3-1:1.1.1.3 pkgsrc-2016Q4:1.4.0.16 pkgsrc-2016Q4-base:1.4 pkgsrc-2016Q3:1.4.0.14 pkgsrc-2016Q3-base:1.4 pkgsrc-2016Q2:1.4.0.12 pkgsrc-2016Q2-base:1.4 libarchive-3-2-1:1.1.1.3 pkgsrc-2016Q1:1.4.0.10 pkgsrc-2016Q1-base:1.4 pkgsrc-2015Q4:1.4.0.8 pkgsrc-2015Q4-base:1.4 pkgsrc-2015Q3:1.4.0.6 pkgsrc-2015Q3-base:1.4 pkgsrc-2015Q2:1.4.0.4 pkgsrc-2015Q2-base:1.4 pkgsrc-2015Q1:1.4.0.2 pkgsrc-2015Q1-base:1.4 pkgsrc-2014Q4:1.3.0.40 pkgsrc-2014Q4-base:1.3 pkgsrc-2014Q3:1.3.0.38 pkgsrc-2014Q3-base:1.3 pkgsrc-2014Q2:1.3.0.36 pkgsrc-2014Q2-base:1.3 pkgsrc-2014Q1:1.3.0.34 pkgsrc-2014Q1-base:1.3 pkgsrc-2013Q4:1.3.0.32 pkgsrc-2013Q4-base:1.3 pkgsrc-2013Q3:1.3.0.30 pkgsrc-2013Q3-base:1.3 pkgsrc-2013Q2:1.3.0.28 pkgsrc-2013Q2-base:1.3 pkgsrc-2013Q1:1.3.0.26 pkgsrc-2013Q1-base:1.3 pkgsrc-2012Q4:1.3.0.24 pkgsrc-2012Q4-base:1.3 pkgsrc-2012Q3:1.3.0.22 pkgsrc-2012Q3-base:1.3 pkgsrc-2012Q2:1.3.0.20 pkgsrc-2012Q2-base:1.3 pkgsrc-2012Q1:1.3.0.18 pkgsrc-2012Q1-base:1.3 pkgsrc-2011Q4:1.3.0.16 pkgsrc-2011Q4-base:1.3 pkgsrc-2011Q3:1.3.0.14 pkgsrc-2011Q3-base:1.3 pkgsrc-2011Q2:1.3.0.12 pkgsrc-2011Q2-base:1.3 pkgsrc-2011Q1:1.3.0.10 pkgsrc-2011Q1-base:1.3 pkgsrc-2010Q4:1.3.0.8 pkgsrc-2010Q4-base:1.3 pkgsrc-2010Q3:1.3.0.6 pkgsrc-2010Q3-base:1.3 libarchive-2-8-4:1.1.1.2 pkgsrc-2010Q2:1.3.0.4 pkgsrc-2010Q2-base:1.3 pkgsrc-2010Q1:1.3.0.2 pkgsrc-2010Q1-base:1.3 libarchive-2-8-3:1.1.1.2 libarchive-2-8-2:1.1.1.2 libarchive-2-8-0:1.1.1.2 pkgsrc-2009Q4:1.1.1.1.0.20 pkgsrc-2009Q4-base:1.1.1.1 pkgsrc-2009Q3:1.1.1.1.0.18 pkgsrc-2009Q3-base:1.1.1.1 pkgsrc-2009Q2:1.1.1.1.0.16 pkgsrc-2009Q2-base:1.1.1.1 pkgsrc-2009Q1:1.1.1.1.0.14 pkgsrc-2009Q1-base:1.1.1.1 pkgsrc-2008Q4:1.1.1.1.0.12 pkgsrc-2008Q4-base:1.1.1.1 pkgsrc-2008Q3:1.1.1.1.0.10 pkgsrc-2008Q3-base:1.1.1.1 cube-native-xorg:1.1.1.1.0.8 cube-native-xorg-base:1.1.1.1 libarchive-2-5-5:1.1.1.1 pkgsrc-2008Q2:1.1.1.1.0.6 pkgsrc-2008Q2-base:1.1.1.1 cwrapper:1.1.1.1.0.4 libarchive-2-5-4b:1.1.1.1 libarchive-2-5-1b:1.1.1.1 pkgsrc-2008Q1:1.1.1.1.0.2 pkgsrc-2008Q1-base:1.1.1.1 libarchive-2-5-0b:1.1.1.1 libarchive-2-4-14:1.1.1.1 libarchive-2-4-13:1.1.1.1 KIENTZLE:1.1.1; locks; strict; comment @# @; 1.4 date 2015.01.17.12.44.48; author adam; state Exp; branches; next 1.3; commitid yy7e1hLrfmA2pn6y; 1.3 date 2010.02.20.03.54.08; author joerg; state Exp; branches; next 1.2; 1.2 date 2010.02.20.03.51.41; author joerg; state dead; branches; next 1.1; 1.1 date 2008.02.26.13.09.31; author joerg; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2008.02.26.13.09.31; author joerg; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 2010.02.20.03.49.42; author joerg; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 2016.06.20.17.11.50; author joerg; state Exp; branches; next ; commitid rRgm3BqbmbI8aebz; desc @@ 1.4 log @Changes 3.1.2: This is a maintenance update to fix issues with the new RAR seeking feature. This new release also contains fixes for build failures when building libarchive using Visual Studio 2012 and MinGW. @ text @#!/usr/bin/awk # # Copyright (c) 2003 Peter Stuge # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # Dramatically overhauled by Tim Kientzle. This version almost # handles library-style pages with Fn, Ft, etc commands. Still # a lot of problems... BEGIN { displaylines = 0 trailer = "" out = "" sep = "" nextsep = " " } # Add a word with appropriate preceding whitespace # Maintain a short queue of the expected upcoming word separators. function add(str) { out=out sep str sep = nextsep nextsep = " " } # Add a word with no following whitespace # Use for opening punctuation such as '(' function addopen(str) { add(str) sep = "" } # Add a word with no preceding whitespace # Use for closing punctuation such as ')' or '.' function addclose(str) { sep = "" add(str) } # Add a word with no space before or after # Use for separating punctuation such as '=' function addpunct(str) { sep = "" add(str) sep = "" } # Emit the current line so far function endline() { addclose(trailer) trailer = "" if(length(out) > 0) { print out out="" } if(displaylines > 0) { displaylines = displaylines - 1 if (displaylines == 0) dispend() } # First word on next line has no preceding whitespace sep = "" } function linecmd(cmd) { endline() add(cmd) endline() } function breakline() { linecmd(".br") } # Start an indented display function dispstart() { linecmd(".RS 4") } # End an indented display function dispend() { linecmd(".RE") } # Collect rest of input line function wtail() { retval="" while(w 0) { sub("^[ \t]*", "", l) if (match(l, "^\"")) { l = substr(l, 2) o = index(l, "\"") if (o > 0) { w = substr(l, 1, o-1) l = substr(l, o+1) dest[n++] = w } else { dest[n++] = l l = "" } } else { o = match(l, "[ \t]") if (o > 0) { w = substr(l, 1, o-1) l = substr(l, o+1) dest[n++] = w } else { dest[n++] = l l = "" } } } return n-1 } ! /^\./ { out = $0 endline() next } /^\.\\"/ { next } { sub("^\\.","") nwords=splitwords($0, words) # TODO: Instead of iterating 'w' over the array, have a separate # function that returns 'next word' and use that. This will allow # proper handling of double-quoted arguments as well. for(w=1;w<=nwords;w++) { if(match(words[w],"^Li$")) { # Literal; rest of line is unformatted dispstart() displaylines = 1 } else if(match(words[w],"^Dl$")) { # Display literal dispstart() displaylines = 1 } else if(match(words[w],"^Bd$")) { # Begin display if(match(words[w+1],"-literal")) { dispstart() linecmd(".nf") displaylines=10000 w=nwords } } else if(match(words[w],"^Ed$")) { # End display displaylines = 0 dispend() } else if(match(words[w],"^Ns$")) { # Suppress space after next word nextsep = "" } else if(match(words[w],"^No$")) { # Normal text add(words[++w]) } else if(match(words[w],"^Dq$")) { # Quote addopen("``") add(words[++w]) while(w") } else if(match(words[w],"^Dd$")) { date=wtail() next } else if(match(words[w],"^Dt$")) { id=wtail() next } else if(match(words[w],"^Ox$")) { add("OpenBSD") } else if(match(words[w],"^Fx$")) { add("FreeBSD") } else if(match(words[w],"^Nx$")) { add("NetBSD") } else if(match(words[w],"^St$")) { if (match(words[w+1], "^-p1003.1$")) { w++ add("IEEE Std 1003.1 (``POSIX.1'')") } else if(match(words[w+1], "^-p1003.1-96$")) { w++ add("ISO/IEC 9945-1:1996 (``POSIX.1'')") } else if(match(words[w+1], "^-p1003.1-88$")) { w++ add("IEEE Std 1003.1-1988 (``POSIX.1'')") } else if(match(words[w+1], "^-p1003.1-2001$")) { w++ add("IEEE Std 1003.1-2001 (``POSIX.1'')") } else if(match(words[w+1], "^-susv2$")) { w++ add("Version 2 of the Single UNIX Specification (``SUSv2'')") } } else if(match(words[w],"^Ex$")) { if (match(words[w+1], "^-std$")) { w++ add("The \\fB" name "\\fP utility exits 0 on success, and >0 if an error occurs.") } } else if(match(words[w],"^Os$")) { add(".TH " id " \"" date "\" \"" wtail() "\"") } else if(match(words[w],"^Sh$")) { section=wtail() add(".SH " section) linecmd(".ad l") } else if(match(words[w],"^Xr$")) { add("\\fB" words[++w] "\\fP(" words[++w] ")" words[++w]) } else if(match(words[w],"^Nm$")) { if(match(section,"SYNOPSIS")) breakline() if(w >= nwords) n=name else if (match(words[w+1], "^[A-Z][a-z]$")) n=name else if (match(words[w+1], "^[.,;:]$")) n=name else { n=words[++w] if(!length(name)) name=n } if(!length(n)) n=name add("\\fB\\%" n "\\fP") } else if(match(words[w],"^Nd$")) { add("\\- " wtail()) } else if(match(words[w],"^Fl$")) { add("\\fB\\-" words[++w] "\\fP") } else if(match(words[w],"^Ar$")) { addopen("\\fI") if(w==nwords) add("file ...\\fP") else add(words[++w] "\\fP") } else if(match(words[w],"^Cm$")) { add("\\fB" words[++w] "\\fP") } else if(match(words[w],"^Op$")) { addopen("[") option=1 trailer="]" trailer } else if(match(words[w],"^Pp$")) { linecmd(".PP") } else if(match(words[w],"^An$")) { endline() } else if(match(words[w],"^Ss$")) { add(".SS") } else if(match(words[w],"^Ft$")) { if (match(section, "SYNOPSIS")) { breakline() } add("\\fI" wtail() "\\fP") if (match(section, "SYNOPSIS")) { breakline() } } else if(match(words[w],"^Fn$")) { ++w F = "\\fB\\%" words[w] "\\fP(" Fsep = "" while(w\\fP") } else if(match(words[w],"^Pa$")) { addopen("\\fI") w++ if(match(words[w],"^\\.")) add("\\&") add(words[w] "\\fP") } else if(match(words[w],"^Dv$")) { add(".BR") } else if(match(words[w],"^Em|Ev$")) { add(".IR") } else if(match(words[w],"^Pq$")) { addopen("(") trailer=")" trailer } else if(match(words[w],"^Aq$")) { addopen("\\%<") trailer=">" trailer } else if(match(words[w],"^Brq$")) { addopen("{") trailer="}" trailer } else if(match(words[w],"^S[xy]$")) { add(".B " wtail()) } else if(match(words[w],"^Ic$")) { add("\\fB") trailer="\\fP" trailer } else if(match(words[w],"^Bl$")) { oldoptlist=optlist linecmd(".RS 5") if(match(words[w+1],"-bullet")) optlist=1 else if(match(words[w+1],"-enum")) { optlist=2 enum=0 } else if(match(words[w+1],"-tag")) optlist=3 else if(match(words[w+1],"-item")) optlist=4 else if(match(words[w+1],"-bullet")) optlist=1 w=nwords } else if(match(words[w],"^El$")) { linecmd(".RE") optlist=oldoptlist } else if(match(words[w],"^It$")&&optlist) { if(optlist==1) add(".IP \\(bu") else if(optlist==2) add(".IP " ++enum ".") else if(optlist==3) { add(".TP") endline() if(match(words[w+1],"^Pa$|^Ev$")) { add(".B") w++ } } else if(optlist==4) add(".IP") } else if(match(words[w],"^Xo$")) { # TODO: Figure out how to handle this } else if(match(words[w],"^Xc$")) { # TODO: Figure out how to handle this } else if(match(words[w],"^[=]$")) { addpunct(words[w]) } else if(match(words[w],"^[[{(]$")) { addopen(words[w]) } else if(match(words[w],"^[\\])}.,;:]$")) { addclose(words[w]) } else { add(words[w]) } } if(match(out,"^\\.[^a-zA-Z]")) sub("^\\.","",out) endline() } @ 1.3 log @Merge again... @ text @d380 1 a380 1 } else if(match(words[w],"^[\[{(]$")) { d382 1 a382 1 } else if(match(words[w],"^[\\\])}.,;:]$")) { @ 1.2 log @Merge @ text @d88 1 a88 1 linecmd(".RS") d107 31 d148 1 a148 1 nwords=split($0,words) d162 1 d179 4 d228 3 a230 2 add(".SH") section=words[w+1] d236 6 a241 2 if(w>1) n=name d249 1 a249 1 add("\\fB" n "\\fP") d258 1 a258 1 else { a259 3 while(match(words[w+1],"^\\|$")) add(words[++w] " \\fI" words[++w] "\\fP") } d267 1 a267 1 endline() d273 7 a279 3 addopen("\\fI") trailer = "\\fP" trailer displaylines = 1 d281 22 a302 5 # Using '.nh' to suppress hyphenation doesn't really work... # TODO: Fix this. add(".nh") endline() addopen("\\fB") d304 8 a311 9 add(words[w]) addclose("\\fP") endline() add(".hy") endline() addpunct("(") # This is broken; Fn should peek ahead and put each double-quoted # arg in .Ty and be smarter about following punct. trailer = ");" trailer a317 1 breakline() d332 1 a332 1 addopen("<") d344 1 d358 1 d374 4 @ 1.1 log @Initial revision @ text @@ 1.1.1.1 log @Import libarchive-2.4.13. This brings a number of bugfixes, support for more ZIP archives and a more complete cpio frontend. @ text @@ 1.1.1.2 log @Import libarchive 2.8.0: - Infrastructure: - Allow command line tools as fallback for missing compression libraries. If compiled without gzip for example, gunzip will be used automatically. - Improved support for a number of platforms like high-resolution timestamps and Extended Attributes on various Unix systems - New convience interface for creating archives based on disk content, complement of the archive_write_disk interface. - Frontends: - bsdcpio ready for public consumption - hand-written date parser replaces the yacc code - Filter system: - Simplified read filter chains - Option support for filters - LZMA, XZ, uudecode handled - Format support: - Write support for mtree files based on file system or archive content - Basic read support for Joliet - Write support for zip files - Write support for shar archives, both text-only and binary-safe @ text @d88 1 a88 1 linecmd(".RS 4") a106 31 function splitwords(l, dest, n, o, w) { n = 1 delete dest while (length(l) > 0) { sub("^[ \t]*", "", l) if (match(l, "^\"")) { l = substr(l, 2) o = index(l, "\"") if (o > 0) { w = substr(l, 1, o-1) l = substr(l, o+1) dest[n++] = w } else { dest[n++] = l l = "" } } else { o = match(l, "[ \t]") if (o > 0) { w = substr(l, 1, o-1) l = substr(l, o+1) dest[n++] = w } else { dest[n++] = l l = "" } } } return n-1 } d117 1 a117 1 nwords=splitwords($0, words) a130 1 linecmd(".nf") a146 4 } else if(match(words[w],"^Do$")) { addopen("``") } else if(match(words[w],"^Dc$")) { addclose("''") d192 2 a193 3 section=wtail() add(".SH " section) linecmd(".ad l") d199 2 a200 6 if(w >= nwords) n=name else if (match(words[w+1], "^[A-Z][a-z]$")) n=name else if (match(words[w+1], "^[.,;:]$")) n=name d208 1 a208 1 add("\\fB\\%" n "\\fP") d217 1 a217 1 else d219 3 d229 1 a229 1 linecmd(".PP") d235 3 a237 7 if (match(section, "SYNOPSIS")) { breakline() } add("\\fI" wtail() "\\fP") if (match(section, "SYNOPSIS")) { breakline() } d239 5 a243 18 ++w F = "\\fB\\%" words[w] "\\fP(" Fsep = "" while(w