Magellan Linux

Diff of /trunk/pkgtools/mage2mysql.sh

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

revision 1330 by niro, Wed Feb 11 17:56:03 2009 UTC revision 1331 by niro, Tue May 31 17:44:01 2011 UTC
# Line 113  evaluate_magefile() Line 113  evaluate_magefile()
113   # get current time   # get current time
114   local time="$(date +%F\ %T)"   local time="$(date +%F\ %T)"
115    
116    #get last primary key !!!
117    
118   # found, then update   # found, then update
119   if [[ ! -z ${id} ]]   if [[ ! -z ${id} ]]
120   then   then
# Line 135  evaluate_magefile() Line 137  evaluate_magefile()
137   else   else
138   # else import to database as new   # else import to database as new
139   mysqldo "INSERT INTO ${SQL_TABLE_PACKAGES} (   mysqldo "INSERT INTO ${SQL_TABLE_PACKAGES} (
140     id,
141   pname,   pname,
142   pver,   pver,
143   pbuild,   pbuild,
# Line 150  evaluate_magefile() Line 153  evaluate_magefile()
153   flag   flag
154   )   )
155   VALUES (   VALUES (
156     '${id}',
157   '${PNAME}',   '${PNAME}',
158   '${PVER}',   '${PVER}',
159   '${PBUILD}',   '${PBUILD}',
# Line 163  evaluate_magefile() Line 167  evaluate_magefile()
167   '${PROVIDE}',   '${PROVIDE}',
168   '${time}',   '${time}',
169   '1'   '1'
170   )"   ) ON DUPLICATE KEY UPDATE ${SQL_TABLE_PACKAGES} SET
171     pname='${PNAME}',
172     pver='${PVER}',
173     pbuild='${PBUILD}',
174     pcat='${pcatid}',
175     state='${STATE}',
176     description='${DESCRIPTION}',
177     homepage='${HOMEPAGE}',
178     pkgtype='${PKGTYPE}',
179     depend='${DEPEND}',
180     sdepend='${SDEPEND}',
181     provide='${PROVIDE}',
182     time='${time}',
183     flag='1'
184     WHERE id='${id}'"
185   fi   fi
186  }  }
187    

Legend:
Removed from v.1330  
changed lines
  Added in v.1331