Magellan Linux

Diff of /trunk/mage/usr/lib/mage/meta-generator.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2290 by niro, Fri Dec 6 09:29:41 2013 UTC revision 2291 by niro, Fri Dec 6 09:42:46 2013 UTC
# Line 95  SMAGEFILE="$1" Line 95  SMAGEFILE="$1"
95  [ -z ${SMAGEFILE} ] && die "No smage file given."  [ -z ${SMAGEFILE} ] && die "No smage file given."
96  [ -e ${SMAGEFILE} ] || die "Smage file '${SMAGEFILE}' does not exist."  [ -e ${SMAGEFILE} ] || die "Smage file '${SMAGEFILE}' does not exist."
97    
98    PKGNAME="${PNAME}-${PVER}-${PBUILD}"
99    ARCHPKGNAME="${PNAME}-${PVER}-${ARCH}$(distrotag)-${PBUILD}"
100    
101  if [[ -n ${PKGTARBALL} ]]  if [[ -n ${PKGTARBALL} ]]
102  then  then
103   # abort if given file is not a pkg   # abort if given file is not a pkg
# Line 117  smagesource ${SMAGEFILE} Line 120  smagesource ${SMAGEFILE}
120    
121  # set the right meta-location  # set the right meta-location
122  [[ ! -d ${METADIR} ]] && install -d ${METADIR}  [[ ! -d ${METADIR} ]] && install -d ${METADIR}
123  METAFILE="${METADIR}/${PNAME}-${PVER}-${ARCH}-${PBUILD}.${METASUFFIX}"  METAFILE="${METADIR}/${ARCHPKGNAME}.${METASUFFIX}"
124    
125  # create a clean metafile  # create a clean metafile
126  :> ${METAFILE}  :> ${METAFILE}
# Line 136  add2meta PKGTYPE "${PKGTYPE}" Line 139  add2meta PKGTYPE "${PKGTYPE}"
139    
140  # arch specific  # arch specific
141  add2meta ARCH "${ARCH}"  add2meta ARCH "${ARCH}"
142  add2meta SIZE "$(du -Ds ${BUILDDIR}/${PNAME}-${PVER}-${ARCH}-${PBUILD}/binfiles | sed 's/^\(.*\)\t.*/\1/')"  add2meta SIZE "$(du -Ds ${BUILDDIR}/${ARCHPKGNAME}/binfiles | sed 's/^\(.*\)\t.*/\1/')"
143  add2meta MTIME "$(< ${BUILDDIR}/${PNAME}-${PVER}-${ARCH}-${PBUILD}/.mtime)"  add2meta MTIME "$(< ${BUILDDIR}/${ARCHPKGNAME}/.mtime)"
144    
145  # provided binfiles  # provided binfiles
146  SEARCH_DIRS="bin,sbin,usr/bin,usr/sbin"  SEARCH_DIRS="bin,sbin,usr/bin,usr/sbin"
# Line 147  SEARCH_DIRS+=",opt/*/jre/bin" Line 150  SEARCH_DIRS+=",opt/*/jre/bin"
150  # at last add braces  # at last add braces
151  SEARCH_DIRS="{${SEARCH_DIRS}}"  SEARCH_DIRS="{${SEARCH_DIRS}}"
152  # search them  # search them
153  add2meta PROVIDED_BINARIES "$(find $(eval echo ${BUILDDIR}/${PNAME}-${PVER}-${ARCH}-${PBUILD}/binfiles/${SEARCH_DIRS}) -type f -printf '%f ' 2> /dev/null)"  add2meta PROVIDED_BINARIES "$(find $(eval echo ${BUILDDIR}/${ARCHPKGNAME}/binfiles/${SEARCH_DIRS}) -type f -printf '%f ' 2> /dev/null)"
154    
155  # generate MD5SUM (get it with tail -n1)  # generate MD5SUM (get it with tail -n1)
156  echo >> ${METAFILE}  echo >> ${METAFILE}
157  echo '# MD5 CHECKSUM:' >> ${METAFILE}  echo '# MD5 CHECKSUM:' >> ${METAFILE}
158  ( cd ${PKGDIR}; md5sum ${PNAME}-${PVER}-${ARCH}-${PBUILD}.${PKGSUFFIX} >> ${METAFILE} )  ( cd ${PKGDIR}; md5sum ${ARCHPKGNAME}.${PKGSUFFIX} >> ${METAFILE} )

Legend:
Removed from v.2290  
changed lines
  Added in v.2291